game.min.js 400 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722
  1. function alk() {
  2. var e = [];
  3. var t = [Constants.IMAGE_TITLE_MAIN_MENU_BACK, Constants.IMAGE_GLOBAL_MAP, Constants.IMAGE_BACK];
  4. var n = [Constants.IMAGE_BUTTON_MORE_GAMES, Constants.IMAGE_SELECT_LEVEL_BACK, Constants.IMAGE_BORDER_SIDE, Constants.IMAGE_BORDER_CORNER, Constants.IMAGE_WIN_STRINGS, Constants.IMAGE_HEART_PARTICLE, Constants.IMAGE_SHINING, Constants.IMAGE_BIG_SHINING, Constants.IMAGE_POINTS_CONTROL_BIG, Constants.IMAGE_POINTS_CONTROL_SMALL, Constants.IMAGE_LEVEL_BUTTON, Constants.IMAGE_BACK, Constants.IMAGE_ROTATE, Constants.IMAGE_TITLE_MAIN_MENU_BACK, "cake_1", "cake_2", "cake_3", "cake_4", "cake_5", "cake_6", "cake_7", "font_0", "font_1", "font_2", "font_3", "font_4", "font_5", "font_6", "font_7", "font_8", "font_9", "sel_0", "sel_1", "sel_2", "sel_3", "sel_4", "sel_5", "sel_6", "sel_7", "sel_8", "sel_9", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "p", "boom_1", "boom_2", "boom_3", "boom_4", "boom_5", "boom_6", "boom_7", "boom_8", "boom_9", "boom_10", "boom_11", Constants.IMAGE_CELL, Constants.IMAGE_AWESOME, Constants.IMAGE_SUPERB, Constants.IMAGE_SHINING, Constants.IMAGE_DROP, Constants.IMAGE_DONUT, Constants.IMAGE_ARROW_BONUS_VERT, Constants.IMAGE_ARROW_BONUS_HOR, Constants.IMAGE_BOMB, Constants.IMAGE_MESSAGE_WINDOW, Constants.IMAGE_HINT_ARROW, Constants.IMAGE_BUTTON_PLAY, Constants.IMAGE_BUTTON_SOUND_ON, Constants.IMAGE_BUTTON_SOUND_OFF, Constants.IMAGE_BUTTON_CLOSE, Constants.IMAGE_BUTTON_EXIT, Constants.IMAGE_BUTTON_PAUSE, Constants.IMAGE_BUTTON_RESTART, Constants.IMAGE_GAMEOVER_CAPTION, Constants.IMAGE_SICKLE, Constants.IMAGE_DIRT, Constants.IMAGE_GUI, Constants.IMAGE_LOCK, Constants.IMAGE_OUT_OF_MOVES, Constants.IMAGE_WIN_CAPTION, Constants.IMAGE_STONE_HEART, Constants.IMAGE_TASK_PANEL, Constants.IMAGE_GLOBAL_MAP];
  5. var r = [SoundManager.SOUND_MUSIC, SoundManager.SOUND_CLICK, SoundManager.SOUND_MATCH_1, SoundManager.SOUND_MATCH_2, SoundManager.SOUND_MATCH_3, SoundManager.SOUND_MATCH_4, SoundManager.SOUND_MATCH_5, SoundManager.SOUND_DROP_1, SoundManager.SOUND_DROP_2, SoundManager.SOUND_DROP_3, SoundManager.SOUND_LINE, SoundManager.SOUND_KILL_COLOR, SoundManager.SOUND_BOOM, SoundManager.SOUND_AWESOME, SoundManager.SOUND_EXCHANGE, SoundManager.SOUND_WIN, SoundManager.SOUND_LOSE];
  6. for (var i = 0; i < n.length; i++) {
  7. if (t.indexOf(n[i]) == -1) {
  8. e.push({
  9. src: "assets/art/" + n[i] + ".png",
  10. id: n[i]
  11. })
  12. } else {
  13. e.push({
  14. src: "assets/art/" + n[i] + ".jpg",
  15. id: n[i]
  16. })
  17. }
  18. }
  19. for (var i = 0; i < r.length; i++) {
  20. e.push({
  21. src: "assets/sound/" + r[i] + ".ogg",
  22. id: r[i]
  23. });
  24. console.log("Loading " + r[i])
  25. }
  26. Constants.g_isPC = !Utils.IsMobileBrowser();
  27. Constants.W = StateManager.getInnerWidth();
  28. Constants.H = StateManager.getInnerHeight();
  29. new StateManager(e)
  30. }
  31. var viewporter;
  32. (function() {
  33. var e;
  34. viewporter = {
  35. forceDetection: false,
  36. disableLegacyAndroid: true,
  37. ACTIVE: function() {
  38. if (viewporter.disableLegacyAndroid && /android 2/i.test(navigator.userAgent)) {
  39. return false
  40. }
  41. if (/ipad/i.test(navigator.userAgent)) {
  42. return false
  43. }
  44. if (/webos/i.test(navigator.userAgent)) {
  45. return true
  46. }
  47. if ("ontouchstart" in window) {
  48. return true
  49. }
  50. return false
  51. },
  52. READY: false,
  53. isLandscape: function() {
  54. return window.orientation === 90 || window.orientation === -90
  55. },
  56. ready: function(e) {
  57. window.addEventListener("viewportready", e, false)
  58. },
  59. change: function(e) {
  60. window.addEventListener("viewportchange", e, false)
  61. },
  62. refresh: function() {
  63. if (e) {
  64. e.prepareVisualViewport()
  65. }
  66. },
  67. preventPageScroll: function() {
  68. document.body.addEventListener("touchmove", function(e) {
  69. e.preventDefault()
  70. }, false);
  71. document.body.addEventListener("touchstart", function() {
  72. e.prepareVisualViewport()
  73. }, false)
  74. }
  75. };
  76. viewporter.ACTIVE = viewporter.ACTIVE();
  77. if (!viewporter.ACTIVE) {
  78. return
  79. }
  80. var t = function() {
  81. var e = this;
  82. this.IS_ANDROID = /Android/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent);
  83. var t = function() {
  84. e.prepareVisualViewport();
  85. var t = window.orientation;
  86. window.addEventListener("orientationchange", function() {
  87. if (window.orientation !== t) {
  88. e.prepareVisualViewport();
  89. t = window.orientation
  90. }
  91. }, false)
  92. };
  93. if (document.readyState === "loading") {
  94. document.addEventListener("DOMContentLoaded", function() {
  95. t()
  96. }, false)
  97. } else {
  98. t()
  99. }
  100. };
  101. t.prototype = {
  102. getProfile: function() {
  103. if (viewporter.forceDetection) {
  104. return null
  105. }
  106. for (var e in viewporter.profiles) {
  107. if ((new RegExp(e)).test(navigator.userAgent)) {
  108. return viewporter.profiles[e]
  109. }
  110. }
  111. return null
  112. },
  113. postProcess: function() {
  114. viewporter.READY = true;
  115. this.triggerWindowEvent(!this._firstUpdateExecuted ? "viewportready" : "viewportchange");
  116. this._firstUpdateExecuted = true
  117. },
  118. prepareVisualViewport: function() {
  119. var e = this;
  120. if (navigator.standalone) {
  121. return this.postProcess()
  122. }
  123. document.documentElement.style.minHeight = "5000px";
  124. var t = window.innerHeight;
  125. var n = this.getProfile();
  126. var r = viewporter.isLandscape() ? "landscape" : "portrait";
  127. window.scrollTo(0, e.IS_ANDROID ? 1 : 0);
  128. var i = 40;
  129. var s = window.setInterval(function() {
  130. function o() {
  131. return n ? window.innerHeight === n[r] : false
  132. }
  133. function u() {
  134. return window.innerHeight > t
  135. }
  136. window.scrollTo(0, e.IS_ANDROID ? 1 : 0);
  137. i--;
  138. if ((e.IS_ANDROID ? o() : u()) || i < 0) {
  139. document.documentElement.style.minHeight = window.innerHeight + "px";
  140. document.getElementById("viewporter").style.position = "relative";
  141. document.getElementById("viewporter").style.height = window.innerHeight + "px";
  142. clearInterval(s);
  143. e.postProcess()
  144. }
  145. }, 10)
  146. },
  147. triggerWindowEvent: function(e) {
  148. var t = document.createEvent("Event");
  149. t.initEvent(e, false, false);
  150. window.dispatchEvent(t)
  151. }
  152. };
  153. e = new t
  154. })();
  155. viewporter.profiles = {
  156. MZ601: {
  157. portrait: 696,
  158. landscape: 1176
  159. },
  160. "GT-I9000|GT-I9100|Nexus S": {
  161. portrait: 508,
  162. landscape: 295
  163. },
  164. "GT-P1000": {
  165. portrait: 657,
  166. landscape: 400
  167. },
  168. "Desire_A8181|DesireHD_A9191": {
  169. portrait: 533,
  170. landscape: 320
  171. }
  172. };
  173. this.createjs = this.createjs || {};
  174. (function() {
  175. "use strict";
  176. var e = function(e, t, n) {
  177. this.initialize(e, t, n)
  178. };
  179. var t = e.prototype;
  180. t.type = null;
  181. t.target = null;
  182. t.currentTarget = null;
  183. t.eventPhase = 0;
  184. t.bubbles = false;
  185. t.cancelable = false;
  186. t.timeStamp = 0;
  187. t.defaultPrevented = false;
  188. t.propagationStopped = false;
  189. t.immediatePropagationStopped = false;
  190. t.removed = false;
  191. t.initialize = function(e, t, n) {
  192. this.type = e;
  193. this.bubbles = t;
  194. this.cancelable = n;
  195. this.timeStamp = (new Date).getTime()
  196. };
  197. t.preventDefault = function() {
  198. this.defaultPrevented = true
  199. };
  200. t.stopPropagation = function() {
  201. this.propagationStopped = true
  202. };
  203. t.stopImmediatePropagation = function() {
  204. this.immediatePropagationStopped = this.propagationStopped = true
  205. };
  206. t.remove = function() {
  207. this.removed = true
  208. };
  209. t.clone = function() {
  210. return new e(this.type, this.bubbles, this.cancelable)
  211. };
  212. t.toString = function() {
  213. return "[Event (type=" + this.type + ")]"
  214. };
  215. createjs.Event = e
  216. })();
  217. this.createjs = this.createjs || {};
  218. (function() {
  219. "use strict";
  220. var e = function() {};
  221. var t = e.prototype;
  222. e.initialize = function(e) {
  223. e.addEventListener = t.addEventListener;
  224. e.on = t.on;
  225. e.removeEventListener = e.off = t.removeEventListener;
  226. e.removeAllEventListeners = t.removeAllEventListeners;
  227. e.hasEventListener = t.hasEventListener;
  228. e.dispatchEvent = t.dispatchEvent;
  229. e._dispatchEvent = t._dispatchEvent;
  230. e.willTrigger = t.willTrigger
  231. };
  232. t._listeners = null;
  233. t._captureListeners = null;
  234. t.initialize = function() {};
  235. t.addEventListener = function(e, t, n) {
  236. var r;
  237. if (n) {
  238. r = this._captureListeners = this._captureListeners || {}
  239. } else {
  240. r = this._listeners = this._listeners || {}
  241. }
  242. var i = r[e];
  243. if (i) {
  244. this.removeEventListener(e, t, n)
  245. }
  246. i = r[e];
  247. if (!i) {
  248. r[e] = [t]
  249. } else {
  250. i.push(t)
  251. }
  252. return t
  253. };
  254. t.on = function(e, t, n, r, i, s) {
  255. if (t.handleEvent) {
  256. n = n || t;
  257. t = t.handleEvent
  258. }
  259. n = n || this;
  260. return this.addEventListener(e, function(e) {
  261. t.call(n, e, i);
  262. r && e.remove()
  263. }, s)
  264. };
  265. t.removeEventListener = function(e, t, n) {
  266. var r = n ? this._captureListeners : this._listeners;
  267. if (!r) {
  268. return
  269. }
  270. var i = r[e];
  271. if (!i) {
  272. return
  273. }
  274. for (var s = 0, o = i.length; s < o; s++) {
  275. if (i[s] == t) {
  276. if (o == 1) {
  277. delete r[e]
  278. } else {
  279. i.splice(s, 1)
  280. }
  281. break
  282. }
  283. }
  284. };
  285. t.off = t.removeEventListener;
  286. t.removeAllEventListeners = function(e) {
  287. if (!e) {
  288. this._listeners = this._captureListeners = null
  289. } else {
  290. if (this._listeners) {
  291. delete this._listeners[e]
  292. }
  293. if (this._captureListeners) {
  294. delete this._captureListeners[e]
  295. }
  296. }
  297. };
  298. t.dispatchEvent = function(e, t) {
  299. if (typeof e == "string") {
  300. var n = this._listeners;
  301. if (!n || !n[e]) {
  302. return false
  303. }
  304. e = new createjs.Event(e)
  305. }
  306. try {
  307. e.target = t || this
  308. } catch (r) {}
  309. if (!e.bubbles || !this.parent) {
  310. this._dispatchEvent(e, 2)
  311. } else {
  312. var i = this,
  313. s = [i];
  314. while (i.parent) {
  315. s.push(i = i.parent)
  316. }
  317. var o, u = s.length;
  318. for (o = u - 1; o >= 0 && !e.propagationStopped; o--) {
  319. s[o]._dispatchEvent(e, 1 + (o == 0))
  320. }
  321. for (o = 1; o < u && !e.propagationStopped; o++) {
  322. s[o]._dispatchEvent(e, 3)
  323. }
  324. }
  325. return e.defaultPrevented
  326. };
  327. t.hasEventListener = function(e) {
  328. var t = this._listeners,
  329. n = this._captureListeners;
  330. return !!(t && t[e] || n && n[e])
  331. };
  332. t.willTrigger = function(e) {
  333. var t = this;
  334. while (t) {
  335. if (t.hasEventListener(e)) {
  336. return true
  337. }
  338. t = t.parent
  339. }
  340. return false
  341. };
  342. t.toString = function() {
  343. return "[EventDispatcher]"
  344. };
  345. t._dispatchEvent = function(e, t) {
  346. var n, r = t == 1 ? this._captureListeners : this._listeners;
  347. if (e && r) {
  348. var i = r[e.type];
  349. if (!i || !(n = i.length)) {
  350. return
  351. }
  352. try {
  353. e.currentTarget = this
  354. } catch (s) {}
  355. try {
  356. e.eventPhase = t
  357. } catch (s) {}
  358. e.removed = false;
  359. i = i.slice();
  360. for (var o = 0; o < n && !e.immediatePropagationStopped; o++) {
  361. var u = i[o];
  362. if (u.handleEvent) {
  363. u.handleEvent(e)
  364. } else {
  365. u(e)
  366. } if (e.removed) {
  367. this.off(e.type, u, t == 1);
  368. e.removed = false
  369. }
  370. }
  371. }
  372. };
  373. createjs.EventDispatcher = e
  374. })();
  375. this.createjs = this.createjs || {};
  376. (function() {
  377. "use strict";
  378. createjs.indexOf = function(e, t) {
  379. for (var n = 0, r = e.length; n < r; n++) {
  380. if (t === e[n]) {
  381. return n
  382. }
  383. }
  384. return -1
  385. }
  386. })();
  387. this.createjs = this.createjs || {};
  388. (function() {
  389. "use strict";
  390. var e = function() {
  391. throw "UID cannot be instantiated"
  392. };
  393. e._nextID = 0;
  394. e.get = function() {
  395. return e._nextID++
  396. };
  397. createjs.UID = e
  398. })();
  399. this.createjs = this.createjs || {};
  400. (function() {
  401. "use strict";
  402. var e = function() {
  403. throw "Ticker cannot be instantiated."
  404. };
  405. e.RAF_SYNCHED = "synched";
  406. e.RAF = "raf";
  407. e.TIMEOUT = "timeout";
  408. e.useRAF = false;
  409. e.timingMode = null;
  410. e.maxDelta = 0;
  411. e.removeEventListener = null;
  412. e.removeAllEventListeners = null;
  413. e.dispatchEvent = null;
  414. e.hasEventListener = null;
  415. e._listeners = null;
  416. createjs.EventDispatcher.initialize(e);
  417. e._addEventListener = e.addEventListener;
  418. e.addEventListener = function() {
  419. !e._inited && e.init();
  420. return e._addEventListener.apply(e, arguments)
  421. };
  422. e._paused = false;
  423. e._inited = false;
  424. e._startTime = 0;
  425. e._pausedTime = 0;
  426. e._ticks = 0;
  427. e._pausedTicks = 0;
  428. e._interval = 50;
  429. e._lastTime = 0;
  430. e._times = null;
  431. e._tickTimes = null;
  432. e._timerId = null;
  433. e._raf = true;
  434. e.init = function() {
  435. if (e._inited) {
  436. return
  437. }
  438. e._inited = true;
  439. e._times = [];
  440. e._tickTimes = [];
  441. e._startTime = e._getTime();
  442. e._times.push(e._lastTime = 0);
  443. e.setInterval(e._interval)
  444. };
  445. e.reset = function() {
  446. if (e._raf) {
  447. var t = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame;
  448. t && t(e._timerId)
  449. } else {
  450. clearTimeout(e._timerId)
  451. }
  452. e.removeAllEventListeners("tick")
  453. };
  454. e.setInterval = function(t) {
  455. e._interval = t;
  456. if (!e._inited) {
  457. return
  458. }
  459. e._setupTick()
  460. };
  461. e.getInterval = function() {
  462. return e._interval
  463. };
  464. e.setFPS = function(t) {
  465. e.setInterval(1e3 / t)
  466. };
  467. e.getFPS = function() {
  468. return 1e3 / e._interval
  469. };
  470. e.getMeasuredTickTime = function(t) {
  471. var n = 0,
  472. r = e._tickTimes;
  473. if (r.length < 1) {
  474. return -1
  475. }
  476. t = Math.min(r.length, t || e.getFPS() | 0);
  477. for (var i = 0; i < t; i++) {
  478. n += r[i]
  479. }
  480. return n / t
  481. };
  482. e.getMeasuredFPS = function(t) {
  483. var n = e._times;
  484. if (n.length < 2) {
  485. return -1
  486. }
  487. t = Math.min(n.length - 1, t || e.getFPS() | 0);
  488. return 1e3 / ((n[0] - n[t]) / t)
  489. };
  490. e.setPaused = function(t) {
  491. e._paused = t
  492. };
  493. e.getPaused = function() {
  494. return e._paused
  495. };
  496. e.getTime = function(t) {
  497. return e._getTime() - e._startTime - (t ? e._pausedTime : 0)
  498. };
  499. e.getEventTime = function(t) {
  500. return (e._lastTime || e._startTime) - (t ? e._pausedTime : 0)
  501. };
  502. e.getTicks = function(t) {
  503. return e._ticks - (t ? e._pausedTicks : 0)
  504. };
  505. e._handleSynch = function() {
  506. var t = e._getTime() - e._startTime;
  507. e._timerId = null;
  508. e._setupTick();
  509. if (t - e._lastTime >= (e._interval - 1) * .97) {
  510. e._tick()
  511. }
  512. };
  513. e._handleRAF = function() {
  514. e._timerId = null;
  515. e._setupTick();
  516. e._tick()
  517. };
  518. e._handleTimeout = function() {
  519. e._timerId = null;
  520. e._setupTick();
  521. e._tick()
  522. };
  523. e._setupTick = function() {
  524. if (e._timerId != null) {
  525. return
  526. }
  527. var t = e.timingMode || e.useRAF && e.RAF_SYNCHED;
  528. if (t == e.RAF_SYNCHED || t == e.RAF) {
  529. var n = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame;
  530. if (n) {
  531. e._timerId = n(t == e.RAF ? e._handleRAF : e._handleSynch);
  532. e._raf = true;
  533. return
  534. }
  535. }
  536. e._raf = false;
  537. e._timerId = setTimeout(e._handleTimeout, e._interval)
  538. };
  539. e._tick = function() {
  540. var t = e._getTime() - e._startTime;
  541. var n = t - e._lastTime;
  542. var r = e._paused;
  543. e._ticks++;
  544. if (r) {
  545. e._pausedTicks++;
  546. e._pausedTime += n
  547. }
  548. e._lastTime = t;
  549. if (e.hasEventListener("tick")) {
  550. var i = new createjs.Event("tick");
  551. var s = e.maxDelta;
  552. i.delta = s && n > s ? s : n;
  553. i.paused = r;
  554. i.time = t;
  555. i.runTime = t - e._pausedTime;
  556. e.dispatchEvent(i)
  557. }
  558. e._tickTimes.unshift(e._getTime() - t);
  559. while (e._tickTimes.length > 100) {
  560. e._tickTimes.pop()
  561. }
  562. e._times.unshift(t);
  563. while (e._times.length > 100) {
  564. e._times.pop()
  565. }
  566. };
  567. var t = window.performance && (performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow);
  568. e._getTime = function() {
  569. return t && t.call(performance) || (new Date).getTime()
  570. };
  571. createjs.Ticker = e
  572. })();
  573. this.createjs = this.createjs || {};
  574. (function() {
  575. "use strict";
  576. var e = function(e, t, n, r, i, s) {
  577. this.initialize(e, t, n, r, i, s)
  578. };
  579. var t = e.prototype;
  580. e.identity = null;
  581. e.DEG_TO_RAD = Math.PI / 180;
  582. t.a = 1;
  583. t.b = 0;
  584. t.c = 0;
  585. t.d = 1;
  586. t.tx = 0;
  587. t.ty = 0;
  588. t.alpha = 1;
  589. t.shadow = null;
  590. t.compositeOperation = null;
  591. t.visible = true;
  592. t.initialize = function(e, t, n, r, i, s) {
  593. this.a = e == null ? 1 : e;
  594. this.b = t || 0;
  595. this.c = n || 0;
  596. this.d = r == null ? 1 : r;
  597. this.tx = i || 0;
  598. this.ty = s || 0;
  599. return this
  600. };
  601. t.prepend = function(e, t, n, r, i, s) {
  602. var o = this.tx;
  603. if (e != 1 || t != 0 || n != 0 || r != 1) {
  604. var u = this.a;
  605. var a = this.c;
  606. this.a = u * e + this.b * n;
  607. this.b = u * t + this.b * r;
  608. this.c = a * e + this.d * n;
  609. this.d = a * t + this.d * r
  610. }
  611. this.tx = o * e + this.ty * n + i;
  612. this.ty = o * t + this.ty * r + s;
  613. return this
  614. };
  615. t.append = function(e, t, n, r, i, s) {
  616. var o = this.a;
  617. var u = this.b;
  618. var a = this.c;
  619. var f = this.d;
  620. this.a = e * o + t * a;
  621. this.b = e * u + t * f;
  622. this.c = n * o + r * a;
  623. this.d = n * u + r * f;
  624. this.tx = i * o + s * a + this.tx;
  625. this.ty = i * u + s * f + this.ty;
  626. return this
  627. };
  628. t.prependMatrix = function(e) {
  629. this.prepend(e.a, e.b, e.c, e.d, e.tx, e.ty);
  630. this.prependProperties(e.alpha, e.shadow, e.compositeOperation, e.visible);
  631. return this
  632. };
  633. t.appendMatrix = function(e) {
  634. this.append(e.a, e.b, e.c, e.d, e.tx, e.ty);
  635. this.appendProperties(e.alpha, e.shadow, e.compositeOperation, e.visible);
  636. return this
  637. };
  638. t.prependTransform = function(t, n, r, i, s, o, u, a, f) {
  639. if (s % 360) {
  640. var l = s * e.DEG_TO_RAD;
  641. var c = Math.cos(l);
  642. var h = Math.sin(l)
  643. } else {
  644. c = 1;
  645. h = 0
  646. } if (a || f) {
  647. this.tx -= a;
  648. this.ty -= f
  649. }
  650. if (o || u) {
  651. o *= e.DEG_TO_RAD;
  652. u *= e.DEG_TO_RAD;
  653. this.prepend(c * r, h * r, -h * i, c * i, 0, 0);
  654. this.prepend(Math.cos(u), Math.sin(u), -Math.sin(o), Math.cos(o), t, n)
  655. } else {
  656. this.prepend(c * r, h * r, -h * i, c * i, t, n)
  657. }
  658. return this
  659. };
  660. t.appendTransform = function(t, n, r, i, s, o, u, a, f) {
  661. if (s % 360) {
  662. var l = s * e.DEG_TO_RAD;
  663. var c = Math.cos(l);
  664. var h = Math.sin(l)
  665. } else {
  666. c = 1;
  667. h = 0
  668. } if (o || u) {
  669. o *= e.DEG_TO_RAD;
  670. u *= e.DEG_TO_RAD;
  671. this.append(Math.cos(u), Math.sin(u), -Math.sin(o), Math.cos(o), t, n);
  672. this.append(c * r, h * r, -h * i, c * i, 0, 0)
  673. } else {
  674. this.append(c * r, h * r, -h * i, c * i, t, n)
  675. } if (a || f) {
  676. this.tx -= a * this.a + f * this.c;
  677. this.ty -= a * this.b + f * this.d
  678. }
  679. return this
  680. };
  681. t.rotate = function(e) {
  682. var t = Math.cos(e);
  683. var n = Math.sin(e);
  684. var r = this.a;
  685. var i = this.c;
  686. var s = this.tx;
  687. this.a = r * t - this.b * n;
  688. this.b = r * n + this.b * t;
  689. this.c = i * t - this.d * n;
  690. this.d = i * n + this.d * t;
  691. this.tx = s * t - this.ty * n;
  692. this.ty = s * n + this.ty * t;
  693. return this
  694. };
  695. t.skew = function(t, n) {
  696. t = t * e.DEG_TO_RAD;
  697. n = n * e.DEG_TO_RAD;
  698. this.append(Math.cos(n), Math.sin(n), -Math.sin(t), Math.cos(t), 0, 0);
  699. return this
  700. };
  701. t.scale = function(e, t) {
  702. this.a *= e;
  703. this.d *= t;
  704. this.c *= e;
  705. this.b *= t;
  706. this.tx *= e;
  707. this.ty *= t;
  708. return this
  709. };
  710. t.translate = function(e, t) {
  711. this.tx += e;
  712. this.ty += t;
  713. return this
  714. };
  715. t.identity = function() {
  716. this.alpha = this.a = this.d = 1;
  717. this.b = this.c = this.tx = this.ty = 0;
  718. this.shadow = this.compositeOperation = null;
  719. this.visible = true;
  720. return this
  721. };
  722. t.invert = function() {
  723. var e = this.a;
  724. var t = this.b;
  725. var n = this.c;
  726. var r = this.d;
  727. var i = this.tx;
  728. var s = e * r - t * n;
  729. this.a = r / s;
  730. this.b = -t / s;
  731. this.c = -n / s;
  732. this.d = e / s;
  733. this.tx = (n * this.ty - r * i) / s;
  734. this.ty = -(e * this.ty - t * i) / s;
  735. return this
  736. };
  737. t.isIdentity = function() {
  738. return this.tx == 0 && this.ty == 0 && this.a == 1 && this.b == 0 && this.c == 0 && this.d == 1
  739. };
  740. t.transformPoint = function(e, t, n) {
  741. n = n || {};
  742. n.x = e * this.a + t * this.c + this.tx;
  743. n.y = e * this.b + t * this.d + this.ty;
  744. return n
  745. };
  746. t.decompose = function(t) {
  747. if (t == null) {
  748. t = {}
  749. }
  750. t.x = this.tx;
  751. t.y = this.ty;
  752. t.scaleX = Math.sqrt(this.a * this.a + this.b * this.b);
  753. t.scaleY = Math.sqrt(this.c * this.c + this.d * this.d);
  754. var n = Math.atan2(-this.c, this.d);
  755. var r = Math.atan2(this.b, this.a);
  756. if (n == r) {
  757. t.rotation = r / e.DEG_TO_RAD;
  758. if (this.a < 0 && this.d >= 0) {
  759. t.rotation += t.rotation <= 0 ? 180 : -180
  760. }
  761. t.skewX = t.skewY = 0
  762. } else {
  763. t.skewX = n / e.DEG_TO_RAD;
  764. t.skewY = r / e.DEG_TO_RAD
  765. }
  766. return t
  767. };
  768. t.reinitialize = function(e, t, n, r, i, s, o, u, a, f) {
  769. this.initialize(e, t, n, r, i, s);
  770. this.alpha = o == null ? 1 : o;
  771. this.shadow = u;
  772. this.compositeOperation = a;
  773. this.visible = f == null ? true : f;
  774. return this
  775. };
  776. t.copy = function(e) {
  777. return this.reinitialize(e.a, e.b, e.c, e.d, e.tx, e.ty, e.alpha, e.shadow, e.compositeOperation, e.visible)
  778. };
  779. t.appendProperties = function(e, t, n, r) {
  780. this.alpha *= e;
  781. this.shadow = t || this.shadow;
  782. this.compositeOperation = n || this.compositeOperation;
  783. this.visible = this.visible && r;
  784. return this
  785. };
  786. t.prependProperties = function(e, t, n, r) {
  787. this.alpha *= e;
  788. this.shadow = this.shadow || t;
  789. this.compositeOperation = this.compositeOperation || n;
  790. this.visible = this.visible && r;
  791. return this
  792. };
  793. t.clone = function() {
  794. return (new e).copy(this)
  795. };
  796. t.toString = function() {
  797. return "[Matrix2D (a=" + this.a + " b=" + this.b + " c=" + this.c + " d=" + this.d + " tx=" + this.tx + " ty=" + this.ty + ")]"
  798. };
  799. e.identity = new e;
  800. createjs.Matrix2D = e
  801. })();
  802. this.createjs = this.createjs || {};
  803. (function() {
  804. "use strict";
  805. var e = function(e, t) {
  806. this.initialize(e, t)
  807. };
  808. var t = e.prototype;
  809. t.x = 0;
  810. t.y = 0;
  811. t.initialize = function(e, t) {
  812. this.x = e == null ? 0 : e;
  813. this.y = t == null ? 0 : t;
  814. return this
  815. };
  816. t.copy = function(e) {
  817. return this.initialize(e.x, e.y)
  818. };
  819. t.clone = function() {
  820. return new e(this.x, this.y)
  821. };
  822. t.toString = function() {
  823. return "[Point (x=" + this.x + " y=" + this.y + ")]"
  824. };
  825. createjs.Point = e
  826. })();
  827. this.createjs = this.createjs || {};
  828. (function() {
  829. "use strict";
  830. var e = function(e, t, n, r) {
  831. this.initialize(e, t, n, r)
  832. };
  833. var t = e.prototype;
  834. t.x = 0;
  835. t.y = 0;
  836. t.width = 0;
  837. t.height = 0;
  838. t.initialize = function(e, t, n, r) {
  839. this.x = e || 0;
  840. this.y = t || 0;
  841. this.width = n || 0;
  842. this.height = r || 0;
  843. return this
  844. };
  845. t.copy = function(e) {
  846. return this.initialize(e.x, e.y, e.width, e.height)
  847. };
  848. t.clone = function() {
  849. return new e(this.x, this.y, this.width, this.height)
  850. };
  851. t.toString = function() {
  852. return "[Rectangle (x=" + this.x + " y=" + this.y + " width=" + this.width + " height=" + this.height + ")]"
  853. };
  854. createjs.Rectangle = e
  855. })();
  856. this.createjs = this.createjs || {};
  857. (function() {
  858. "use strict";
  859. var e = function(e, t, n, r) {
  860. this.initialize(e, t, n, r)
  861. };
  862. var t = e.prototype;
  863. e.identity = null;
  864. t.color = null;
  865. t.offsetX = 0;
  866. t.offsetY = 0;
  867. t.blur = 0;
  868. t.initialize = function(e, t, n, r) {
  869. this.color = e;
  870. this.offsetX = t;
  871. this.offsetY = n;
  872. this.blur = r
  873. };
  874. t.toString = function() {
  875. return "[Shadow]"
  876. };
  877. t.clone = function() {
  878. return new e(this.color, this.offsetX, this.offsetY, this.blur)
  879. };
  880. e.identity = new e("transparent", 0, 0, 0);
  881. createjs.Shadow = e
  882. })();
  883. this.createjs = this.createjs || {};
  884. (function() {
  885. "use strict";
  886. var e = function(e) {
  887. this.initialize(e)
  888. };
  889. var t = e.prototype = new createjs.EventDispatcher;
  890. t.complete = true;
  891. t.framerate = 0;
  892. t._animations = null;
  893. t._frames = null;
  894. t._images = null;
  895. t._data = null;
  896. t._loadCount = 0;
  897. t._frameHeight = 0;
  898. t._frameWidth = 0;
  899. t._numFrames = 0;
  900. t._regX = 0;
  901. t._regY = 0;
  902. t.initialize = function(e) {
  903. var t, n, r, i;
  904. if (e == null) {
  905. return
  906. }
  907. this.framerate = e.framerate || 0;
  908. if (e.images && (n = e.images.length) > 0) {
  909. i = this._images = [];
  910. for (t = 0; t < n; t++) {
  911. var s = e.images[t];
  912. if (typeof s == "string") {
  913. var o = s;
  914. s = document.createElement("img");
  915. s.src = o
  916. }
  917. i.push(s);
  918. if (!s.getContext && !s.complete) {
  919. this._loadCount++;
  920. this.complete = false;
  921. (function(e) {
  922. s.onload = function() {
  923. e._handleImageLoad()
  924. }
  925. })(this)
  926. }
  927. }
  928. }
  929. if (e.frames == null) {} else if (e.frames instanceof Array) {
  930. this._frames = [];
  931. i = e.frames;
  932. for (t = 0, n = i.length; t < n; t++) {
  933. var u = i[t];
  934. this._frames.push({
  935. image: this._images[u[4] ? u[4] : 0],
  936. rect: new createjs.Rectangle(u[0], u[1], u[2], u[3]),
  937. regX: u[5] || 0,
  938. regY: u[6] || 0
  939. })
  940. }
  941. } else {
  942. r = e.frames;
  943. this._frameWidth = r.width;
  944. this._frameHeight = r.height;
  945. this._regX = r.regX || 0;
  946. this._regY = r.regY || 0;
  947. this._numFrames = r.count;
  948. if (this._loadCount == 0) {
  949. this._calculateFrames()
  950. }
  951. }
  952. this._animations = [];
  953. if ((r = e.animations) != null) {
  954. this._data = {};
  955. var a;
  956. for (a in r) {
  957. var f = {
  958. name: a
  959. };
  960. var l = r[a];
  961. if (typeof l == "number") {
  962. i = f.frames = [l]
  963. } else if (l instanceof Array) {
  964. if (l.length == 1) {
  965. f.frames = [l[0]]
  966. } else {
  967. f.speed = l[3];
  968. f.next = l[2];
  969. i = f.frames = [];
  970. for (t = l[0]; t <= l[1]; t++) {
  971. i.push(t)
  972. }
  973. }
  974. } else {
  975. f.speed = l.speed;
  976. f.next = l.next;
  977. var c = l.frames;
  978. i = f.frames = typeof c == "number" ? [c] : c.slice(0)
  979. } if (f.next === true || f.next === undefined) {
  980. f.next = a
  981. }
  982. if (f.next === false || i.length < 2 && f.next == a) {
  983. f.next = null
  984. }
  985. if (!f.speed) {
  986. f.speed = 1
  987. }
  988. this._animations.push(a);
  989. this._data[a] = f
  990. }
  991. }
  992. };
  993. t.getNumFrames = function(e) {
  994. if (e == null) {
  995. return this._frames ? this._frames.length : this._numFrames
  996. } else {
  997. var t = this._data[e];
  998. if (t == null) {
  999. return 0
  1000. } else {
  1001. return t.frames.length
  1002. }
  1003. }
  1004. };
  1005. t.getAnimations = function() {
  1006. return this._animations.slice(0)
  1007. };
  1008. t.getAnimation = function(e) {
  1009. return this._data[e]
  1010. };
  1011. t.getFrame = function(e) {
  1012. var t;
  1013. if (this._frames && (t = this._frames[e])) {
  1014. return t
  1015. }
  1016. return null
  1017. };
  1018. t.getFrameBounds = function(e, t) {
  1019. var n = this.getFrame(e);
  1020. return n ? (t || new createjs.Rectangle).initialize(-n.regX, -n.regY, n.rect.width, n.rect.height) : null
  1021. };
  1022. t.toString = function() {
  1023. return "[SpriteSheet]"
  1024. };
  1025. t.clone = function() {
  1026. var t = new e;
  1027. t.complete = this.complete;
  1028. t._animations = this._animations;
  1029. t._frames = this._frames;
  1030. t._images = this._images;
  1031. t._data = this._data;
  1032. t._frameHeight = this._frameHeight;
  1033. t._frameWidth = this._frameWidth;
  1034. t._numFrames = this._numFrames;
  1035. t._loadCount = this._loadCount;
  1036. return t
  1037. };
  1038. t._handleImageLoad = function() {
  1039. if (--this._loadCount == 0) {
  1040. this._calculateFrames();
  1041. this.complete = true;
  1042. this.dispatchEvent("complete")
  1043. }
  1044. };
  1045. t._calculateFrames = function() {
  1046. if (this._frames || this._frameWidth == 0) {
  1047. return
  1048. }
  1049. this._frames = [];
  1050. var e = 0;
  1051. var t = this._frameWidth;
  1052. var n = this._frameHeight;
  1053. for (var r = 0, i = this._images; r < i.length; r++) {
  1054. var s = i[r];
  1055. var o = s.width / t | 0;
  1056. var u = s.height / n | 0;
  1057. var a = this._numFrames > 0 ? Math.min(this._numFrames - e, o * u) : o * u;
  1058. for (var f = 0; f < a; f++) {
  1059. this._frames.push({
  1060. image: s,
  1061. rect: new createjs.Rectangle(f % o * t, (f / o | 0) * n, t, n),
  1062. regX: this._regX,
  1063. regY: this._regY
  1064. })
  1065. }
  1066. e += a
  1067. }
  1068. this._numFrames = e
  1069. };
  1070. createjs.SpriteSheet = e
  1071. })();
  1072. this.createjs = this.createjs || {};
  1073. (function() {
  1074. "use strict";
  1075. function e(e, t, n) {
  1076. this.f = e;
  1077. this.params = t;
  1078. this.path = n == null ? true : n
  1079. }
  1080. e.prototype.exec = function(e) {
  1081. this.f.apply(e, this.params)
  1082. };
  1083. var t = function() {
  1084. this.initialize()
  1085. };
  1086. var n = t.prototype;
  1087. t.getRGB = function(e, t, n, r) {
  1088. if (e != null && n == null) {
  1089. r = t;
  1090. n = e & 255;
  1091. t = e >> 8 & 255;
  1092. e = e >> 16 & 255
  1093. }
  1094. if (r == null) {
  1095. return "rgb(" + e + "," + t + "," + n + ")"
  1096. } else {
  1097. return "rgba(" + e + "," + t + "," + n + "," + r + ")"
  1098. }
  1099. };
  1100. t.getHSL = function(e, t, n, r) {
  1101. if (r == null) {
  1102. return "hsl(" + e % 360 + "," + t + "%," + n + "%)"
  1103. } else {
  1104. return "hsla(" + e % 360 + "," + t + "%," + n + "%," + r + ")"
  1105. }
  1106. };
  1107. t.Command = e;
  1108. t.BASE_64 = {
  1109. A: 0,
  1110. B: 1,
  1111. C: 2,
  1112. D: 3,
  1113. E: 4,
  1114. F: 5,
  1115. G: 6,
  1116. H: 7,
  1117. I: 8,
  1118. J: 9,
  1119. K: 10,
  1120. L: 11,
  1121. M: 12,
  1122. N: 13,
  1123. O: 14,
  1124. P: 15,
  1125. Q: 16,
  1126. R: 17,
  1127. S: 18,
  1128. T: 19,
  1129. U: 20,
  1130. V: 21,
  1131. W: 22,
  1132. X: 23,
  1133. Y: 24,
  1134. Z: 25,
  1135. a: 26,
  1136. b: 27,
  1137. c: 28,
  1138. d: 29,
  1139. e: 30,
  1140. f: 31,
  1141. g: 32,
  1142. h: 33,
  1143. i: 34,
  1144. j: 35,
  1145. k: 36,
  1146. l: 37,
  1147. m: 38,
  1148. n: 39,
  1149. o: 40,
  1150. p: 41,
  1151. q: 42,
  1152. r: 43,
  1153. s: 44,
  1154. t: 45,
  1155. u: 46,
  1156. v: 47,
  1157. w: 48,
  1158. x: 49,
  1159. y: 50,
  1160. z: 51,
  1161. 0: 52,
  1162. 1: 53,
  1163. 2: 54,
  1164. 3: 55,
  1165. 4: 56,
  1166. 5: 57,
  1167. 6: 58,
  1168. 7: 59,
  1169. 8: 60,
  1170. 9: 61,
  1171. "+": 62,
  1172. "/": 63
  1173. };
  1174. t.STROKE_CAPS_MAP = ["butt", "round", "square"];
  1175. t.STROKE_JOINTS_MAP = ["miter", "round", "bevel"];
  1176. var r = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
  1177. if (r.getContext) {
  1178. var i = t._ctx = r.getContext("2d");
  1179. t.beginCmd = new e(i.beginPath, [], false);
  1180. t.fillCmd = new e(i.fill, [], false);
  1181. t.strokeCmd = new e(i.stroke, [], false);
  1182. r.width = r.height = 1
  1183. }
  1184. n._strokeInstructions = null;
  1185. n._strokeStyleInstructions = null;
  1186. n._strokeIgnoreScale = false;
  1187. n._fillInstructions = null;
  1188. n._fillMatrix = null;
  1189. n._instructions = null;
  1190. n._oldInstructions = null;
  1191. n._activeInstructions = null;
  1192. n._active = false;
  1193. n._dirty = false;
  1194. n.initialize = function() {
  1195. this.clear();
  1196. this._ctx = t._ctx
  1197. };
  1198. n.isEmpty = function() {
  1199. return !(this._instructions.length || this._oldInstructions.length || this._activeInstructions.length)
  1200. };
  1201. n.draw = function(e) {
  1202. if (this._dirty) {
  1203. this._updateInstructions()
  1204. }
  1205. var t = this._instructions;
  1206. for (var n = 0, r = t.length; n < r; n++) {
  1207. t[n].exec(e)
  1208. }
  1209. };
  1210. n.drawAsPath = function(e) {
  1211. if (this._dirty) {
  1212. this._updateInstructions()
  1213. }
  1214. var t, n = this._instructions;
  1215. for (var r = 0, i = n.length; r < i; r++) {
  1216. if ((t = n[r]).path || r == 0) {
  1217. t.exec(e)
  1218. }
  1219. }
  1220. };
  1221. n.moveTo = function(t, n) {
  1222. this._activeInstructions.push(new e(this._ctx.moveTo, [t, n]));
  1223. return this
  1224. };
  1225. n.lineTo = function(t, n) {
  1226. this._dirty = this._active = true;
  1227. this._activeInstructions.push(new e(this._ctx.lineTo, [t, n]));
  1228. return this
  1229. };
  1230. n.arcTo = function(t, n, r, i, s) {
  1231. this._dirty = this._active = true;
  1232. this._activeInstructions.push(new e(this._ctx.arcTo, [t, n, r, i, s]));
  1233. return this
  1234. };
  1235. n.arc = function(t, n, r, i, s, o) {
  1236. this._dirty = this._active = true;
  1237. if (o == null) {
  1238. o = false
  1239. }
  1240. this._activeInstructions.push(new e(this._ctx.arc, [t, n, r, i, s, o]));
  1241. return this
  1242. };
  1243. n.quadraticCurveTo = function(t, n, r, i) {
  1244. this._dirty = this._active = true;
  1245. this._activeInstructions.push(new e(this._ctx.quadraticCurveTo, [t, n, r, i]));
  1246. return this
  1247. };
  1248. n.bezierCurveTo = function(t, n, r, i, s, o) {
  1249. this._dirty = this._active = true;
  1250. this._activeInstructions.push(new e(this._ctx.bezierCurveTo, [t, n, r, i, s, o]));
  1251. return this
  1252. };
  1253. n.rect = function(t, n, r, i) {
  1254. this._dirty = this._active = true;
  1255. this._activeInstructions.push(new e(this._ctx.rect, [t, n, r, i]));
  1256. return this
  1257. };
  1258. n.closePath = function() {
  1259. if (this._active) {
  1260. this._dirty = true;
  1261. this._activeInstructions.push(new e(this._ctx.closePath, []))
  1262. }
  1263. return this
  1264. };
  1265. n.clear = function() {
  1266. this._instructions = [];
  1267. this._oldInstructions = [];
  1268. this._activeInstructions = [];
  1269. this._strokeStyleInstructions = this._strokeInstructions = this._fillInstructions = this._fillMatrix = null;
  1270. this._active = this._dirty = this._strokeIgnoreScale = false;
  1271. return this
  1272. };
  1273. n.beginFill = function(t) {
  1274. if (this._active) {
  1275. this._newPath()
  1276. }
  1277. this._fillInstructions = t ? [new e(this._setProp, ["fillStyle", t], false)] : null;
  1278. this._fillMatrix = null;
  1279. return this
  1280. };
  1281. n.beginLinearGradientFill = function(t, n, r, i, s, o) {
  1282. if (this._active) {
  1283. this._newPath()
  1284. }
  1285. var u = this._ctx.createLinearGradient(r, i, s, o);
  1286. for (var a = 0, f = t.length; a < f; a++) {
  1287. u.addColorStop(n[a], t[a])
  1288. }
  1289. this._fillInstructions = [new e(this._setProp, ["fillStyle", u], false)];
  1290. this._fillMatrix = null;
  1291. return this
  1292. };
  1293. n.beginRadialGradientFill = function(t, n, r, i, s, o, u, a) {
  1294. if (this._active) {
  1295. this._newPath()
  1296. }
  1297. var f = this._ctx.createRadialGradient(r, i, s, o, u, a);
  1298. for (var l = 0, c = t.length; l < c; l++) {
  1299. f.addColorStop(n[l], t[l])
  1300. }
  1301. this._fillInstructions = [new e(this._setProp, ["fillStyle", f], false)];
  1302. this._fillMatrix = null;
  1303. return this
  1304. };
  1305. n.beginBitmapFill = function(t, n, r) {
  1306. if (this._active) {
  1307. this._newPath()
  1308. }
  1309. n = n || "";
  1310. var i = this._ctx.createPattern(t, n);
  1311. this._fillInstructions = [new e(this._setProp, ["fillStyle", i], false)];
  1312. this._fillMatrix = r ? [r.a, r.b, r.c, r.d, r.tx, r.ty] : null;
  1313. return this
  1314. };
  1315. n.endFill = function() {
  1316. return this.beginFill()
  1317. };
  1318. n.setStrokeStyle = function(n, r, i, s, o) {
  1319. if (this._active) {
  1320. this._newPath()
  1321. }
  1322. this._strokeStyleInstructions = [new e(this._setProp, ["lineWidth", n == null ? "1" : n], false), new e(this._setProp, ["lineCap", r == null ? "butt" : isNaN(r) ? r : t.STROKE_CAPS_MAP[r]], false), new e(this._setProp, ["lineJoin", i == null ? "miter" : isNaN(i) ? i : t.STROKE_JOINTS_MAP[i]], false), new e(this._setProp, ["miterLimit", s == null ? "10" : s], false)];
  1323. this._strokeIgnoreScale = o;
  1324. return this
  1325. };
  1326. n.beginStroke = function(t) {
  1327. if (this._active) {
  1328. this._newPath()
  1329. }
  1330. this._strokeInstructions = t ? [new e(this._setProp, ["strokeStyle", t], false)] : null;
  1331. return this
  1332. };
  1333. n.beginLinearGradientStroke = function(t, n, r, i, s, o) {
  1334. if (this._active) {
  1335. this._newPath()
  1336. }
  1337. var u = this._ctx.createLinearGradient(r, i, s, o);
  1338. for (var a = 0, f = t.length; a < f; a++) {
  1339. u.addColorStop(n[a], t[a])
  1340. }
  1341. this._strokeInstructions = [new e(this._setProp, ["strokeStyle", u], false)];
  1342. return this
  1343. };
  1344. n.beginRadialGradientStroke = function(t, n, r, i, s, o, u, a) {
  1345. if (this._active) {
  1346. this._newPath()
  1347. }
  1348. var f = this._ctx.createRadialGradient(r, i, s, o, u, a);
  1349. for (var l = 0, c = t.length; l < c; l++) {
  1350. f.addColorStop(n[l], t[l])
  1351. }
  1352. this._strokeInstructions = [new e(this._setProp, ["strokeStyle", f], false)];
  1353. return this
  1354. };
  1355. n.beginBitmapStroke = function(t, n) {
  1356. if (this._active) {
  1357. this._newPath()
  1358. }
  1359. n = n || "";
  1360. var r = this._ctx.createPattern(t, n);
  1361. this._strokeInstructions = [new e(this._setProp, ["strokeStyle", r], false)];
  1362. return this
  1363. };
  1364. n.endStroke = function() {
  1365. this.beginStroke();
  1366. return this
  1367. };
  1368. n.curveTo = n.quadraticCurveTo;
  1369. n.drawRect = n.rect;
  1370. n.drawRoundRect = function(e, t, n, r, i) {
  1371. this.drawRoundRectComplex(e, t, n, r, i, i, i, i);
  1372. return this
  1373. };
  1374. n.drawRoundRectComplex = function(t, n, r, i, s, o, u, a) {
  1375. var f = (r < i ? r : i) / 2;
  1376. var l = 0,
  1377. c = 0,
  1378. h = 0,
  1379. p = 0;
  1380. if (s < 0) {
  1381. s *= l = -1
  1382. }
  1383. if (s > f) {
  1384. s = f
  1385. }
  1386. if (o < 0) {
  1387. o *= c = -1
  1388. }
  1389. if (o > f) {
  1390. o = f
  1391. }
  1392. if (u < 0) {
  1393. u *= h = -1
  1394. }
  1395. if (u > f) {
  1396. u = f
  1397. }
  1398. if (a < 0) {
  1399. a *= p = -1
  1400. }
  1401. if (a > f) {
  1402. a = f
  1403. }
  1404. this._dirty = this._active = true;
  1405. var d = this._ctx.arcTo,
  1406. v = this._ctx.lineTo;
  1407. this._activeInstructions.push(new e(this._ctx.moveTo, [t + r - o, n]), new e(d, [t + r + o * c, n - o * c, t + r, n + o, o]), new e(v, [t + r, n + i - u]), new e(d, [t + r + u * h, n + i + u * h, t + r - u, n + i, u]), new e(v, [t + a, n + i]), new e(d, [t - a * p, n + i + a * p, t, n + i - a, a]), new e(v, [t, n + s]), new e(d, [t - s * l, n - s * l, t + s, n, s]), new e(this._ctx.closePath));
  1408. return this
  1409. };
  1410. n.drawCircle = function(e, t, n) {
  1411. this.arc(e, t, n, 0, Math.PI * 2);
  1412. return this
  1413. };
  1414. n.drawEllipse = function(t, n, r, i) {
  1415. this._dirty = this._active = true;
  1416. var s = .5522848;
  1417. var o = r / 2 * s;
  1418. var u = i / 2 * s;
  1419. var a = t + r;
  1420. var f = n + i;
  1421. var l = t + r / 2;
  1422. var c = n + i / 2;
  1423. this._activeInstructions.push(new e(this._ctx.moveTo, [t, c]), new e(this._ctx.bezierCurveTo, [t, c - u, l - o, n, l, n]), new e(this._ctx.bezierCurveTo, [l + o, n, a, c - u, a, c]), new e(this._ctx.bezierCurveTo, [a, c + u, l + o, f, l, f]), new e(this._ctx.bezierCurveTo, [l - o, f, t, c + u, t, c]));
  1424. return this
  1425. };
  1426. n.inject = function(t, n) {
  1427. this._dirty = this._active = true;
  1428. this._activeInstructions.push(new e(t, [n]));
  1429. return this
  1430. };
  1431. n.drawPolyStar = function(t, n, r, i, s, o) {
  1432. this._dirty = this._active = true;
  1433. if (s == null) {
  1434. s = 0
  1435. }
  1436. s = 1 - s;
  1437. if (o == null) {
  1438. o = 0
  1439. } else {
  1440. o /= 180 / Math.PI
  1441. }
  1442. var u = Math.PI / i;
  1443. this._activeInstructions.push(new e(this._ctx.moveTo, [t + Math.cos(o) * r, n + Math.sin(o) * r]));
  1444. for (var a = 0; a < i; a++) {
  1445. o += u;
  1446. if (s != 1) {
  1447. this._activeInstructions.push(new e(this._ctx.lineTo, [t + Math.cos(o) * r * s, n + Math.sin(o) * r * s]))
  1448. }
  1449. o += u;
  1450. this._activeInstructions.push(new e(this._ctx.lineTo, [t + Math.cos(o) * r, n + Math.sin(o) * r]))
  1451. }
  1452. return this
  1453. };
  1454. n.decodePath = function(e) {
  1455. var n = [this.moveTo, this.lineTo, this.quadraticCurveTo, this.bezierCurveTo, this.closePath];
  1456. var r = [2, 2, 4, 6, 0];
  1457. var i = 0,
  1458. s = e.length;
  1459. var o = [];
  1460. var u = 0,
  1461. a = 0;
  1462. var f = t.BASE_64;
  1463. while (i < s) {
  1464. var l = e.charAt(i);
  1465. var c = f[l];
  1466. var h = c >> 3;
  1467. var p = n[h];
  1468. if (!p || c & 3) {
  1469. throw "bad path data (@" + i + "): " + l
  1470. }
  1471. var d = r[h];
  1472. if (!h) {
  1473. u = a = 0
  1474. }
  1475. o.length = 0;
  1476. i++;
  1477. var v = (c >> 2 & 1) + 2;
  1478. for (var m = 0; m < d; m++) {
  1479. var g = f[e.charAt(i)];
  1480. var y = g >> 5 ? -1 : 1;
  1481. g = (g & 31) << 6 | f[e.charAt(i + 1)];
  1482. if (v == 3) {
  1483. g = g << 6 | f[e.charAt(i + 2)]
  1484. }
  1485. g = y * g / 10;
  1486. if (m % 2) {
  1487. u = g += u
  1488. } else {
  1489. a = g += a
  1490. }
  1491. o[m] = g;
  1492. i += v
  1493. }
  1494. p.apply(this, o)
  1495. }
  1496. return this
  1497. };
  1498. n.clone = function() {
  1499. var e = new t;
  1500. e._instructions = this._instructions.slice();
  1501. e._activeInstructions = this._activeInstructions.slice();
  1502. e._oldInstructions = this._oldInstructions.slice();
  1503. if (this._fillInstructions) {
  1504. e._fillInstructions = this._fillInstructions.slice()
  1505. }
  1506. if (this._strokeInstructions) {
  1507. e._strokeInstructions = this._strokeInstructions.slice()
  1508. }
  1509. if (this._strokeStyleInstructions) {
  1510. e._strokeStyleInstructions = this._strokeStyleInstructions.slice()
  1511. }
  1512. e._active = this._active;
  1513. e._dirty = this._dirty;
  1514. e._fillMatrix = this._fillMatrix;
  1515. e._strokeIgnoreScale = this._strokeIgnoreScale;
  1516. return e
  1517. };
  1518. n.toString = function() {
  1519. return "[Graphics]"
  1520. };
  1521. n.mt = n.moveTo;
  1522. n.lt = n.lineTo;
  1523. n.at = n.arcTo;
  1524. n.bt = n.bezierCurveTo;
  1525. n.qt = n.quadraticCurveTo;
  1526. n.a = n.arc;
  1527. n.r = n.rect;
  1528. n.cp = n.closePath;
  1529. n.c = n.clear;
  1530. n.f = n.beginFill;
  1531. n.lf = n.beginLinearGradientFill;
  1532. n.rf = n.beginRadialGradientFill;
  1533. n.bf = n.beginBitmapFill;
  1534. n.ef = n.endFill;
  1535. n.ss = n.setStrokeStyle;
  1536. n.s = n.beginStroke;
  1537. n.ls = n.beginLinearGradientStroke;
  1538. n.rs = n.beginRadialGradientStroke;
  1539. n.bs = n.beginBitmapStroke;
  1540. n.es = n.endStroke;
  1541. n.dr = n.drawRect;
  1542. n.rr = n.drawRoundRect;
  1543. n.rc = n.drawRoundRectComplex;
  1544. n.dc = n.drawCircle;
  1545. n.de = n.drawEllipse;
  1546. n.dp = n.drawPolyStar;
  1547. n.p = n.decodePath;
  1548. n._updateInstructions = function() {
  1549. this._instructions = this._oldInstructions.slice();
  1550. this._instructions.push(t.beginCmd);
  1551. this._appendInstructions(this._fillInstructions);
  1552. this._appendInstructions(this._strokeInstructions);
  1553. this._appendInstructions(this._strokeInstructions && this._strokeStyleInstructions);
  1554. this._appendInstructions(this._activeInstructions);
  1555. if (this._fillInstructions) {
  1556. this._appendDraw(t.fillCmd, this._fillMatrix)
  1557. }
  1558. if (this._strokeInstructions) {
  1559. this._appendDraw(t.strokeCmd, this._strokeIgnoreScale && [1, 0, 0, 1, 0, 0])
  1560. }
  1561. };
  1562. n._appendInstructions = function(e) {
  1563. if (e) {
  1564. this._instructions.push.apply(this._instructions, e)
  1565. }
  1566. };
  1567. n._appendDraw = function(t, n) {
  1568. if (!n) {
  1569. this._instructions.push(t)
  1570. } else {
  1571. this._instructions.push(new e(this._ctx.save, [], false), new e(this._ctx.transform, n, false), t, new e(this._ctx.restore, [], false))
  1572. }
  1573. };
  1574. n._newPath = function() {
  1575. if (this._dirty) {
  1576. this._updateInstructions()
  1577. }
  1578. this._oldInstructions = this._instructions;
  1579. this._activeInstructions = [];
  1580. this._active = this._dirty = false
  1581. };
  1582. n._setProp = function(e, t) {
  1583. this[e] = t
  1584. };
  1585. createjs.Graphics = t
  1586. })();
  1587. this.createjs = this.createjs || {};
  1588. (function() {
  1589. var e = function() {
  1590. this.initialize()
  1591. };
  1592. var t = e.prototype = new createjs.EventDispatcher;
  1593. e._MOUSE_EVENTS = ["click", "dblclick", "mousedown", "mouseout", "mouseover", "pressmove", "pressup", "rollout", "rollover"];
  1594. e.suppressCrossDomainErrors = false;
  1595. e._snapToPixelEnabled = false;
  1596. var n = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
  1597. if (n.getContext) {
  1598. e._hitTestCanvas = n;
  1599. e._hitTestContext = n.getContext("2d");
  1600. n.width = n.height = 1
  1601. }
  1602. e._nextCacheID = 1;
  1603. t.alpha = 1;
  1604. t.cacheCanvas = null;
  1605. t.id = -1;
  1606. t.mouseEnabled = true;
  1607. t.tickEnabled = true;
  1608. t.name = null;
  1609. t.parent = null;
  1610. t.regX = 0;
  1611. t.regY = 0;
  1612. t.rotation = 0;
  1613. t.scaleX = 1;
  1614. t.scaleY = 1;
  1615. t.skewX = 0;
  1616. t.skewY = 0;
  1617. t.shadow = null;
  1618. t.visible = true;
  1619. t.x = 0;
  1620. t.y = 0;
  1621. t.compositeOperation = null;
  1622. t.snapToPixel = true;
  1623. t.filters = null;
  1624. t.cacheID = 0;
  1625. t.mask = null;
  1626. t.hitArea = null;
  1627. t.cursor = null;
  1628. t._cacheOffsetX = 0;
  1629. t._cacheOffsetY = 0;
  1630. t._cacheScale = 1;
  1631. t._cacheDataURLID = 0;
  1632. t._cacheDataURL = null;
  1633. t._matrix = null;
  1634. t._rectangle = null;
  1635. t._bounds = null;
  1636. t.initialize = function() {
  1637. this.id = createjs.UID.get();
  1638. this._matrix = new createjs.Matrix2D;
  1639. this._rectangle = new createjs.Rectangle
  1640. };
  1641. t.isVisible = function() {
  1642. return !!(this.visible && this.alpha > 0 && this.scaleX != 0 && this.scaleY != 0)
  1643. };
  1644. t.draw = function(e, t) {
  1645. var n = this.cacheCanvas;
  1646. if (t || !n) {
  1647. return false
  1648. }
  1649. var r = this._cacheScale,
  1650. i = this._cacheOffsetX,
  1651. s = this._cacheOffsetY,
  1652. o;
  1653. if (o = this._applyFilterBounds(i, s, 0, 0)) {
  1654. i = o.x;
  1655. s = o.y
  1656. }
  1657. e.drawImage(n, i, s, n.width / r, n.height / r);
  1658. return true
  1659. };
  1660. t.updateContext = function(t) {
  1661. var n, r = this.mask,
  1662. i = this;
  1663. if (r && r.graphics && !r.graphics.isEmpty()) {
  1664. n = r.getMatrix(r._matrix);
  1665. t.transform(n.a, n.b, n.c, n.d, n.tx, n.ty);
  1666. r.graphics.drawAsPath(t);
  1667. t.clip();
  1668. n.invert();
  1669. t.transform(n.a, n.b, n.c, n.d, n.tx, n.ty)
  1670. }
  1671. n = i._matrix.identity().appendTransform(i.x, i.y, i.scaleX, i.scaleY, i.rotation, i.skewX, i.skewY, i.regX, i.regY);
  1672. var s = n.tx,
  1673. o = n.ty;
  1674. if (e._snapToPixelEnabled && i.snapToPixel) {
  1675. s = s + (s < 0 ? -.5 : .5) | 0;
  1676. o = o + (o < 0 ? -.5 : .5) | 0
  1677. }
  1678. t.transform(n.a, n.b, n.c, n.d, s, o);
  1679. t.globalAlpha *= i.alpha;
  1680. if (i.compositeOperation) {
  1681. t.globalCompositeOperation = i.compositeOperation
  1682. }
  1683. if (i.shadow) {
  1684. this._applyShadow(t, i.shadow)
  1685. }
  1686. };
  1687. t.cache = function(e, t, n, r, i) {
  1688. i = i || 1;
  1689. if (!this.cacheCanvas) {
  1690. this.cacheCanvas = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas")
  1691. }
  1692. this._cacheWidth = n;
  1693. this._cacheHeight = r;
  1694. this._cacheOffsetX = e;
  1695. this._cacheOffsetY = t;
  1696. this._cacheScale = i;
  1697. this.updateCache()
  1698. };
  1699. t.updateCache = function(t) {
  1700. var n = this.cacheCanvas,
  1701. r = this._cacheScale,
  1702. i = this._cacheOffsetX * r,
  1703. s = this._cacheOffsetY * r;
  1704. var o = this._cacheWidth,
  1705. u = this._cacheHeight,
  1706. a;
  1707. if (!n) {
  1708. throw "cache() must be called before updateCache()"
  1709. }
  1710. var f = n.getContext("2d");
  1711. if (a = this._applyFilterBounds(i, s, o, u)) {
  1712. i = a.x;
  1713. s = a.y;
  1714. o = a.width;
  1715. u = a.height
  1716. }
  1717. o = Math.ceil(o * r);
  1718. u = Math.ceil(u * r);
  1719. if (o != n.width || u != n.height) {
  1720. n.width = o;
  1721. n.height = u
  1722. } else if (!t) {
  1723. f.clearRect(0, 0, o + 1, u + 1)
  1724. }
  1725. f.save();
  1726. f.globalCompositeOperation = t;
  1727. f.setTransform(r, 0, 0, r, -i, -s);
  1728. this.draw(f, true);
  1729. this._applyFilters();
  1730. f.restore();
  1731. this.cacheID = e._nextCacheID++
  1732. };
  1733. t.uncache = function() {
  1734. this._cacheDataURL = this.cacheCanvas = null;
  1735. this.cacheID = this._cacheOffsetX = this._cacheOffsetY = 0;
  1736. this._cacheScale = 1
  1737. };
  1738. t.getCacheDataURL = function() {
  1739. if (!this.cacheCanvas) {
  1740. return null
  1741. }
  1742. if (this.cacheID != this._cacheDataURLID) {
  1743. this._cacheDataURL = this.cacheCanvas.toDataURL()
  1744. }
  1745. return this._cacheDataURL
  1746. };
  1747. t.getStage = function() {
  1748. var e = this;
  1749. while (e.parent) {
  1750. e = e.parent
  1751. }
  1752. if (e instanceof createjs["Stage"]) {
  1753. return e
  1754. }
  1755. return null
  1756. };
  1757. t.localToGlobal = function(e, t) {
  1758. var n = this.getConcatenatedMatrix(this._matrix);
  1759. if (n == null) {
  1760. return null
  1761. }
  1762. n.append(1, 0, 0, 1, e, t);
  1763. return new createjs.Point(n.tx, n.ty)
  1764. };
  1765. t.globalToLocal = function(e, t) {
  1766. var n = this.getConcatenatedMatrix(this._matrix);
  1767. if (n == null) {
  1768. return null
  1769. }
  1770. n.invert();
  1771. n.append(1, 0, 0, 1, e, t);
  1772. return new createjs.Point(n.tx, n.ty)
  1773. };
  1774. t.localToLocal = function(e, t, n) {
  1775. var r = this.localToGlobal(e, t);
  1776. return n.globalToLocal(r.x, r.y)
  1777. };
  1778. t.setTransform = function(e, t, n, r, i, s, o, u, a) {
  1779. this.x = e || 0;
  1780. this.y = t || 0;
  1781. this.scaleX = n == null ? 1 : n;
  1782. this.scaleY = r == null ? 1 : r;
  1783. this.rotation = i || 0;
  1784. this.skewX = s || 0;
  1785. this.skewY = o || 0;
  1786. this.regX = u || 0;
  1787. this.regY = a || 0;
  1788. return this
  1789. };
  1790. t.getMatrix = function(e) {
  1791. var t = this;
  1792. return (e ? e.identity() : new createjs.Matrix2D).appendTransform(t.x, t.y, t.scaleX, t.scaleY, t.rotation, t.skewX, t.skewY, t.regX, t.regY).appendProperties(t.alpha, t.shadow, t.compositeOperation)
  1793. };
  1794. t.getConcatenatedMatrix = function(e) {
  1795. if (e) {
  1796. e.identity()
  1797. } else {
  1798. e = new createjs.Matrix2D
  1799. }
  1800. var t = this;
  1801. while (t != null) {
  1802. e.prependTransform(t.x, t.y, t.scaleX, t.scaleY, t.rotation, t.skewX, t.skewY, t.regX, t.regY).prependProperties(t.alpha, t.shadow, t.compositeOperation, t.visible);
  1803. t = t.parent
  1804. }
  1805. return e
  1806. };
  1807. t.hitTest = function(t, n) {
  1808. var r = e._hitTestContext;
  1809. r.setTransform(1, 0, 0, 1, -t, -n);
  1810. this.draw(r);
  1811. var i = this._testHit(r);
  1812. r.setTransform(1, 0, 0, 1, 0, 0);
  1813. r.clearRect(0, 0, 2, 2);
  1814. return i
  1815. };
  1816. t.set = function(e) {
  1817. for (var t in e) {
  1818. this[t] = e[t]
  1819. }
  1820. return this
  1821. };
  1822. t.getBounds = function() {
  1823. if (this._bounds) {
  1824. return this._rectangle.copy(this._bounds)
  1825. }
  1826. var e = this.cacheCanvas;
  1827. if (e) {
  1828. var t = this._cacheScale;
  1829. return this._rectangle.initialize(this._cacheOffsetX, this._cacheOffsetY, e.width / t, e.height / t)
  1830. }
  1831. return null
  1832. };
  1833. t.getTransformedBounds = function() {
  1834. return this._getBounds()
  1835. };
  1836. t.setBounds = function(e, t, n, r) {
  1837. if (e == null) {
  1838. this._bounds = e
  1839. }
  1840. this._bounds = (this._bounds || new createjs.Rectangle).initialize(e, t, n, r)
  1841. };
  1842. t.clone = function() {
  1843. var t = new e;
  1844. this.cloneProps(t);
  1845. return t
  1846. };
  1847. t.toString = function() {
  1848. return "[DisplayObject (name=" + this.name + ")]"
  1849. };
  1850. t.cloneProps = function(e) {
  1851. e.alpha = this.alpha;
  1852. e.name = this.name;
  1853. e.regX = this.regX;
  1854. e.regY = this.regY;
  1855. e.rotation = this.rotation;
  1856. e.scaleX = this.scaleX;
  1857. e.scaleY = this.scaleY;
  1858. e.shadow = this.shadow;
  1859. e.skewX = this.skewX;
  1860. e.skewY = this.skewY;
  1861. e.visible = this.visible;
  1862. e.x = this.x;
  1863. e.y = this.y;
  1864. e._bounds = this._bounds;
  1865. e.mouseEnabled = this.mouseEnabled;
  1866. e.compositeOperation = this.compositeOperation
  1867. };
  1868. t._applyShadow = function(e, t) {
  1869. t = t || Shadow.identity;
  1870. e.shadowColor = t.color;
  1871. e.shadowOffsetX = t.offsetX;
  1872. e.shadowOffsetY = t.offsetY;
  1873. e.shadowBlur = t.blur
  1874. };
  1875. t._tick = function(e) {
  1876. var t = this._listeners;
  1877. if (t && t["tick"]) {
  1878. var n = new createjs.Event("tick");
  1879. n.params = e;
  1880. this._dispatchEvent(n, this, 2)
  1881. }
  1882. };
  1883. t._testHit = function(t) {
  1884. try {
  1885. var n = t.getImageData(0, 0, 1, 1).data[3] > 1
  1886. } catch (r) {
  1887. if (!e.suppressCrossDomainErrors) {
  1888. throw "An error has occurred. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images."
  1889. }
  1890. }
  1891. return n
  1892. };
  1893. t._applyFilters = function() {
  1894. if (!this.filters || this.filters.length == 0 || !this.cacheCanvas) {
  1895. return
  1896. }
  1897. var e = this.filters.length;
  1898. var t = this.cacheCanvas.getContext("2d");
  1899. var n = this.cacheCanvas.width;
  1900. var r = this.cacheCanvas.height;
  1901. for (var i = 0; i < e; i++) {
  1902. this.filters[i].applyFilter(t, 0, 0, n, r)
  1903. }
  1904. };
  1905. t._applyFilterBounds = function(e, t, n, r) {
  1906. var i, s, o = this.filters;
  1907. if (!o || !(s = o.length)) {
  1908. return null
  1909. }
  1910. for (var u = 0; u < s; u++) {
  1911. var a = this.filters[u];
  1912. var f = a.getBounds && a.getBounds();
  1913. if (!f) {
  1914. continue
  1915. }
  1916. if (!i) {
  1917. i = this._rectangle.initialize(e, t, n, r)
  1918. }
  1919. i.x += f.x;
  1920. i.y += f.y;
  1921. i.width += f.width;
  1922. i.height += f.height
  1923. }
  1924. return i
  1925. };
  1926. t._getBounds = function(e, t) {
  1927. return this._transformBounds(this.getBounds(), e, t)
  1928. };
  1929. t._transformBounds = function(e, t, n) {
  1930. if (!e) {
  1931. return e
  1932. }
  1933. var r = e.x,
  1934. i = e.y,
  1935. s = e.width,
  1936. o = e.height;
  1937. var u = n ? this._matrix.identity() : this.getMatrix(this._matrix);
  1938. if (r || i) {
  1939. u.appendTransform(0, 0, 1, 1, 0, 0, 0, -r, -i)
  1940. }
  1941. if (t) {
  1942. u.prependMatrix(t)
  1943. }
  1944. var a = s * u.a,
  1945. f = s * u.b;
  1946. var l = o * u.c,
  1947. c = o * u.d;
  1948. var h = u.tx,
  1949. p = u.ty;
  1950. var d = h,
  1951. v = h,
  1952. m = p,
  1953. g = p;
  1954. if ((r = a + h) < d) {
  1955. d = r
  1956. } else if (r > v) {
  1957. v = r
  1958. }
  1959. if ((r = a + l + h) < d) {
  1960. d = r
  1961. } else if (r > v) {
  1962. v = r
  1963. }
  1964. if ((r = l + h) < d) {
  1965. d = r
  1966. } else if (r > v) {
  1967. v = r
  1968. }
  1969. if ((i = f + p) < m) {
  1970. m = i
  1971. } else if (i > g) {
  1972. g = i
  1973. }
  1974. if ((i = f + c + p) < m) {
  1975. m = i
  1976. } else if (i > g) {
  1977. g = i
  1978. }
  1979. if ((i = c + p) < m) {
  1980. m = i
  1981. } else if (i > g) {
  1982. g = i
  1983. }
  1984. return e.initialize(d, m, v - d, g - m)
  1985. };
  1986. t._hasMouseEventListener = function() {
  1987. var t = e._MOUSE_EVENTS;
  1988. for (var n = 0, r = t.length; n < r; n++) {
  1989. if (this.hasEventListener(t[n])) {
  1990. return true
  1991. }
  1992. }
  1993. return !!this.cursor
  1994. };
  1995. createjs.DisplayObject = e
  1996. })();
  1997. this.createjs = this.createjs || {};
  1998. (function() {
  1999. var e = function() {
  2000. this.initialize()
  2001. };
  2002. var t = e.prototype = new createjs.DisplayObject;
  2003. t.children = null;
  2004. t.mouseChildren = true;
  2005. t.tickChildren = true;
  2006. t.DisplayObject_initialize = t.initialize;
  2007. t.initialize = function() {
  2008. this.DisplayObject_initialize();
  2009. this.children = []
  2010. };
  2011. t.isVisible = function() {
  2012. var e = this.cacheCanvas || this.children.length;
  2013. return !!(this.visible && this.alpha > 0 && this.scaleX != 0 && this.scaleY != 0 && e)
  2014. };
  2015. t.DisplayObject_draw = t.draw;
  2016. t.draw = function(e, t) {
  2017. if (this.DisplayObject_draw(e, t)) {
  2018. return true
  2019. }
  2020. var n = this.children.slice(0);
  2021. for (var r = 0, i = n.length; r < i; r++) {
  2022. var s = n[r];
  2023. if (!s.isVisible()) {
  2024. continue
  2025. }
  2026. e.save();
  2027. s.updateContext(e);
  2028. s.draw(e);
  2029. e.restore()
  2030. }
  2031. return true
  2032. };
  2033. t.addChild = function(e) {
  2034. if (e == null) {
  2035. return e
  2036. }
  2037. var t = arguments.length;
  2038. if (t > 1) {
  2039. for (var n = 0; n < t; n++) {
  2040. this.addChild(arguments[n])
  2041. }
  2042. return arguments[t - 1]
  2043. }
  2044. if (e.parent) {
  2045. e.parent.removeChild(e)
  2046. }
  2047. e.parent = this;
  2048. this.children.push(e);
  2049. return e
  2050. };
  2051. t.addChildAt = function(e, t) {
  2052. var n = arguments.length;
  2053. var r = arguments[n - 1];
  2054. if (r < 0 || r > this.children.length) {
  2055. return arguments[n - 2]
  2056. }
  2057. if (n > 2) {
  2058. for (var i = 0; i < n - 1; i++) {
  2059. this.addChildAt(arguments[i], r + i)
  2060. }
  2061. return arguments[n - 2]
  2062. }
  2063. if (e.parent) {
  2064. e.parent.removeChild(e)
  2065. }
  2066. e.parent = this;
  2067. this.children.splice(t, 0, e);
  2068. return e
  2069. };
  2070. t.removeChild = function(e) {
  2071. var t = arguments.length;
  2072. if (t > 1) {
  2073. var n = true;
  2074. for (var r = 0; r < t; r++) {
  2075. n = n && this.removeChild(arguments[r])
  2076. }
  2077. return n
  2078. }
  2079. return this.removeChildAt(createjs.indexOf(this.children, e))
  2080. };
  2081. t.removeChildAt = function(e) {
  2082. var t = arguments.length;
  2083. if (t > 1) {
  2084. var n = [];
  2085. for (var r = 0; r < t; r++) {
  2086. n[r] = arguments[r]
  2087. }
  2088. n.sort(function(e, t) {
  2089. return t - e
  2090. });
  2091. var i = true;
  2092. for (var r = 0; r < t; r++) {
  2093. i = i && this.removeChildAt(n[r])
  2094. }
  2095. return i
  2096. }
  2097. if (e < 0 || e > this.children.length - 1) {
  2098. return false
  2099. }
  2100. var s = this.children[e];
  2101. if (s) {
  2102. s.parent = null
  2103. }
  2104. this.children.splice(e, 1);
  2105. return true
  2106. };
  2107. t.removeAllChildren = function() {
  2108. var e = this.children;
  2109. while (e.length) {
  2110. e.pop().parent = null
  2111. }
  2112. };
  2113. t.getChildAt = function(e) {
  2114. return this.children[e]
  2115. };
  2116. t.getChildByName = function(e) {
  2117. var t = this.children;
  2118. for (var n = 0, r = t.length; n < r; n++) {
  2119. if (t[n].name == e) {
  2120. return t[n]
  2121. }
  2122. }
  2123. return null
  2124. };
  2125. t.sortChildren = function(e) {
  2126. this.children.sort(e)
  2127. };
  2128. t.getChildIndex = function(e) {
  2129. return createjs.indexOf(this.children, e)
  2130. };
  2131. t.getNumChildren = function() {
  2132. return this.children.length
  2133. };
  2134. t.swapChildrenAt = function(e, t) {
  2135. var n = this.children;
  2136. var r = n[e];
  2137. var i = n[t];
  2138. if (!r || !i) {
  2139. return
  2140. }
  2141. n[e] = i;
  2142. n[t] = r
  2143. };
  2144. t.swapChildren = function(e, t) {
  2145. var n = this.children;
  2146. var r, i;
  2147. for (var s = 0, o = n.length; s < o; s++) {
  2148. if (n[s] == e) {
  2149. r = s
  2150. }
  2151. if (n[s] == t) {
  2152. i = s
  2153. }
  2154. if (r != null && i != null) {
  2155. break
  2156. }
  2157. }
  2158. if (s == o) {
  2159. return
  2160. }
  2161. n[r] = t;
  2162. n[i] = e
  2163. };
  2164. t.setChildIndex = function(e, t) {
  2165. var n = this.children,
  2166. r = n.length;
  2167. if (e.parent != this || t < 0 || t >= r) {
  2168. return
  2169. }
  2170. for (var i = 0; i < r; i++) {
  2171. if (n[i] == e) {
  2172. break
  2173. }
  2174. }
  2175. if (i == r || i == t) {
  2176. return
  2177. }
  2178. n.splice(i, 1);
  2179. n.splice(t, 0, e)
  2180. };
  2181. t.contains = function(e) {
  2182. while (e) {
  2183. if (e == this) {
  2184. return true
  2185. }
  2186. e = e.parent
  2187. }
  2188. return false
  2189. };
  2190. t.hitTest = function(e, t) {
  2191. return this.getObjectUnderPoint(e, t) != null
  2192. };
  2193. t.getObjectsUnderPoint = function(e, t) {
  2194. var n = [];
  2195. var r = this.localToGlobal(e, t);
  2196. this._getObjectsUnderPoint(r.x, r.y, n);
  2197. return n
  2198. };
  2199. t.getObjectUnderPoint = function(e, t) {
  2200. var n = this.localToGlobal(e, t);
  2201. return this._getObjectsUnderPoint(n.x, n.y)
  2202. };
  2203. t.DisplayObject_getBounds = t.getBounds;
  2204. t.getBounds = function() {
  2205. return this._getBounds(null, true)
  2206. };
  2207. t.getTransformedBounds = function() {
  2208. return this._getBounds()
  2209. };
  2210. t.clone = function(t) {
  2211. var n = new e;
  2212. this.cloneProps(n);
  2213. if (t) {
  2214. var r = n.children = [];
  2215. for (var i = 0, s = this.children.length; i < s; i++) {
  2216. var o = this.children[i].clone(t);
  2217. o.parent = n;
  2218. r.push(o)
  2219. }
  2220. }
  2221. return n
  2222. };
  2223. t.toString = function() {
  2224. return "[Container (name=" + this.name + ")]"
  2225. };
  2226. t.DisplayObject__tick = t._tick;
  2227. t._tick = function(e) {
  2228. if (this.tickChildren) {
  2229. for (var t = this.children.length - 1; t >= 0; t--) {
  2230. var n = this.children[t];
  2231. if (n.tickEnabled && n._tick) {
  2232. n._tick(e)
  2233. }
  2234. }
  2235. }
  2236. this.DisplayObject__tick(e)
  2237. };
  2238. t._getObjectsUnderPoint = function(t, n, r, i, s) {
  2239. var o = createjs.DisplayObject._hitTestContext;
  2240. var u = this._matrix;
  2241. s = s || i && this._hasMouseEventListener();
  2242. var a = this.children;
  2243. var f = a.length;
  2244. for (var l = f - 1; l >= 0; l--) {
  2245. var c = a[l];
  2246. var h = c.hitArea;
  2247. if (!c.visible || !h && !c.isVisible() || i && !c.mouseEnabled) {
  2248. continue
  2249. }
  2250. if (!h && c instanceof e) {
  2251. var p = c._getObjectsUnderPoint(t, n, r, i, s);
  2252. if (!r && p) {
  2253. return i && !this.mouseChildren ? this : p
  2254. }
  2255. } else {
  2256. if (i && !s && !c._hasMouseEventListener()) {
  2257. continue
  2258. }
  2259. c.getConcatenatedMatrix(u);
  2260. if (h) {
  2261. u.appendTransform(h.x, h.y, h.scaleX, h.scaleY, h.rotation, h.skewX, h.skewY, h.regX, h.regY);
  2262. u.alpha = h.alpha
  2263. }
  2264. o.globalAlpha = u.alpha;
  2265. o.setTransform(u.a, u.b, u.c, u.d, u.tx - t, u.ty - n);
  2266. (h || c).draw(o);
  2267. if (!this._testHit(o)) {
  2268. continue
  2269. }
  2270. o.setTransform(1, 0, 0, 1, 0, 0);
  2271. o.clearRect(0, 0, 2, 2);
  2272. if (r) {
  2273. r.push(c)
  2274. } else {
  2275. return i && !this.mouseChildren ? this : c
  2276. }
  2277. }
  2278. }
  2279. return null
  2280. };
  2281. t._getBounds = function(e, t) {
  2282. var n = this.DisplayObject_getBounds();
  2283. if (n) {
  2284. return this._transformBounds(n, e, t)
  2285. }
  2286. var r, i, s, o;
  2287. var u = t ? this._matrix.identity() : this.getMatrix(this._matrix);
  2288. if (e) {
  2289. u.prependMatrix(e)
  2290. }
  2291. var a = this.children.length;
  2292. for (var f = 0; f < a; f++) {
  2293. var l = this.children[f];
  2294. if (!l.visible || !(n = l._getBounds(u))) {
  2295. continue
  2296. }
  2297. var c = n.x,
  2298. h = n.y,
  2299. p = c + n.width,
  2300. d = h + n.height;
  2301. if (c < r || r == null) {
  2302. r = c
  2303. }
  2304. if (p > i || i == null) {
  2305. i = p
  2306. }
  2307. if (h < s || s == null) {
  2308. s = h
  2309. }
  2310. if (d > o || o == null) {
  2311. o = d
  2312. }
  2313. }
  2314. return i == null ? null : this._rectangle.initialize(r, s, i - r, o - s)
  2315. };
  2316. createjs.Container = e
  2317. })();
  2318. this.createjs = this.createjs || {};
  2319. (function() {
  2320. "use strict";
  2321. var e = function(e) {
  2322. this.initialize(e)
  2323. };
  2324. var t = e.prototype = new createjs.Container;
  2325. t.autoClear = true;
  2326. t.canvas = null;
  2327. t.mouseX = 0;
  2328. t.mouseY = 0;
  2329. t.snapToPixelEnabled = false;
  2330. t.mouseInBounds = false;
  2331. t.tickOnUpdate = true;
  2332. t.mouseMoveOutside = false;
  2333. t._get_nextStage = function() {
  2334. return this._nextStage
  2335. };
  2336. t._set_nextStage = function(e) {
  2337. if (this._nextStage) {
  2338. this._nextStage._prevStage = null
  2339. }
  2340. if (e) {
  2341. e._prevStage = this
  2342. }
  2343. this._nextStage = e
  2344. };
  2345. try {
  2346. Object.defineProperties(t, {
  2347. nextStage: {
  2348. get: t._get_nextStage,
  2349. set: t._set_nextStage
  2350. }
  2351. })
  2352. } catch (n) {}
  2353. t._pointerData = null;
  2354. t._pointerCount = 0;
  2355. t._primaryPointerID = null;
  2356. t._mouseOverIntervalID = null;
  2357. t._nextStage = null;
  2358. t._prevStage = null;
  2359. t.Container_initialize = t.initialize;
  2360. t.initialize = function(e) {
  2361. this.Container_initialize();
  2362. this.canvas = typeof e == "string" ? document.getElementById(e) : e;
  2363. this._pointerData = {};
  2364. this.enableDOMEvents(true)
  2365. };
  2366. t.update = function(e) {
  2367. if (!this.canvas) {
  2368. return
  2369. }
  2370. if (this.tickOnUpdate) {
  2371. this.dispatchEvent("tickstart");
  2372. this.tickEnabled && this._tick(arguments.length ? arguments : null);
  2373. this.dispatchEvent("tickend")
  2374. }
  2375. this.dispatchEvent("drawstart");
  2376. createjs.DisplayObject._snapToPixelEnabled = this.snapToPixelEnabled;
  2377. if (this.autoClear) {
  2378. this.clear()
  2379. }
  2380. var t = this.canvas.getContext("2d");
  2381. t.save();
  2382. this.updateContext(t);
  2383. this.draw(t, false);
  2384. t.restore();
  2385. this.dispatchEvent("drawend")
  2386. };
  2387. t.handleEvent = function(e) {
  2388. if (e.type == "tick") {
  2389. this.update(e)
  2390. }
  2391. };
  2392. t.clear = function() {
  2393. if (!this.canvas) {
  2394. return
  2395. }
  2396. var e = this.canvas.getContext("2d");
  2397. e.setTransform(1, 0, 0, 1, 0, 0);
  2398. e.clearRect(0, 0, this.canvas.width + 1, this.canvas.height + 1)
  2399. };
  2400. t.toDataURL = function(e, t) {
  2401. if (!t) {
  2402. t = "image/png"
  2403. }
  2404. var n = this.canvas.getContext("2d");
  2405. var r = this.canvas.width;
  2406. var i = this.canvas.height;
  2407. var s;
  2408. if (e) {
  2409. s = n.getImageData(0, 0, r, i);
  2410. var o = n.globalCompositeOperation;
  2411. n.globalCompositeOperation = "destination-over";
  2412. n.fillStyle = e;
  2413. n.fillRect(0, 0, r, i)
  2414. }
  2415. var u = this.canvas.toDataURL(t);
  2416. if (e) {
  2417. n.clearRect(0, 0, r + 1, i + 1);
  2418. n.putImageData(s, 0, 0);
  2419. n.globalCompositeOperation = o
  2420. }
  2421. return u
  2422. };
  2423. t.enableMouseOver = function(e) {
  2424. if (this._mouseOverIntervalID) {
  2425. clearInterval(this._mouseOverIntervalID);
  2426. this._mouseOverIntervalID = null;
  2427. if (e == 0) {
  2428. this._testMouseOver(true)
  2429. }
  2430. }
  2431. if (e == null) {
  2432. e = 20
  2433. } else if (e <= 0) {
  2434. return
  2435. }
  2436. var t = this;
  2437. this._mouseOverIntervalID = setInterval(function() {
  2438. t._testMouseOver()
  2439. }, 1e3 / Math.min(50, e))
  2440. };
  2441. t.enableDOMEvents = function(e) {
  2442. if (e == null) {
  2443. e = true
  2444. }
  2445. var t, n, r = this._eventListeners;
  2446. if (!e && r) {
  2447. for (t in r) {
  2448. n = r[t];
  2449. n.t.removeEventListener(t, n.f, false)
  2450. }
  2451. this._eventListeners = null
  2452. } else if (e && !r && this.canvas) {
  2453. var i = window.addEventListener ? window : document;
  2454. var s = this;
  2455. r = this._eventListeners = {};
  2456. r["mouseup"] = {
  2457. t: i,
  2458. f: function(e) {
  2459. s._handleMouseUp(e)
  2460. }
  2461. };
  2462. r["mousemove"] = {
  2463. t: i,
  2464. f: function(e) {
  2465. s._handleMouseMove(e)
  2466. }
  2467. };
  2468. r["dblclick"] = {
  2469. t: this.canvas,
  2470. f: function(e) {
  2471. s._handleDoubleClick(e)
  2472. }
  2473. };
  2474. r["mousedown"] = {
  2475. t: this.canvas,
  2476. f: function(e) {
  2477. s._handleMouseDown(e)
  2478. }
  2479. };
  2480. for (t in r) {
  2481. n = r[t];
  2482. n.t.addEventListener(t, n.f, false)
  2483. }
  2484. }
  2485. };
  2486. t.clone = function() {
  2487. var t = new e(null);
  2488. this.cloneProps(t);
  2489. return t
  2490. };
  2491. t.toString = function() {
  2492. return "[Stage (name=" + this.name + ")]"
  2493. };
  2494. t._getElementRect = function(e) {
  2495. var t;
  2496. try {
  2497. t = e.getBoundingClientRect()
  2498. } catch (n) {
  2499. t = {
  2500. top: e.offsetTop,
  2501. left: e.offsetLeft,
  2502. width: e.offsetWidth,
  2503. height: e.offsetHeight
  2504. }
  2505. }
  2506. var r = (window.pageXOffset || document.scrollLeft || 0) - (document.clientLeft || document.body.clientLeft || 0);
  2507. var i = (window.pageYOffset || document.scrollTop || 0) - (document.clientTop || document.body.clientTop || 0);
  2508. var s = window.getComputedStyle ? getComputedStyle(e) : e.currentStyle;
  2509. var o = parseInt(s.paddingLeft) + parseInt(s.borderLeftWidth);
  2510. var u = parseInt(s.paddingTop) + parseInt(s.borderTopWidth);
  2511. var a = parseInt(s.paddingRight) + parseInt(s.borderRightWidth);
  2512. var f = parseInt(s.paddingBottom) + parseInt(s.borderBottomWidth);
  2513. return {
  2514. left: t.left + r + o,
  2515. right: t.right + r - a,
  2516. top: t.top + i + u,
  2517. bottom: t.bottom + i - f
  2518. }
  2519. };
  2520. t._getPointerData = function(e) {
  2521. var t = this._pointerData[e];
  2522. if (!t) {
  2523. t = this._pointerData[e] = {
  2524. x: 0,
  2525. y: 0
  2526. };
  2527. if (this._primaryPointerID == null) {
  2528. this._primaryPointerID = e
  2529. }
  2530. if (this._primaryPointerID == null || this._primaryPointerID == -1) {
  2531. this._primaryPointerID = e
  2532. }
  2533. }
  2534. return t
  2535. };
  2536. t._handleMouseMove = function(e) {
  2537. if (!e) {
  2538. e = window.event
  2539. }
  2540. this._handlePointerMove(-1, e, e.pageX, e.pageY)
  2541. };
  2542. t._handlePointerMove = function(e, t, n, r, i) {
  2543. if (this._prevStage && i === undefined) {
  2544. return
  2545. }
  2546. if (!this.canvas) {
  2547. return
  2548. }
  2549. var s = this._nextStage,
  2550. o = this._getPointerData(e);
  2551. var u = o.inBounds;
  2552. this._updatePointerPosition(e, t, n, r);
  2553. if (u || o.inBounds || this.mouseMoveOutside) {
  2554. if (e == -1 && o.inBounds == !u) {
  2555. this._dispatchMouseEvent(this, u ? "mouseleave" : "mouseenter", false, e, o, t)
  2556. }
  2557. this._dispatchMouseEvent(this, "stagemousemove", false, e, o, t);
  2558. this._dispatchMouseEvent(o.target, "pressmove", true, e, o, t)
  2559. }
  2560. s && s._handlePointerMove(e, t, n, r, null)
  2561. };
  2562. t._updatePointerPosition = function(e, t, n, r) {
  2563. var i = this._getElementRect(this.canvas);
  2564. n -= i.left;
  2565. r -= i.top;
  2566. var s = this.canvas.width;
  2567. var o = this.canvas.height;
  2568. n /= (i.right - i.left) / s;
  2569. r /= (i.bottom - i.top) / o;
  2570. var u = this._getPointerData(e);
  2571. if (u.inBounds = n >= 0 && r >= 0 && n <= s - 1 && r <= o - 1) {
  2572. u.x = n;
  2573. u.y = r
  2574. } else if (this.mouseMoveOutside) {
  2575. u.x = n < 0 ? 0 : n > s - 1 ? s - 1 : n;
  2576. u.y = r < 0 ? 0 : r > o - 1 ? o - 1 : r
  2577. }
  2578. u.posEvtObj = t;
  2579. u.rawX = n;
  2580. u.rawY = r;
  2581. if (e == this._primaryPointerID) {
  2582. this.mouseX = u.x;
  2583. this.mouseY = u.y;
  2584. this.mouseInBounds = u.inBounds
  2585. }
  2586. };
  2587. t._handleMouseUp = function(e) {
  2588. this._handlePointerUp(-1, e, false)
  2589. };
  2590. t._handlePointerUp = function(e, t, n, r) {
  2591. var i = this._nextStage,
  2592. s = this._getPointerData(e);
  2593. if (this._prevStage && r === undefined) {
  2594. return
  2595. }
  2596. this._dispatchMouseEvent(this, "stagemouseup", false, e, s, t);
  2597. var o = null,
  2598. u = s.target;
  2599. if (!r && (u || i)) {
  2600. o = this._getObjectsUnderPoint(s.x, s.y, null, true)
  2601. }
  2602. if (o == u) {
  2603. this._dispatchMouseEvent(u, "click", true, e, s, t)
  2604. }
  2605. this._dispatchMouseEvent(u, "pressup", true, e, s, t);
  2606. if (n) {
  2607. if (e == this._primaryPointerID) {
  2608. this._primaryPointerID = null
  2609. }
  2610. delete this._pointerData[e]
  2611. } else {
  2612. s.target = null
  2613. }
  2614. i && i._handlePointerUp(e, t, n, r || o && this)
  2615. };
  2616. t._handleMouseDown = function(e) {
  2617. this._handlePointerDown(-1, e, e.pageX, e.pageY)
  2618. };
  2619. t._handlePointerDown = function(e, t, n, r, i) {
  2620. if (r != null) {
  2621. this._updatePointerPosition(e, t, n, r)
  2622. }
  2623. var s = null,
  2624. o = this._nextStage,
  2625. u = this._getPointerData(e);
  2626. if (u.inBounds) {
  2627. this._dispatchMouseEvent(this, "stagemousedown", false, e, u, t)
  2628. }
  2629. if (!i) {
  2630. s = u.target = this._getObjectsUnderPoint(u.x, u.y, null, true);
  2631. this._dispatchMouseEvent(u.target, "mousedown", true, e, u, t)
  2632. }
  2633. o && o._handlePointerDown(e, t, n, r, i || s && this)
  2634. };
  2635. t._testMouseOver = function(e, t, n) {
  2636. if (this._prevStage && t === undefined) {
  2637. return
  2638. }
  2639. var r = this._nextStage;
  2640. if (!this._mouseOverIntervalID) {
  2641. r && r._testMouseOver(e, t, n);
  2642. return
  2643. }
  2644. if (this._primaryPointerID != -1 || !e && this.mouseX == this._mouseOverX && this.mouseY == this._mouseOverY && this.mouseInBounds) {
  2645. return
  2646. }
  2647. var i = this._getPointerData(-1),
  2648. s = i.posEvtObj;
  2649. var o = n || s && s.target == this.canvas;
  2650. var u = null,
  2651. a = -1,
  2652. f = "",
  2653. l, c, h;
  2654. if (!t && (e || this.mouseInBounds && o)) {
  2655. u = this._getObjectsUnderPoint(this.mouseX, this.mouseY, null, true);
  2656. this._mouseOverX = this.mouseX;
  2657. this._mouseOverY = this.mouseY
  2658. }
  2659. var p = this._mouseOverTarget || [];
  2660. var d = p[p.length - 1];
  2661. var v = this._mouseOverTarget = [];
  2662. l = u;
  2663. while (l) {
  2664. v.unshift(l);
  2665. if (l.cursor != null) {
  2666. f = l.cursor
  2667. }
  2668. l = l.parent
  2669. }
  2670. this.canvas.style.cursor = f;
  2671. if (!t && n) {
  2672. n.canvas.style.cursor = f
  2673. }
  2674. for (c = 0, h = v.length; c < h; c++) {
  2675. if (v[c] != p[c]) {
  2676. break
  2677. }
  2678. a = c
  2679. }
  2680. if (d != u) {
  2681. this._dispatchMouseEvent(d, "mouseout", true, -1, i, s)
  2682. }
  2683. for (c = p.length - 1; c > a; c--) {
  2684. this._dispatchMouseEvent(p[c], "rollout", false, -1, i, s)
  2685. }
  2686. for (c = v.length - 1; c > a; c--) {
  2687. this._dispatchMouseEvent(v[c], "rollover", false, -1, i, s)
  2688. }
  2689. if (d != u) {
  2690. this._dispatchMouseEvent(u, "mouseover", true, -1, i, s)
  2691. }
  2692. r && r._testMouseOver(e, t || u && this, n || o && this)
  2693. };
  2694. t._handleDoubleClick = function(e, t) {
  2695. var n = null,
  2696. r = this._nextStage,
  2697. i = this._getPointerData(-1);
  2698. if (!t) {
  2699. n = this._getObjectsUnderPoint(i.x, i.y, null, true);
  2700. this._dispatchMouseEvent(n, "dblclick", true, -1, i, e)
  2701. }
  2702. r && r._handleDoubleClick(e, t || n && this)
  2703. };
  2704. t._dispatchMouseEvent = function(e, t, n, r, i, s) {
  2705. if (!e || !n && !e.hasEventListener(t)) {
  2706. return
  2707. }
  2708. var o = new createjs.MouseEvent(t, n, false, i.x, i.y, s, r, r == this._primaryPointerID, i.rawX, i.rawY);
  2709. e.dispatchEvent(o)
  2710. };
  2711. createjs.Stage = e
  2712. })();
  2713. this.createjs = this.createjs || {};
  2714. (function() {
  2715. var e = function(e) {
  2716. this.initialize(e)
  2717. };
  2718. var t = e.prototype = new createjs.DisplayObject;
  2719. t.image = null;
  2720. t.sourceRect = null;
  2721. t.DisplayObject_initialize = t.initialize;
  2722. t.initialize = function(e) {
  2723. this.DisplayObject_initialize();
  2724. if (typeof e == "string") {
  2725. this.image = document.createElement("img");
  2726. this.image.src = e
  2727. } else {
  2728. this.image = e
  2729. }
  2730. };
  2731. t.isVisible = function() {
  2732. var e = this.cacheCanvas || this.image && (this.image.complete || this.image.getContext || this.image.readyState >= 2);
  2733. return !!(this.visible && this.alpha > 0 && this.scaleX != 0 && this.scaleY != 0 && e)
  2734. };
  2735. t.DisplayObject_draw = t.draw;
  2736. t.draw = function(e, t) {
  2737. if (this.DisplayObject_draw(e, t)) {
  2738. return true
  2739. }
  2740. var n = this.sourceRect;
  2741. if (n) {
  2742. e.drawImage(this.image, n.x, n.y, n.width, n.height, 0, 0, n.width, n.height)
  2743. } else {
  2744. try {
  2745. e.drawImage(this.image, 0, 0)
  2746. } catch (r) {}
  2747. }
  2748. return true
  2749. };
  2750. t.DisplayObject_getBounds = t.getBounds;
  2751. t.getBounds = function() {
  2752. var e = this.DisplayObject_getBounds();
  2753. if (e) {
  2754. return e
  2755. }
  2756. var t = this.sourceRect || this.image;
  2757. var n = this.image && (this.image.complete || this.image.getContext || this.image.readyState >= 2);
  2758. return n ? this._rectangle.initialize(0, 0, t.width, t.height) : null
  2759. };
  2760. t.clone = function() {
  2761. var t = new e(this.image);
  2762. if (this.sourceRect) {
  2763. t.sourceRect = this.sourceRect.clone()
  2764. }
  2765. this.cloneProps(t);
  2766. return t
  2767. };
  2768. t.toString = function() {
  2769. return "[Bitmap (name=" + this.name + ")]"
  2770. };
  2771. createjs.Bitmap = e
  2772. })();
  2773. this.createjs = this.createjs || {};
  2774. (function() {
  2775. "use strict";
  2776. var e = function(e, t) {
  2777. this.initialize(e, t)
  2778. };
  2779. var t = e.prototype = new createjs.DisplayObject;
  2780. t.currentFrame = 0;
  2781. t.currentAnimation = null;
  2782. t.paused = true;
  2783. t.spriteSheet = null;
  2784. t.offset = 0;
  2785. t.currentAnimationFrame = 0;
  2786. t.framerate = 0;
  2787. t._advanceCount = 0;
  2788. t._animation = null;
  2789. t._currentFrame = null;
  2790. t.DisplayObject_initialize = t.initialize;
  2791. t.initialize = function(e, t) {
  2792. this.DisplayObject_initialize();
  2793. this.spriteSheet = e;
  2794. if (t) {
  2795. this.gotoAndPlay(t)
  2796. }
  2797. };
  2798. t.isVisible = function() {
  2799. var e = this.cacheCanvas || this.spriteSheet.complete;
  2800. return !!(this.visible && this.alpha > 0 && this.scaleX != 0 && this.scaleY != 0 && e)
  2801. };
  2802. t.DisplayObject_draw = t.draw;
  2803. t.draw = function(e, t) {
  2804. if (this.DisplayObject_draw(e, t)) {
  2805. return true
  2806. }
  2807. this._normalizeFrame();
  2808. var n = this.spriteSheet.getFrame(this._currentFrame | 0);
  2809. if (!n) {
  2810. return false
  2811. }
  2812. var r = n.rect;
  2813. e.drawImage(n.image, r.x, r.y, r.width, r.height, -n.regX, -n.regY, r.width, r.height);
  2814. return true
  2815. };
  2816. t.play = function() {
  2817. this.paused = false
  2818. };
  2819. t.stop = function() {
  2820. this.paused = true
  2821. };
  2822. t.gotoAndPlay = function(e) {
  2823. this.paused = false;
  2824. this._goto(e)
  2825. };
  2826. t.gotoAndStop = function(e) {
  2827. this.paused = true;
  2828. this._goto(e)
  2829. };
  2830. t.advance = function(e) {
  2831. var t = this._animation && this._animation.speed || 1;
  2832. var n = this.framerate || this.spriteSheet.framerate;
  2833. var r = n && e != null ? e / (1e3 / n) : 1;
  2834. if (this._animation) {
  2835. this.currentAnimationFrame += r * t
  2836. } else {
  2837. this._currentFrame += r * t
  2838. }
  2839. this._normalizeFrame()
  2840. };
  2841. t.DisplayObject_getBounds = t.getBounds;
  2842. t.getBounds = function() {
  2843. return this.DisplayObject_getBounds() || this.spriteSheet.getFrameBounds(this.currentFrame, this._rectangle)
  2844. };
  2845. t.clone = function() {
  2846. var t = new e(this.spriteSheet);
  2847. this.cloneProps(t);
  2848. return t
  2849. };
  2850. t.toString = function() {
  2851. return "[Sprite (name=" + this.name + ")]"
  2852. };
  2853. t.DisplayObject__tick = t._tick;
  2854. t._tick = function(e) {
  2855. if (!this.paused) {
  2856. this.advance(e && e[0] && e[0].delta)
  2857. }
  2858. this.DisplayObject__tick(e)
  2859. };
  2860. t._normalizeFrame = function() {
  2861. var e = this._animation;
  2862. var t = this.paused;
  2863. var n = this._currentFrame;
  2864. var r = this.currentAnimationFrame;
  2865. var i;
  2866. if (e) {
  2867. i = e.frames.length;
  2868. if ((r | 0) >= i) {
  2869. var s = e.next;
  2870. if (this._dispatchAnimationEnd(e, n, t, s, i - 1)) {} else if (s) {
  2871. return this._goto(s, r - i)
  2872. } else {
  2873. this.paused = true;
  2874. r = this.currentAnimationFrame = e.frames.length - 1;
  2875. this._currentFrame = e.frames[r]
  2876. }
  2877. } else {
  2878. this._currentFrame = e.frames[r | 0]
  2879. }
  2880. } else {
  2881. i = this.spriteSheet.getNumFrames();
  2882. if (n >= i) {
  2883. if (!this._dispatchAnimationEnd(e, n, t, i - 1)) {
  2884. if ((this._currentFrame -= i) >= i) {
  2885. return this._normalizeFrame()
  2886. }
  2887. }
  2888. }
  2889. }
  2890. this.currentFrame = this._currentFrame | 0
  2891. };
  2892. t._dispatchAnimationEnd = function(e, t, n, r, i) {
  2893. var s = e ? e.name : null;
  2894. if (this.hasEventListener("animationend")) {
  2895. var o = new createjs.Event("animationend");
  2896. o.name = s;
  2897. o.next = r;
  2898. this.dispatchEvent(o)
  2899. }
  2900. var u = this._animation != e || this._currentFrame != t;
  2901. if (!u && !n && this.paused) {
  2902. this.currentAnimationFrame = i;
  2903. u = true
  2904. }
  2905. return u
  2906. };
  2907. t.DisplayObject_cloneProps = t.cloneProps;
  2908. t.cloneProps = function(e) {
  2909. this.DisplayObject_cloneProps(e);
  2910. e.currentFrame = this.currentFrame;
  2911. e._currentFrame = this._currentFrame;
  2912. e.currentAnimation = this.currentAnimation;
  2913. e.paused = this.paused;
  2914. e._animation = this._animation;
  2915. e.currentAnimationFrame = this.currentAnimationFrame;
  2916. e.framerate = this.framerate
  2917. };
  2918. t._goto = function(e, t) {
  2919. if (isNaN(e)) {
  2920. var n = this.spriteSheet.getAnimation(e);
  2921. if (n) {
  2922. this.currentAnimationFrame = t || 0;
  2923. this._animation = n;
  2924. this.currentAnimation = e;
  2925. this._normalizeFrame()
  2926. }
  2927. } else {
  2928. this.currentAnimationFrame = 0;
  2929. this.currentAnimation = this._animation = null;
  2930. this._currentFrame = e;
  2931. this._normalizeFrame()
  2932. }
  2933. };
  2934. createjs.Sprite = e
  2935. })();
  2936. this.createjs = this.createjs || {};
  2937. (function() {
  2938. "use strict";
  2939. var e = "BitmapAnimation is deprecated in favour of Sprite. See VERSIONS file for info on changes.";
  2940. if (!createjs.Sprite) {
  2941. throw e
  2942. }(createjs.BitmapAnimation = function(t) {
  2943. console.log(e);
  2944. this.initialize(t)
  2945. }).prototype = new createjs.Sprite
  2946. })();
  2947. this.createjs = this.createjs || {};
  2948. (function() {
  2949. "use strict";
  2950. function e(e, t) {
  2951. this.initialize(e, t)
  2952. }
  2953. var t = e.prototype = new createjs.Container;
  2954. e.maxPoolSize = 100;
  2955. e._spritePool = [];
  2956. t.text = "";
  2957. t.spriteSheet = null;
  2958. t.lineHeight = 0;
  2959. t.letterSpacing = 0;
  2960. t.spaceWidth = 0;
  2961. t._oldProps = null;
  2962. t.Container_initialize = t.initialize;
  2963. t.initialize = function(e, t) {
  2964. this.Container_initialize();
  2965. this.text = e;
  2966. this.spriteSheet = t;
  2967. this._oldProps = {
  2968. text: 0,
  2969. spriteSheet: 0,
  2970. lineHeight: 0,
  2971. letterSpacing: 0,
  2972. spaceWidth: 0
  2973. }
  2974. };
  2975. t.Container_draw = t.draw;
  2976. t.draw = function(e, t) {
  2977. if (this.DisplayObject_draw(e, t)) {
  2978. return
  2979. }
  2980. this._updateText();
  2981. this.Container_draw(e, t)
  2982. };
  2983. t.Container_getBounds = t.getBounds;
  2984. t.getBounds = function() {
  2985. this._updateText();
  2986. return this.Container_getBounds()
  2987. };
  2988. t.isVisible = function() {
  2989. var e = this.cacheCanvas || this.spriteSheet && this.spriteSheet.complete && this.text;
  2990. return !!(this.visible && this.alpha > 0 && this.scaleX != 0 && this.scaleY != 0 && e)
  2991. };
  2992. t._getFrameIndex = function(e, t) {
  2993. var n, r = t.getAnimation(e);
  2994. if (!r) {
  2995. e != (n = e.toUpperCase()) || e != (n = e.toLowerCase()) || (n = null);
  2996. if (n) {
  2997. r = t.getAnimation(n)
  2998. }
  2999. }
  3000. return r && r.frames[0]
  3001. };
  3002. t._getFrame = function(e, t) {
  3003. var n = this._getFrameIndex(e, t);
  3004. return n == null ? n : t.getFrame(n)
  3005. };
  3006. t._getLineHeight = function(e) {
  3007. var t = this._getFrame("1", e) || this._getFrame("T", e) || this._getFrame("L", e) || e.getFrame(0);
  3008. return t ? t.rect.height : 1
  3009. };
  3010. t._getSpaceWidth = function(e) {
  3011. var t = this._getFrame("1", e) || this._getFrame("l", e) || this._getFrame("e", e) || this._getFrame("a", e) || e.getFrame(0);
  3012. return t ? t.rect.width : 1
  3013. };
  3014. t._updateText = function() {
  3015. var t = 0,
  3016. n = 0,
  3017. r = this._oldProps,
  3018. i = false,
  3019. s = this.spaceWidth,
  3020. o = this.lineHeight,
  3021. u = this.spriteSheet;
  3022. var a = e._spritePool,
  3023. f = this.children,
  3024. l = 0,
  3025. c = f.length,
  3026. h;
  3027. for (var p in r) {
  3028. if (r[p] != this[p]) {
  3029. r[p] = this[p];
  3030. i = true
  3031. }
  3032. }
  3033. if (!i) {
  3034. return
  3035. }
  3036. var d = !!this._getFrame(" ", u);
  3037. if (!d && s == 0) {
  3038. s = this._getSpaceWidth(u)
  3039. }
  3040. if (o == 0) {
  3041. o = this._getLineHeight(u)
  3042. }
  3043. for (var v = 0, m = this.text.length; v < m; v++) {
  3044. var g = this.text.charAt(v);
  3045. if (g == " " && !d) {
  3046. t += s;
  3047. continue
  3048. } else if (g == "\n" || g == "\r") {
  3049. if (g == "\r" && this.text.charAt(v + 1) == "\n") {
  3050. v++
  3051. }
  3052. t = 0;
  3053. n += o;
  3054. continue
  3055. }
  3056. var y = this._getFrameIndex(g, u);
  3057. if (y == null) {
  3058. continue
  3059. }
  3060. if (l < c) {
  3061. h = f[l]
  3062. } else {
  3063. h = this.addChild(a.length ? a.pop() : new createjs.Sprite);
  3064. c++
  3065. }
  3066. h.spriteSheet = u;
  3067. h.gotoAndStop(y);
  3068. h.x = t;
  3069. h.y = n;
  3070. l++;
  3071. t += h.getBounds().width + this.letterSpacing
  3072. }
  3073. while (c > l) {
  3074. a.push(h = f.pop());
  3075. h.parent = null
  3076. }
  3077. if (a.length > e.maxPoolSize) {
  3078. a.length = e.maxPoolSize
  3079. }
  3080. };
  3081. createjs.BitmapText = e
  3082. })();
  3083. this.createjs = this.createjs || {};
  3084. (function() {
  3085. "use strict";
  3086. var e = function(e) {
  3087. this.initialize(e)
  3088. };
  3089. var t = e.prototype = new createjs.DisplayObject;
  3090. t.graphics = null;
  3091. t.DisplayObject_initialize = t.initialize;
  3092. t.initialize = function(e) {
  3093. this.DisplayObject_initialize();
  3094. this.graphics = e ? e : new createjs.Graphics
  3095. };
  3096. t.isVisible = function() {
  3097. var e = this.cacheCanvas || this.graphics && !this.graphics.isEmpty();
  3098. return !!(this.visible && this.alpha > 0 && this.scaleX != 0 && this.scaleY != 0 && e)
  3099. };
  3100. t.DisplayObject_draw = t.draw;
  3101. t.draw = function(e, t) {
  3102. if (this.DisplayObject_draw(e, t)) {
  3103. return true
  3104. }
  3105. this.graphics.draw(e);
  3106. return true
  3107. };
  3108. t.clone = function(t) {
  3109. var n = new e(t && this.graphics ? this.graphics.clone() : this.graphics);
  3110. this.cloneProps(n);
  3111. return n
  3112. };
  3113. t.toString = function() {
  3114. return "[Shape (name=" + this.name + ")]"
  3115. };
  3116. createjs.Shape = e
  3117. })();
  3118. this.createjs = this.createjs || {};
  3119. (function() {
  3120. "use strict";
  3121. var e = function(e, t, n) {
  3122. this.initialize(e, t, n)
  3123. };
  3124. var t = e.prototype = new createjs.DisplayObject;
  3125. var n = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
  3126. if (n.getContext) {
  3127. e._workingContext = n.getContext("2d");
  3128. n.width = n.height = 1
  3129. }
  3130. e.H_OFFSETS = {
  3131. start: 0,
  3132. left: 0,
  3133. center: -.5,
  3134. end: -1,
  3135. right: -1
  3136. };
  3137. e.V_OFFSETS = {
  3138. top: 0,
  3139. hanging: -.01,
  3140. middle: -.4,
  3141. alphabetic: -.8,
  3142. ideographic: -.85,
  3143. bottom: -1
  3144. };
  3145. t.text = "";
  3146. t.font = null;
  3147. t.color = null;
  3148. t.textAlign = "left";
  3149. t.textBaseline = "top";
  3150. t.maxWidth = null;
  3151. t.outline = 0;
  3152. t.lineHeight = 0;
  3153. t.lineWidth = null;
  3154. t.DisplayObject_initialize = t.initialize;
  3155. t.initialize = function(e, t, n) {
  3156. this.DisplayObject_initialize();
  3157. this.text = e;
  3158. this.font = t;
  3159. this.color = n
  3160. };
  3161. t.isVisible = function() {
  3162. var e = this.cacheCanvas || this.text != null && this.text !== "";
  3163. return !!(this.visible && this.alpha > 0 && this.scaleX != 0 && this.scaleY != 0 && e)
  3164. };
  3165. t.DisplayObject_draw = t.draw;
  3166. t.draw = function(e, t) {
  3167. if (this.DisplayObject_draw(e, t)) {
  3168. return true
  3169. }
  3170. var n = this.color || "#000";
  3171. if (this.outline) {
  3172. e.strokeStyle = n;
  3173. e.lineWidth = this.outline * 1
  3174. } else {
  3175. e.fillStyle = n
  3176. }
  3177. this._drawText(this._prepContext(e));
  3178. return true
  3179. };
  3180. t.getMeasuredWidth = function() {
  3181. return this._prepContext(e._workingContext).measureText(this.text).width
  3182. };
  3183. t.getMeasuredLineHeight = function() {
  3184. return this._prepContext(e._workingContext).measureText("M").width * 1.2
  3185. };
  3186. t.getMeasuredHeight = function() {
  3187. return this._drawText(null, {}).height
  3188. };
  3189. t.DisplayObject_getBounds = t.getBounds;
  3190. t.getBounds = function() {
  3191. var t = this.DisplayObject_getBounds();
  3192. if (t) {
  3193. return t
  3194. }
  3195. if (this.text == null || this.text == "") {
  3196. return null
  3197. }
  3198. var n = this._drawText(null, {});
  3199. var r = this.maxWidth && this.maxWidth < n.width ? this.maxWidth : n.width;
  3200. var i = r * e.H_OFFSETS[this.textAlign || "left"];
  3201. var s = this.lineHeight || this.getMeasuredLineHeight();
  3202. var o = s * e.V_OFFSETS[this.textBaseline || "top"];
  3203. return this._rectangle.initialize(i, o, r, n.height)
  3204. };
  3205. t.clone = function() {
  3206. var t = new e(this.text, this.font, this.color);
  3207. this.cloneProps(t);
  3208. return t
  3209. };
  3210. t.toString = function() {
  3211. return "[Text (text=" + (this.text.length > 20 ? this.text.substr(0, 17) + "..." : this.text) + ")]"
  3212. };
  3213. t.DisplayObject_cloneProps = t.cloneProps;
  3214. t.cloneProps = function(e) {
  3215. this.DisplayObject_cloneProps(e);
  3216. e.textAlign = this.textAlign;
  3217. e.textBaseline = this.textBaseline;
  3218. e.maxWidth = this.maxWidth;
  3219. e.outline = this.outline;
  3220. e.lineHeight = this.lineHeight;
  3221. e.lineWidth = this.lineWidth
  3222. };
  3223. t._prepContext = function(e) {
  3224. e.font = this.font;
  3225. e.textAlign = this.textAlign || "left";
  3226. e.textBaseline = this.textBaseline || "top";
  3227. return e
  3228. };
  3229. t._drawText = function(t, n) {
  3230. var r = !!t;
  3231. if (!r) {
  3232. t = this._prepContext(e._workingContext)
  3233. }
  3234. var i = this.lineHeight || this.getMeasuredLineHeight();
  3235. var s = 0,
  3236. o = 0;
  3237. var u = String(this.text).split(/(?:\r\n|\r|\n)/);
  3238. for (var a = 0, f = u.length; a < f; a++) {
  3239. var l = u[a];
  3240. var c = null;
  3241. if (this.lineWidth != null && (c = t.measureText(l).width) > this.lineWidth) {
  3242. var h = l.split(/(\s)/);
  3243. l = h[0];
  3244. c = t.measureText(l).width;
  3245. for (var p = 1, d = h.length; p < d; p += 2) {
  3246. var v = t.measureText(h[p] + h[p + 1]).width;
  3247. if (c + v > this.lineWidth) {
  3248. if (r) {
  3249. this._drawTextLine(t, l, o * i)
  3250. }
  3251. if (c > s) {
  3252. s = c
  3253. }
  3254. l = h[p + 1];
  3255. c = t.measureText(l).width;
  3256. o++
  3257. } else {
  3258. l += h[p] + h[p + 1];
  3259. c += v
  3260. }
  3261. }
  3262. }
  3263. if (r) {
  3264. this._drawTextLine(t, l, o * i)
  3265. }
  3266. if (n && c == null) {
  3267. c = t.measureText(l).width
  3268. }
  3269. if (c > s) {
  3270. s = c
  3271. }
  3272. o++
  3273. }
  3274. if (n) {
  3275. n.count = o;
  3276. n.width = s;
  3277. n.height = o * i
  3278. }
  3279. return n
  3280. };
  3281. t._drawTextLine = function(e, t, n) {
  3282. if (this.outline) {
  3283. e.strokeText(t, 0, n, this.maxWidth || 65535)
  3284. } else {
  3285. e.fillText(t, 0, n, this.maxWidth || 65535)
  3286. }
  3287. };
  3288. createjs.Text = e
  3289. })();
  3290. this.createjs = this.createjs || {};
  3291. (function() {
  3292. "use strict";
  3293. var e = function(e) {
  3294. this.initialize(e)
  3295. };
  3296. var t = e.prototype = new createjs.DisplayObject;
  3297. t.htmlElement = null;
  3298. t._oldMtx = null;
  3299. t._visible = false;
  3300. t.DisplayObject_initialize = t.initialize;
  3301. t.initialize = function(e) {
  3302. if (typeof e == "string") {
  3303. e = document.getElementById(e)
  3304. }
  3305. this.DisplayObject_initialize();
  3306. this.mouseEnabled = false;
  3307. this.htmlElement = e;
  3308. var t = e.style;
  3309. t.position = "absolute";
  3310. t.transformOrigin = t.WebkitTransformOrigin = t.msTransformOrigin = t.MozTransformOrigin = t.OTransformOrigin = "0% 0%"
  3311. };
  3312. t.isVisible = function() {
  3313. return this.htmlElement != null
  3314. };
  3315. t.draw = function(e, t) {
  3316. return true
  3317. };
  3318. t.cache = function() {};
  3319. t.uncache = function() {};
  3320. t.updateCache = function() {};
  3321. t.hitTest = function() {};
  3322. t.localToGlobal = function() {};
  3323. t.globalToLocal = function() {};
  3324. t.localToLocal = function() {};
  3325. t.clone = function() {
  3326. throw "DOMElement cannot be cloned."
  3327. };
  3328. t.toString = function() {
  3329. return "[DOMElement (name=" + this.name + ")]"
  3330. };
  3331. t.DisplayObject__tick = t._tick;
  3332. t._tick = function(e) {
  3333. var t = this.getStage();
  3334. t && t.on("drawend", this._handleDrawEnd, this, true);
  3335. this.DisplayObject__tick(e)
  3336. };
  3337. t._handleDrawEnd = function(e) {
  3338. var t = this.htmlElement;
  3339. if (!t) {
  3340. return
  3341. }
  3342. var n = t.style;
  3343. var r = this.getConcatenatedMatrix(this._matrix);
  3344. var i = r.visible ? "visible" : "hidden";
  3345. if (i != n.visibility) {
  3346. n.visibility = i
  3347. }
  3348. if (!r.visible) {
  3349. return
  3350. }
  3351. var s = this._oldMtx;
  3352. var o = 1e4;
  3353. if (!s || s.alpha != r.alpha) {
  3354. n.opacity = "" + (r.alpha * o | 0) / o;
  3355. if (s) {
  3356. s.alpha = r.alpha
  3357. }
  3358. }
  3359. if (!s || s.tx != r.tx || s.ty != r.ty || s.a != r.a || s.b != r.b || s.c != r.c || s.d != r.d) {
  3360. var u = "matrix(" + (r.a * o | 0) / o + "," + (r.b * o | 0) / o + "," + (r.c * o | 0) / o + "," + (r.d * o | 0) / o + "," + (r.tx + .5 | 0);
  3361. n.transform = n.WebkitTransform = n.OTransform = n.msTransform = u + "," + (r.ty + .5 | 0) + ")";
  3362. n.MozTransform = u + "px," + (r.ty + .5 | 0) + "px)";
  3363. this._oldMtx = s ? s.copy(r) : r.clone()
  3364. }
  3365. };
  3366. createjs.DOMElement = e
  3367. })();
  3368. this.createjs = this.createjs || {};
  3369. (function() {
  3370. "use strict";
  3371. var e = function(e, t, n, r, i, s, o, u, a, f) {
  3372. this.initialize(e, t, n, r, i, s, o, u, a, f)
  3373. };
  3374. var t = e.prototype = new createjs.Event;
  3375. t.stageX = 0;
  3376. t.stageY = 0;
  3377. t.rawX = 0;
  3378. t.rawY = 0;
  3379. t.nativeEvent = null;
  3380. t.pointerID = 0;
  3381. t.primary = false;
  3382. t._get_localX = function() {
  3383. return this.currentTarget.globalToLocal(this.rawX, this.rawY).x
  3384. };
  3385. t._get_localY = function() {
  3386. return this.currentTarget.globalToLocal(this.rawX, this.rawY).y
  3387. };
  3388. try {
  3389. Object.defineProperties(t, {
  3390. localX: {
  3391. get: t._get_localX
  3392. },
  3393. localY: {
  3394. get: t._get_localY
  3395. }
  3396. })
  3397. } catch (n) {}
  3398. t.Event_initialize = t.initialize;
  3399. t.initialize = function(e, t, n, r, i, s, o, u, a, f) {
  3400. this.Event_initialize(e, t, n);
  3401. this.stageX = r;
  3402. this.stageY = i;
  3403. this.nativeEvent = s;
  3404. this.pointerID = o;
  3405. this.primary = u;
  3406. this.rawX = a == null ? r : a;
  3407. this.rawY = f == null ? i : f
  3408. };
  3409. t.clone = function() {
  3410. return new e(this.type, this.bubbles, this.cancelable, this.stageX, this.stageY, this.target, this.nativeEvent, this.pointerID, this.primary, this.rawX, this.rawY)
  3411. };
  3412. t.toString = function() {
  3413. return "[MouseEvent (type=" + this.type + " stageX=" + this.stageX + " stageY=" + this.stageY + ")]"
  3414. };
  3415. createjs.MouseEvent = e
  3416. })();
  3417. this.createjs = this.createjs || {};
  3418. (function() {
  3419. "use strict";
  3420. var e = function() {
  3421. this.initialize()
  3422. };
  3423. var t = e.prototype;
  3424. t.initialize = function() {};
  3425. t.getBounds = function() {
  3426. return null
  3427. };
  3428. t.applyFilter = function(e, t, n, r, i, s, o, u) {};
  3429. t.toString = function() {
  3430. return "[Filter]"
  3431. };
  3432. t.clone = function() {
  3433. return new e
  3434. };
  3435. createjs.Filter = e
  3436. })();
  3437. this.createjs = this.createjs || {};
  3438. (function() {
  3439. "use strict";
  3440. var e = function(e, t, n, r, i, s, o) {
  3441. this.initialize(e, t, n, r, i, s, o)
  3442. };
  3443. var t = e.prototype;
  3444. t.target = null;
  3445. t.overLabel = null;
  3446. t.outLabel = null;
  3447. t.downLabel = null;
  3448. t.play = false;
  3449. t.setEnabled = function(e) {
  3450. var t = this.target;
  3451. this._enabled = e;
  3452. if (e) {
  3453. t.cursor = "pointer";
  3454. t.addEventListener("rollover", this);
  3455. t.addEventListener("rollout", this);
  3456. t.addEventListener("mousedown", this);
  3457. t.addEventListener("pressup", this)
  3458. } else {
  3459. t.cursor = null;
  3460. t.removeEventListener("rollover", this);
  3461. t.removeEventListener("rollout", this);
  3462. t.removeEventListener("mousedown", this);
  3463. t.removeEventListener("pressup", this)
  3464. }
  3465. };
  3466. t.getEnabled = function() {
  3467. return this._enabled
  3468. };
  3469. try {
  3470. Object.defineProperties(t, {
  3471. enabled: {
  3472. get: t.getEnabled,
  3473. set: t.setEnabled
  3474. }
  3475. })
  3476. } catch (n) {}
  3477. t._isPressed = false;
  3478. t._isOver = false;
  3479. t._enabled = false;
  3480. t.initialize = function(e, t, n, r, i, s, o) {
  3481. if (!e.addEventListener) {
  3482. return
  3483. }
  3484. this.target = e;
  3485. e.mouseChildren = false;
  3486. this.overLabel = n == null ? "over" : n;
  3487. this.outLabel = t == null ? "out" : t;
  3488. this.downLabel = r == null ? "down" : r;
  3489. this.play = i;
  3490. this.setEnabled(true);
  3491. this.handleEvent({});
  3492. if (s) {
  3493. if (o) {
  3494. s.actionsEnabled = false;
  3495. s.gotoAndStop && s.gotoAndStop(o)
  3496. }
  3497. e.hitArea = s
  3498. }
  3499. };
  3500. t.toString = function() {
  3501. return "[ButtonHelper]"
  3502. };
  3503. t.handleEvent = function(e) {
  3504. var t, n = this.target,
  3505. r = e.type;
  3506. if (r == "mousedown") {
  3507. this._isPressed = true;
  3508. t = this.downLabel
  3509. } else if (r == "pressup") {
  3510. this._isPressed = false;
  3511. t = this._isOver ? this.overLabel : this.outLabel
  3512. } else if (r == "rollover") {
  3513. this._isOver = true;
  3514. t = this._isPressed ? this.downLabel : this.overLabel
  3515. } else {
  3516. this._isOver = false;
  3517. t = this._isPressed ? this.overLabel : this.outLabel
  3518. } if (this.play) {
  3519. n.gotoAndPlay && n.gotoAndPlay(t)
  3520. } else {
  3521. n.gotoAndStop && n.gotoAndStop(t)
  3522. }
  3523. };
  3524. createjs.ButtonHelper = e
  3525. })();
  3526. this.createjs = this.createjs || {};
  3527. (function() {
  3528. "use strict";
  3529. var e = function() {
  3530. throw "Touch cannot be instantiated"
  3531. };
  3532. e.isSupported = function() {
  3533. return "ontouchstart" in window || window.navigator["msPointerEnabled"] && window.navigator["msMaxTouchPoints"] > 0 || window.navigator["pointerEnabled"] && window.navigator["maxTouchPoints"] > 0
  3534. };
  3535. e.enable = function(t, n, r) {
  3536. if (!t || !t.canvas || !e.isSupported()) {
  3537. return false
  3538. }
  3539. t.__touch = {
  3540. pointers: {},
  3541. multitouch: !n,
  3542. preventDefault: !r,
  3543. count: 0
  3544. };
  3545. if ("ontouchstart" in window) {
  3546. e._IOS_enable(t)
  3547. } else if (window.navigator["msPointerEnabled"] || window.navigator["pointerEnabled"]) {
  3548. e._IE_enable(t)
  3549. }
  3550. return true
  3551. };
  3552. e.disable = function(t) {
  3553. if (!t) {
  3554. return
  3555. }
  3556. if ("ontouchstart" in window) {
  3557. e._IOS_disable(t)
  3558. } else if (window.navigator["msPointerEnabled"] || window.navigator["pointerEnabled"]) {
  3559. e._IE_disable(t)
  3560. }
  3561. };
  3562. e._IOS_enable = function(t) {
  3563. var n = t.canvas;
  3564. var r = t.__touch.f = function(n) {
  3565. e._IOS_handleEvent(t, n)
  3566. };
  3567. n.addEventListener("touchstart", r, false);
  3568. n.addEventListener("touchmove", r, false);
  3569. n.addEventListener("touchend", r, false);
  3570. n.addEventListener("touchcancel", r, false)
  3571. };
  3572. e._IOS_disable = function(e) {
  3573. var t = e.canvas;
  3574. if (!t) {
  3575. return
  3576. }
  3577. var n = e.__touch.f;
  3578. t.removeEventListener("touchstart", n, false);
  3579. t.removeEventListener("touchmove", n, false);
  3580. t.removeEventListener("touchend", n, false);
  3581. t.removeEventListener("touchcancel", n, false)
  3582. };
  3583. e._IOS_handleEvent = function(e, t) {
  3584. if (!e) {
  3585. return
  3586. }
  3587. if (e.__touch.preventDefault) {
  3588. t.preventDefault && t.preventDefault()
  3589. }
  3590. var n = t.changedTouches;
  3591. var r = t.type;
  3592. for (var i = 0, s = n.length; i < s; i++) {
  3593. var o = n[i];
  3594. var u = o.identifier;
  3595. if (o.target != e.canvas) {
  3596. continue
  3597. }
  3598. if (r == "touchstart") {
  3599. this._handleStart(e, u, t, o.pageX, o.pageY)
  3600. } else if (r == "touchmove") {
  3601. this._handleMove(e, u, t, o.pageX, o.pageY)
  3602. } else if (r == "touchend" || r == "touchcancel") {
  3603. this._handleEnd(e, u, t)
  3604. }
  3605. }
  3606. };
  3607. e._IE_enable = function(t) {
  3608. var n = t.canvas;
  3609. var r = t.__touch.f = function(n) {
  3610. e._IE_handleEvent(t, n)
  3611. };
  3612. if (window.navigator["pointerEnabled"] === undefined) {
  3613. n.addEventListener("MSPointerDown", r, false);
  3614. window.addEventListener("MSPointerMove", r, false);
  3615. window.addEventListener("MSPointerUp", r, false);
  3616. window.addEventListener("MSPointerCancel", r, false);
  3617. if (t.__touch.preventDefault) {
  3618. n.style.msTouchAction = "none"
  3619. }
  3620. } else {
  3621. n.addEventListener("pointerdown", r, false);
  3622. window.addEventListener("pointermove", r, false);
  3623. window.addEventListener("pointerup", r, false);
  3624. window.addEventListener("pointercancel", r, false);
  3625. if (t.__touch.preventDefault) {
  3626. n.style.touchAction = "none"
  3627. }
  3628. }
  3629. t.__touch.activeIDs = {}
  3630. };
  3631. e._IE_disable = function(e) {
  3632. var t = e.__touch.f;
  3633. if (window.navigator["pointerEnabled"] === undefined) {
  3634. window.removeEventListener("MSPointerMove", t, false);
  3635. window.removeEventListener("MSPointerUp", t, false);
  3636. window.removeEventListener("MSPointerCancel", t, false);
  3637. if (e.canvas) {
  3638. e.canvas.removeEventListener("MSPointerDown", t, false)
  3639. }
  3640. } else {
  3641. window.removeEventListener("pointermove", t, false);
  3642. window.removeEventListener("pointerup", t, false);
  3643. window.removeEventListener("pointercancel", t, false);
  3644. if (e.canvas) {
  3645. e.canvas.removeEventListener("pointerdown", t, false)
  3646. }
  3647. }
  3648. };
  3649. e._IE_handleEvent = function(e, t) {
  3650. if (!e) {
  3651. return
  3652. }
  3653. if (e.__touch.preventDefault) {
  3654. t.preventDefault && t.preventDefault()
  3655. }
  3656. var n = t.type;
  3657. var r = t.pointerId;
  3658. var i = e.__touch.activeIDs;
  3659. if (n == "MSPointerDown" || n == "pointerdown") {
  3660. if (t.srcElement != e.canvas) {
  3661. return
  3662. }
  3663. i[r] = true;
  3664. this._handleStart(e, r, t, t.pageX, t.pageY)
  3665. } else if (i[r]) {
  3666. if (n == "MSPointerMove" || n == "pointermove") {
  3667. this._handleMove(e, r, t, t.pageX, t.pageY)
  3668. } else if (n == "MSPointerUp" || n == "MSPointerCancel" || n == "pointerup" || n == "pointercancel") {
  3669. delete i[r];
  3670. this._handleEnd(e, r, t)
  3671. }
  3672. }
  3673. };
  3674. e._handleStart = function(e, t, n, r, i) {
  3675. var s = e.__touch;
  3676. if (!s.multitouch && s.count) {
  3677. return
  3678. }
  3679. var o = s.pointers;
  3680. if (o[t]) {
  3681. return
  3682. }
  3683. o[t] = true;
  3684. s.count++;
  3685. e._handlePointerDown(t, n, r, i)
  3686. };
  3687. e._handleMove = function(e, t, n, r, i) {
  3688. if (!e.__touch.pointers[t]) {
  3689. return
  3690. }
  3691. e._handlePointerMove(t, n, r, i)
  3692. };
  3693. e._handleEnd = function(e, t, n) {
  3694. var r = e.__touch;
  3695. var i = r.pointers;
  3696. if (!i[t]) {
  3697. return
  3698. }
  3699. r.count--;
  3700. e._handlePointerUp(t, n, true);
  3701. delete i[t]
  3702. };
  3703. createjs.Touch = e
  3704. })();
  3705. this.createjs = this.createjs || {};
  3706. (function() {
  3707. "use strict";
  3708. var e = function() {
  3709. throw "SpriteSheetUtils cannot be instantiated"
  3710. };
  3711. var t = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
  3712. if (t.getContext) {
  3713. e._workingCanvas = t;
  3714. e._workingContext = t.getContext("2d");
  3715. t.width = t.height = 1
  3716. }
  3717. e.addFlippedFrames = function(t, n, r, i) {
  3718. if (!n && !r && !i) {
  3719. return
  3720. }
  3721. var s = 0;
  3722. if (n) {
  3723. e._flip(t, ++s, true, false)
  3724. }
  3725. if (r) {
  3726. e._flip(t, ++s, false, true)
  3727. }
  3728. if (i) {
  3729. e._flip(t, ++s, true, true)
  3730. }
  3731. };
  3732. e.extractFrame = function(t, n) {
  3733. if (isNaN(n)) {
  3734. n = t.getAnimation(n).frames[0]
  3735. }
  3736. var r = t.getFrame(n);
  3737. if (!r) {
  3738. return null
  3739. }
  3740. var i = r.rect;
  3741. var s = e._workingCanvas;
  3742. s.width = i.width;
  3743. s.height = i.height;
  3744. e._workingContext.drawImage(r.image, i.x, i.y, i.width, i.height, 0, 0, i.width, i.height);
  3745. var o = document.createElement("img");
  3746. o.src = s.toDataURL("image/png");
  3747. return o
  3748. };
  3749. e.mergeAlpha = function(e, t, n) {
  3750. if (!n) {
  3751. n = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas")
  3752. }
  3753. n.width = Math.max(t.width, e.width);
  3754. n.height = Math.max(t.height, e.height);
  3755. var r = n.getContext("2d");
  3756. r.save();
  3757. r.drawImage(e, 0, 0);
  3758. r.globalCompositeOperation = "destination-in";
  3759. r.drawImage(t, 0, 0);
  3760. r.restore();
  3761. return n
  3762. };
  3763. e._flip = function(t, n, r, i) {
  3764. var s = t._images;
  3765. var o = e._workingCanvas;
  3766. var u = e._workingContext;
  3767. var a = s.length / n;
  3768. for (var f = 0; f < a; f++) {
  3769. var l = s[f];
  3770. l.__tmp = f;
  3771. u.setTransform(1, 0, 0, 1, 0, 0);
  3772. u.clearRect(0, 0, o.width + 1, o.height + 1);
  3773. o.width = l.width;
  3774. o.height = l.height;
  3775. u.setTransform(r ? -1 : 1, 0, 0, i ? -1 : 1, r ? l.width : 0, i ? l.height : 0);
  3776. u.drawImage(l, 0, 0);
  3777. var c = document.createElement("img");
  3778. c.src = o.toDataURL("image/png");
  3779. c.width = l.width;
  3780. c.height = l.height;
  3781. s.push(c)
  3782. }
  3783. var h = t._frames;
  3784. var p = h.length / n;
  3785. for (f = 0; f < p; f++) {
  3786. l = h[f];
  3787. var d = l.rect.clone();
  3788. c = s[l.image.__tmp + a * n];
  3789. var v = {
  3790. image: c,
  3791. rect: d,
  3792. regX: l.regX,
  3793. regY: l.regY
  3794. };
  3795. if (r) {
  3796. d.x = c.width - d.x - d.width;
  3797. v.regX = d.width - l.regX
  3798. }
  3799. if (i) {
  3800. d.y = c.height - d.y - d.height;
  3801. v.regY = d.height - l.regY
  3802. }
  3803. h.push(v)
  3804. }
  3805. var m = "_" + (r ? "h" : "") + (i ? "v" : "");
  3806. var g = t._animations;
  3807. var y = t._data;
  3808. var b = g.length / n;
  3809. for (f = 0; f < b; f++) {
  3810. var w = g[f];
  3811. l = y[w];
  3812. var E = {
  3813. name: w + m,
  3814. speed: l.speed,
  3815. next: l.next,
  3816. frames: []
  3817. };
  3818. if (l.next) {
  3819. E.next += m
  3820. }
  3821. h = l.frames;
  3822. for (var S = 0, x = h.length; S < x; S++) {
  3823. E.frames.push(h[S] + p * n)
  3824. }
  3825. y[E.name] = E;
  3826. g.push(E.name)
  3827. }
  3828. };
  3829. createjs.SpriteSheetUtils = e
  3830. })();
  3831. this.createjs = this.createjs || {};
  3832. (function() {
  3833. "use strict";
  3834. var e = function() {
  3835. this.initialize()
  3836. };
  3837. var t = e.prototype = new createjs.EventDispatcher;
  3838. e.ERR_DIMENSIONS = "frame dimensions exceed max spritesheet dimensions";
  3839. e.ERR_RUNNING = "a build is already running";
  3840. t.maxWidth = 2048;
  3841. t.maxHeight = 2048;
  3842. t.spriteSheet = null;
  3843. t.scale = 1;
  3844. t.padding = 1;
  3845. t.timeSlice = .3;
  3846. t.progress = -1;
  3847. t._frames = null;
  3848. t._animations = null;
  3849. t._data = null;
  3850. t._nextFrameIndex = 0;
  3851. t._index = 0;
  3852. t._timerID = null;
  3853. t._scale = 1;
  3854. t.initialize = function() {
  3855. this._frames = [];
  3856. this._animations = {}
  3857. };
  3858. t.addFrame = function(t, n, r, i, s) {
  3859. if (this._data) {
  3860. throw e.ERR_RUNNING
  3861. }
  3862. var o = n || t.bounds || t.nominalBounds;
  3863. if (!o && t.getBounds) {
  3864. o = t.getBounds()
  3865. }
  3866. if (!o) {
  3867. return null
  3868. }
  3869. r = r || 1;
  3870. return this._frames.push({
  3871. source: t,
  3872. sourceRect: o,
  3873. scale: r,
  3874. funct: i,
  3875. data: s,
  3876. index: this._frames.length,
  3877. height: o.height * r
  3878. }) - 1
  3879. };
  3880. t.addAnimation = function(t, n, r, i) {
  3881. if (this._data) {
  3882. throw e.ERR_RUNNING
  3883. }
  3884. this._animations[t] = {
  3885. frames: n,
  3886. next: r,
  3887. frequency: i
  3888. }
  3889. };
  3890. t.addMovieClip = function(t, n, r, i, s, o) {
  3891. if (this._data) {
  3892. throw e.ERR_RUNNING
  3893. }
  3894. var u = t.frameBounds;
  3895. var a = n || t.bounds || t.nominalBounds;
  3896. if (!a && t.getBounds) {
  3897. a = t.getBounds()
  3898. }
  3899. if (!a && !u) {
  3900. return
  3901. }
  3902. var f, l, c = this._frames.length;
  3903. var h = t.timeline.duration;
  3904. for (f = 0; f < h; f++) {
  3905. var p = u && u[f] ? u[f] : a;
  3906. this.addFrame(t, p, r, this._setupMovieClipFrame, {
  3907. i: f,
  3908. f: i,
  3909. d: s
  3910. })
  3911. }
  3912. var d = t.timeline._labels;
  3913. var v = [];
  3914. for (var m in d) {
  3915. v.push({
  3916. index: d[m],
  3917. label: m
  3918. })
  3919. }
  3920. if (v.length) {
  3921. v.sort(function(e, t) {
  3922. return e.index - t.index
  3923. });
  3924. for (f = 0, l = v.length; f < l; f++) {
  3925. var g = v[f].label;
  3926. var y = c + v[f].index;
  3927. var b = c + (f == l - 1 ? h : v[f + 1].index);
  3928. var w = [];
  3929. for (var E = y; E < b; E++) {
  3930. w.push(E)
  3931. }
  3932. if (o) {
  3933. g = o(g, t, y, b);
  3934. if (!g) {
  3935. continue
  3936. }
  3937. }
  3938. this.addAnimation(g, w, true)
  3939. }
  3940. }
  3941. };
  3942. t.build = function() {
  3943. if (this._data) {
  3944. throw e.ERR_RUNNING
  3945. }
  3946. this._startBuild();
  3947. while (this._drawNext()) {}
  3948. this._endBuild();
  3949. return this.spriteSheet
  3950. };
  3951. t.buildAsync = function(t) {
  3952. if (this._data) {
  3953. throw e.ERR_RUNNING
  3954. }
  3955. this.timeSlice = t;
  3956. this._startBuild();
  3957. var n = this;
  3958. this._timerID = setTimeout(function() {
  3959. n._run()
  3960. }, 50 - Math.max(.01, Math.min(.99, this.timeSlice || .3)) * 50)
  3961. };
  3962. t.stopAsync = function() {
  3963. clearTimeout(this._timerID);
  3964. this._data = null
  3965. };
  3966. t.clone = function() {
  3967. throw "SpriteSheetBuilder cannot be cloned."
  3968. };
  3969. t.toString = function() {
  3970. return "[SpriteSheetBuilder]"
  3971. };
  3972. t._startBuild = function() {
  3973. var t = this.padding || 0;
  3974. this.progress = 0;
  3975. this.spriteSheet = null;
  3976. this._index = 0;
  3977. this._scale = this.scale;
  3978. var n = [];
  3979. this._data = {
  3980. images: [],
  3981. frames: n,
  3982. animations: this._animations
  3983. };
  3984. var r = this._frames.slice();
  3985. r.sort(function(e, t) {
  3986. return e.height <= t.height ? -1 : 1
  3987. });
  3988. if (r[r.length - 1].height + t * 2 > this.maxHeight) {
  3989. throw e.ERR_DIMENSIONS
  3990. }
  3991. var i = 0,
  3992. s = 0;
  3993. var o = 0;
  3994. while (r.length) {
  3995. var u = this._fillRow(r, i, o, n, t);
  3996. if (u.w > s) {
  3997. s = u.w
  3998. }
  3999. i += u.h;
  4000. if (!u.h || !r.length) {
  4001. var a = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
  4002. a.width = this._getSize(s, this.maxWidth);
  4003. a.height = this._getSize(i, this.maxHeight);
  4004. this._data.images[o] = a;
  4005. if (!u.h) {
  4006. s = i = 0;
  4007. o++
  4008. }
  4009. }
  4010. }
  4011. };
  4012. t._setupMovieClipFrame = function(e, t) {
  4013. var n = e.actionsEnabled;
  4014. e.actionsEnabled = false;
  4015. e.gotoAndStop(t.i);
  4016. e.actionsEnabled = n;
  4017. t.f && t.f(e, t.d, t.i)
  4018. };
  4019. t._getSize = function(e, t) {
  4020. var n = 4;
  4021. while (Math.pow(2, ++n) < e) {}
  4022. return Math.min(t, Math.pow(2, n))
  4023. };
  4024. t._fillRow = function(t, n, r, i, s) {
  4025. var o = this.maxWidth;
  4026. var u = this.maxHeight;
  4027. n += s;
  4028. var a = u - n;
  4029. var f = s;
  4030. var l = 0;
  4031. for (var c = t.length - 1; c >= 0; c--) {
  4032. var h = t[c];
  4033. var p = this._scale * h.scale;
  4034. var d = h.sourceRect;
  4035. var v = h.source;
  4036. var m = Math.floor(p * d.x - s);
  4037. var g = Math.floor(p * d.y - s);
  4038. var y = Math.ceil(p * d.height + s * 2);
  4039. var b = Math.ceil(p * d.width + s * 2);
  4040. if (b > o) {
  4041. throw e.ERR_DIMENSIONS
  4042. }
  4043. if (y > a || f + b > o) {
  4044. continue
  4045. }
  4046. h.img = r;
  4047. h.rect = new createjs.Rectangle(f, n, b, y);
  4048. l = l || y;
  4049. t.splice(c, 1);
  4050. i[h.index] = [f, n, b, y, r, Math.round(-m + p * v.regX - s), Math.round(-g + p * v.regY - s)];
  4051. f += b
  4052. }
  4053. return {
  4054. w: f,
  4055. h: l
  4056. }
  4057. };
  4058. t._endBuild = function() {
  4059. this.spriteSheet = new createjs.SpriteSheet(this._data);
  4060. this._data = null;
  4061. this.progress = 1;
  4062. this.dispatchEvent("complete")
  4063. };
  4064. t._run = function() {
  4065. var e = Math.max(.01, Math.min(.99, this.timeSlice || .3)) * 50;
  4066. var t = (new Date).getTime() + e;
  4067. var n = false;
  4068. while (t > (new Date).getTime()) {
  4069. if (!this._drawNext()) {
  4070. n = true;
  4071. break
  4072. }
  4073. }
  4074. if (n) {
  4075. this._endBuild()
  4076. } else {
  4077. var r = this;
  4078. this._timerID = setTimeout(function() {
  4079. r._run()
  4080. }, 50 - e)
  4081. }
  4082. var i = this.progress = this._index / this._frames.length;
  4083. if (this.hasEventListener("progress")) {
  4084. var s = new createjs.Event("progress");
  4085. s.progress = i;
  4086. this.dispatchEvent(s)
  4087. }
  4088. };
  4089. t._drawNext = function() {
  4090. var e = this._frames[this._index];
  4091. var t = e.scale * this._scale;
  4092. var n = e.rect;
  4093. var r = e.sourceRect;
  4094. var i = this._data.images[e.img];
  4095. var s = i.getContext("2d");
  4096. e.funct && e.funct(e.source, e.data);
  4097. s.save();
  4098. s.beginPath();
  4099. s.rect(n.x, n.y, n.width, n.height);
  4100. s.clip();
  4101. s.translate(Math.ceil(n.x - r.x * t), Math.ceil(n.y - r.y * t));
  4102. s.scale(t, t);
  4103. e.source.draw(s);
  4104. s.restore();
  4105. return ++this._index < this._frames.length
  4106. };
  4107. createjs.SpriteSheetBuilder = e
  4108. })();
  4109. this.createjs = this.createjs || {},
  4110. function() {
  4111. "use strict";
  4112. var e = createjs.PreloadJS = createjs.PreloadJS || {};
  4113. e.version = "0.4.1", e.buildDate = "Thu, 12 Dec 2013 23:33:38 GMT"
  4114. }(), this.createjs = this.createjs || {},
  4115. function() {
  4116. "use strict";
  4117. var e = function(e, t, n) {
  4118. this.initialize(e, t, n)
  4119. },
  4120. t = e.prototype;
  4121. t.type = null, t.target = null, t.currentTarget = null, t.eventPhase = 0, t.bubbles = !1, t.cancelable = !1, t.timeStamp = 0, t.defaultPrevented = !1, t.propagationStopped = !1, t.immediatePropagationStopped = !1, t.removed = !1, t.initialize = function(e, t, n) {
  4122. this.type = e, this.bubbles = t, this.cancelable = n, this.timeStamp = (new Date).getTime()
  4123. }, t.preventDefault = function() {
  4124. this.defaultPrevented = !0
  4125. }, t.stopPropagation = function() {
  4126. this.propagationStopped = !0
  4127. }, t.stopImmediatePropagation = function() {
  4128. this.immediatePropagationStopped = this.propagationStopped = !0
  4129. }, t.remove = function() {
  4130. this.removed = !0
  4131. }, t.clone = function() {
  4132. return new e(this.type, this.bubbles, this.cancelable)
  4133. }, t.toString = function() {
  4134. return "[Event (type=" + this.type + ")]"
  4135. }, createjs.Event = e
  4136. }(), this.createjs = this.createjs || {},
  4137. function() {
  4138. "use strict";
  4139. var e = function() {},
  4140. t = e.prototype;
  4141. e.initialize = function(e) {
  4142. e.addEventListener = t.addEventListener, e.on = t.on, e.removeEventListener = e.off = t.removeEventListener, e.removeAllEventListeners = t.removeAllEventListeners, e.hasEventListener = t.hasEventListener, e.dispatchEvent = t.dispatchEvent, e._dispatchEvent = t._dispatchEvent, e.willTrigger = t.willTrigger
  4143. }, t._listeners = null, t._captureListeners = null, t.initialize = function() {}, t.addEventListener = function(e, t, n) {
  4144. var r;
  4145. r = n ? this._captureListeners = this._captureListeners || {} : this._listeners = this._listeners || {};
  4146. var i = r[e];
  4147. return i && this.removeEventListener(e, t, n), i = r[e], i ? i.push(t) : r[e] = [t], t
  4148. }, t.on = function(e, t, n, r, i, s) {
  4149. return t.handleEvent && (n = n || t, t = t.handleEvent), n = n || this, this.addEventListener(e, function(e) {
  4150. t.call(n, e, i), r && e.remove()
  4151. }, s)
  4152. }, t.removeEventListener = function(e, t, n) {
  4153. var r = n ? this._captureListeners : this._listeners;
  4154. if (r) {
  4155. var i = r[e];
  4156. if (i)
  4157. for (var s = 0, o = i.length; o > s; s++)
  4158. if (i[s] == t) {
  4159. 1 == o ? delete r[e] : i.splice(s, 1);
  4160. break
  4161. }
  4162. }
  4163. }, t.off = t.removeEventListener, t.removeAllEventListeners = function(e) {
  4164. e ? (this._listeners && delete this._listeners[e], this._captureListeners && delete this._captureListeners[e]) : this._listeners = this._captureListeners = null
  4165. }, t.dispatchEvent = function(e, t) {
  4166. if ("string" == typeof e) {
  4167. var n = this._listeners;
  4168. if (!n || !n[e]) return !1;
  4169. e = new createjs.Event(e)
  4170. }
  4171. if (e.target = t || this, e.bubbles && this.parent) {
  4172. for (var r = this, i = [r]; r.parent;) i.push(r = r.parent);
  4173. var s, o = i.length;
  4174. for (s = o - 1; s >= 0 && !e.propagationStopped; s--) i[s]._dispatchEvent(e, 1 + (0 == s));
  4175. for (s = 1; o > s && !e.propagationStopped; s++) i[s]._dispatchEvent(e, 3)
  4176. } else this._dispatchEvent(e, 2);
  4177. return e.defaultPrevented
  4178. }, t.hasEventListener = function(e) {
  4179. var t = this._listeners,
  4180. n = this._captureListeners;
  4181. return !!(t && t[e] || n && n[e])
  4182. }, t.willTrigger = function(e) {
  4183. for (var t = this; t;) {
  4184. if (t.hasEventListener(e)) return !0;
  4185. t = t.parent
  4186. }
  4187. return !1
  4188. }, t.toString = function() {
  4189. return "[EventDispatcher]"
  4190. }, t._dispatchEvent = function(e, t) {
  4191. var n, r = 1 == t ? this._captureListeners : this._listeners;
  4192. if (e && r) {
  4193. var i = r[e.type];
  4194. if (!i || !(n = i.length)) return;
  4195. e.currentTarget = this, e.eventPhase = t, e.removed = !1, i = i.slice();
  4196. for (var s = 0; n > s && !e.immediatePropagationStopped; s++) {
  4197. var o = i[s];
  4198. o.handleEvent ? o.handleEvent(e) : o(e), e.removed && (this.off(e.type, o, 1 == t), e.removed = !1)
  4199. }
  4200. }
  4201. }, createjs.EventDispatcher = e
  4202. }(), this.createjs = this.createjs || {},
  4203. function() {
  4204. "use strict";
  4205. createjs.indexOf = function(e, t) {
  4206. for (var n = 0, r = e.length; r > n; n++)
  4207. if (t === e[n]) return n;
  4208. return -1
  4209. }
  4210. }(), this.createjs = this.createjs || {},
  4211. function() {
  4212. "use strict";
  4213. createjs.proxy = function(e, t) {
  4214. var n = Array.prototype.slice.call(arguments, 2);
  4215. return function() {
  4216. return e.apply(t, Array.prototype.slice.call(arguments, 0).concat(n))
  4217. }
  4218. }
  4219. }(), this.createjs = this.createjs || {},
  4220. function() {
  4221. "use strict";
  4222. var e = function() {
  4223. this.init()
  4224. };
  4225. e.prototype = new createjs.EventDispatcher;
  4226. var t = e.prototype,
  4227. n = e;
  4228. n.FILE_PATTERN = /^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?)|(.{0,2}\/{1}))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/, n.PATH_PATTERN = /^(?:(\w+:)\/{2})|(.{0,2}\/{1})?([/.]*?(?:[^?]+)?\/?)?$/, t.loaded = !1, t.canceled = !1, t.progress = 0, t._item = null, t.getItem = function() {
  4229. return this._item
  4230. }, t.init = function() {}, t.load = function() {}, t.close = function() {}, t._sendLoadStart = function() {
  4231. this._isCanceled() || this.dispatchEvent("loadstart")
  4232. }, t._sendProgress = function(e) {
  4233. if (!this._isCanceled()) {
  4234. var t = null;
  4235. "number" == typeof e ? (this.progress = e, t = new createjs.Event("progress"), t.loaded = this.progress, t.total = 1) : (t = e, this.progress = e.loaded / e.total, (isNaN(this.progress) || 1 / 0 == this.progress) && (this.progress = 0)), t.progress = this.progress, this.hasEventListener("progress") && this.dispatchEvent(t)
  4236. }
  4237. }, t._sendComplete = function() {
  4238. this._isCanceled() || this.dispatchEvent("complete")
  4239. }, t._sendError = function(e) {
  4240. !this._isCanceled() && this.hasEventListener("error") && (null == e && (e = new createjs.Event("error")), this.dispatchEvent(e))
  4241. }, t._isCanceled = function() {
  4242. return null == window.createjs || this.canceled ? !0 : !1
  4243. }, t._parseURI = function(e) {
  4244. return e ? e.match(n.FILE_PATTERN) : null
  4245. }, t._parsePath = function(e) {
  4246. return e ? e.match(n.PATH_PATTERN) : null
  4247. }, t._formatQueryString = function(e, t) {
  4248. if (null == e) throw new Error("You must specify data.");
  4249. var n = [];
  4250. for (var r in e) n.push(r + "=" + escape(e[r]));
  4251. return t && (n = n.concat(t)), n.join("&")
  4252. }, t.buildPath = function(e, t) {
  4253. if (null == t) return e;
  4254. var n = [],
  4255. r = e.indexOf("?");
  4256. if (-1 != r) {
  4257. var i = e.slice(r + 1);
  4258. n = n.concat(i.split("&"))
  4259. }
  4260. return -1 != r ? e.slice(0, r) + "?" + this._formatQueryString(t, n) : e + "?" + this._formatQueryString(t, n)
  4261. }, t._isCrossDomain = function(e) {
  4262. var t = document.createElement("a");
  4263. t.href = e.src;
  4264. var n = document.createElement("a");
  4265. n.href = location.href;
  4266. var r = "" != t.hostname && (t.port != n.port || t.protocol != n.protocol || t.hostname != n.hostname);
  4267. return r
  4268. }, t._isLocal = function(e) {
  4269. var t = document.createElement("a");
  4270. return t.href = e.src, "" == t.hostname && "file:" == t.protocol
  4271. }, t.toString = function() {
  4272. return "[PreloadJS AbstractLoader]"
  4273. }, createjs.AbstractLoader = e
  4274. }(), this.createjs = this.createjs || {},
  4275. function() {
  4276. "use strict";
  4277. var e = function(e, t, n) {
  4278. this.init(e, t, n)
  4279. },
  4280. t = e.prototype = new createjs.AbstractLoader,
  4281. n = e;
  4282. n.loadTimeout = 8e3, n.LOAD_TIMEOUT = 0, n.BINARY = "binary", n.CSS = "css", n.IMAGE = "image", n.JAVASCRIPT = "javascript", n.JSON = "json", n.JSONP = "jsonp", n.MANIFEST = "manifest", n.SOUND = "sound", n.SVG = "svg", n.TEXT = "text", n.XML = "xml", n.POST = "POST", n.GET = "GET", t._basePath = null, t._crossOrigin = "", t.useXHR = !0, t.stopOnError = !1, t.maintainScriptOrder = !0, t.next = null, t._typeCallbacks = null, t._extensionCallbacks = null, t._loadStartWasDispatched = !1, t._maxConnections = 1, t._currentlyLoadingScript = null, t._currentLoads = null, t._loadQueue = null, t._loadQueueBackup = null, t._loadItemsById = null, t._loadItemsBySrc = null, t._loadedResults = null, t._loadedRawResults = null, t._numItems = 0, t._numItemsLoaded = 0, t._scriptOrder = null, t._loadedScripts = null, t.init = function(e, t, n) {
  4283. this._numItems = this._numItemsLoaded = 0, this._paused = !1, this._loadStartWasDispatched = !1, this._currentLoads = [], this._loadQueue = [], this._loadQueueBackup = [], this._scriptOrder = [], this._loadedScripts = [], this._loadItemsById = {}, this._loadItemsBySrc = {}, this._loadedResults = {}, this._loadedRawResults = {}, this._typeCallbacks = {}, this._extensionCallbacks = {}, this._basePath = t, this.setUseXHR(e), this._crossOrigin = n === !0 ? "Anonymous" : n === !1 || null == n ? "" : n
  4284. }, t.setUseXHR = function(e) {
  4285. return this.useXHR = 0 != e && null != window.XMLHttpRequest, this.useXHR
  4286. }, t.removeAll = function() {
  4287. this.remove()
  4288. }, t.remove = function(e) {
  4289. var t = null;
  4290. if (!e || e instanceof Array) {
  4291. if (e) t = e;
  4292. else if (arguments.length > 0) return
  4293. } else t = [e];
  4294. var n = !1;
  4295. if (t) {
  4296. for (; t.length;) {
  4297. var r = t.pop(),
  4298. i = this.getResult(r);
  4299. for (s = this._loadQueue.length - 1; s >= 0; s--)
  4300. if (o = this._loadQueue[s].getItem(), o.id == r || o.src == r) {
  4301. this._loadQueue.splice(s, 1)[0].cancel();
  4302. break
  4303. }
  4304. for (s = this._loadQueueBackup.length - 1; s >= 0; s--)
  4305. if (o = this._loadQueueBackup[s].getItem(), o.id == r || o.src == r) {
  4306. this._loadQueueBackup.splice(s, 1)[0].cancel();
  4307. break
  4308. }
  4309. if (i) delete this._loadItemsById[i.id], delete this._loadItemsBySrc[i.src], this._disposeItem(i);
  4310. else
  4311. for (var s = this._currentLoads.length - 1; s >= 0; s--) {
  4312. var o = this._currentLoads[s].getItem();
  4313. if (o.id == r || o.src == r) {
  4314. this._currentLoads.splice(s, 1)[0].cancel(), n = !0;
  4315. break
  4316. }
  4317. }
  4318. }
  4319. n && this._loadNext()
  4320. } else {
  4321. this.close();
  4322. for (var u in this._loadItemsById) this._disposeItem(this._loadItemsById[u]);
  4323. this.init(this.useXHR)
  4324. }
  4325. }, t.reset = function() {
  4326. this.close();
  4327. for (var e in this._loadItemsById) this._disposeItem(this._loadItemsById[e]);
  4328. for (var t = [], n = 0, r = this._loadQueueBackup.length; r > n; n++) t.push(this._loadQueueBackup[n].getItem());
  4329. this.loadManifest(t, !1)
  4330. }, n.isBinary = function(e) {
  4331. switch (e) {
  4332. case createjs.LoadQueue.IMAGE:
  4333. case createjs.LoadQueue.BINARY:
  4334. return !0;
  4335. default:
  4336. return !1
  4337. }
  4338. }, n.isText = function(e) {
  4339. switch (e) {
  4340. case createjs.LoadQueue.TEXT:
  4341. case createjs.LoadQueue.JSON:
  4342. case createjs.LoadQueue.MANIFEST:
  4343. case createjs.LoadQueue.XML:
  4344. case createjs.LoadQueue.HTML:
  4345. case createjs.LoadQueue.CSS:
  4346. case createjs.LoadQueue.SVG:
  4347. case createjs.LoadQueue.JAVASCRIPT:
  4348. return !0;
  4349. default:
  4350. return !1
  4351. }
  4352. }, t.installPlugin = function(e) {
  4353. if (null != e && null != e.getPreloadHandlers) {
  4354. var t = e.getPreloadHandlers();
  4355. if (t.scope = e, null != t.types)
  4356. for (var n = 0, r = t.types.length; r > n; n++) this._typeCallbacks[t.types[n]] = t;
  4357. if (null != t.extensions)
  4358. for (n = 0, r = t.extensions.length; r > n; n++) this._extensionCallbacks[t.extensions[n]] = t
  4359. }
  4360. }, t.setMaxConnections = function(e) {
  4361. this._maxConnections = e, !this._paused && this._loadQueue.length > 0 && this._loadNext()
  4362. }, t.loadFile = function(e, t, n) {
  4363. if (null == e) {
  4364. var r = new createjs.Event("error");
  4365. return r.text = "PRELOAD_NO_FILE", this._sendError(r), void 0
  4366. }
  4367. this._addItem(e, null, n), t !== !1 ? this.setPaused(!1) : this.setPaused(!0)
  4368. }, t.loadManifest = function(e, t, r) {
  4369. var i = null,
  4370. s = null;
  4371. if (e instanceof Array) {
  4372. if (0 == e.length) {
  4373. var o = new createjs.Event("error");
  4374. return o.text = "PRELOAD_MANIFEST_EMPTY", this._sendError(o), void 0
  4375. }
  4376. i = e
  4377. } else if ("string" == typeof e) i = [{
  4378. src: e,
  4379. type: n.MANIFEST
  4380. }];
  4381. else {
  4382. if ("object" != typeof e) {
  4383. var o = new createjs.Event("error");
  4384. return o.text = "PRELOAD_MANIFEST_NULL", this._sendError(o), void 0
  4385. }
  4386. if (void 0 !== e.src) {
  4387. if (null == e.type) e.type = n.MANIFEST;
  4388. else if (e.type != n.MANIFEST) {
  4389. var o = new createjs.Event("error");
  4390. o.text = "PRELOAD_MANIFEST_ERROR", this._sendError(o)
  4391. }
  4392. i = [e]
  4393. } else void 0 !== e.manifest && (i = e.manifest, s = e.path)
  4394. }
  4395. for (var u = 0, a = i.length; a > u; u++) this._addItem(i[u], s, r);
  4396. t !== !1 ? this.setPaused(!1) : this.setPaused(!0)
  4397. }, t.load = function() {
  4398. this.setPaused(!1)
  4399. }, t.getItem = function(e) {
  4400. return this._loadItemsById[e] || this._loadItemsBySrc[e]
  4401. }, t.getResult = function(e, t) {
  4402. var n = this._loadItemsById[e] || this._loadItemsBySrc[e];
  4403. if (null == n) return null;
  4404. var r = n.id;
  4405. return t && this._loadedRawResults[r] ? this._loadedRawResults[r] : this._loadedResults[r]
  4406. }, t.setPaused = function(e) {
  4407. this._paused = e, this._paused || this._loadNext()
  4408. }, t.close = function() {
  4409. for (; this._currentLoads.length;) this._currentLoads.pop().cancel();
  4410. this._scriptOrder.length = 0, this._loadedScripts.length = 0, this.loadStartWasDispatched = !1
  4411. }, t._addItem = function(e, t, n) {
  4412. var r = this._createLoadItem(e, t, n);
  4413. if (null != r) {
  4414. var i = this._createLoader(r);
  4415. null != i && (this._loadQueue.push(i), this._loadQueueBackup.push(i), this._numItems++, this._updateProgress(), this.maintainScriptOrder && r.type == createjs.LoadQueue.JAVASCRIPT && i instanceof createjs.XHRLoader && (this._scriptOrder.push(r), this._loadedScripts.push(null)))
  4416. }
  4417. }, t._createLoadItem = function(e, t, n) {
  4418. var r = null;
  4419. switch (typeof e) {
  4420. case "string":
  4421. r = {
  4422. src: e
  4423. };
  4424. break;
  4425. case "object":
  4426. r = window.HTMLAudioElement && e instanceof window.HTMLAudioElement ? {
  4427. tag: e,
  4428. src: r.tag.src,
  4429. type: createjs.LoadQueue.SOUND
  4430. } : e;
  4431. break;
  4432. default:
  4433. return null
  4434. }
  4435. var i = this._parseURI(r.src);
  4436. null != i && (r.ext = i[6]), null == r.type && (r.type = this._getTypeByExtension(r.ext));
  4437. var s = "",
  4438. o = n || this._basePath,
  4439. u = r.src;
  4440. if (i && null == i[1] && null == i[3])
  4441. if (t) {
  4442. s = t;
  4443. var a = this._parsePath(t);
  4444. u = t + u, null != o && a && null == a[1] && null == a[2] && (s = o + s)
  4445. } else null != o && (s = o);
  4446. if (r.src = s + r.src, r.path = s, (r.type == createjs.LoadQueue.JSON || r.type == createjs.LoadQueue.MANIFEST) && (r._loadAsJSONP = null != r.callback), r.type == createjs.LoadQueue.JSONP && null == r.callback) throw new Error("callback is required for loading JSONP requests.");
  4447. (void 0 === r.tag || null === r.tag) && (r.tag = this._createTag(r)), (void 0 === r.id || null === r.id || "" === r.id) && (r.id = u);
  4448. var f = this._typeCallbacks[r.type] || this._extensionCallbacks[r.ext];
  4449. if (f) {
  4450. var l = f.callback.call(f.scope, r.src, r.type, r.id, r.data, s, this);
  4451. if (l === !1) return null;
  4452. l === !0 || (null != l.src && (r.src = l.src), null != l.id && (r.id = l.id), null != l.tag && (r.tag = l.tag), null != l.completeHandler && (r.completeHandler = l.completeHandler), l.type && (r.type = l.type), i = this._parseURI(r.src), null != i && null != i[6] && (r.ext = i[6].toLowerCase()))
  4453. }
  4454. return this._loadItemsById[r.id] = r, this._loadItemsBySrc[r.src] = r, r
  4455. }, t._createLoader = function(e) {
  4456. var t = this.useXHR;
  4457. switch (e.type) {
  4458. case createjs.LoadQueue.JSON:
  4459. case createjs.LoadQueue.MANIFEST:
  4460. t = !e._loadAsJSONP;
  4461. break;
  4462. case createjs.LoadQueue.XML:
  4463. case createjs.LoadQueue.TEXT:
  4464. t = !0;
  4465. break;
  4466. case createjs.LoadQueue.SOUND:
  4467. case createjs.LoadQueue.JSONP:
  4468. t = !1;
  4469. break;
  4470. case null:
  4471. return null
  4472. }
  4473. return t ? new createjs.XHRLoader(e, this._crossOrigin) : new createjs.TagLoader(e)
  4474. }, t._loadNext = function() {
  4475. if (!this._paused) {
  4476. this._loadStartWasDispatched || (this._sendLoadStart(), this._loadStartWasDispatched = !0), this._numItems == this._numItemsLoaded ? (this.loaded = !0, this._sendComplete(), this.next && this.next.load && this.next.load()) : this.loaded = !1;
  4477. for (var e = 0; e < this._loadQueue.length && !(this._currentLoads.length >= this._maxConnections); e++) {
  4478. var t = this._loadQueue[e];
  4479. if (this.maintainScriptOrder && t instanceof createjs.TagLoader && t.getItem().type == createjs.LoadQueue.JAVASCRIPT) {
  4480. if (this._currentlyLoadingScript) continue;
  4481. this._currentlyLoadingScript = !0
  4482. }
  4483. this._loadQueue.splice(e, 1), e--, this._loadItem(t)
  4484. }
  4485. }
  4486. }, t._loadItem = function(e) {
  4487. e.on("progress", this._handleProgress, this), e.on("complete", this._handleFileComplete, this), e.on("error", this._handleFileError, this), this._currentLoads.push(e), this._sendFileStart(e.getItem()), e.load()
  4488. }, t._handleFileError = function(e) {
  4489. var t = e.target;
  4490. this._numItemsLoaded++, this._updateProgress();
  4491. var n = new createjs.Event("error");
  4492. n.text = "FILE_LOAD_ERROR", n.item = t.getItem(), this._sendError(n), this.stopOnError || (this._removeLoadItem(t), this._loadNext())
  4493. }, t._handleFileComplete = function(e) {
  4494. var t = e.target,
  4495. n = t.getItem();
  4496. if (this._loadedResults[n.id] = t.getResult(), t instanceof createjs.XHRLoader && (this._loadedRawResults[n.id] = t.getResult(!0)), this._removeLoadItem(t), this.maintainScriptOrder && n.type == createjs.LoadQueue.JAVASCRIPT) {
  4497. if (!(t instanceof createjs.TagLoader)) return this._loadedScripts[createjs.indexOf(this._scriptOrder, n)] = n, this._checkScriptLoadOrder(t), void 0;
  4498. this._currentlyLoadingScript = !1
  4499. }
  4500. if (delete n._loadAsJSONP, n.type == createjs.LoadQueue.MANIFEST) {
  4501. var r = t.getResult();
  4502. null != r && void 0 !== r.manifest && this.loadManifest(r, !0)
  4503. }
  4504. this._processFinishedLoad(n, t)
  4505. }, t._processFinishedLoad = function(e, t) {
  4506. this._numItemsLoaded++, this._updateProgress(), this._sendFileComplete(e, t), this._loadNext()
  4507. }, t._checkScriptLoadOrder = function() {
  4508. for (var e = this._loadedScripts.length, t = 0; e > t; t++) {
  4509. var n = this._loadedScripts[t];
  4510. if (null === n) break;
  4511. if (n !== !0) {
  4512. var r = this._loadedResults[n.id];
  4513. (document.body || document.getElementsByTagName("body")[0]).appendChild(r), this._processFinishedLoad(n), this._loadedScripts[t] = !0
  4514. }
  4515. }
  4516. }, t._removeLoadItem = function(e) {
  4517. for (var t = this._currentLoads.length, n = 0; t > n; n++)
  4518. if (this._currentLoads[n] == e) {
  4519. this._currentLoads.splice(n, 1);
  4520. break
  4521. }
  4522. }, t._handleProgress = function(e) {
  4523. var t = e.target;
  4524. this._sendFileProgress(t.getItem(), t.progress), this._updateProgress()
  4525. }, t._updateProgress = function() {
  4526. var e = this._numItemsLoaded / this._numItems,
  4527. t = this._numItems - this._numItemsLoaded;
  4528. if (t > 0) {
  4529. for (var n = 0, r = 0, i = this._currentLoads.length; i > r; r++) n += this._currentLoads[r].progress;
  4530. e += n / t * (t / this._numItems)
  4531. }
  4532. this._sendProgress(e)
  4533. }, t._disposeItem = function(e) {
  4534. delete this._loadedResults[e.id], delete this._loadedRawResults[e.id], delete this._loadItemsById[e.id], delete this._loadItemsBySrc[e.src]
  4535. }, t._createTag = function(e) {
  4536. var t = null;
  4537. switch (e.type) {
  4538. case createjs.LoadQueue.IMAGE:
  4539. return t = document.createElement("img"), "" == this._crossOrigin || this._isLocal(e) || (t.crossOrigin = this._crossOrigin), t;
  4540. case createjs.LoadQueue.SOUND:
  4541. return t = document.createElement("audio"), t.autoplay = !1, t;
  4542. case createjs.LoadQueue.JSON:
  4543. case createjs.LoadQueue.JSONP:
  4544. case createjs.LoadQueue.JAVASCRIPT:
  4545. case createjs.LoadQueue.MANIFEST:
  4546. return t = document.createElement("script"), t.type = "text/javascript", t;
  4547. case createjs.LoadQueue.CSS:
  4548. return t = this.useXHR ? document.createElement("style") : document.createElement("link"), t.rel = "stylesheet", t.type = "text/css", t;
  4549. case createjs.LoadQueue.SVG:
  4550. return this.useXHR ? t = document.createElement("svg") : (t = document.createElement("object"), t.type = "image/svg+xml"), t
  4551. }
  4552. return null
  4553. }, t._getTypeByExtension = function(e) {
  4554. if (null == e) return createjs.LoadQueue.TEXT;
  4555. switch (e.toLowerCase()) {
  4556. case "jpeg":
  4557. case "jpg":
  4558. case "gif":
  4559. case "png":
  4560. case "webp":
  4561. case "bmp":
  4562. return createjs.LoadQueue.IMAGE;
  4563. case "ogg":
  4564. case "mp3":
  4565. case "wav":
  4566. return createjs.LoadQueue.SOUND;
  4567. case "json":
  4568. return createjs.LoadQueue.JSON;
  4569. case "xml":
  4570. return createjs.LoadQueue.XML;
  4571. case "css":
  4572. return createjs.LoadQueue.CSS;
  4573. case "js":
  4574. return createjs.LoadQueue.JAVASCRIPT;
  4575. case "svg":
  4576. return createjs.LoadQueue.SVG;
  4577. default:
  4578. return createjs.LoadQueue.TEXT
  4579. }
  4580. }, t._sendFileProgress = function(e, t) {
  4581. if (this._isCanceled()) return this._cleanUp(), void 0;
  4582. if (this.hasEventListener("fileprogress")) {
  4583. var n = new createjs.Event("fileprogress");
  4584. n.progress = t, n.loaded = t, n.total = 1, n.item = e, this.dispatchEvent(n)
  4585. }
  4586. }, t._sendFileComplete = function(e, t) {
  4587. if (!this._isCanceled()) {
  4588. var n = new createjs.Event("fileload");
  4589. n.loader = t, n.item = e, n.result = this._loadedResults[e.id], n.rawResult = this._loadedRawResults[e.id], e.completeHandler && e.completeHandler(n), this.hasEventListener("fileload") && this.dispatchEvent(n)
  4590. }
  4591. }, t._sendFileStart = function(e) {
  4592. var t = new createjs.Event("filestart");
  4593. t.item = e, this.hasEventListener("filestart") && this.dispatchEvent(t)
  4594. }, t.toString = function() {
  4595. return "[PreloadJS LoadQueue]"
  4596. }, createjs.LoadQueue = e;
  4597. var r = function() {};
  4598. r.init = function() {
  4599. var e = navigator.userAgent;
  4600. r.isFirefox = e.indexOf("Firefox") > -1, r.isOpera = null != window.opera, r.isChrome = e.indexOf("Chrome") > -1, r.isIOS = e.indexOf("iPod") > -1 || e.indexOf("iPhone") > -1 || e.indexOf("iPad") > -1
  4601. }, r.init(), createjs.LoadQueue.BrowserDetect = r
  4602. }(), this.createjs = this.createjs || {},
  4603. function() {
  4604. "use strict";
  4605. var e = function(e) {
  4606. this.init(e)
  4607. },
  4608. t = e.prototype = new createjs.AbstractLoader;
  4609. t._loadTimeout = null, t._tagCompleteProxy = null, t._isAudio = !1, t._tag = null, t._jsonResult = null, t.init = function(e) {
  4610. this._item = e, this._tag = e.tag, this._isAudio = window.HTMLAudioElement && e.tag instanceof window.HTMLAudioElement, this._tagCompleteProxy = createjs.proxy(this._handleLoad, this)
  4611. }, t.getResult = function() {
  4612. return this._item.type == createjs.LoadQueue.JSONP || this._item.type == createjs.LoadQueue.MANIFEST ? this._jsonResult : this._tag
  4613. }, t.cancel = function() {
  4614. this.canceled = !0, this._clean()
  4615. }, t.load = function() {
  4616. var e = this._item,
  4617. t = this._tag;
  4618. clearTimeout(this._loadTimeout);
  4619. var n = createjs.LoadQueue.LOAD_TIMEOUT;
  4620. 0 == n && (n = createjs.LoadQueue.loadTimeout), this._loadTimeout = setTimeout(createjs.proxy(this._handleTimeout, this), n), this._isAudio && (t.src = null, t.preload = "auto"), t.onerror = createjs.proxy(this._handleError, this), this._isAudio ? (t.onstalled = createjs.proxy(this._handleStalled, this), t.addEventListener("canplaythrough", this._tagCompleteProxy, !1)) : (t.onload = createjs.proxy(this._handleLoad, this), t.onreadystatechange = createjs.proxy(this._handleReadyStateChange, this));
  4621. var r = this.buildPath(e.src, e.values);
  4622. switch (e.type) {
  4623. case createjs.LoadQueue.CSS:
  4624. t.href = r;
  4625. break;
  4626. case createjs.LoadQueue.SVG:
  4627. t.data = r;
  4628. break;
  4629. default:
  4630. t.src = r
  4631. }
  4632. if (e.type == createjs.LoadQueue.JSONP || e.type == createjs.LoadQueue.JSON || e.type == createjs.LoadQueue.MANIFEST) {
  4633. if (null == e.callback) throw new Error("callback is required for loading JSONP requests.");
  4634. if (null != window[e.callback]) throw new Error('JSONP callback "' + e.callback + '" already exists on window. You need to specify a different callback. Or re-name the current one.');
  4635. window[e.callback] = createjs.proxy(this._handleJSONPLoad, this)
  4636. }(e.type == createjs.LoadQueue.SVG || e.type == createjs.LoadQueue.JSONP || e.type == createjs.LoadQueue.JSON || e.type == createjs.LoadQueue.MANIFEST || e.type == createjs.LoadQueue.JAVASCRIPT || e.type == createjs.LoadQueue.CSS) && (this._startTagVisibility = t.style.visibility, t.style.visibility = "hidden", (document.body || document.getElementsByTagName("body")[0]).appendChild(t)), null != t.load && t.load()
  4637. }, t._handleJSONPLoad = function(e) {
  4638. this._jsonResult = e
  4639. }, t._handleTimeout = function() {
  4640. this._clean();
  4641. var e = new createjs.Event("error");
  4642. e.text = "PRELOAD_TIMEOUT", this._sendError(e)
  4643. }, t._handleStalled = function() {}, t._handleError = function() {
  4644. this._clean();
  4645. var e = new createjs.Event("error");
  4646. this._sendError(e)
  4647. }, t._handleReadyStateChange = function() {
  4648. clearTimeout(this._loadTimeout);
  4649. var e = this.getItem().tag;
  4650. ("loaded" == e.readyState || "complete" == e.readyState) && this._handleLoad()
  4651. }, t._handleLoad = function() {
  4652. if (!this._isCanceled()) {
  4653. var e = this.getItem(),
  4654. t = e.tag;
  4655. if (!(this.loaded || this._isAudio && 4 !== t.readyState)) {
  4656. switch (this.loaded = !0, e.type) {
  4657. case createjs.LoadQueue.SVG:
  4658. case createjs.LoadQueue.JSON:
  4659. case createjs.LoadQueue.JSONP:
  4660. case createjs.LoadQueue.MANIFEST:
  4661. case createjs.LoadQueue.CSS:
  4662. t.style.visibility = this._startTagVisibility, (document.body || document.getElementsByTagName("body")[0]).removeChild(t)
  4663. }
  4664. this._clean(), this._sendComplete()
  4665. }
  4666. }
  4667. }, t._clean = function() {
  4668. clearTimeout(this._loadTimeout);
  4669. var e = this.getItem(),
  4670. t = e.tag;
  4671. null != t && (t.onload = null, t.removeEventListener && t.removeEventListener("canplaythrough", this._tagCompleteProxy, !1), t.onstalled = null, t.onprogress = null, t.onerror = null, null != t.parentNode && e.type == createjs.LoadQueue.SVG && e.type == createjs.LoadQueue.JSON && e.type == createjs.LoadQueue.MANIFEST && e.type == createjs.LoadQueue.CSS && e.type == createjs.LoadQueue.JSONP && t.parentNode.removeChild(t));
  4672. var e = this.getItem();
  4673. (e.type == createjs.LoadQueue.JSONP || e.type == createjs.LoadQueue.MANIFEST) && (window[e.callback] = null)
  4674. }, t.toString = function() {
  4675. return "[PreloadJS TagLoader]"
  4676. }, createjs.TagLoader = e
  4677. }(), this.createjs = this.createjs || {},
  4678. function() {
  4679. "use strict";
  4680. var e = function(e, t) {
  4681. this.init(e, t)
  4682. },
  4683. t = e.prototype = new createjs.AbstractLoader;
  4684. t._request = null, t._loadTimeout = null, t._xhrLevel = 1, t._response = null, t._rawResponse = null, t._crossOrigin = "", t.init = function(e, t) {
  4685. this._item = e, this._crossOrigin = t, !this._createXHR(e)
  4686. }, t.getResult = function(e) {
  4687. return e && this._rawResponse ? this._rawResponse : this._response
  4688. }, t.cancel = function() {
  4689. this.canceled = !0, this._clean(), this._request.abort()
  4690. }, t.load = function() {
  4691. if (null == this._request) return this._handleError(), void 0;
  4692. if (this._request.onloadstart = createjs.proxy(this._handleLoadStart, this), this._request.onprogress = createjs.proxy(this._handleProgress, this), this._request.onabort = createjs.proxy(this._handleAbort, this), this._request.onerror = createjs.proxy(this._handleError, this), this._request.ontimeout = createjs.proxy(this._handleTimeout, this), 1 == this._xhrLevel) {
  4693. var e = createjs.LoadQueue.LOAD_TIMEOUT;
  4694. if (0 == e) e = createjs.LoadQueue.loadTimeout;
  4695. else try {
  4696. console.warn("LoadQueue.LOAD_TIMEOUT has been deprecated in favor of LoadQueue.loadTimeout")
  4697. } catch (t) {}
  4698. this._loadTimeout = setTimeout(createjs.proxy(this._handleTimeout, this), e)
  4699. }
  4700. this._request.onload = createjs.proxy(this._handleLoad, this), this._request.onreadystatechange = createjs.proxy(this._handleReadyStateChange, this);
  4701. try {
  4702. this._item.values && this._item.method != createjs.LoadQueue.GET ? this._item.method == createjs.LoadQueue.POST && this._request.send(this._formatQueryString(this._item.values)) : this._request.send()
  4703. } catch (n) {
  4704. var r = new createjs.Event("error");
  4705. r.error = n, this._sendError(r)
  4706. }
  4707. }, t.getAllResponseHeaders = function() {
  4708. return this._request.getAllResponseHeaders instanceof Function ? this._request.getAllResponseHeaders() : null
  4709. }, t.getResponseHeader = function(e) {
  4710. return this._request.getResponseHeader instanceof Function ? this._request.getResponseHeader(e) : null
  4711. }, t._handleProgress = function(e) {
  4712. if (e && !(e.loaded > 0 && 0 == e.total)) {
  4713. var t = new createjs.Event("progress");
  4714. t.loaded = e.loaded, t.total = e.total, this._sendProgress(t)
  4715. }
  4716. }, t._handleLoadStart = function() {
  4717. clearTimeout(this._loadTimeout), this._sendLoadStart()
  4718. }, t._handleAbort = function() {
  4719. this._clean();
  4720. var e = new createjs.Event("error");
  4721. e.text = "XHR_ABORTED", this._sendError(e)
  4722. }, t._handleError = function() {
  4723. this._clean();
  4724. var e = new createjs.Event("error");
  4725. this._sendError(e)
  4726. }, t._handleReadyStateChange = function() {
  4727. 4 == this._request.readyState && this._handleLoad()
  4728. }, t._handleLoad = function() {
  4729. if (!this.loaded) {
  4730. if (this.loaded = !0, !this._checkError()) return this._handleError(), void 0;
  4731. this._response = this._getResponse(), this._clean();
  4732. var e = this._generateTag();
  4733. e && this._sendComplete()
  4734. }
  4735. }, t._handleTimeout = function(e) {
  4736. this._clean();
  4737. var t = new createjs.Event("error");
  4738. t.text = "PRELOAD_TIMEOUT", this._sendError(e)
  4739. }, t._checkError = function() {
  4740. var e = parseInt(this._request.status);
  4741. switch (e) {
  4742. case 404:
  4743. case 0:
  4744. return !1
  4745. }
  4746. return !0
  4747. }, t._getResponse = function() {
  4748. if (null != this._response) return this._response;
  4749. if (null != this._request.response) return this._request.response;
  4750. try {
  4751. if (null != this._request.responseText) return this._request.responseText
  4752. } catch (e) {}
  4753. try {
  4754. if (null != this._request.responseXML) return this._request.responseXML
  4755. } catch (e) {}
  4756. return null
  4757. }, t._createXHR = function(e) {
  4758. var t = this._isCrossDomain(e),
  4759. n = null;
  4760. if (t && window.XDomainRequest) n = new XDomainRequest;
  4761. else if (window.XMLHttpRequest) n = new XMLHttpRequest;
  4762. else try {
  4763. n = new ActiveXObject("Msxml2.XMLHTTP.6.0")
  4764. } catch (r) {
  4765. try {
  4766. n = new ActiveXObject("Msxml2.XMLHTTP.3.0")
  4767. } catch (r) {
  4768. try {
  4769. n = new ActiveXObject("Msxml2.XMLHTTP")
  4770. } catch (r) {
  4771. return !1
  4772. }
  4773. }
  4774. }
  4775. createjs.LoadQueue.isText(e.type) && n.overrideMimeType && n.overrideMimeType("text/plain; charset=utf-8"), this._xhrLevel = "string" == typeof n.responseType ? 2 : 1;
  4776. var i = null;
  4777. return i = e.method == createjs.LoadQueue.GET ? this.buildPath(e.src, e.values) : e.src, n.open(e.method || createjs.LoadQueue.GET, i, !0), t && n instanceof XMLHttpRequest && 1 == this._xhrLevel && n.setRequestHeader("Origin", location.origin), e.values && e.method == createjs.LoadQueue.POST && n.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), createjs.LoadQueue.isBinary(e.type) && (n.responseType = "arraybuffer"), this._request = n, !0
  4778. }, t._clean = function() {
  4779. clearTimeout(this._loadTimeout);
  4780. var e = this._request;
  4781. e.onloadstart = null, e.onprogress = null, e.onabort = null, e.onerror = null, e.onload = null, e.ontimeout = null, e.onloadend = null, e.onreadystatechange = null
  4782. }, t._generateTag = function() {
  4783. var e = this._item.type,
  4784. t = this._item.tag;
  4785. switch (e) {
  4786. case createjs.LoadQueue.IMAGE:
  4787. return t.onload = createjs.proxy(this._handleTagReady, this), "" != this._crossOrigin && (t.crossOrigin = "Anonymous"), t.src = this.buildPath(this._item.src, this._item.values), this._rawResponse = this._response, this._response = t, !1;
  4788. case createjs.LoadQueue.JAVASCRIPT:
  4789. return t = document.createElement("script"), t.text = this._response, this._rawResponse = this._response, this._response = t, !0;
  4790. case createjs.LoadQueue.CSS:
  4791. var n = document.getElementsByTagName("head")[0];
  4792. if (n.appendChild(t), t.styleSheet) t.styleSheet.cssText = this._response;
  4793. else {
  4794. var r = document.createTextNode(this._response);
  4795. t.appendChild(r)
  4796. }
  4797. return this._rawResponse = this._response, this._response = t, !0;
  4798. case createjs.LoadQueue.XML:
  4799. var i = this._parseXML(this._response, "text/xml");
  4800. return this._rawResponse = this._response, this._response = i, !0;
  4801. case createjs.LoadQueue.SVG:
  4802. var i = this._parseXML(this._response, "image/svg+xml");
  4803. return this._rawResponse = this._response, null != i.documentElement ? (t.appendChild(i.documentElement), this._response = t) : this._response = i, !0;
  4804. case createjs.LoadQueue.JSON:
  4805. case createjs.LoadQueue.MANIFEST:
  4806. var s = {};
  4807. try {
  4808. s = JSON.parse(this._response)
  4809. } catch (o) {
  4810. s = o
  4811. }
  4812. return this._rawResponse = this._response, this._response = s, !0
  4813. }
  4814. return !0
  4815. }, t._parseXML = function(e, t) {
  4816. var n = null;
  4817. try {
  4818. if (window.DOMParser) {
  4819. var r = new DOMParser;
  4820. n = r.parseFromString(e, t)
  4821. } else n = new ActiveXObject("Microsoft.XMLDOM"), n.async = !1, n.loadXML(e)
  4822. } catch (i) {}
  4823. return n
  4824. }, t._handleTagReady = function() {
  4825. this._sendComplete()
  4826. }, t.toString = function() {
  4827. return "[PreloadJS XHRLoader]"
  4828. }, createjs.XHRLoader = e
  4829. }(), "object" != typeof JSON && (JSON = {}),
  4830. function() {
  4831. "use strict";
  4832. function f(e) {
  4833. return 10 > e ? "0" + e : e
  4834. }
  4835. function quote(e) {
  4836. return escapable.lastIndex = 0, escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  4837. var t = meta[e];
  4838. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  4839. }) + '"' : '"' + e + '"'
  4840. }
  4841. function str(e, t) {
  4842. var n, r, i, s, o, u = gap,
  4843. a = t[e];
  4844. switch (a && "object" == typeof a && "function" == typeof a.toJSON && (a = a.toJSON(e)), "function" == typeof rep && (a = rep.call(t, e, a)), typeof a) {
  4845. case "string":
  4846. return quote(a);
  4847. case "number":
  4848. return isFinite(a) ? String(a) : "null";
  4849. case "boolean":
  4850. case "null":
  4851. return String(a);
  4852. case "object":
  4853. if (!a) return "null";
  4854. if (gap += indent, o = [], "[object Array]" === Object.prototype.toString.apply(a)) {
  4855. for (s = a.length, n = 0; s > n; n += 1) o[n] = str(n, a) || "null";
  4856. return i = 0 === o.length ? "[]" : gap ? "[\n" + gap + o.join(",\n" + gap) + "\n" + u + "]" : "[" + o.join(",") + "]", gap = u, i
  4857. }
  4858. if (rep && "object" == typeof rep)
  4859. for (s = rep.length, n = 0; s > n; n += 1) "string" == typeof rep[n] && (r = rep[n], i = str(r, a), i && o.push(quote(r) + (gap ? ": " : ":") + i));
  4860. else
  4861. for (r in a) Object.prototype.hasOwnProperty.call(a, r) && (i = str(r, a), i && o.push(quote(r) + (gap ? ": " : ":") + i));
  4862. return i = 0 === o.length ? "{}" : gap ? "{\n" + gap + o.join(",\n" + gap) + "\n" + u + "}" : "{" + o.join(",") + "}", gap = u, i
  4863. }
  4864. }
  4865. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  4866. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
  4867. }, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  4868. return this.valueOf()
  4869. });
  4870. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  4871. escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  4872. gap, indent, meta = {
  4873. "\b": "\\b",
  4874. " ": "\\t",
  4875. "\n": "\\n",
  4876. "\f": "\\f",
  4877. "\r": "\\r",
  4878. '"': '\\"',
  4879. "\\": "\\\\"
  4880. },
  4881. rep;
  4882. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  4883. var r;
  4884. if (gap = "", indent = "", "number" == typeof n)
  4885. for (r = 0; n > r; r += 1) indent += " ";
  4886. else "string" == typeof n && (indent = n); if (rep = t, t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length)) throw new Error("JSON.stringify");
  4887. return str("", {
  4888. "": e
  4889. })
  4890. }), "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  4891. function walk(e, t) {
  4892. var n, r, i = e[t];
  4893. if (i && "object" == typeof i)
  4894. for (n in i) Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n), void 0 !== r ? i[n] = r : delete i[n]);
  4895. return reviver.call(e, t, i)
  4896. }
  4897. var j;
  4898. if (text = String(text), cx.lastIndex = 0, cx.test(text) && (text = text.replace(cx, function(e) {
  4899. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  4900. })), /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return j = eval("(" + text + ")"), "function" == typeof reviver ? walk({
  4901. "": j
  4902. }, "") : j;
  4903. throw new SyntaxError("JSON.parse")
  4904. })
  4905. }();
  4906. this.createjs = this.createjs || {},
  4907. function() {
  4908. "use strict";
  4909. var e = function(e, t, n) {
  4910. this.initialize(e, t, n)
  4911. },
  4912. t = e.prototype;
  4913. t.type = null, t.target = null, t.currentTarget = null, t.eventPhase = 0, t.bubbles = !1, t.cancelable = !1, t.timeStamp = 0, t.defaultPrevented = !1, t.propagationStopped = !1, t.immediatePropagationStopped = !1, t.removed = !1, t.initialize = function(e, t, n) {
  4914. this.type = e, this.bubbles = t, this.cancelable = n, this.timeStamp = (new Date).getTime()
  4915. }, t.preventDefault = function() {
  4916. this.defaultPrevented = !0
  4917. }, t.stopPropagation = function() {
  4918. this.propagationStopped = !0
  4919. }, t.stopImmediatePropagation = function() {
  4920. this.immediatePropagationStopped = this.propagationStopped = !0
  4921. }, t.remove = function() {
  4922. this.removed = !0
  4923. }, t.clone = function() {
  4924. return new e(this.type, this.bubbles, this.cancelable)
  4925. }, t.toString = function() {
  4926. return "[Event (type=" + this.type + ")]"
  4927. }, createjs.Event = e
  4928. }(), this.createjs = this.createjs || {},
  4929. function() {
  4930. "use strict";
  4931. var e = function() {},
  4932. t = e.prototype;
  4933. e.initialize = function(e) {
  4934. e.addEventListener = t.addEventListener, e.on = t.on, e.removeEventListener = e.off = t.removeEventListener, e.removeAllEventListeners = t.removeAllEventListeners, e.hasEventListener = t.hasEventListener, e.dispatchEvent = t.dispatchEvent, e._dispatchEvent = t._dispatchEvent, e.willTrigger = t.willTrigger
  4935. }, t._listeners = null, t._captureListeners = null, t.initialize = function() {}, t.addEventListener = function(e, t, n) {
  4936. var r;
  4937. r = n ? this._captureListeners = this._captureListeners || {} : this._listeners = this._listeners || {};
  4938. var i = r[e];
  4939. return i && this.removeEventListener(e, t, n), i = r[e], i ? i.push(t) : r[e] = [t], t
  4940. }, t.on = function(e, t, n, r, i, s) {
  4941. return t.handleEvent && (n = n || t, t = t.handleEvent), n = n || this, this.addEventListener(e, function(e) {
  4942. t.call(n, e, i), r && e.remove()
  4943. }, s)
  4944. }, t.removeEventListener = function(e, t, n) {
  4945. var r = n ? this._captureListeners : this._listeners;
  4946. if (r) {
  4947. var i = r[e];
  4948. if (i)
  4949. for (var s = 0, o = i.length; o > s; s++)
  4950. if (i[s] == t) {
  4951. 1 == o ? delete r[e] : i.splice(s, 1);
  4952. break
  4953. }
  4954. }
  4955. }, t.off = t.removeEventListener, t.removeAllEventListeners = function(e) {
  4956. e ? (this._listeners && delete this._listeners[e], this._captureListeners && delete this._captureListeners[e]) : this._listeners = this._captureListeners = null
  4957. }, t.dispatchEvent = function(e, t) {
  4958. if ("string" == typeof e) {
  4959. var n = this._listeners;
  4960. if (!n || !n[e]) return !1;
  4961. e = new createjs.Event(e)
  4962. }
  4963. if (e.target = t || this, e.bubbles && this.parent) {
  4964. for (var r = this, i = [r]; r.parent;) i.push(r = r.parent);
  4965. var s, o = i.length;
  4966. for (s = o - 1; s >= 0 && !e.propagationStopped; s--) i[s]._dispatchEvent(e, 1 + (0 == s));
  4967. for (s = 1; o > s && !e.propagationStopped; s++) i[s]._dispatchEvent(e, 3)
  4968. } else this._dispatchEvent(e, 2);
  4969. return e.defaultPrevented
  4970. }, t.hasEventListener = function(e) {
  4971. var t = this._listeners,
  4972. n = this._captureListeners;
  4973. return !!(t && t[e] || n && n[e])
  4974. }, t.willTrigger = function(e) {
  4975. for (var t = this; t;) {
  4976. if (t.hasEventListener(e)) return !0;
  4977. t = t.parent
  4978. }
  4979. return !1
  4980. }, t.toString = function() {
  4981. return "[EventDispatcher]"
  4982. }, t._dispatchEvent = function(e, t) {
  4983. var n, r = 1 == t ? this._captureListeners : this._listeners;
  4984. if (e && r) {
  4985. var i = r[e.type];
  4986. if (!i || !(n = i.length)) return;
  4987. e.currentTarget = this, e.eventPhase = t, e.removed = !1, i = i.slice();
  4988. for (var s = 0; n > s && !e.immediatePropagationStopped; s++) {
  4989. var o = i[s];
  4990. o.handleEvent ? o.handleEvent(e) : o(e), e.removed && (this.off(e.type, o, 1 == t), e.removed = !1)
  4991. }
  4992. }
  4993. }, createjs.EventDispatcher = e
  4994. }(), this.createjs = this.createjs || {},
  4995. function() {
  4996. "use strict";
  4997. var e = function(e, t, n) {
  4998. this.initialize(e, t, n)
  4999. },
  5000. t = e.prototype = new createjs.EventDispatcher;
  5001. e.NONE = 0, e.LOOP = 1, e.REVERSE = 2, e.IGNORE = {}, e._tweens = [], e._plugins = {}, e.get = function(t, n, r, i) {
  5002. return i && e.removeTweens(t), new e(t, n, r)
  5003. }, e.tick = function(t, n) {
  5004. for (var r = e._tweens.slice(), i = r.length - 1; i >= 0; i--) {
  5005. var s = r[i];
  5006. n && !s.ignoreGlobalPause || s._paused || s.tick(s._useTicks ? 1 : t)
  5007. }
  5008. }, e.handleEvent = function(e) {
  5009. "tick" == e.type && this.tick(e.delta, e.paused)
  5010. }, e.removeTweens = function(t) {
  5011. if (t.tweenjs_count) {
  5012. for (var n = e._tweens, r = n.length - 1; r >= 0; r--) n[r]._target == t && (n[r]._paused = !0, n.splice(r, 1));
  5013. t.tweenjs_count = 0
  5014. }
  5015. }, e.removeAllTweens = function() {
  5016. for (var t = e._tweens, n = 0, r = t.length; r > n; n++) {
  5017. var i = t[n];
  5018. i.paused = !0, i.target.tweenjs_count = 0
  5019. }
  5020. t.length = 0
  5021. }, e.hasActiveTweens = function(t) {
  5022. return t ? t.tweenjs_count : e._tweens && !!e._tweens.length
  5023. }, e.installPlugin = function(t, n) {
  5024. var r = t.priority;
  5025. null == r && (t.priority = r = 0);
  5026. for (var i = 0, s = n.length, o = e._plugins; s > i; i++) {
  5027. var u = n[i];
  5028. if (o[u]) {
  5029. for (var f = o[u], l = 0, c = f.length; c > l && !(r < f[l].priority); l++);
  5030. o[u].splice(l, 0, t)
  5031. } else o[u] = [t]
  5032. }
  5033. }, e._register = function(t, n) {
  5034. var r = t._target,
  5035. i = e._tweens;
  5036. if (n) r && (r.tweenjs_count = r.tweenjs_count ? r.tweenjs_count + 1 : 1), i.push(t), !e._inited && createjs.Ticker && (createjs.Ticker.addEventListener("tick", e), e._inited = !0);
  5037. else {
  5038. r && r.tweenjs_count--;
  5039. for (var s = i.length; s--;)
  5040. if (i[s] == t) return i.splice(s, 1), void 0
  5041. }
  5042. }, t.ignoreGlobalPause = !1, t.loop = !1, t.duration = 0, t.pluginData = null, t.target = null, t.position = null, t.passive = !1, t._paused = !1, t._curQueueProps = null, t._initQueueProps = null, t._steps = null, t._actions = null, t._prevPosition = 0, t._stepPosition = 0, t._prevPos = -1, t._target = null, t._useTicks = !1, t._inited = !1, t.initialize = function(t, n, r) {
  5043. this.target = this._target = t, n && (this._useTicks = n.useTicks, this.ignoreGlobalPause = n.ignoreGlobalPause, this.loop = n.loop, n.onChange && this.addEventListener("change", n.onChange), n.override && e.removeTweens(t)), this.pluginData = r || {}, this._curQueueProps = {}, this._initQueueProps = {}, this._steps = [], this._actions = [], n && n.paused ? this._paused = !0 : e._register(this, !0), n && null != n.position && this.setPosition(n.position, e.NONE)
  5044. }, t.wait = function(e, t) {
  5045. if (null == e || 0 >= e) return this;
  5046. var n = this._cloneProps(this._curQueueProps);
  5047. return this._addStep({
  5048. d: e,
  5049. p0: n,
  5050. e: this._linearEase,
  5051. p1: n,
  5052. v: t
  5053. })
  5054. }, t.to = function(e, t, n) {
  5055. return (isNaN(t) || 0 > t) && (t = 0), this._addStep({
  5056. d: t || 0,
  5057. p0: this._cloneProps(this._curQueueProps),
  5058. e: n,
  5059. p1: this._cloneProps(this._appendQueueProps(e))
  5060. })
  5061. }, t.call = function(e, t, n) {
  5062. return this._addAction({
  5063. f: e,
  5064. p: t ? t : [this],
  5065. o: n ? n : this._target
  5066. })
  5067. }, t.set = function(e, t) {
  5068. return this._addAction({
  5069. f: this._set,
  5070. o: this,
  5071. p: [e, t ? t : this._target]
  5072. })
  5073. }, t.play = function(e) {
  5074. return e || (e = this), this.call(e.setPaused, [!1], e)
  5075. }, t.pause = function(e) {
  5076. return e || (e = this), this.call(e.setPaused, [!0], e)
  5077. }, t.setPosition = function(e, t) {
  5078. 0 > e && (e = 0), null == t && (t = 1);
  5079. var n = e,
  5080. r = !1;
  5081. if (n >= this.duration && (this.loop ? n %= this.duration : (n = this.duration, r = !0)), n == this._prevPos) return r;
  5082. var i = this._prevPos;
  5083. if (this.position = this._prevPos = n, this._prevPosition = e, this._target)
  5084. if (r) this._updateTargetProps(null, 1);
  5085. else if (this._steps.length > 0) {
  5086. for (var s = 0, o = this._steps.length; o > s && !(this._steps[s].t > n); s++);
  5087. var u = this._steps[s - 1];
  5088. this._updateTargetProps(u, (this._stepPosition = n - u.t) / u.d)
  5089. }
  5090. return 0 != t && this._actions.length > 0 && (this._useTicks ? this._runActions(n, n) : 1 == t && i > n ? (i != this.duration && this._runActions(i, this.duration), this._runActions(0, n, !0)) : this._runActions(i, n)), r && this.setPaused(!0), this.dispatchEvent("change"), r
  5091. }, t.tick = function(e) {
  5092. this._paused || this.setPosition(this._prevPosition + e)
  5093. }, t.setPaused = function(t) {
  5094. return this._paused = !!t, e._register(this, !t), this
  5095. }, t.w = t.wait, t.t = t.to, t.c = t.call, t.s = t.set, t.toString = function() {
  5096. return "[Tween]"
  5097. }, t.clone = function() {
  5098. throw "Tween can not be cloned."
  5099. }, t._updateTargetProps = function(t, n) {
  5100. var r, i, s, o, u, f;
  5101. if (t || 1 != n) {
  5102. if (this.passive = !!t.v, this.passive) return;
  5103. t.e && (n = t.e(n, 0, 1, 1)), r = t.p0, i = t.p1
  5104. } else this.passive = !1, r = i = this._curQueueProps;
  5105. for (var l in this._initQueueProps) {
  5106. null == (o = r[l]) && (r[l] = o = this._initQueueProps[l]), null == (u = i[l]) && (i[l] = u = o), s = o == u || 0 == n || 1 == n || "number" != typeof o ? 1 == n ? u : o : o + (u - o) * n;
  5107. var c = !1;
  5108. if (f = e._plugins[l])
  5109. for (var h = 0, p = f.length; p > h; h++) {
  5110. var d = f[h].tween(this, l, s, r, i, n, !!t && r == i, !t);
  5111. d == e.IGNORE ? c = !0 : s = d
  5112. }
  5113. c || (this._target[l] = s)
  5114. }
  5115. }, t._runActions = function(e, t, n) {
  5116. var r = e,
  5117. i = t,
  5118. s = -1,
  5119. o = this._actions.length,
  5120. u = 1;
  5121. for (e > t && (r = t, i = e, s = o, o = u = -1);
  5122. (s += u) != o;) {
  5123. var a = this._actions[s],
  5124. f = a.t;
  5125. (f == i || f > r && i > f || n && f == e) && a.f.apply(a.o, a.p)
  5126. }
  5127. }, t._appendQueueProps = function(t) {
  5128. var n, r, i, s, o;
  5129. for (var u in t)
  5130. if (void 0 === this._initQueueProps[u]) {
  5131. if (r = this._target[u], n = e._plugins[u])
  5132. for (i = 0, s = n.length; s > i; i++) r = n[i].init(this, u, r);
  5133. this._initQueueProps[u] = this._curQueueProps[u] = void 0 === r ? null : r
  5134. } else r = this._curQueueProps[u];
  5135. for (var u in t) {
  5136. if (r = this._curQueueProps[u], n = e._plugins[u])
  5137. for (o = o || {}, i = 0, s = n.length; s > i; i++) n[i].step && n[i].step(this, u, r, t[u], o);
  5138. this._curQueueProps[u] = t[u]
  5139. }
  5140. return o && this._appendQueueProps(o), this._curQueueProps
  5141. }, t._cloneProps = function(e) {
  5142. var t = {};
  5143. for (var n in e) t[n] = e[n];
  5144. return t
  5145. }, t._addStep = function(e) {
  5146. return e.d > 0 && (this._steps.push(e), e.t = this.duration, this.duration += e.d), this
  5147. }, t._addAction = function(e) {
  5148. return e.t = this.duration, this._actions.push(e), this
  5149. }, t._set = function(e, t) {
  5150. for (var n in e) t[n] = e[n]
  5151. }, createjs.Tween = e
  5152. }(), this.createjs = this.createjs || {},
  5153. function() {
  5154. "use strict";
  5155. var e = function(e, t, n) {
  5156. this.initialize(e, t, n)
  5157. },
  5158. t = e.prototype = new createjs.EventDispatcher;
  5159. t.ignoreGlobalPause = !1, t.duration = 0, t.loop = !1, t.position = null, t._paused = !1, t._tweens = null, t._labels = null, t._labelList = null, t._prevPosition = 0, t._prevPos = -1, t._useTicks = !1, t.initialize = function(e, t, n) {
  5160. this._tweens = [], n && (this._useTicks = n.useTicks, this.loop = n.loop, this.ignoreGlobalPause = n.ignoreGlobalPause, n.onChange && this.addEventListener("change", n.onChange)), e && this.addTween.apply(this, e), this.setLabels(t), n && n.paused ? this._paused = !0 : createjs.Tween._register(this, !0), n && null != n.position && this.setPosition(n.position, createjs.Tween.NONE)
  5161. }, t.addTween = function(e) {
  5162. var t = arguments.length;
  5163. if (t > 1) {
  5164. for (var n = 0; t > n; n++) this.addTween(arguments[n]);
  5165. return arguments[0]
  5166. }
  5167. return 0 == t ? null : (this.removeTween(e), this._tweens.push(e), e.setPaused(!0), e._paused = !1, e._useTicks = this._useTicks, e.duration > this.duration && (this.duration = e.duration), this._prevPos >= 0 && e.setPosition(this._prevPos, createjs.Tween.NONE), e)
  5168. }, t.removeTween = function(e) {
  5169. var t = arguments.length;
  5170. if (t > 1) {
  5171. for (var n = !0, r = 0; t > r; r++) n = n && this.removeTween(arguments[r]);
  5172. return n
  5173. }
  5174. if (0 == t) return !1;
  5175. for (var i = this._tweens, r = i.length; r--;)
  5176. if (i[r] == e) return i.splice(r, 1), e.duration >= this.duration && this.updateDuration(), !0;
  5177. return !1
  5178. }, t.addLabel = function(e, t) {
  5179. this._labels[e] = t;
  5180. var n = this._labelList;
  5181. if (n) {
  5182. for (var r = 0, i = n.length; i > r && !(t < n[r].position); r++);
  5183. n.splice(r, 0, {
  5184. label: e,
  5185. position: t
  5186. })
  5187. }
  5188. }, t.setLabels = function(e) {
  5189. this._labels = e ? e : {}
  5190. }, t.getLabels = function() {
  5191. var e = this._labelList;
  5192. if (!e) {
  5193. e = this._labelList = [];
  5194. var t = this._labels;
  5195. for (var n in t) e.push({
  5196. label: n,
  5197. position: t[n]
  5198. });
  5199. e.sort(function(e, t) {
  5200. return e.position - t.position
  5201. })
  5202. }
  5203. return e
  5204. }, t.getCurrentLabel = function() {
  5205. var e = this.getLabels(),
  5206. t = this.position,
  5207. n = e.length;
  5208. if (n) {
  5209. for (var r = 0; n > r && !(t < e[r].position); r++);
  5210. return 0 == r ? null : e[r - 1].label
  5211. }
  5212. return null
  5213. }, t.gotoAndPlay = function(e) {
  5214. this.setPaused(!1), this._goto(e)
  5215. }, t.gotoAndStop = function(e) {
  5216. this.setPaused(!0), this._goto(e)
  5217. }, t.setPosition = function(e, t) {
  5218. 0 > e && (e = 0);
  5219. var n = this.loop ? e % this.duration : e,
  5220. r = !this.loop && e >= this.duration;
  5221. if (n == this._prevPos) return r;
  5222. this._prevPosition = e, this.position = this._prevPos = n;
  5223. for (var i = 0, s = this._tweens.length; s > i; i++)
  5224. if (this._tweens[i].setPosition(n, t), n != this._prevPos) return !1;
  5225. return r && this.setPaused(!0), this.dispatchEvent("change"), r
  5226. }, t.setPaused = function(e) {
  5227. this._paused = !!e, createjs.Tween._register(this, !e)
  5228. }, t.updateDuration = function() {
  5229. this.duration = 0;
  5230. for (var e = 0, t = this._tweens.length; t > e; e++) {
  5231. var n = this._tweens[e];
  5232. n.duration > this.duration && (this.duration = n.duration)
  5233. }
  5234. }, t.tick = function(e) {
  5235. this.setPosition(this._prevPosition + e)
  5236. }, t.resolve = function(e) {
  5237. var t = parseFloat(e);
  5238. return isNaN(t) && (t = this._labels[e]), t
  5239. }, t.toString = function() {
  5240. return "[Timeline]"
  5241. }, t.clone = function() {
  5242. throw "Timeline can not be cloned."
  5243. }, t._goto = function(e) {
  5244. var t = this.resolve(e);
  5245. null != t && this.setPosition(t)
  5246. }, createjs.Timeline = e
  5247. }(), this.createjs = this.createjs || {},
  5248. function() {
  5249. "use strict";
  5250. var e = function() {
  5251. throw "Ease cannot be instantiated."
  5252. };
  5253. e.linear = function(e) {
  5254. return e
  5255. }, e.none = e.linear, e.get = function(e) {
  5256. return -1 > e && (e = -1), e > 1 && (e = 1),
  5257. function(t) {
  5258. return 0 == e ? t : 0 > e ? t * (t * -e + 1 + e) : t * ((2 - t) * e + (1 - e))
  5259. }
  5260. }, e.getPowIn = function(e) {
  5261. return function(t) {
  5262. return Math.pow(t, e)
  5263. }
  5264. }, e.getPowOut = function(e) {
  5265. return function(t) {
  5266. return 1 - Math.pow(1 - t, e)
  5267. }
  5268. }, e.getPowInOut = function(e) {
  5269. return function(t) {
  5270. return (t *= 2) < 1 ? .5 * Math.pow(t, e) : 1 - .5 * Math.abs(Math.pow(2 - t, e))
  5271. }
  5272. }, e.quadIn = e.getPowIn(2), e.quadOut = e.getPowOut(2), e.quadInOut = e.getPowInOut(2), e.cubicIn = e.getPowIn(3), e.cubicOut = e.getPowOut(3), e.cubicInOut = e.getPowInOut(3), e.quartIn = e.getPowIn(4), e.quartOut = e.getPowOut(4), e.quartInOut = e.getPowInOut(4), e.quintIn = e.getPowIn(5), e.quintOut = e.getPowOut(5), e.quintInOut = e.getPowInOut(5), e.sineIn = function(e) {
  5273. return 1 - Math.cos(e * Math.PI / 2)
  5274. }, e.sineOut = function(e) {
  5275. return Math.sin(e * Math.PI / 2)
  5276. }, e.sineInOut = function(e) {
  5277. return -.5 * (Math.cos(Math.PI * e) - 1)
  5278. }, e.getBackIn = function(e) {
  5279. return function(t) {
  5280. return t * t * ((e + 1) * t - e)
  5281. }
  5282. }, e.backIn = e.getBackIn(1.7), e.getBackOut = function(e) {
  5283. return function(t) {
  5284. return --t * t * ((e + 1) * t + e) + 1
  5285. }
  5286. }, e.backOut = e.getBackOut(1.7), e.getBackInOut = function(e) {
  5287. return e *= 1.525,
  5288. function(t) {
  5289. return (t *= 2) < 1 ? .5 * t * t * ((e + 1) * t - e) : .5 * ((t -= 2) * t * ((e + 1) * t + e) + 2)
  5290. }
  5291. }, e.backInOut = e.getBackInOut(1.7), e.circIn = function(e) {
  5292. return -(Math.sqrt(1 - e * e) - 1)
  5293. }, e.circOut = function(e) {
  5294. return Math.sqrt(1 - --e * e)
  5295. }, e.circInOut = function(e) {
  5296. return (e *= 2) < 1 ? -.5 * (Math.sqrt(1 - e * e) - 1) : .5 * (Math.sqrt(1 - (e -= 2) * e) + 1)
  5297. }, e.bounceIn = function(t) {
  5298. return 1 - e.bounceOut(1 - t)
  5299. }, e.bounceOut = function(e) {
  5300. return 1 / 2.75 > e ? 7.5625 * e * e : 2 / 2.75 > e ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : 2.5 / 2.75 > e ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375
  5301. }, e.bounceInOut = function(t) {
  5302. return .5 > t ? .5 * e.bounceIn(2 * t) : .5 * e.bounceOut(2 * t - 1) + .5
  5303. }, e.getElasticIn = function(e, t) {
  5304. var n = 2 * Math.PI;
  5305. return function(r) {
  5306. if (0 == r || 1 == r) return r;
  5307. var i = t / n * Math.asin(1 / e);
  5308. return -(e * Math.pow(2, 10 * (r -= 1)) * Math.sin((r - i) * n / t))
  5309. }
  5310. }, e.elasticIn = e.getElasticIn(1, .3), e.getElasticOut = function(e, t) {
  5311. var n = 2 * Math.PI;
  5312. return function(r) {
  5313. if (0 == r || 1 == r) return r;
  5314. var i = t / n * Math.asin(1 / e);
  5315. return e * Math.pow(2, -10 * r) * Math.sin((r - i) * n / t) + 1
  5316. }
  5317. }, e.elasticOut = e.getElasticOut(1, .3), e.getElasticInOut = function(e, t) {
  5318. var n = 2 * Math.PI;
  5319. return function(r) {
  5320. var i = t / n * Math.asin(1 / e);
  5321. return (r *= 2) < 1 ? -.5 * e * Math.pow(2, 10 * (r -= 1)) * Math.sin((r - i) * n / t) : .5 * e * Math.pow(2, -10 * (r -= 1)) * Math.sin((r - i) * n / t) + 1
  5322. }
  5323. }, e.elasticInOut = e.getElasticInOut(1, .3 * 1.5), createjs.Ease = e
  5324. }(), this.createjs = this.createjs || {},
  5325. function() {
  5326. "use strict";
  5327. var e = function() {
  5328. throw "MotionGuidePlugin cannot be instantiated."
  5329. };
  5330. e.priority = 0, e._rotOffS, e._rotOffE, e._rotNormS, e._rotNormE, e.install = function() {
  5331. return createjs.Tween.installPlugin(e, ["guide", "x", "y", "rotation"]), createjs.Tween.IGNORE
  5332. }, e.init = function(e, t, n) {
  5333. var r = e.target;
  5334. return r.hasOwnProperty("x") || (r.x = 0), r.hasOwnProperty("y") || (r.y = 0), r.hasOwnProperty("rotation") || (r.rotation = 0), "rotation" == t && (e.__needsRot = !0), "guide" == t ? null : n
  5335. }, e.step = function(t, n, r, i, s) {
  5336. if ("rotation" == n && (t.__rotGlobalS = r, t.__rotGlobalE = i, e.testRotData(t, s)), "guide" != n) return i;
  5337. var o, u = i;
  5338. u.hasOwnProperty("path") || (u.path = []);
  5339. var f = u.path;
  5340. if (u.hasOwnProperty("end") || (u.end = 1), u.hasOwnProperty("start") || (u.start = r && r.hasOwnProperty("end") && r.path === f ? r.end : 0), u.hasOwnProperty("_segments") && u._length) return i;
  5341. var l = f.length,
  5342. c = 10;
  5343. if (!(l >= 6 && 0 == (l - 2) % 4)) throw "invalid 'path' data, please see documentation for valid paths";
  5344. u._segments = [], u._length = 0;
  5345. for (var h = 2; l > h; h += 4) {
  5346. for (var p, d, v = f[h - 2], m = f[h - 1], g = f[h + 0], y = f[h + 1], b = f[h + 2], w = f[h + 3], E = v, S = m, x = 0, T = [], N = 1; c >= N; N++) {
  5347. var C = N / c,
  5348. k = 1 - C;
  5349. p = k * k * v + 2 * k * C * g + C * C * b, d = k * k * m + 2 * k * C * y + C * C * w, x += T[T.push(Math.sqrt((o = p - E) * o + (o = d - S) * o)) - 1], E = p, S = d
  5350. }
  5351. u._segments.push(x), u._segments.push(T), u._length += x
  5352. }
  5353. o = u.orient, u.orient = !0;
  5354. var L = {};
  5355. return e.calc(u, u.start, L), t.__rotPathS = Number(L.rotation.toFixed(5)), e.calc(u, u.end, L), t.__rotPathE = Number(L.rotation.toFixed(5)), u.orient = !1, e.calc(u, u.end, s), u.orient = o, u.orient ? (t.__guideData = u, e.testRotData(t, s), i) : i
  5356. }, e.testRotData = function(e, t) {
  5357. if (void 0 === e.__rotGlobalS || void 0 === e.__rotGlobalE) {
  5358. if (e.__needsRot) return;
  5359. e.__rotGlobalS = e.__rotGlobalE = void 0 !== e._curQueueProps.rotation ? e._curQueueProps.rotation : t.rotation = e.target.rotation || 0
  5360. }
  5361. if (void 0 !== e.__guideData) {
  5362. var n = e.__guideData,
  5363. r = e.__rotGlobalE - e.__rotGlobalS,
  5364. i = e.__rotPathE - e.__rotPathS,
  5365. s = r - i;
  5366. if ("auto" == n.orient) s > 180 ? s -= 360 : -180 > s && (s += 360);
  5367. else if ("cw" == n.orient) {
  5368. for (; 0 > s;) s += 360;
  5369. 0 == s && r > 0 && 180 != r && (s += 360)
  5370. } else if ("ccw" == n.orient) {
  5371. for (s = r - (i > 180 ? 360 - i : i); s > 0;) s -= 360;
  5372. 0 == s && 0 > r && -180 != r && (s -= 360)
  5373. }
  5374. n.rotDelta = s, n.rotOffS = e.__rotGlobalS - e.__rotPathS, e.__rotGlobalS = e.__rotGlobalE = e.__guideData = e.__needsRot = void 0
  5375. }
  5376. }, e.tween = function(t, n, r, i, s, o, u) {
  5377. var f = s.guide;
  5378. if (void 0 == f || f === i.guide) return r;
  5379. if (f.lastRatio != o) {
  5380. var l = (f.end - f.start) * (u ? f.end : o) + f.start;
  5381. switch (e.calc(f, l, t.target), f.orient) {
  5382. case "cw":
  5383. case "ccw":
  5384. case "auto":
  5385. t.target.rotation += f.rotOffS + f.rotDelta * o;
  5386. break;
  5387. case "fixed":
  5388. default:
  5389. t.target.rotation += f.rotOffS
  5390. }
  5391. f.lastRatio = o
  5392. }
  5393. return "rotation" != n || f.orient && "false" != f.orient ? t.target[n] : r
  5394. }, e.calc = function(t, n, r) {
  5395. void 0 == t._segments && e.validate(t), void 0 == r && (r = {
  5396. x: 0,
  5397. y: 0,
  5398. rotation: 0
  5399. });
  5400. for (var i = t._segments, s = t.path, o = t._length * n, u = i.length - 2, f = 0; o > i[f] && u > f;) o -= i[f], f += 2;
  5401. var l = i[f + 1],
  5402. c = 0;
  5403. for (u = l.length - 1; o > l[c] && u > c;) o -= l[c], c++;
  5404. var h = c / ++u + o / (u * l[c]);
  5405. f = 2 * f + 2;
  5406. var p = 1 - h;
  5407. return r.x = p * p * s[f - 2] + 2 * p * h * s[f + 0] + h * h * s[f + 2], r.y = p * p * s[f - 1] + 2 * p * h * s[f + 1] + h * h * s[f + 3], t.orient && (r.rotation = 57.2957795 * Math.atan2((s[f + 1] - s[f - 1]) * p + (s[f + 3] - s[f + 1]) * h, (s[f + 0] - s[f - 2]) * p + (s[f + 2] - s[f + 0]) * h)), r
  5408. }, createjs.MotionGuidePlugin = e
  5409. }(), this.createjs = this.createjs || {},
  5410. function() {
  5411. "use strict";
  5412. var e = createjs.TweenJS = createjs.TweenJS || {};
  5413. e.version = "0.5.1", e.buildDate = "Thu, 12 Dec 2013 23:33:38 GMT"
  5414. }();
  5415. this.createjs = this.createjs || {},
  5416. function() {
  5417. var e = createjs.SoundJS = createjs.SoundJS || {};
  5418. e.version = "0.5.2", e.buildDate = "Thu, 12 Dec 2013 23:33:37 GMT"
  5419. }(), this.createjs = this.createjs || {},
  5420. function() {
  5421. "use strict";
  5422. var e = function() {},
  5423. t = e.prototype;
  5424. e.initialize = function(e) {
  5425. e.addEventListener = t.addEventListener, e.on = t.on, e.removeEventListener = e.off = t.removeEventListener, e.removeAllEventListeners = t.removeAllEventListeners, e.hasEventListener = t.hasEventListener, e.dispatchEvent = t.dispatchEvent, e._dispatchEvent = t._dispatchEvent, e.willTrigger = t.willTrigger
  5426. }, t._listeners = null, t._captureListeners = null, t.initialize = function() {}, t.addEventListener = function(e, t, n) {
  5427. var r;
  5428. r = n ? this._captureListeners = this._captureListeners || {} : this._listeners = this._listeners || {};
  5429. var i = r[e];
  5430. return i && this.removeEventListener(e, t, n), i = r[e], i ? i.push(t) : r[e] = [t], t
  5431. }, t.on = function(e, t, n, r, i, s) {
  5432. return t.handleEvent && (n = n || t, t = t.handleEvent), n = n || this, this.addEventListener(e, function(e) {
  5433. t.call(n, e, i), r && e.remove()
  5434. }, s)
  5435. }, t.removeEventListener = function(e, t, n) {
  5436. var r = n ? this._captureListeners : this._listeners;
  5437. if (r) {
  5438. var i = r[e];
  5439. if (i)
  5440. for (var s = 0, o = i.length; o > s; s++)
  5441. if (i[s] == t) {
  5442. 1 == o ? delete r[e] : i.splice(s, 1);
  5443. break
  5444. }
  5445. }
  5446. }, t.off = t.removeEventListener, t.removeAllEventListeners = function(e) {
  5447. e ? (this._listeners && delete this._listeners[e], this._captureListeners && delete this._captureListeners[e]) : this._listeners = this._captureListeners = null
  5448. }, t.dispatchEvent = function(e, t) {
  5449. if ("string" == typeof e) {
  5450. var n = this._listeners;
  5451. if (!n || !n[e]) return !1;
  5452. e = new createjs.Event(e)
  5453. }
  5454. if (e.target = t || this, e.bubbles && this.parent) {
  5455. for (var r = this, i = [r]; r.parent;) i.push(r = r.parent);
  5456. var s, o = i.length;
  5457. for (s = o - 1; s >= 0 && !e.propagationStopped; s--) i[s]._dispatchEvent(e, 1 + (0 == s));
  5458. for (s = 1; o > s && !e.propagationStopped; s++) i[s]._dispatchEvent(e, 3)
  5459. } else this._dispatchEvent(e, 2);
  5460. return e.defaultPrevented
  5461. }, t.hasEventListener = function(e) {
  5462. var t = this._listeners,
  5463. n = this._captureListeners;
  5464. return !!(t && t[e] || n && n[e])
  5465. }, t.willTrigger = function(e) {
  5466. for (var t = this; t;) {
  5467. if (t.hasEventListener(e)) return !0;
  5468. t = t.parent
  5469. }
  5470. return !1
  5471. }, t.toString = function() {
  5472. return "[EventDispatcher]"
  5473. }, t._dispatchEvent = function(e, t) {
  5474. var n, r = 1 == t ? this._captureListeners : this._listeners;
  5475. if (e && r) {
  5476. var i = r[e.type];
  5477. if (!i || !(n = i.length)) return;
  5478. e.currentTarget = this, e.eventPhase = t, e.removed = !1, i = i.slice();
  5479. for (var s = 0; n > s && !e.immediatePropagationStopped; s++) {
  5480. var o = i[s];
  5481. o.handleEvent ? o.handleEvent(e) : o(e), e.removed && (this.off(e.type, o, 1 == t), e.removed = !1)
  5482. }
  5483. }
  5484. }, createjs.EventDispatcher = e
  5485. }(), this.createjs = this.createjs || {},
  5486. function() {
  5487. "use strict";
  5488. var e = function(e, t, n) {
  5489. this.initialize(e, t, n)
  5490. },
  5491. t = e.prototype;
  5492. t.type = null, t.target = null, t.currentTarget = null, t.eventPhase = 0, t.bubbles = !1, t.cancelable = !1, t.timeStamp = 0, t.defaultPrevented = !1, t.propagationStopped = !1, t.immediatePropagationStopped = !1, t.removed = !1, t.initialize = function(e, t, n) {
  5493. this.type = e, this.bubbles = t, this.cancelable = n, this.timeStamp = (new Date).getTime()
  5494. }, t.preventDefault = function() {
  5495. this.defaultPrevented = !0
  5496. }, t.stopPropagation = function() {
  5497. this.propagationStopped = !0
  5498. }, t.stopImmediatePropagation = function() {
  5499. this.immediatePropagationStopped = this.propagationStopped = !0
  5500. }, t.remove = function() {
  5501. this.removed = !0
  5502. }, t.clone = function() {
  5503. return new e(this.type, this.bubbles, this.cancelable)
  5504. }, t.toString = function() {
  5505. return "[Event (type=" + this.type + ")]"
  5506. }, createjs.Event = e
  5507. }(), this.createjs = this.createjs || {},
  5508. function() {
  5509. "use strict";
  5510. createjs.indexOf = function(e, t) {
  5511. for (var n = 0, r = e.length; r > n; n++)
  5512. if (t === e[n]) return n;
  5513. return -1
  5514. }
  5515. }(), this.createjs = this.createjs || {},
  5516. function() {
  5517. "use strict";
  5518. createjs.proxy = function(e, t) {
  5519. var n = Array.prototype.slice.call(arguments, 2);
  5520. return function() {
  5521. return e.apply(t, Array.prototype.slice.call(arguments, 0).concat(n))
  5522. }
  5523. }
  5524. }(), this.createjs = this.createjs || {},
  5525. function() {
  5526. "use strict";
  5527. function e() {
  5528. throw "Sound cannot be instantiated"
  5529. }
  5530. function t(e, t) {
  5531. this.init(e, t)
  5532. }
  5533. function n() {
  5534. this.isDefault = !0, this.addEventListener = this.removeEventListener = this.removeAllEventListeners = this.dispatchEvent = this.hasEventListener = this._listeners = this._interrupt = this._playFailed = this.pause = this.resume = this.play = this._beginPlaying = this._cleanUp = this.stop = this.setMasterVolume = this.setVolume = this.mute = this.setMute = this.getMute = this.setPan = this.getPosition = this.setPosition = this.playFailed = function() {
  5535. return !1
  5536. }, this.getVolume = this.getPan = this.getDuration = function() {
  5537. return 0
  5538. }, this.playState = e.PLAY_FAILED, this.toString = function() {
  5539. return "[Sound Default Sound Instance]"
  5540. }
  5541. }
  5542. function r() {}
  5543. var i = e;
  5544. i.DELIMITER = "|", i.INTERRUPT_ANY = "any", i.INTERRUPT_EARLY = "early", i.INTERRUPT_LATE = "late", i.INTERRUPT_NONE = "none", i.PLAY_INITED = "playInited", i.PLAY_SUCCEEDED = "playSucceeded", i.PLAY_INTERRUPTED = "playInterrupted", i.PLAY_FINISHED = "playFinished", i.PLAY_FAILED = "playFailed", i.SUPPORTED_EXTENSIONS = ["mp3", "ogg", "mpeg", "wav", "m4a", "mp4", "aiff", "wma", "mid"], i.EXTENSION_MAP = {
  5545. m4a: "mp4"
  5546. }, i.FILE_PATTERN = /^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/, i.defaultInterruptBehavior = i.INTERRUPT_NONE, i.alternateExtensions = [], i._lastID = 0, i.activePlugin = null, i._pluginsRegistered = !1, i._masterVolume = 1, i._masterMute = !1, i._instances = [], i._idHash = {}, i._preloadHash = {}, i._defaultSoundInstance = null, i.addEventListener = null, i.removeEventListener = null, i.removeAllEventListeners = null, i.dispatchEvent = null, i.hasEventListener = null, i._listeners = null, createjs.EventDispatcher.initialize(i), i._sendFileLoadEvent = function(e) {
  5547. if (i._preloadHash[e])
  5548. for (var t = 0, n = i._preloadHash[e].length; n > t; t++) {
  5549. var r = i._preloadHash[e][t];
  5550. if (i._preloadHash[e][t] = !0, i.hasEventListener("fileload")) {
  5551. var s = new createjs.Event("fileload");
  5552. s.src = r.src, s.id = r.id, s.data = r.data, i.dispatchEvent(s)
  5553. }
  5554. }
  5555. }, i.getPreloadHandlers = function() {
  5556. return {
  5557. callback: createjs.proxy(i.initLoad, i),
  5558. types: ["sound"],
  5559. extensions: i.SUPPORTED_EXTENSIONS
  5560. }
  5561. }, i.registerPlugin = function(e) {
  5562. try {
  5563. console.log("createjs.Sound.registerPlugin has been deprecated. Please use registerPlugins.")
  5564. } catch (t) {}
  5565. return i._registerPlugin(e)
  5566. }, i._registerPlugin = function(e) {
  5567. return i._pluginsRegistered = !0, null == e ? !1 : e.isSupported() ? (i.activePlugin = new e, !0) : !1
  5568. }, i.registerPlugins = function(e) {
  5569. for (var t = 0, n = e.length; n > t; t++) {
  5570. var r = e[t];
  5571. if (i._registerPlugin(r)) return !0
  5572. }
  5573. return !1
  5574. }, i.initializeDefaultPlugins = function() {
  5575. return null != i.activePlugin ? !0 : i._pluginsRegistered ? !1 : i.registerPlugins([createjs.WebAudioPlugin, createjs.HTMLAudioPlugin]) ? !0 : !1
  5576. }, i.isReady = function() {
  5577. return null != i.activePlugin
  5578. }, i.getCapabilities = function() {
  5579. return null == i.activePlugin ? null : i.activePlugin._capabilities
  5580. }, i.getCapability = function(e) {
  5581. return null == i.activePlugin ? null : i.activePlugin._capabilities[e]
  5582. }, i.initLoad = function(e, t, n, r, s) {
  5583. e = e.replace(s, "");
  5584. var o = i.registerSound(e, n, r, !1, s);
  5585. return null == o ? !1 : o
  5586. }, i.registerSound = function(e, n, r, s, o) {
  5587. if (!i.initializeDefaultPlugins()) return !1;
  5588. if (e instanceof Object && (o = n, n = e.id, r = e.data, e = e.src), i.alternateExtensions.length) var u = i._parsePath2(e, "sound", n, r);
  5589. else var u = i._parsePath(e, "sound", n, r); if (null == u) return !1;
  5590. null != o && (e = o + e, u.src = o + u.src), null != n && (i._idHash[n] = u.src);
  5591. var a = null;
  5592. null != r && (isNaN(r.channels) ? isNaN(r) || (a = parseInt(r)) : a = parseInt(r.channels));
  5593. var f = i.activePlugin.register(u.src, a);
  5594. if (null != f && (null != f.numChannels && (a = f.numChannels), t.create(u.src, a), null != r && isNaN(r) ? r.channels = u.data.channels = a || t.maxPerChannel() : r = u.data = a || t.maxPerChannel(), null != f.tag ? u.tag = f.tag : f.src && (u.src = f.src), null != f.completeHandler && (u.completeHandler = f.completeHandler), f.type && (u.type = f.type)), 0 != s)
  5595. if (i._preloadHash[u.src] || (i._preloadHash[u.src] = []), i._preloadHash[u.src].push({
  5596. src: e,
  5597. id: n,
  5598. data: r
  5599. }), 1 == i._preloadHash[u.src].length) i.activePlugin.preload(u.src, f);
  5600. else if (1 == i._preloadHash[u.src][0]) return !0;
  5601. return u
  5602. }, i.registerManifest = function(e, t) {
  5603. for (var n = [], r = 0, i = e.length; i > r; r++) n[r] = createjs.Sound.registerSound(e[r].src, e[r].id, e[r].data, e[r].preload, t);
  5604. return n
  5605. }, i.removeSound = function(e, n) {
  5606. if (null == i.activePlugin) return !1;
  5607. if (e instanceof Object && (e = e.src), e = i._getSrcById(e), i.alternateExtensions.length) var r = i._parsePath2(e);
  5608. else var r = i._parsePath(e); if (null == r) return !1;
  5609. null != n && (r.src = n + r.src), e = r.src;
  5610. for (var s in i._idHash) i._idHash[s] == e && delete i._idHash[s];
  5611. return t.removeSrc(e), delete i._preloadHash[e], i.activePlugin.removeSound(e), !0
  5612. }, i.removeManifest = function(e, t) {
  5613. for (var n = [], r = 0, i = e.length; i > r; r++) n[r] = createjs.Sound.removeSound(e[r].src, t);
  5614. return n
  5615. }, i.removeAllSounds = function() {
  5616. i._idHash = {}, i._preloadHash = {}, t.removeAll(), i.activePlugin.removeAllSounds()
  5617. }, i.loadComplete = function(e) {
  5618. if (i.alternateExtensions.length) var t = i._parsePath2(e, "sound");
  5619. else var t = i._parsePath(e, "sound");
  5620. return e = t ? i._getSrcById(t.src) : i._getSrcById(e), 1 == i._preloadHash[e][0]
  5621. }, i._parsePath = function(e, t, n, r) {
  5622. "string" != typeof e && (e = e.toString());
  5623. var s = e.split(i.DELIMITER);
  5624. if (s.length > 1) try {
  5625. console.log('createjs.Sound.DELIMITER "|" loading approach has been deprecated. Please use the new alternateExtensions property.')
  5626. } catch (o) {}
  5627. for (var u = {
  5628. type: t || "sound",
  5629. id: n,
  5630. data: r
  5631. }, a = i.getCapabilities(), f = 0, l = s.length; l > f; f++) {
  5632. var c = s[f],
  5633. h = c.match(i.FILE_PATTERN);
  5634. if (null == h) return !1;
  5635. var p = h[4],
  5636. d = h[5];
  5637. if (a[d] && createjs.indexOf(i.SUPPORTED_EXTENSIONS, d) > -1) return u.name = p, u.src = c, u.extension = d, u
  5638. }
  5639. return null
  5640. }, i._parsePath2 = function(e, t, n, r) {
  5641. "string" != typeof e && (e = e.toString());
  5642. var s = e.match(i.FILE_PATTERN);
  5643. if (null == s) return !1;
  5644. for (var o = s[4], u = s[5], a = i.getCapabilities(), f = 0; !a[u];)
  5645. if (u = i.alternateExtensions[f++], f > i.alternateExtensions.length) return null;
  5646. e = e.replace("." + s[5], "." + u);
  5647. var l = {
  5648. type: t || "sound",
  5649. id: n,
  5650. data: r
  5651. };
  5652. return l.name = o, l.src = e, l.extension = u, l
  5653. }, i.play = function(e, t, n, r, s, o, u) {
  5654. var a = i.createInstance(e),
  5655. f = i._playInstance(a, t, n, r, s, o, u);
  5656. return f || a.playFailed(), a
  5657. }, i.createInstance = function(n) {
  5658. if (!i.initializeDefaultPlugins()) return i._defaultSoundInstance;
  5659. if (n = i._getSrcById(n), i.alternateExtensions.length) var r = i._parsePath2(n, "sound");
  5660. else var r = i._parsePath(n, "sound");
  5661. var s = null;
  5662. return null != r && null != r.src ? (t.create(r.src), s = i.activePlugin.create(r.src)) : s = e._defaultSoundInstance, s.uniqueId = i._lastID++, s
  5663. }, i.setVolume = function(e) {
  5664. if (null == Number(e)) return !1;
  5665. if (e = Math.max(0, Math.min(1, e)), i._masterVolume = e, !this.activePlugin || !this.activePlugin.setVolume || !this.activePlugin.setVolume(e))
  5666. for (var t = this._instances, n = 0, r = t.length; r > n; n++) t[n].setMasterVolume(e)
  5667. }, i.getVolume = function() {
  5668. return i._masterVolume
  5669. }, i.setMute = function(e) {
  5670. if (null == e || void 0 == e) return !1;
  5671. if (this._masterMute = e, !this.activePlugin || !this.activePlugin.setMute || !this.activePlugin.setMute(e))
  5672. for (var t = this._instances, n = 0, r = t.length; r > n; n++) t[n].setMasterMute(e);
  5673. return !0
  5674. }, i.getMute = function() {
  5675. return this._masterMute
  5676. }, i.stop = function() {
  5677. for (var e = this._instances, t = e.length; t--;) e[t].stop()
  5678. }, i._playInstance = function(e, t, n, r, s, o, u) {
  5679. if (t instanceof Object && (n = t.delay, r = t.offset, s = t.loop, o = t.volume, u = t.pan, t = t.interrupt), t = t || i.defaultInterruptBehavior, null == n && (n = 0), null == r && (r = e.getPosition()), null == s && (s = 0), null == o && (o = e.volume), null == u && (u = e.pan), 0 == n) {
  5680. var a = i._beginPlaying(e, t, r, s, o, u);
  5681. if (!a) return !1
  5682. } else {
  5683. var f = setTimeout(function() {
  5684. i._beginPlaying(e, t, r, s, o, u)
  5685. }, n);
  5686. e._delayTimeoutId = f
  5687. }
  5688. return this._instances.push(e), !0
  5689. }, i._beginPlaying = function(e, n, r, i, s, o) {
  5690. if (!t.add(e, n)) return !1;
  5691. var u = e._beginPlaying(r, i, s, o);
  5692. if (!u) {
  5693. var a = createjs.indexOf(this._instances, e);
  5694. return a > -1 && this._instances.splice(a, 1), !1
  5695. }
  5696. return !0
  5697. }, i._getSrcById = function(e) {
  5698. return null == i._idHash || null == i._idHash[e] ? e : i._idHash[e]
  5699. }, i._playFinished = function(e) {
  5700. t.remove(e);
  5701. var n = createjs.indexOf(this._instances, e);
  5702. n > -1 && this._instances.splice(n, 1)
  5703. }, createjs.Sound = e, t.channels = {}, t.create = function(e, n) {
  5704. var r = t.get(e);
  5705. return null == r ? (t.channels[e] = new t(e, n), !0) : !1
  5706. }, t.removeSrc = function(e) {
  5707. var n = t.get(e);
  5708. return null == n ? !1 : (n.removeAll(), delete t.channels[e], !0)
  5709. }, t.removeAll = function() {
  5710. for (var e in t.channels) t.channels[e].removeAll();
  5711. t.channels = {}
  5712. }, t.add = function(e, n) {
  5713. var r = t.get(e.src);
  5714. return null == r ? !1 : r.add(e, n)
  5715. }, t.remove = function(e) {
  5716. var n = t.get(e.src);
  5717. return null == n ? !1 : (n.remove(e), !0)
  5718. }, t.maxPerChannel = function() {
  5719. return s.maxDefault
  5720. }, t.get = function(e) {
  5721. return t.channels[e]
  5722. };
  5723. var s = t.prototype;
  5724. s.src = null, s.max = null, s.maxDefault = 100, s.length = 0, s.init = function(e, t) {
  5725. this.src = e, this.max = t || this.maxDefault, -1 == this.max && (this.max = this.maxDefault), this._instances = []
  5726. }, s.get = function(e) {
  5727. return this._instances[e]
  5728. }, s.add = function(e, t) {
  5729. return this.getSlot(t, e) ? (this._instances.push(e), this.length++, !0) : !1
  5730. }, s.remove = function(e) {
  5731. var t = createjs.indexOf(this._instances, e);
  5732. return -1 == t ? !1 : (this._instances.splice(t, 1), this.length--, !0)
  5733. }, s.removeAll = function() {
  5734. for (var e = this.length - 1; e >= 0; e--) this._instances[e].stop()
  5735. }, s.getSlot = function(t) {
  5736. for (var n, r, i = 0, s = this.max; s > i; i++) {
  5737. if (n = this.get(i), null == n) return !0;
  5738. (t != e.INTERRUPT_NONE || n.playState == e.PLAY_FINISHED) && (0 != i ? n.playState == e.PLAY_FINISHED || n.playState == e.PLAY_INTERRUPTED || n.playState == e.PLAY_FAILED ? r = n : (t == e.INTERRUPT_EARLY && n.getPosition() < r.getPosition() || t == e.INTERRUPT_LATE && n.getPosition() > r.getPosition()) && (r = n) : r = n)
  5739. }
  5740. return null != r ? (r._interrupt(), this.remove(r), !0) : !1
  5741. }, s.toString = function() {
  5742. return "[Sound SoundChannel]"
  5743. }, e._defaultSoundInstance = new n, r.init = function() {
  5744. var e = window.navigator.userAgent;
  5745. r.isFirefox = e.indexOf("Firefox") > -1, r.isOpera = null != window.opera, r.isChrome = e.indexOf("Chrome") > -1, r.isIOS = e.indexOf("iPod") > -1 || e.indexOf("iPhone") > -1 || e.indexOf("iPad") > -1, r.isAndroid = e.indexOf("Android") > -1, r.isBlackberry = e.indexOf("Blackberry") > -1
  5746. }, r.init(), createjs.Sound.BrowserDetect = r
  5747. }(), this.createjs = this.createjs || {},
  5748. function() {
  5749. "use strict";
  5750. function e() {
  5751. this._init()
  5752. }
  5753. var t = e;
  5754. t._capabilities = null, t.isSupported = function() {
  5755. var e = createjs.Sound.BrowserDetect.isIOS || createjs.Sound.BrowserDetect.isAndroid || createjs.Sound.BrowserDetect.isBlackberry;
  5756. return "file:" != location.protocol || e || this._isFileXHRSupported() ? (t._generateCapabilities(), null == t.context ? !1 : !0) : !1
  5757. }, t._isFileXHRSupported = function() {
  5758. var e = !0,
  5759. t = new XMLHttpRequest;
  5760. try {
  5761. t.open("GET", "fail.fail", !1)
  5762. } catch (n) {
  5763. return e = !1
  5764. }
  5765. t.onerror = function() {
  5766. e = !1
  5767. }, t.onload = function() {
  5768. e = 404 == this.status || 200 == this.status || 0 == this.status && "" != this.response
  5769. };
  5770. try {
  5771. t.send()
  5772. } catch (n) {
  5773. e = !1
  5774. }
  5775. return e
  5776. }, t._generateCapabilities = function() {
  5777. if (null == t._capabilities) {
  5778. var e = document.createElement("audio");
  5779. if (null == e.canPlayType) return null;
  5780. if (window.webkitAudioContext) t.context = new webkitAudioContext;
  5781. else {
  5782. if (!window.AudioContext) return null;
  5783. t.context = new AudioContext
  5784. }
  5785. t._compatibilitySetUp(), t.playEmptySound(), t._capabilities = {
  5786. panning: !0,
  5787. volume: !0,
  5788. tracks: -1
  5789. };
  5790. for (var n = createjs.Sound.SUPPORTED_EXTENSIONS, r = createjs.Sound.EXTENSION_MAP, i = 0, s = n.length; s > i; i++) {
  5791. var o = n[i],
  5792. u = r[o] || o;
  5793. t._capabilities[o] = "no" != e.canPlayType("audio/" + o) && "" != e.canPlayType("audio/" + o) || "no" != e.canPlayType("audio/" + u) && "" != e.canPlayType("audio/" + u)
  5794. }
  5795. t.context.destination.numberOfChannels < 2 && (t._capabilities.panning = !1), t.dynamicsCompressorNode = t.context.createDynamicsCompressor(), t.dynamicsCompressorNode.connect(t.context.destination), t.gainNode = t.context.createGain(), t.gainNode.connect(t.dynamicsCompressorNode)
  5796. }
  5797. }, t._compatibilitySetUp = function() {
  5798. if (!t.context.createGain) {
  5799. t.context.createGain = t.context.createGainNode;
  5800. var e = t.context.createBufferSource();
  5801. e.__proto__.start = e.__proto__.noteGrainOn, e.__proto__.stop = e.__proto__.noteOff, this._panningModel = 0
  5802. }
  5803. }, t.playEmptySound = function() {
  5804. var e = this.context.createBuffer(1, 1, 22050),
  5805. t = this.context.createBufferSource();
  5806. t.buffer = e, t.connect(this.context.destination), t.start(0, 0, 0)
  5807. };
  5808. var n = e.prototype;
  5809. n._capabilities = null, n._volume = 1, n.context = null, n._panningModel = "equalpower", n.dynamicsCompressorNode = null, n.gainNode = null, n._arrayBuffers = null, n._init = function() {
  5810. this._capabilities = t._capabilities, this._arrayBuffers = {}, this.context = t.context, this.gainNode = t.gainNode, this.dynamicsCompressorNode = t.dynamicsCompressorNode
  5811. }, n.register = function(e) {
  5812. this._arrayBuffers[e] = !0;
  5813. var t = new createjs.WebAudioPlugin.Loader(e, this);
  5814. return {
  5815. tag: t
  5816. }
  5817. }, n.isPreloadStarted = function(e) {
  5818. return null != this._arrayBuffers[e]
  5819. }, n.isPreloadComplete = function(e) {
  5820. return !(null == this._arrayBuffers[e] || 1 == this._arrayBuffers[e])
  5821. }, n.removeSound = function(e) {
  5822. delete this._arrayBuffers[e]
  5823. }, n.removeAllSounds = function() {
  5824. this._arrayBuffers = {}
  5825. }, n.addPreloadResults = function(e, t) {
  5826. this._arrayBuffers[e] = t
  5827. }, n._handlePreloadComplete = function() {
  5828. createjs.Sound._sendFileLoadEvent(this.src)
  5829. }, n.preload = function(e) {
  5830. this._arrayBuffers[e] = !0;
  5831. var t = new createjs.WebAudioPlugin.Loader(e, this);
  5832. t.onload = this._handlePreloadComplete, t.load()
  5833. }, n.create = function(e) {
  5834. return this.isPreloadStarted(e) || this.preload(e), new createjs.WebAudioPlugin.SoundInstance(e, this)
  5835. }, n.setVolume = function(e) {
  5836. return this._volume = e, this._updateVolume(), !0
  5837. }, n._updateVolume = function() {
  5838. var e = createjs.Sound._masterMute ? 0 : this._volume;
  5839. e != this.gainNode.gain.value && (this.gainNode.gain.value = e)
  5840. }, n.getVolume = function() {
  5841. return this._volume
  5842. }, n.setMute = function() {
  5843. return this._updateVolume(), !0
  5844. }, n.toString = function() {
  5845. return "[WebAudioPlugin]"
  5846. }, createjs.WebAudioPlugin = e
  5847. }(),
  5848. function() {
  5849. "use strict";
  5850. function e(e, t) {
  5851. this._init(e, t)
  5852. }
  5853. var t = e.prototype = new createjs.EventDispatcher;
  5854. t.src = null, t.uniqueId = -1, t.playState = null, t._owner = null, t._offset = 0, t._delay = 0, t._volume = 1;
  5855. try {
  5856. Object.defineProperty(t, "volume", {
  5857. get: function() {
  5858. return this._volume
  5859. },
  5860. set: function(e) {
  5861. return null == Number(e) ? !1 : (e = Math.max(0, Math.min(1, e)), this._volume = e, this._updateVolume(), void 0)
  5862. }
  5863. })
  5864. } catch (n) {}
  5865. t._pan = 0;
  5866. try {
  5867. Object.defineProperty(t, "pan", {
  5868. get: function() {
  5869. return this._pan
  5870. },
  5871. set: function(e) {
  5872. return this._owner._capabilities.panning && null != Number(e) ? (e = Math.max(-1, Math.min(1, e)), this._pan = e, this.panNode.setPosition(e, 0, -.5), void 0) : !1
  5873. }
  5874. })
  5875. } catch (n) {}
  5876. t._duration = 0, t._remainingLoops = 0, t._delayTimeoutId = null, t._soundCompleteTimeout = null, t.gainNode = null, t.panNode = null, t.sourceNode = null, t._sourceNodeNext = null, t._muted = !1, t._paused = !1, t._startTime = 0, t._endedHandler = null, t._sendEvent = function(e) {
  5877. var t = new createjs.Event(e);
  5878. this.dispatchEvent(t)
  5879. }, t._init = function(e, t) {
  5880. this._owner = t, this.src = e, this.gainNode = this._owner.context.createGain(), this.panNode = this._owner.context.createPanner(), this.panNode.panningModel = this._owner._panningModel, this.panNode.connect(this.gainNode), this._owner.isPreloadComplete(this.src) && (this._duration = 1e3 * this._owner._arrayBuffers[this.src].duration), this._endedHandler = createjs.proxy(this._handleSoundComplete, this)
  5881. }, t._cleanUp = function() {
  5882. this.sourceNode && this.playState == createjs.Sound.PLAY_SUCCEEDED && (this.sourceNode = this._cleanUpAudioNode(this.sourceNode), this._sourceNodeNext = this._cleanUpAudioNode(this._sourceNodeNext)), 0 != this.gainNode.numberOfOutputs && this.gainNode.disconnect(0), clearTimeout(this._delayTimeoutId), clearTimeout(this._soundCompleteTimeout), this._startTime = 0, null != window.createjs && createjs.Sound._playFinished(this)
  5883. }, t._cleanUpAudioNode = function(e) {
  5884. return e && (e.stop(0), e.disconnect(this.panNode), e = null), e
  5885. }, t._interrupt = function() {
  5886. this._cleanUp(), this.playState = createjs.Sound.PLAY_INTERRUPTED, this._paused = !1, this._sendEvent("interrupted")
  5887. }, t._handleSoundReady = function() {
  5888. if (null != window.createjs) {
  5889. if (1e3 * this._offset > this.getDuration()) return this.playFailed(), void 0;
  5890. this._offset < 0 && (this._offset = 0), this.playState = createjs.Sound.PLAY_SUCCEEDED, this._paused = !1, this.gainNode.connect(this._owner.gainNode);
  5891. var e = this._owner._arrayBuffers[this.src].duration;
  5892. this.sourceNode = this._createAndPlayAudioNode(this._owner.context.currentTime - e, this._offset), this._duration = 1e3 * e, this._startTime = this.sourceNode.startTime - this._offset, this._soundCompleteTimeout = setTimeout(this._endedHandler, 1e3 * (e - this._offset)), 0 != this._remainingLoops && (this._sourceNodeNext = this._createAndPlayAudioNode(this._startTime, 0))
  5893. }
  5894. }, t._createAndPlayAudioNode = function(e, t) {
  5895. var n = this._owner.context.createBufferSource();
  5896. return n.buffer = this._owner._arrayBuffers[this.src], n.connect(this.panNode), this._owner.context.currentTime, n.startTime = e + n.buffer.duration, n.start(n.startTime, t, n.buffer.duration - t), n
  5897. }, t.play = function(e, t, n, r, i, s) {
  5898. this._cleanUp(), createjs.Sound._playInstance(this, e, t, n, r, i, s)
  5899. }, t._beginPlaying = function(e, t, n, r) {
  5900. return null != window.createjs && this.src ? (this._offset = e / 1e3, this._remainingLoops = t, this.volume = n, this.pan = r, this._owner.isPreloadComplete(this.src) ? (this._handleSoundReady(null), this._sendEvent("succeeded"), 1) : (this.playFailed(), void 0)) : void 0
  5901. }, t.pause = function() {
  5902. return this._paused || this.playState != createjs.Sound.PLAY_SUCCEEDED ? !1 : (this._paused = !0, this._offset = this._owner.context.currentTime - this._startTime, this._cleanUpAudioNode(this.sourceNode), this._cleanUpAudioNode(this._sourceNodeNext), 0 != this.gainNode.numberOfOutputs && this.gainNode.disconnect(), clearTimeout(this._delayTimeoutId), clearTimeout(this._soundCompleteTimeout), !0)
  5903. }, t.resume = function() {
  5904. return this._paused ? (this._handleSoundReady(null), !0) : !1
  5905. }, t.stop = function() {
  5906. return this._cleanUp(), this.playState = createjs.Sound.PLAY_FINISHED, this._offset = 0, !0
  5907. }, t.setVolume = function(e) {
  5908. return this.volume = e, !0
  5909. }, t._updateVolume = function() {
  5910. var e = this._muted ? 0 : this._volume;
  5911. return e != this.gainNode.gain.value ? (this.gainNode.gain.value = e, !0) : !1
  5912. }, t.getVolume = function() {
  5913. return this.volume
  5914. }, t.setMute = function(e) {
  5915. return null == e || void 0 == e ? !1 : (this._muted = e, this._updateVolume(), !0)
  5916. }, t.getMute = function() {
  5917. return this._muted
  5918. }, t.setPan = function(e) {
  5919. return this.pan = e, this.pan != e ? !1 : void 0
  5920. }, t.getPan = function() {
  5921. return this.pan
  5922. }, t.getPosition = function() {
  5923. if (this._paused || null == this.sourceNode) var e = this._offset;
  5924. else var e = this._owner.context.currentTime - this._startTime;
  5925. return 1e3 * e
  5926. }, t.setPosition = function(e) {
  5927. return this._offset = e / 1e3, this.sourceNode && this.playState == createjs.Sound.PLAY_SUCCEEDED && (this._cleanUpAudioNode(this.sourceNode), this._cleanUpAudioNode(this._sourceNodeNext), clearTimeout(this._soundCompleteTimeout)), this._paused || this.playState != createjs.Sound.PLAY_SUCCEEDED || this._handleSoundReady(null), !0
  5928. }, t.getDuration = function() {
  5929. return this._duration
  5930. }, t._handleSoundComplete = function() {
  5931. return this._offset = 0, 0 != this._remainingLoops ? (this._remainingLoops--, this._sourceNodeNext ? (this._cleanUpAudioNode(this.sourceNode), this.sourceNode = this._sourceNodeNext, this._startTime = this.sourceNode.startTime, this._sourceNodeNext = this._createAndPlayAudioNode(this._startTime, 0), this._soundCompleteTimeout = setTimeout(this._endedHandler, this._duration)) : this._handleSoundReady(null), this._sendEvent("loop"), void 0) : (null != window.createjs && (this._cleanUp(), this.playState = createjs.Sound.PLAY_FINISHED, this._sendEvent("complete")), void 0)
  5932. }, t.playFailed = function() {
  5933. null != window.createjs && (this._cleanUp(), this.playState = createjs.Sound.PLAY_FAILED, this._sendEvent("failed"))
  5934. }, t.toString = function() {
  5935. return "[WebAudioPlugin SoundInstance]"
  5936. }, createjs.WebAudioPlugin.SoundInstance = e
  5937. }(),
  5938. function() {
  5939. "use strict";
  5940. function e(e, t) {
  5941. this._init(e, t)
  5942. }
  5943. var t = e.prototype;
  5944. t.request = null, t.owner = null, t.progress = -1, t.src = null, t.originalSrc = null, t.result = null, t.onload = null, t.onprogress = null, t.onError = null, t._init = function(e, t) {
  5945. this.src = e, this.originalSrc = e, this.owner = t
  5946. }, t.load = function(e) {
  5947. null != e && (this.src = e), this.request = new XMLHttpRequest, this.request.open("GET", this.src, !0), this.request.responseType = "arraybuffer", this.request.onload = createjs.proxy(this.handleLoad, this), this.request.onError = createjs.proxy(this.handleError, this), this.request.onprogress = createjs.proxy(this.handleProgress, this), this.request.send()
  5948. }, t.handleProgress = function(e, t) {
  5949. this.progress = e / t, null != this.onprogress && this.onprogress({
  5950. loaded: e,
  5951. total: t,
  5952. progress: this.progress
  5953. })
  5954. }, t.handleLoad = function() {
  5955. this.owner.context.decodeAudioData(this.request.response, createjs.proxy(this.handleAudioDecoded, this), createjs.proxy(this.handleError, this))
  5956. }, t.handleAudioDecoded = function(e) {
  5957. this.progress = 1, this.result = e, this.src = this.originalSrc, this.owner.addPreloadResults(this.src, this.result), this.onload && this.onload()
  5958. }, t.handleError = function(e) {
  5959. this.owner.removeSound(this.src), this.onerror && this.onerror(e)
  5960. }, t.toString = function() {
  5961. return "[WebAudioPlugin Loader]"
  5962. }, createjs.WebAudioPlugin.Loader = e
  5963. }(), this.createjs = this.createjs || {},
  5964. function() {
  5965. "use strict";
  5966. function e() {
  5967. this._init()
  5968. }
  5969. var t = e;
  5970. t.MAX_INSTANCES = 30, t._AUDIO_READY = "canplaythrough", t._AUDIO_ENDED = "ended", t._AUDIO_SEEKED = "seeked", t._AUDIO_STALLED = "stalled", t._capabilities = null, t.enableIOS = !1, t.isSupported = function() {
  5971. if (createjs.Sound.BrowserDetect.isIOS && !t.enableIOS) return !1;
  5972. t._generateCapabilities();
  5973. var e = t.tag;
  5974. return null == e || null == t._capabilities ? !1 : !0
  5975. }, t._generateCapabilities = function() {
  5976. if (null == t._capabilities) {
  5977. var e = t.tag = document.createElement("audio");
  5978. if (null == e.canPlayType) return null;
  5979. t._capabilities = {
  5980. panning: !0,
  5981. volume: !0,
  5982. tracks: -1
  5983. };
  5984. for (var n = createjs.Sound.SUPPORTED_EXTENSIONS, r = createjs.Sound.EXTENSION_MAP, i = 0, s = n.length; s > i; i++) {
  5985. var o = n[i],
  5986. u = r[o] || o;
  5987. t._capabilities[o] = "no" != e.canPlayType("audio/" + o) && "" != e.canPlayType("audio/" + o) || "no" != e.canPlayType("audio/" + u) && "" != e.canPlayType("audio/" + u)
  5988. }
  5989. }
  5990. };
  5991. var n = e.prototype;
  5992. n._capabilities = null, n._audioSources = null, n.defaultNumChannels = 2, n.loadedHandler = null, n._init = function() {
  5993. this._capabilities = t._capabilities, this._audioSources = {}
  5994. }, n.register = function(e, t) {
  5995. this._audioSources[e] = !0;
  5996. for (var n = createjs.HTMLAudioPlugin.TagPool.get(e), r = null, i = t || this.defaultNumChannels, s = 0; i > s; s++) r = this._createTag(e), n.add(r);
  5997. if (r.id = e, this.loadedHandler = createjs.proxy(this._handleTagLoad, this), r.addEventListener && r.addEventListener("canplaythrough", this.loadedHandler), null == r.onreadystatechange) r.onreadystatechange = this.loadedHandler;
  5998. else {
  5999. var o = r.onreadystatechange;
  6000. r.onreadystatechange = function() {
  6001. o(), this.loadedHandler()
  6002. }
  6003. }
  6004. return {
  6005. tag: r,
  6006. numChannels: i
  6007. }
  6008. }, n._handleTagLoad = function(e) {
  6009. e.target.removeEventListener && e.target.removeEventListener("canplaythrough", this.loadedHandler), e.target.onreadystatechange = null, e.target.src != e.target.id && createjs.HTMLAudioPlugin.TagPool.checkSrc(e.target.id)
  6010. }, n._createTag = function(e) {
  6011. var t = document.createElement("audio");
  6012. return t.autoplay = !1, t.preload = "none", t.src = e, t
  6013. }, n.removeSound = function(e) {
  6014. delete this._audioSources[e], createjs.HTMLAudioPlugin.TagPool.remove(e)
  6015. }, n.removeAllSounds = function() {
  6016. this._audioSources = {}, createjs.HTMLAudioPlugin.TagPool.removeAll()
  6017. }, n.create = function(e) {
  6018. if (!this.isPreloadStarted(e)) {
  6019. var t = createjs.HTMLAudioPlugin.TagPool.get(e),
  6020. n = this._createTag(e);
  6021. n.id = e, t.add(n), this.preload(e, {
  6022. tag: n
  6023. })
  6024. }
  6025. return new createjs.HTMLAudioPlugin.SoundInstance(e, this)
  6026. }, n.isPreloadStarted = function(e) {
  6027. return null != this._audioSources[e]
  6028. }, n.preload = function(e, t) {
  6029. this._audioSources[e] = !0, new createjs.HTMLAudioPlugin.Loader(e, t.tag)
  6030. }, n.toString = function() {
  6031. return "[HTMLAudioPlugin]"
  6032. }, createjs.HTMLAudioPlugin = e
  6033. }(),
  6034. function() {
  6035. "use strict";
  6036. function e(e, t) {
  6037. this._init(e, t)
  6038. }
  6039. var t = e.prototype = new createjs.EventDispatcher;
  6040. t.src = null, t.uniqueId = -1, t.playState = null, t._owner = null, t.loaded = !1, t._offset = 0, t._delay = 0, t._volume = 1;
  6041. try {
  6042. Object.defineProperty(t, "volume", {
  6043. get: function() {
  6044. return this._volume
  6045. },
  6046. set: function(e) {
  6047. null != Number(e) && (e = Math.max(0, Math.min(1, e)), this._volume = e, this._updateVolume())
  6048. }
  6049. })
  6050. } catch (n) {}
  6051. t.pan = 0, t._duration = 0, t._remainingLoops = 0, t._delayTimeoutId = null, t.tag = null, t._muted = !1, t._paused = !1, t._endedHandler = null, t._readyHandler = null, t._stalledHandler = null, t.loopHandler = null, t._init = function(e, t) {
  6052. this.src = e, this._owner = t, this._endedHandler = createjs.proxy(this._handleSoundComplete, this), this._readyHandler = createjs.proxy(this._handleSoundReady, this), this._stalledHandler = createjs.proxy(this._handleSoundStalled, this), this.loopHandler = createjs.proxy(this.handleSoundLoop, this)
  6053. }, t._sendEvent = function(e) {
  6054. var t = new createjs.Event(e);
  6055. this.dispatchEvent(t)
  6056. }, t._cleanUp = function() {
  6057. var e = this.tag;
  6058. if (null != e) {
  6059. e.pause(), e.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED, this._endedHandler, !1), e.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY, this._readyHandler, !1), e.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this.loopHandler, !1);
  6060. try {
  6061. e.currentTime = 0
  6062. } catch (t) {}
  6063. createjs.HTMLAudioPlugin.TagPool.setInstance(this.src, e), this.tag = null
  6064. }
  6065. clearTimeout(this._delayTimeoutId), null != window.createjs && createjs.Sound._playFinished(this)
  6066. }, t._interrupt = function() {
  6067. null != this.tag && (this.playState = createjs.Sound.PLAY_INTERRUPTED, this._cleanUp(), this._paused = !1, this._sendEvent("interrupted"))
  6068. }, t.play = function(e, t, n, r, i, s) {
  6069. this._cleanUp(), createjs.Sound._playInstance(this, e, t, n, r, i, s)
  6070. }, t._beginPlaying = function(e, t, n, r) {
  6071. if (null == window.createjs) return -1;
  6072. var i = this.tag = createjs.HTMLAudioPlugin.TagPool.getInstance(this.src);
  6073. return null == i ? (this.playFailed(), -1) : (i.addEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED, this._endedHandler, !1), this._offset = e, this.volume = n, this.pan = r, this._updateVolume(), this._remainingLoops = t, 4 !== i.readyState ? (i.addEventListener(createjs.HTMLAudioPlugin._AUDIO_READY, this._readyHandler, !1), i.addEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED, this._stalledHandler, !1), i.preload = "auto", i.load()) : this._handleSoundReady(null), this._sendEvent("succeeded"), 1)
  6074. }, t._handleSoundStalled = function() {
  6075. this._cleanUp(), this._sendEvent("failed")
  6076. }, t._handleSoundReady = function() {
  6077. if (null != window.createjs) {
  6078. if (this._duration = 1e3 * this.tag.duration, this.playState = createjs.Sound.PLAY_SUCCEEDED, this._paused = !1, this.tag.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY, this._readyHandler, !1), this._offset >= this.getDuration()) return this.playFailed(), void 0;
  6079. this._offset > 0 && (this.tag.currentTime = .001 * this._offset), -1 == this._remainingLoops && (this.tag.loop = !0), 0 != this._remainingLoops && (this.tag.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this.loopHandler, !1), this.tag.loop = !0), this.tag.play()
  6080. }
  6081. }, t.pause = function() {
  6082. return this._paused || this.playState != createjs.Sound.PLAY_SUCCEEDED || null == this.tag ? !1 : (this._paused = !0, this.tag.pause(), clearTimeout(this._delayTimeoutId), !0)
  6083. }, t.resume = function() {
  6084. return this._paused && null != this.tag ? (this._paused = !1, this.tag.play(), !0) : !1
  6085. }, t.stop = function() {
  6086. return this._offset = 0, this.pause(), this.playState = createjs.Sound.PLAY_FINISHED, this._cleanUp(), !0
  6087. }, t.setMasterVolume = function() {
  6088. return this._updateVolume(), !0
  6089. }, t.setVolume = function(e) {
  6090. return this.volume = e, !0
  6091. }, t._updateVolume = function() {
  6092. if (null != this.tag) {
  6093. var e = this._muted || createjs.Sound._masterMute ? 0 : this._volume * createjs.Sound._masterVolume;
  6094. return e != this.tag.volume && (this.tag.volume = e), !0
  6095. }
  6096. return !1
  6097. }, t.getVolume = function() {
  6098. return this.volume
  6099. }, t.setMasterMute = function() {
  6100. return this._updateVolume(), !0
  6101. }, t.setMute = function(e) {
  6102. return null == e || void 0 == e ? !1 : (this._muted = e, this._updateVolume(), !0)
  6103. }, t.getMute = function() {
  6104. return this._muted
  6105. }, t.setPan = function() {
  6106. return !1
  6107. }, t.getPan = function() {
  6108. return 0
  6109. }, t.getPosition = function() {
  6110. return null == this.tag ? this._offset : 1e3 * this.tag.currentTime
  6111. }, t.setPosition = function(e) {
  6112. if (null == this.tag) this._offset = e;
  6113. else {
  6114. this.tag.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this.loopHandler, !1);
  6115. try {
  6116. this.tag.currentTime = .001 * e
  6117. } catch (t) {
  6118. return !1
  6119. }
  6120. this.tag.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this.loopHandler, !1)
  6121. }
  6122. return !0
  6123. }, t.getDuration = function() {
  6124. return this._duration
  6125. }, t._handleSoundComplete = function() {
  6126. this._offset = 0, null != window.createjs && (this.playState = createjs.Sound.PLAY_FINISHED, this._cleanUp(), this._sendEvent("complete"))
  6127. }, t.handleSoundLoop = function() {
  6128. this._offset = 0, this._remainingLoops--, 0 == this._remainingLoops && (this.tag.loop = !1, this.tag.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this.loopHandler, !1)), this._sendEvent("loop")
  6129. }, t.playFailed = function() {
  6130. null != window.createjs && (this.playState = createjs.Sound.PLAY_FAILED, this._cleanUp(), this._sendEvent("failed"))
  6131. }, t.toString = function() {
  6132. return "[HTMLAudioPlugin SoundInstance]"
  6133. }, createjs.HTMLAudioPlugin.SoundInstance = e
  6134. }(),
  6135. function() {
  6136. "use strict";
  6137. function e(e, t) {
  6138. this._init(e, t)
  6139. }
  6140. var t = e.prototype;
  6141. t.src = null, t.tag = null, t.preloadTimer = null, t.loadedHandler = null, t._init = function(e, t) {
  6142. if (this.src = e, this.tag = t, this.preloadTimer = setInterval(createjs.proxy(this.preloadTick, this), 200), this.loadedHandler = createjs.proxy(this.sendLoadedEvent, this), this.tag.addEventListener && this.tag.addEventListener("canplaythrough", this.loadedHandler), null == this.tag.onreadystatechange) this.tag.onreadystatechange = createjs.proxy(this.sendLoadedEvent, this);
  6143. else {
  6144. var n = this.tag.onreadystatechange;
  6145. this.tag.onreadystatechange = function() {
  6146. n(), this.tag.onreadystatechange = createjs.proxy(this.sendLoadedEvent, this)
  6147. }
  6148. }
  6149. this.tag.preload = "auto", this.tag.load()
  6150. }, t.preloadTick = function() {
  6151. var e = this.tag.buffered,
  6152. t = this.tag.duration;
  6153. e.length > 0 && e.end(0) >= t - 1 && this.handleTagLoaded()
  6154. }, t.handleTagLoaded = function() {
  6155. clearInterval(this.preloadTimer)
  6156. }, t.sendLoadedEvent = function() {
  6157. this.tag.removeEventListener && this.tag.removeEventListener("canplaythrough", this.loadedHandler), this.tag.onreadystatechange = null, createjs.Sound._sendFileLoadEvent(this.src)
  6158. }, t.toString = function() {
  6159. return "[HTMLAudioPlugin Loader]"
  6160. }, createjs.HTMLAudioPlugin.Loader = e
  6161. }(),
  6162. function() {
  6163. "use strict";
  6164. function e(e) {
  6165. this._init(e)
  6166. }
  6167. var t = e;
  6168. t.tags = {}, t.get = function(n) {
  6169. var r = t.tags[n];
  6170. return null == r && (r = t.tags[n] = new e(n)), r
  6171. }, t.remove = function(e) {
  6172. var n = t.tags[e];
  6173. return null == n ? !1 : (n.removeAll(), delete t.tags[e], !0)
  6174. }, t.removeAll = function() {
  6175. for (var e in t.tags) t.tags[e].removeAll();
  6176. t.tags = {}
  6177. }, t.getInstance = function(e) {
  6178. var n = t.tags[e];
  6179. return null == n ? null : n.get()
  6180. }, t.setInstance = function(e, n) {
  6181. var r = t.tags[e];
  6182. return null == r ? null : r.set(n)
  6183. }, t.checkSrc = function(e) {
  6184. var n = t.tags[e];
  6185. return null == n ? null : (n.checkSrcChange(), void 0)
  6186. };
  6187. var n = e.prototype;
  6188. n.src = null, n.length = 0, n.available = 0, n.tags = null, n._init = function(e) {
  6189. this.src = e, this.tags = []
  6190. }, n.add = function(e) {
  6191. this.tags.push(e), this.length++, this.available++
  6192. }, n.removeAll = function() {
  6193. for (; this.length--;) delete this.tags[this.length];
  6194. this.src = null, this.tags.length = 0
  6195. }, n.get = function() {
  6196. if (0 == this.tags.length) return null;
  6197. this.available = this.tags.length;
  6198. var e = this.tags.pop();
  6199. return null == e.parentNode && document.body.appendChild(e), e
  6200. }, n.set = function(e) {
  6201. var t = createjs.indexOf(this.tags, e); - 1 == t && this.tags.push(e), this.available = this.tags.length
  6202. }, n.checkSrcChange = function() {
  6203. for (var e = this.tags.length - 1, t = this.tags[e].src; e--;) this.tags[e].src = t
  6204. }, n.toString = function() {
  6205. return "[HTMLAudioPlugin TagPool]"
  6206. }, createjs.HTMLAudioPlugin.TagPool = e
  6207. }();
  6208. var g_strings = {
  6209. en: {
  6210. STRING_REMOVE: "消除",
  6211. STRING_CLEAR: "消除全部冰块"
  6212. },
  6213. es: {
  6214. STRING_REMOVE: "Eliminar ",
  6215. STRING_CLEAR: "Despeja todas las casillas de hielo"
  6216. },
  6217. pt: {
  6218. STRING_REMOVE: "Remover",
  6219. STRING_CLEAR: "Limpe todas as células de gelo"
  6220. },
  6221. tr: {
  6222. STRING_REMOVE: "Ortadan Kald?r",
  6223. STRING_CLEAR: "Tüm buz hücreleri sil"
  6224. },
  6225. de: {
  6226. STRING_REMOVE: "Entferne",
  6227. STRING_CLEAR: "Entferne alle Eis K?stchen"
  6228. },
  6229. ru: {
  6230. STRING_REMOVE: "Удалите",
  6231. STRING_CLEAR: "Удали все ледяные кубы"
  6232. }
  6233. };
  6234. var g_allLanguages = ["en", "es", "pt", "tr", "de", "ru"];
  6235. var StringManager = function() {
  6236. function e() {
  6237. this.container = new createjs.Container;
  6238. this.strings = new Object;
  6239. this.allStrings = null
  6240. }
  6241. e.getInstance = function() {
  6242. return e.g_instance
  6243. };
  6244. e.prototype.getString = function(e) {
  6245. return this.strings[e]
  6246. };
  6247. e.prototype.loadStrings = function() {
  6248. this.allStrings = g_strings
  6249. };
  6250. e.prototype.setLanguage = function(e) {
  6251. this.strings = this.allStrings[e]
  6252. };
  6253. e.g_instance = new e;
  6254. e.STRING_REMOVE = "STRING_REMOVE";
  6255. e.STRING_CLEAR = "STRING_CLEAR";
  6256. return e
  6257. }();
  6258. var SoundManager = function() {
  6259. function e() {
  6260. this.soundEnabled = true;
  6261. this.initiliazed = false;
  6262. this.musicInstance = null;
  6263. this.focus = true;
  6264. this.wasMusicPlay = false
  6265. }
  6266. e.prototype.onLostFocus = function() {
  6267. if (this.focus) {
  6268. this.focus = false;
  6269. if (this.soundEnabled) {
  6270. if (this.musicInstance) {
  6271. try {
  6272. this.musicInstance.stop()
  6273. } catch (e) {}
  6274. }
  6275. this.wasMusicPlay = false
  6276. }
  6277. }
  6278. };
  6279. e.prototype.onFocus = function() {
  6280. if (!this.focus) {
  6281. this.focus = true;
  6282. this.playMusic()
  6283. }
  6284. };
  6285. e.prototype.init = function() {
  6286. if (!this.initiliazed) {
  6287. try {
  6288. if (!createjs.Sound.initializeDefaultPlugins()) {
  6289. return
  6290. }
  6291. } catch (e) {}
  6292. this.initiliazed = true
  6293. }
  6294. };
  6295. e.prototype.isSoundEnabled = function() {
  6296. return this.soundEnabled
  6297. };
  6298. e.prototype.setSoundEnabled = function(e) {
  6299. this.soundEnabled = e;
  6300. if (!e) {
  6301. if (this.musicInstance) {
  6302. try {
  6303. this.musicInstance.stop()
  6304. } catch (t) {}
  6305. }
  6306. this.wasMusicPlay = false
  6307. } else {
  6308. this.playMusic()
  6309. }
  6310. };
  6311. e.prototype.play = function(e) {
  6312. try {
  6313. if (this.initiliazed && this.soundEnabled) {
  6314. try {
  6315. return createjs.Sound.play(e, createjs.Sound.INTERRUPT_NONE, 0, 0, 0, 1)
  6316. } catch (t) {}
  6317. }
  6318. } catch (t) {}
  6319. return null
  6320. };
  6321. e.prototype.playMusic = function() {
  6322. if (this.initiliazed && this.soundEnabled) {
  6323. if (!this.wasMusicPlay) {
  6324. this.wasMusicPlay = true;
  6325. try {
  6326. this.musicInstance = createjs.Sound.play(e.SOUND_MUSIC, createjs.Sound.INTERRUPT_NONE, 0, 0, -1, 1);
  6327. if (this.musicInstance.playState == "playFailed") {
  6328. this.wasMusicPlay = false;
  6329. return null
  6330. }
  6331. } catch (t) {
  6332. return null
  6333. }
  6334. return this.musicInstance
  6335. }
  6336. }
  6337. return null
  6338. };
  6339. e.g_instance = new e;
  6340. e.SOUND_MUSIC = "music";
  6341. e.SOUND_CLICK = "click";
  6342. e.SOUND_MATCH_1 = "match_1";
  6343. e.SOUND_MATCH_2 = "match_2";
  6344. e.SOUND_MATCH_3 = "match_3";
  6345. e.SOUND_MATCH_4 = "match_4";
  6346. e.SOUND_MATCH_5 = "match_5";
  6347. e.SOUND_DROP_1 = "drop_1";
  6348. e.SOUND_DROP_2 = "drop_2";
  6349. e.SOUND_DROP_3 = "drop_3";
  6350. e.SOUND_LINE = "line";
  6351. e.SOUND_KILL_COLOR = "kill_color";
  6352. e.SOUND_LOSE = "lose";
  6353. e.SOUND_BOOM = "boom";
  6354. e.SOUND_AWESOME = "awesome";
  6355. e.SOUND_EXCHANGE = "exchange";
  6356. e.SOUND_WIN = "win";
  6357. return e
  6358. }();
  6359. var StateManager = function() {
  6360. function e(t) {
  6361. var n = this;
  6362. this.statesConstainer = new createjs.Container;
  6363. this.isMouseDown = false;
  6364. this.timeDevider = 1;
  6365. this.lastTime = 0;
  6366. e.g_instance = this;
  6367. this.states = Array();
  6368. this.canvas = document.getElementById("canvas");
  6369. this.stage = new createjs.Stage(this.canvas);
  6370. this.stage.autoClear = true;
  6371. createjs.Touch.enable(this.stage);
  6372. this.stage.enableMouseOver(5);
  6373. createjs.Ticker.setFPS(60);
  6374. createjs.Ticker.addEventListener("tick", function(e) {
  6375. return n.update(e)
  6376. });
  6377. if (Constants.DEBUG_MODE) {
  6378. document.onkeydown = function(e) {
  6379. return n.onKeyDown(e)
  6380. };
  6381. document.onkeyup = function(e) {
  6382. return n.onKeyUp(e)
  6383. }
  6384. }
  6385. var r = new AssetsManager(t);
  6386. this.stage.addChild(r);
  6387. r.addEventListener(Constants.LOAD_COMPLETE, function(e) {
  6388. return n.allAssetsLoaded(e)
  6389. });
  6390. r.startDownLoad();
  6391. this.stage.addChild(this.statesConstainer);
  6392. Constants.PIXEL_RATIO = window.devicePixelRatio ? window.devicePixelRatio : 1;
  6393. if (Constants.g_isPC) {
  6394. window.onresize = function(e) {
  6395. return n.onResize(e)
  6396. };
  6397. this.onResize(null)
  6398. } else {
  6399. if (viewporter.ACTIVE) {
  6400. window.addEventListener("viewportready", function() {
  6401. return n.onOrientationChanged()
  6402. });
  6403. window.addEventListener("viewportchange", function() {
  6404. return n.onOrientationChanged()
  6405. })
  6406. } else {
  6407. window.addEventListener("orientationchange", function() {
  6408. return n.onOrientationChanged()
  6409. })
  6410. }
  6411. this.onOrientationChanged()
  6412. }
  6413. }
  6414. e.prototype.isLandscape = function() {
  6415. if (Constants.g_isPC) {
  6416. return false
  6417. }
  6418. return viewporter.isLandscape()
  6419. };
  6420. e.prototype.allAssetsLoaded = function(t) {
  6421. var n = this;
  6422. t.target.removeEventListener(Constants.LOAD_COMPLETE, this.allAssetsLoaded);
  6423. this.stage.addEventListener(Constants.MOUSE_MOVE, function(e) {
  6424. return n.handleMouse(e)
  6425. });
  6426. this.stage.addEventListener(Constants.MOUSE_DOWN, function(e) {
  6427. return n.handleMouse(e)
  6428. });
  6429. this.stage.addEventListener(Constants.MOUSE_UP, function(e) {
  6430. return n.handleMouse(e)
  6431. });
  6432. StringManager.getInstance().loadStrings();
  6433. try {
  6434. var r = SG.lang;
  6435. StringManager.getInstance().setLanguage(r);
  6436. SG_Hooks.setOrientationHandler(function(t) {
  6437. e.g_instance.onOrientationChanged()
  6438. });
  6439. SG_Hooks.setResizeHandler(function(t, n) {
  6440. if (t && n) {
  6441. Constants.g_wasSetSize = true;
  6442. Constants.W = t;
  6443. Constants.H = n;
  6444. if (Constants.g_isPC) {
  6445. e.g_instance.onResize(null)
  6446. } else {
  6447. e.g_instance.onOrientationChanged()
  6448. }
  6449. }
  6450. })
  6451. } catch (i) {
  6452. console.log("SG_Hooks error")
  6453. }
  6454. if (window.onpagehide) {
  6455. window.onpagehide = function(e) {
  6456. return n.onLostFocus(e)
  6457. }
  6458. }
  6459. if (window.onblur) {
  6460. window.onblur = function(e) {
  6461. return n.onLostFocus(e)
  6462. }
  6463. }
  6464. if (window.onpageshow) {
  6465. window.onpageshow = function(e) {
  6466. return n.onFocus(e)
  6467. }
  6468. }
  6469. if (window.onfocus) {
  6470. window.onfocus = function(e) {
  6471. return n.onFocus(e)
  6472. }
  6473. }
  6474. if (AssetsManager.g_instance.parent) {
  6475. AssetsManager.g_instance.parent.removeChild(AssetsManager.g_instance)
  6476. }
  6477. GameData.getInstance().load();
  6478. this.pushState(new MainMenuState);
  6479. if (this.isLandscape()) {
  6480. this.pushState(new PortraitLockState)
  6481. }
  6482. };
  6483. e.prototype.update = function(e) {
  6484. try {
  6485. if (this.states.length != 0) {
  6486. var t = this.states[this.states.length - 1];
  6487. if (!t.isInitiliazed()) {
  6488. t.init()
  6489. }
  6490. var n = createjs.Ticker.getTime();
  6491. var r = n - this.lastTime;
  6492. this.lastTime = n;
  6493. t.update(r * .001 / this.timeDevider)
  6494. }
  6495. } catch (i) {
  6496. console.log(i, "statemanager::update")
  6497. }
  6498. try {
  6499. this.stage.update(e)
  6500. } catch (i) {}
  6501. };
  6502. e.prototype.changeState = function(e) {
  6503. while (this.states.length != 0) {
  6504. this.popState()
  6505. }
  6506. this.pushState(e)
  6507. };
  6508. e.prototype.pushState = function(e) {
  6509. this.states.push(e);
  6510. this.statesConstainer.addChild(e)
  6511. };
  6512. e.prototype.popState = function() {
  6513. if (this.states.length != 0) {
  6514. this.states[this.states.length - 1].cleanup();
  6515. this.statesConstainer.removeChild(this.states[this.states.length - 1]);
  6516. this.states.pop();
  6517. if (this.states.length != 0) {
  6518. this.states[this.states.length - 1].resume()
  6519. }
  6520. }
  6521. };
  6522. e.getInnerWidth = function() {
  6523. if (Constants.g_isPC) {
  6524. return window.innerWidth
  6525. }
  6526. return window.innerWidth
  6527. };
  6528. e.getInnerHeight = function() {
  6529. if (Constants.g_isPC) {
  6530. return window.innerHeight
  6531. }
  6532. return window.innerHeight
  6533. };
  6534. e.prototype.onResize = function(t) {
  6535. if (!Constants.g_wasSetSize) {
  6536. Constants.W = e.getInnerWidth();
  6537. Constants.H = e.getInnerHeight()
  6538. }
  6539. Constants.SCREEN_SCALE = Constants.H / Constants.ASSETS_HEIGHT * Constants.PIXEL_RATIO;
  6540. Constants.SCREEN_HEIGHT = Constants.H / Constants.SCREEN_SCALE * Constants.PIXEL_RATIO;
  6541. this.canvas.width = Constants.ASSETS_WIDTH * Constants.SCREEN_SCALE;
  6542. this.canvas.height = Constants.ASSETS_HEIGHT * Constants.SCREEN_SCALE;
  6543. this.canvas.style.width = this.canvas.width + "px";
  6544. this.canvas.style.height = this.canvas.height + "px";
  6545. this.canvas.style.marginLeft = (Constants.W - this.canvas.width) / 2 + "px";
  6546. this.statesConstainer.scaleX = this.statesConstainer.scaleY = Constants.SCREEN_SCALE
  6547. };
  6548. e.prototype.onOrientationChanged = function() {
  6549. if (!Constants.g_wasSetSize) {
  6550. Constants.W = e.getInnerWidth();
  6551. Constants.H = e.getInnerHeight()
  6552. }
  6553. var t = this.isLandscape();
  6554. var n = Constants.W;
  6555. var r = Constants.H;
  6556. this.canvas.width = n * Constants.PIXEL_RATIO;
  6557. this.canvas.height = r * Constants.PIXEL_RATIO;
  6558. this.canvas.style.width = n + "px";
  6559. this.canvas.style.height = r + "px";
  6560. if (t) {
  6561. Constants.SCREEN_SCALE = r / Constants.ASSETS_HEIGHT * Constants.PIXEL_RATIO;
  6562. Constants.SCREEN_HEIGHT = r
  6563. } else {
  6564. Constants.SCREEN_SCALE = n / Constants.ASSETS_WIDTH * Constants.PIXEL_RATIO;
  6565. Constants.SCREEN_HEIGHT = r / Constants.SCREEN_SCALE * Constants.PIXEL_RATIO
  6566. }
  6567. this.statesConstainer.scaleX = this.statesConstainer.scaleY = Constants.SCREEN_SCALE;
  6568. if (this.states.length != 0) {
  6569. this.states[this.states.length - 1].onOrientationChanged(t)
  6570. }
  6571. if (AssetsManager.g_instance.parent) {
  6572. AssetsManager.g_instance.onOrientationChanged(t)
  6573. }
  6574. };
  6575. e.prototype.onLostFocus = function(e) {
  6576. SoundManager.g_instance.onLostFocus()
  6577. };
  6578. e.prototype.onFocus = function(e) {
  6579. SoundManager.g_instance.onFocus()
  6580. };
  6581. e.prototype.isMouseDownNow = function() {
  6582. return this.isMouseDown
  6583. };
  6584. e.prototype.handleMouse = function(e) {
  6585. e.preventDefault();
  6586. if (this.states.length == 0) {
  6587. return
  6588. }
  6589. var t = this.states[this.states.length - 1];
  6590. switch (e.type) {
  6591. case Constants.MOUSE_DOWN:
  6592. {
  6593. SoundManager.g_instance.init();
  6594. SoundManager.g_instance.playMusic();
  6595. this.isMouseDown = true;
  6596. t.onMouseDown(e.stageX / Constants.SCREEN_SCALE, e.stageY / Constants.SCREEN_SCALE)
  6597. }
  6598. break;
  6599. case Constants.MOUSE_UP:
  6600. {
  6601. this.isMouseDown = false;
  6602. t.onMouseUp(e.stageX / Constants.SCREEN_SCALE, e.stageY / Constants.SCREEN_SCALE)
  6603. }
  6604. break;
  6605. case Constants.MOUSE_MOVE:
  6606. {
  6607. if (this.isMouseDown) {
  6608. t.onMouseMove(e.stageX / Constants.SCREEN_SCALE, e.stageY / Constants.SCREEN_SCALE)
  6609. }
  6610. }
  6611. break
  6612. }
  6613. DNButton.wasActionThisFrame = false
  6614. };
  6615. e.prototype.onKeyDown = function(e) {
  6616. if (Constants.DEBUG_MODE) {
  6617. switch (e.keyCode) {
  6618. case 65:
  6619. {
  6620. this.timeDevider = 5
  6621. }
  6622. break;
  6623. case 68:
  6624. {
  6625. this.timeDevider = 10
  6626. }
  6627. break
  6628. }
  6629. }
  6630. };
  6631. e.prototype.onKeyUp = function(e) {
  6632. if (Constants.DEBUG_MODE) {
  6633. switch (e.keyCode) {
  6634. case 65:
  6635. {
  6636. this.timeDevider = 1
  6637. }
  6638. break;
  6639. case 68:
  6640. {
  6641. this.timeDevider = 1
  6642. }
  6643. break
  6644. }
  6645. }
  6646. };
  6647. return e
  6648. }();
  6649. var __extends = this.__extends || function(e, t) {
  6650. function r() {
  6651. this.constructor = e
  6652. }
  6653. for (var n in t)
  6654. if (t.hasOwnProperty(n)) e[n] = t[n];
  6655. r.prototype = t.prototype;
  6656. e.prototype = new r
  6657. };
  6658. var GameState = function(e) {
  6659. function t() {
  6660. e.call(this);
  6661. this.liveTime = 0;
  6662. this.gameObjects = new Array;
  6663. this.gui = new Array;
  6664. this.newGameObjects = new Array;
  6665. this.initiliazed = false;
  6666. this.consoleH = 200
  6667. }
  6668. __extends(t, e);
  6669. t.prototype.consolePrint = function(e) {
  6670. var t = new createjs.Text(e, "bold 35px Arial", "#000000");
  6671. this.addChild(t);
  6672. t.x = 50;
  6673. t.y = this.consoleH;
  6674. this.consoleH += 40
  6675. };
  6676. t.prototype.isInitiliazed = function() {
  6677. return this.initiliazed
  6678. };
  6679. t.prototype.onMouseDown = function(e, t) {
  6680. for (var n = 0; n < this.gui.length; n++) {
  6681. this.gui[n].onMouseDown(e, t)
  6682. }
  6683. };
  6684. t.prototype.onMouseMove = function(e, t) {
  6685. for (var n = 0; n < this.gui.length; n++) {
  6686. this.gui[n].onMouseMove(e, t)
  6687. }
  6688. };
  6689. t.prototype.onMouseUp = function(e, t) {
  6690. for (var n = 0; n < this.gui.length; n++) {
  6691. this.gui[n].onMouseUp(e, t)
  6692. }
  6693. };
  6694. t.prototype.addGuiObject = function(e) {
  6695. this.gui.push(e);
  6696. this.addGameObject(e)
  6697. };
  6698. t.prototype.update = function(e) {
  6699. this.liveTime += e;
  6700. this.newGameObjects = new Array;
  6701. for (var t = 0; t < this.gameObjects.length; t++) {
  6702. var n = this.gameObjects[t];
  6703. n.update(e);
  6704. if (n.isDead()) {
  6705. n.onDead()
  6706. } else {
  6707. this.newGameObjects.push(n)
  6708. }
  6709. }
  6710. this.gameObjects = this.newGameObjects
  6711. };
  6712. t.prototype.addGameObject = function(e) {
  6713. this.gameObjects.push(e)
  6714. };
  6715. t.prototype.addGameObjectAt = function(e, t) {
  6716. this.gameObjects.push(e);
  6717. if (t) {
  6718. t.addChild(e)
  6719. }
  6720. };
  6721. t.prototype.addGameObjectAtPos = function(e, t, n, r) {
  6722. this.gameObjects.push(e);
  6723. if (t) {
  6724. t.addChild(e);
  6725. e.x = n;
  6726. e.y = r
  6727. }
  6728. };
  6729. t.prototype.cleanup = function() {};
  6730. t.prototype.resume = function() {};
  6731. t.prototype.init = function() {
  6732. this.initiliazed = true
  6733. };
  6734. t.prototype.onOrientationChanged = function(e) {
  6735. if (e) {
  6736. StateManager.g_instance.pushState(new PortraitLockState)
  6737. }
  6738. };
  6739. return t
  6740. }(createjs.Container);
  6741. var Constants = function() {
  6742. function e() {}
  6743. e.W = -1;
  6744. e.H = -1;
  6745. e.g_wasSetSize = false;
  6746. e.g_DEBUG = false;
  6747. e.LOAD_COMPLETE = "LOAD_COMPLETE";
  6748. e.MOUSE_DOWN = "stagemousedown";
  6749. e.MOUSE_UP = "stagemouseup";
  6750. e.MOUSE_MOVE = "stagemousemove";
  6751. e.CELL_SIZE = 85;
  6752. e.FIELD_OFFSET_X = 9;
  6753. e.FIELD_OFFSET_Y = 250;
  6754. e.EXCHANGE_TIME = .22;
  6755. e.MATCH_TIME = .25;
  6756. e.GRAVITY_ACC = 2500;
  6757. e.ASSETS_WIDTH = 700;
  6758. e.ASSETS_HEIGHT = 900;
  6759. e.PIXEL_RATIO = 1;
  6760. e.SCREEN_HEIGHT = 900;
  6761. e.SCREEN_SCALE = 1;
  6762. e.DPI = -1;
  6763. e.g_isPC = true;
  6764. e.DEBUG_MODE = false;
  6765. e.COLOR_PINK = "#ffE5E5";
  6766. e.COLOR_BLUE = "#619CC4";
  6767. e.IMAGE_BUTTON_CLOSE = "button_close";
  6768. e.IMAGE_BUTTON_SOUND_ON = "button_sound_on";
  6769. e.IMAGE_BUTTON_SOUND_OFF = "button_sound_off";
  6770. e.IMAGE_BUTTON_EXIT = "button_exit";
  6771. e.IMAGE_BUTTON_PAUSE = "button_pause";
  6772. e.IMAGE_BUTTON_RESTART = "button_restart";
  6773. e.IMAGE_BUTTON_PLAY = "button_play";
  6774. e.IMAGE_AWESOME = "awesome";
  6775. e.IMAGE_SUPERB = "superb";
  6776. e.IMAGE_SHINING = "shining";
  6777. e.IMAGE_DROP = "drop";
  6778. e.IMAGE_BACK = "back";
  6779. e.IMAGE_DONUT = "donut";
  6780. e.IMAGE_ARROW_BONUS_VERT = "arrow_bonus_vert";
  6781. e.IMAGE_ARROW_BONUS_HOR = "arrow_bonus_hor";
  6782. e.IMAGE_BOMB = "bomb_bonus";
  6783. e.IMAGE_MESSAGE_WINDOW = "message_window";
  6784. e.IMAGE_HINT_ARROW = "hint_arrow";
  6785. e.IMAGE_GAMEOVER_CAPTION = "gameover_caption";
  6786. e.IMAGE_TITLE_MAIN_MENU_BACK = "main_menu_back";
  6787. e.IMAGE_SICKLE = "sickle";
  6788. e.IMAGE_ROTATE = "rotate";
  6789. e.IMAGE_BIG_SHINING = "big_shining";
  6790. e.IMAGE_POINTS_CONTROL_BIG = "point_control_big";
  6791. e.IMAGE_POINTS_CONTROL_SMALL = "point_control_small";
  6792. e.IMAGE_LEVEL_BUTTON = "level_button";
  6793. e.IMAGE_DIRT = "dirt";
  6794. e.IMAGE_GUI = "gui";
  6795. e.IMAGE_LOCK = "lock";
  6796. e.IMAGE_OUT_OF_MOVES = "out_of_moves";
  6797. e.IMAGE_WIN_CAPTION = "win_caption";
  6798. e.IMAGE_STONE_HEART = "stone_heart";
  6799. e.IMAGE_TASK_PANEL = "task_panel";
  6800. e.IMAGE_HEART_PARTICLE = "heart_particle";
  6801. e.IMAGE_WIN_STRINGS = "win_strings";
  6802. e.IMAGE_GLOBAL_MAP = "global_map";
  6803. e.IMAGE_CELL = "cell";
  6804. e.IMAGE_BORDER_SIDE = "border_side";
  6805. e.IMAGE_BORDER_CORNER = "border_corner";
  6806. e.IMAGE_SELECT_LEVEL_BACK = "select_level_back";
  6807. e.IMAGE_BUTTON_MORE_GAMES = "button_more_games";
  6808. return e
  6809. }();
  6810. var AssetsManager = function(e) {
  6811. function t(n) {
  6812. e.call(this);
  6813. this.loadingShape = new createjs.Shape;
  6814. this.loadingShapeBack1 = new createjs.Shape;
  6815. this.loadingShapeBack2 = new createjs.Shape;
  6816. this.shader = null;
  6817. this.maxWidth = 100;
  6818. this.deltaY = 50;
  6819. this.gameplaySprites = null;
  6820. this.mainMenuSprites = null;
  6821. t.g_instance = this;
  6822. this.maxWidth = 300;
  6823. document.getElementById("loader").className = "loader";
  6824. createjs.EventDispatcher.initialize(t.prototype);
  6825. this.manifest = n;
  6826. this.shader = new createjs.Shape;
  6827. this.shader.graphics.beginFill("#4aa4c2");
  6828. this.shader.graphics.drawRect(0, 0, this.maxWidth * 1.2, 130);
  6829. this.shader.graphics.endFill();
  6830. this.addChild(this.shader);
  6831. this.labelPercentDownload = new createjs.Text("100%", "bold 45px Arial", "#ffffff");
  6832. this.labelPercentDownload.textAlign = "center";
  6833. this.addChild(this.labelPercentDownload);
  6834. this.deltaY = this.labelPercentDownload.getBounds().height;
  6835. this.loadingShapeBack1.graphics.beginFill("#4a7dc2");
  6836. this.loadingShapeBack1.graphics.drawRect(0 - 4, 0 - 4, this.maxWidth + 8, this.deltaY + 8);
  6837. this.loadingShapeBack1.graphics.endFill();
  6838. this.addChild(this.loadingShapeBack1);
  6839. this.loadingShape.graphics.beginFill("#ffffff");
  6840. this.loadingShape.graphics.drawRect(0, 0, this.maxWidth, this.deltaY);
  6841. this.loadingShape.graphics.endFill();
  6842. this.addChild(this.loadingShape);
  6843. this.loadingShape.scaleX = 0;
  6844. this.onOrientationChanged(StateManager.g_instance.isLandscape())
  6845. }
  6846. __extends(t, e);
  6847. t.prototype.startDownLoad = function() {
  6848. var e = this;
  6849. this.loader = new createjs.LoadQueue;
  6850. this.loader.addEventListener("progress", function(t) {
  6851. return e.handleProgress(t)
  6852. });
  6853. this.loader.addEventListener("complete", function(t) {
  6854. return e.handleComplete(t)
  6855. });
  6856. createjs.Sound.registerManifest(this.manifest, "");
  6857. this.loader.installPlugin(createjs.SoundJS);
  6858. this.loader.loadManifest(this.manifest)
  6859. };
  6860. t.prototype.handleProgress = function(e) {
  6861. this.labelPercentDownload.text = (e.loaded * 100).toFixed(1) + "%";
  6862. this.loadingShape.scaleX = e.loaded
  6863. };
  6864. t.prototype.handleComplete = function(e) {
  6865. this.removeChild(this.labelPercentDownload);
  6866. this.dispatchEvent(Constants.LOAD_COMPLETE, this);
  6867. document.getElementById("loader").className = ""
  6868. };
  6869. t.prototype.getResult = function(e) {
  6870. return this.loader.getResult(e)
  6871. };
  6872. t.prototype.getBitmap = function(e) {
  6873. return new createjs.Bitmap(this.loader.getResult(e))
  6874. };
  6875. t.prototype.getCenteredBitmap = function(e) {
  6876. var t = new createjs.Bitmap(this.loader.getResult(e));
  6877. if (!t.image) {
  6878. console.log("ERROR HERE", e)
  6879. }
  6880. t.x = -t.image.width / 2;
  6881. t.y = -t.image.height / 2;
  6882. return t
  6883. };
  6884. t.prototype.getImage = function(e) {
  6885. var t = this.getBitmap(e);
  6886. if (t.getBounds()) {
  6887. return t
  6888. }
  6889. var n = this.getSprite(e);
  6890. if (n.getBounds()) {
  6891. return n
  6892. }
  6893. return null
  6894. };
  6895. t.prototype.getCenteredImage = function(e) {
  6896. var t = this.getImage(e);
  6897. t.x = -t.getBounds().width / 2;
  6898. t.y = -t.getBounds().height / 2;
  6899. return t
  6900. };
  6901. t.prototype.getCenteredImageWithProxy = function(e) {
  6902. var t = new createjs.Container;
  6903. t.addChild(this.getCenteredImage(e));
  6904. return t
  6905. };
  6906. t.prototype.getCenteredBitmapWithProxy = function(e) {
  6907. var t = new createjs.Container;
  6908. t.addChild(this.getCenteredBitmap(e));
  6909. return t
  6910. };
  6911. t.prototype.getSprite = function(e) {
  6912. var t = new createjs.Sprite(this.gameplaySprites, e);
  6913. t.stop();
  6914. return t
  6915. };
  6916. t.prototype.getCenteredSprite = function(e) {
  6917. var t = this.getSprite(e);
  6918. t.x = -t.getBounds().width / 2;
  6919. t.y = -t.getBounds().height / 2;
  6920. return t
  6921. };
  6922. t.prototype.onOrientationChanged = function(e) {
  6923. if (Constants.g_isPC) {
  6924. this.labelPercentDownload.x = Constants.ASSETS_WIDTH / 2;
  6925. this.labelPercentDownload.y = Constants.ASSETS_HEIGHT / 2
  6926. } else {
  6927. this.labelPercentDownload.x = Constants.W / 2 * Constants.PIXEL_RATIO;
  6928. this.labelPercentDownload.y = Constants.H / 2 * Constants.PIXEL_RATIO
  6929. }
  6930. this.loadingShape.x = this.labelPercentDownload.x - this.maxWidth / 2;
  6931. this.loadingShape.y = this.labelPercentDownload.y + this.deltaY * 1.5;
  6932. this.loadingShapeBack1.x = this.loadingShape.x;
  6933. this.loadingShapeBack1.y = this.loadingShape.y;
  6934. this.shader.x = this.labelPercentDownload.x - this.maxWidth * .6;
  6935. this.shader.y = this.labelPercentDownload.y
  6936. };
  6937. return t
  6938. }(createjs.Container);
  6939. var GameObject = function(e) {
  6940. function t() {
  6941. e.call(this);
  6942. this.liveTime = 0;
  6943. this.killed = false
  6944. }
  6945. __extends(t, e);
  6946. t.prototype.update = function(e) {
  6947. this.liveTime += e
  6948. };
  6949. t.prototype.kill = function() {
  6950. this.killed = true
  6951. };
  6952. t.prototype.isDead = function() {
  6953. return this.killed
  6954. };
  6955. t.prototype.onDead = function() {
  6956. if (this.parent) {
  6957. this.parent.removeChild(this)
  6958. }
  6959. };
  6960. return t
  6961. }(createjs.Container);
  6962. var Chip = function(e) {
  6963. function t(n, r, i, s, o) {
  6964. e.call(this);
  6965. this.STATE_NORMAL = "STATE_NORMAL";
  6966. this.STATE_EXCHANGE = "STATE_EXCHANGE";
  6967. this.STATE_SHIFT_DOWN = "STATE_SHIFT_DOWN";
  6968. this.STATE_MATCH = "STATE_MATCH";
  6969. this.wasClear = false;
  6970. this.state = null;
  6971. this.rotationSpeed = 0;
  6972. this.selected = false;
  6973. this.stateTime = 0;
  6974. this.rotationTimeOffset = Utils.RandomRange(0, 20);
  6975. this.bonusType = null;
  6976. this.jellyAnim = false;
  6977. this.doubleMatched = false;
  6978. this.canBeMatched = true;
  6979. this.matchReason = null;
  6980. this.hole = false;
  6981. this.stoneHeart = false;
  6982. this.spawnYPos = s;
  6983. this.setIncexes(r, i);
  6984. if (n != 9 && n != 0) {
  6985. this.chipPicture = AssetsManager.g_instance.getImage("cake_" + n);
  6986. this.addChild(this.chipPicture);
  6987. this.chipPicture.x = -this.chipPicture.getBounds().width / 2;
  6988. this.chipPicture.y = -Constants.CELL_SIZE
  6989. }
  6990. this.colorID = n;
  6991. this.setState(t.STATE_SPAWN_NEW);
  6992. this.spawnDelay = o;
  6993. if (n == 9) {
  6994. this.convertToStoneHeart()
  6995. }
  6996. }
  6997. __extends(t, e);
  6998. t.prototype.getMatchReason = function() {
  6999. return this.matchReason
  7000. };
  7001. t.prototype.isHorizontal = function() {
  7002. return this.horizontal
  7003. };
  7004. t.prototype.getBonusType = function() {
  7005. return this.bonusType
  7006. };
  7007. t.prototype.getColorID = function() {
  7008. return this.colorID
  7009. };
  7010. t.prototype.getIndeces = function() {
  7011. return new createjs.Point(this.indexX, this.indexY)
  7012. };
  7013. t.prototype.getIndexX = function() {
  7014. return this.indexX
  7015. };
  7016. t.prototype.getIndexY = function() {
  7017. return this.indexY
  7018. };
  7019. t.prototype.setIncexes = function(e, t) {
  7020. this.indexX = e;
  7021. this.indexY = t
  7022. };
  7023. t.prototype.isMatching = function() {
  7024. return this.state == this.STATE_MATCH
  7025. };
  7026. t.prototype.update = function(e) {
  7027. this.stateTime += e;
  7028. switch (this.state) {
  7029. case this.STATE_NORMAL:
  7030. {
  7031. if (this.stoneHeart) {
  7032. break
  7033. }
  7034. var n = this.stateTime * 9;
  7035. var r = Math.sin(n) * .13;
  7036. this.scaleX = 1 + r;
  7037. this.scaleY = 1 - r;
  7038. if (n >= Math.PI * 1) {
  7039. this.scaleX = this.scaleY = 1
  7040. }
  7041. this.canBeMatched = true
  7042. }
  7043. break;
  7044. case this.STATE_EXCHANGE:
  7045. {
  7046. if (this.stateTime >= Constants.EXCHANGE_TIME) {
  7047. this.setState(this.STATE_NORMAL)
  7048. }
  7049. }
  7050. break;
  7051. case t.STATE_SPAWN_NEW:
  7052. {
  7053. this.spawnDelay -= e;
  7054. if (this.spawnDelay < 0) {
  7055. this.speed.y += this.acceleration.y * e;
  7056. this.x += e * this.speed.x;
  7057. this.y += e * this.speed.y;
  7058. if (this.y >= this.spawnYPos) {
  7059. this.y = this.spawnYPos;
  7060. this.setState(this.STATE_NORMAL);
  7061. PlayState.g_instance.onShiftEnded()
  7062. }
  7063. }
  7064. }
  7065. break;
  7066. case this.STATE_SHIFT_DOWN:
  7067. {
  7068. this.speed.y += this.acceleration.y * e;
  7069. this.x += e * this.speed.x;
  7070. this.y += e * this.speed.y;
  7071. if (this.y >= this.spawnYPos) {
  7072. this.y = this.spawnYPos;
  7073. this.setState(this.STATE_NORMAL);
  7074. PlayState.g_instance.onShiftEnded()
  7075. }
  7076. }
  7077. break;
  7078. case t.STATE_FALL_DOWN:
  7079. {
  7080. this.speed.y += this.acceleration.y * e;
  7081. this.x += e * this.speed.x;
  7082. this.y += e * this.speed.y;
  7083. this.rotation += this.rotationSpeed * e;
  7084. if (this.y >= 1e3) {
  7085. this.kill()
  7086. }
  7087. }
  7088. break;
  7089. case this.STATE_MATCH:
  7090. {
  7091. this.scaleY = 1 - this.stateTime * 1.5;
  7092. this.scaleX = 1 + this.stateTime * 1.5;
  7093. this.alpha = 1 - this.stateTime / Constants.MATCH_TIME;
  7094. if (this.stateTime >= Constants.MATCH_TIME / 2 && !this.wasClear) {
  7095. PlayState.g_instance.addPointsAt(this, this.matchReason);
  7096. PlayState.g_instance.clearCell(this);
  7097. this.wasClear = true
  7098. }
  7099. if (this.stateTime >= Constants.MATCH_TIME) {
  7100. this.kill()
  7101. }
  7102. }
  7103. break
  7104. }
  7105. if (this.shiningCircle) {
  7106. this.shiningCircle.rotation += e * 20
  7107. }
  7108. };
  7109. t.prototype.setState = function(e) {
  7110. if (e == this.state) {
  7111. return
  7112. }
  7113. this.stateTime = 0;
  7114. this.state = e;
  7115. switch (e) {
  7116. case this.STATE_NORMAL:
  7117. this.jellyAnim = true;
  7118. break;
  7119. case this.STATE_EXCHANGE:
  7120. break;
  7121. case this.STATE_SHIFT_DOWN:
  7122. createjs.Tween.get(this, {
  7123. loop: false
  7124. }).to({
  7125. scaleX: 1,
  7126. scaleY: 1
  7127. }, 170, createjs.Ease.linear);
  7128. break;
  7129. case t.STATE_SPAWN_NEW:
  7130. {
  7131. this.speed = new createjs.Point(0, 500);
  7132. this.acceleration = new createjs.Point(0, Constants.GRAVITY_ACC)
  7133. }
  7134. break
  7135. }
  7136. };
  7137. t.prototype.exchange = function(e, t) {
  7138. this.deselect();
  7139. this.setState(this.STATE_EXCHANGE);
  7140. this.indexX = e;
  7141. this.indexY = t
  7142. };
  7143. t.prototype.shiftDown = function(e, t) {
  7144. this.speed = new createjs.Point(0, -250);
  7145. this.deselect();
  7146. this.indexY = e;
  7147. this.spawnYPos = t;
  7148. this.setState(this.STATE_SHIFT_DOWN)
  7149. };
  7150. t.prototype.match = function(e) {
  7151. if (this.stoneHeart) {
  7152. this.fallDown();
  7153. return
  7154. }
  7155. if (this.isHole()) {
  7156. return
  7157. }
  7158. if (this.state == this.STATE_MATCH) {
  7159. this.doubleMatched = true
  7160. }
  7161. if (!this.canBeMatched) {
  7162. return
  7163. }
  7164. this.matchReason = e;
  7165. this.setState(this.STATE_MATCH)
  7166. };
  7167. t.prototype.isDoubleMatched = function() {
  7168. return this.doubleMatched
  7169. };
  7170. t.prototype.select = function() {
  7171. this.stateTime = 0;
  7172. this.jellyAnim = true;
  7173. this.selected = true
  7174. };
  7175. t.prototype.deselect = function() {
  7176. if (this.selected) {
  7177. this.scaleX = this.scaleY = 1;
  7178. this.selected = false
  7179. }
  7180. };
  7181. t.prototype.isNormal = function() {
  7182. return this.state == this.STATE_NORMAL || this.state == t.STATE_HOLE
  7183. };
  7184. t.prototype.getState = function() {
  7185. return this.state
  7186. };
  7187. t.prototype.isBonus = function() {
  7188. return this.bonusType != null;
  7189. };
  7190. t.prototype.convertToBonus = function(e, n) {
  7191. this.horizontal = n;
  7192. this.bonusType = e;
  7193. this.removeAllChildren();
  7194. if (e == t.BONUS_5) {
  7195. var r = AssetsManager.g_instance.getImage("donut");
  7196. this.addChild(r);
  7197. r.x = -r.getBounds().width / 2;
  7198. r.y = -r.getBounds().height
  7199. }
  7200. if (e == t.BONUS_4) {
  7201. var r = AssetsManager.g_instance.getImage(this.horizontal ? Constants.IMAGE_ARROW_BONUS_HOR : Constants.IMAGE_ARROW_BONUS_VERT);
  7202. this.addChild(r);
  7203. r.x = -r.getBounds().width / 2;
  7204. r.y = -r.getBounds().height
  7205. }
  7206. if (e == t.BONUS_BOMB) {
  7207. var r = AssetsManager.g_instance.getImage(Constants.IMAGE_BOMB);
  7208. this.addChild(r);
  7209. r.x = -r.getBounds().width / 2;
  7210. r.y = -r.getBounds().height
  7211. }
  7212. if (this.state != t.STATE_SPAWN_NEW) {
  7213. PlayState.g_instance.addConverToBonusEffect(this)
  7214. }
  7215. this.canBeMatched = false;
  7216. PlayState.g_instance.takeStockMatch(this);
  7217. this.colorID = -1;
  7218. this.setState(this.STATE_NORMAL);
  7219. PlayState.g_instance.tryClearDirt(this.indexX, this.indexY);
  7220. PlayState.g_instance.tryClearStoneHeart(this.indexX, this.indexY)
  7221. };
  7222. t.prototype.fallDown = function() {
  7223. if (this.state == t.STATE_FALL_DOWN) {
  7224. return
  7225. }
  7226. this.setState(t.STATE_FALL_DOWN);
  7227. this.chipPicture.y = -this.chipPicture.getBounds().height / 2;
  7228. this.y -= this.chipPicture.getBounds().height / 2;
  7229. this.speed = new createjs.Point(Utils.RandomRange(-100, 100), -250);
  7230. this.rotationSpeed = Utils.RandomRange(-300, 300);
  7231. PlayState.g_instance.addChild(this);
  7232. if (!this.wasClear) {
  7233. PlayState.g_instance.clearCell(this);
  7234. this.wasClear = true
  7235. }
  7236. };
  7237. t.prototype.isHole = function() {
  7238. return this.hole
  7239. };
  7240. t.prototype.convertToHole = function() {
  7241. this.removeAllChildren();
  7242. this.hole = true;
  7243. this.y = this.spawnYPos;
  7244. this.setState(t.STATE_HOLE);
  7245. this.colorID = -1
  7246. };
  7247. t.prototype.convertToStoneHeart = function() {
  7248. this.stoneHeart = true;
  7249. this.colorID = -1;
  7250. var e = Constants.IMAGE_STONE_HEART;
  7251. this.chipPicture = AssetsManager.g_instance.getImage(e);
  7252. this.addChild(this.chipPicture);
  7253. this.chipPicture.x = -this.chipPicture.getBounds().width / 2;
  7254. this.chipPicture.y = -83
  7255. };
  7256. t.prototype.isStoneHeart = function() {
  7257. return this.stoneHeart
  7258. };
  7259. t.BONUS_4 = "BONUS_4";
  7260. t.BONUS_5 = "BONUS_5";
  7261. t.BONUS_BOMB = "BONUS_BOMB";
  7262. t.STATE_SPAWN_NEW = "STATE_SPAWN_NEW";
  7263. t.STATE_FALL_DOWN = "STATE_FALL_DOWN";
  7264. t.STATE_HOLE = "STATE_HOLE";
  7265. t.MATCH_REASON_SIMPLE = "MATCH_REASON_SIMPLE";
  7266. t.MATCH_REASON_EXCHANGE_WIHT_BONUS = "MATCH_REASON_EXCHANGE_WIHT_BONUS";
  7267. t.MATCH_REASON_BONUS_EFFECT_5 = "MATCH_REASON_BONUS_EFFECT_5";
  7268. t.MATCH_REASON_BONUS_EFFECT_4_HOR = "MATCH_REASON_BONUS_EFFECT_4_HOR";
  7269. t.MATCH_REASON_BONUS_EFFECT_4_VERT = "MATCH_REASON_BONUS_EFFECT_4_VERT";
  7270. t.MATCH_REASON_I_AM_BONUS = "MATCH_REASON_I_AM_BONUS";
  7271. return t
  7272. }(GameObject);
  7273. var Utils = function() {
  7274. function e() {}
  7275. e.RandomRange = function(e, t) {
  7276. return e + (t - e) * Math.random()
  7277. };
  7278. e.RandomRangeInt = function(e, t) {
  7279. return Math.floor(Math.random() * (t - e + 1)) + e
  7280. };
  7281. e.IntToTimeString = function(e) {
  7282. var t = Math.floor(e / 60);
  7283. var n = t.toString();
  7284. var r = e % 60;
  7285. var i;
  7286. if (r < 10) {
  7287. i = "0" + r
  7288. } else {
  7289. i = r.toString()
  7290. }
  7291. return n + "d" + i
  7292. };
  7293. e.RadToGrad = function(e) {
  7294. return e * 180 / Math.PI
  7295. };
  7296. e.GradToRad = function(e) {
  7297. return e * Math.PI / 180
  7298. };
  7299. e.IsMobileBrowser = function() {
  7300. if (window["orientation"] != undefined) {
  7301. return true
  7302. }
  7303. var e = false;
  7304. (function(t) {
  7305. if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(t) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0, 4))) e = true
  7306. })(navigator.userAgent || navigator.vendor || window["opera"]);
  7307. return e;
  7308. return false
  7309. };
  7310. e.ScaledOffset = function(e) {
  7311. return (window.devicePixelRatio ? window.devicePixelRatio : 1) * e / Constants.SCREEN_SCALE
  7312. };
  7313. e.GetScoreString = function(e) {
  7314. var t = e.toString();
  7315. switch (t.length) {
  7316. case 1:
  7317. t = "00000" + t;
  7318. break;
  7319. case 2:
  7320. t = "0000" + t;
  7321. break;
  7322. case 3:
  7323. t = "000" + t;
  7324. break;
  7325. case 4:
  7326. t = "00" + t;
  7327. break;
  7328. case 5:
  7329. t = "0" + t;
  7330. break
  7331. }
  7332. return t
  7333. };
  7334. return e
  7335. }();
  7336. var GameOverState = function(e) {
  7337. function t(t, n) {
  7338. var r = this;
  7339. e.call(this);
  7340. this.panel = new createjs.Container;
  7341. this.shader = new createjs.Shape;
  7342. this.shader.graphics.beginFill("#000000");
  7343. this.shader.graphics.drawRect(0, 0, Constants.ASSETS_WIDTH, Constants.SCREEN_HEIGHT);
  7344. this.shader.graphics.endFill();
  7345. this.addChild(this.shader);
  7346. this.shader.alpha = 0;
  7347. this.shaderTween = createjs.Tween.get(this.shader, {
  7348. loop: false
  7349. }).wait(400).to({
  7350. alpha: .4
  7351. }, 800, createjs.Ease.linear);
  7352. this.addChild(this.panel);
  7353. this.panel.x = Constants.ASSETS_WIDTH / 2;
  7354. this.panel.y = Constants.SCREEN_HEIGHT / 2;
  7355. var i = AssetsManager.g_instance.getCenteredImage(Constants.IMAGE_MESSAGE_WINDOW);
  7356. this.panel.addChild(i);
  7357. var s = new DNButton(Constants.IMAGE_BUTTON_RESTART, function() {
  7358. return r.onRestartTouch()
  7359. });
  7360. this.panel.addChild(s);
  7361. this.addGuiObject(s);
  7362. s.x = -110;
  7363. s.y = 100;
  7364. var o = new DNButton(Constants.IMAGE_BUTTON_EXIT, function() {
  7365. return r.onExitTouch()
  7366. });
  7367. this.panel.addChild(o);
  7368. this.addGuiObject(o);
  7369. o.x = +110;
  7370. o.y = 100;
  7371. var u = AssetsManager.g_instance.getCenteredImageWithProxy(Constants.IMAGE_GAMEOVER_CAPTION);
  7372. this.panel.addChild(u);
  7373. u.y = -210;
  7374. var a = -180;
  7375. var f = +180;
  7376. this.panel.alpha = 0;
  7377. createjs.Tween.get(this.panel, {
  7378. loop: false
  7379. }).to({
  7380. alpha: 1
  7381. }, 200, createjs.Ease.linear);
  7382. this.panel.scaleX = .7;
  7383. this.panel.scaleY = .7;
  7384. createjs.Tween.get(this.panel, {
  7385. loop: false
  7386. }).to({
  7387. scaleX: 1,
  7388. scaleY: 1
  7389. }, 400, createjs.Ease.backOut);
  7390. try {
  7391. SG_Hooks.gameOver(PlayState.g_curLevel, n)
  7392. } catch (l) {
  7393. console.log("error SG_Hooks.gameOver(PlayState.g_curLevel, score);")
  7394. }
  7395. }
  7396. __extends(t, e);
  7397. t.prototype.onRestartTouch = function() {
  7398. StateManager.g_instance.pushState(new ShadeInCircleState(new PlayState(PlayState.g_curLevel, false)))
  7399. };
  7400. t.prototype.onExitTouch = function() {
  7401. StateManager.g_instance.pushState(new ShadeInState(new MainMenuState))
  7402. };
  7403. return t
  7404. }(GameState);
  7405. var MainMenuState = function(e) {
  7406. function t() {
  7407. var t = this;
  7408. e.call(this);
  7409. this.someThing = true;
  7410. t.soundTouched = false;
  7411. this.addChild(AssetsManager.g_instance.getImage(Constants.IMAGE_TITLE_MAIN_MENU_BACK));
  7412. var n = new createjs.Container;
  7413. this.addChild(n);
  7414. n.x = Constants.ASSETS_WIDTH / 2;
  7415. n.y = 690;
  7416. n.scaleX = n.scaleY = 1.35;
  7417. var r = new DNButton(Constants.IMAGE_BUTTON_PLAY, function() {
  7418. console.log("start button pressed");
  7419. SG_Hooks.start();
  7420. console.log("SG_Hooks triggered!");
  7421. return t.onPlayTouch()
  7422. });
  7423. n.addChild(r);
  7424. this.addGuiObject(r);
  7425. createjs.Tween.get(r, {
  7426. loop: true
  7427. }).to({
  7428. scaleX: +1.05,
  7429. scaleY: +1.05
  7430. }, 150, createjs.Ease.linear).to({
  7431. scaleX: +.95,
  7432. scaleY: +.95
  7433. }, 300, createjs.Ease.linear).to({
  7434. scaleX: 1,
  7435. scaleY: 1
  7436. }, 150, createjs.Ease.linear).wait(4e3);
  7437. var i = new DNButton(Constants.IMAGE_BUTTON_MORE_GAMES, function() {
  7438. return t.onMoreGamesTouch()
  7439. });
  7440. this.addChild(i);
  7441. this.addGuiObject(i);
  7442. i.x = 150;
  7443. i.y = 700;
  7444. this.setSoundButton();
  7445. this.configureYAlign()
  7446. }
  7447. __extends(t, e);
  7448. t.prototype.configureYAlign = function() {
  7449. if (Constants.g_isPC) {
  7450. return
  7451. }
  7452. if (Constants.SCREEN_HEIGHT > Constants.ASSETS_HEIGHT) {
  7453. this.y = (Constants.SCREEN_HEIGHT - Constants.ASSETS_HEIGHT) / 2;
  7454. var e = new createjs.Shape;
  7455. e.graphics.beginFill("#ffffff");
  7456. e.graphics.drawRect(0, Constants.ASSETS_HEIGHT, Constants.ASSETS_WIDTH, Constants.SCREEN_HEIGHT - Constants.ASSETS_HEIGHT + 1);
  7457. e.graphics.endFill();
  7458. this.addChild(e);
  7459. var t = new createjs.Shape;
  7460. t.graphics.beginFill("#ffffff");
  7461. t.graphics.drawRect(0, Constants.ASSETS_HEIGHT - Constants.SCREEN_HEIGHT, Constants.ASSETS_WIDTH, Constants.SCREEN_HEIGHT - Constants.ASSETS_HEIGHT);
  7462. t.graphics.endFill();
  7463. this.addChild(t)
  7464. }
  7465. };
  7466. t.prototype.onOrientationChanged = function(t) {
  7467. e.prototype.onOrientationChanged.call(this, t);
  7468. if (!t) {
  7469. this.configureYAlign()
  7470. }
  7471. };
  7472. t.prototype.init = function() {
  7473. e.prototype.init.call(this)
  7474. };
  7475. t.prototype.runJelly = function() {
  7476. this.liveTime = 0
  7477. };
  7478. t.prototype.update = function(t) {
  7479. e.prototype.update.call(this, t)
  7480. };
  7481. t.prototype.onSoundTouch = function() {
  7482. var e = this;
  7483. if (e.soundTouched == false) {
  7484. e.soundTouched = true;
  7485. SoundManager.g_instance.setSoundEnabled(!SoundManager.g_instance.isSoundEnabled());
  7486. this.setSoundButton();
  7487. setTimeout(function() {
  7488. e.soundTouched = false
  7489. }, 500)
  7490. }
  7491. };
  7492. t.prototype.setSoundButton = function() {
  7493. var e = this;
  7494. if (this.soundButton && this.soundButton.parent) {
  7495. this.soundButton.parent.removeChild(this.soundButton)
  7496. }
  7497. var t = SoundManager.g_instance.isSoundEnabled();
  7498. this.soundButton = new DNButton(t ? Constants.IMAGE_BUTTON_SOUND_ON : Constants.IMAGE_BUTTON_SOUND_OFF, function() {
  7499. return e.onSoundTouch()
  7500. });
  7501. this.addChild(this.soundButton);
  7502. this.addGuiObject(this.soundButton);
  7503. this.soundButton.x = +620;
  7504. this.soundButton.y = +150
  7505. };
  7506. t.prototype.onMouseDown = function(t, n) {
  7507. e.prototype.onMouseDown.call(this, t, n)
  7508. };
  7509. t.prototype.onCreditsTouch = function() {
  7510. StateManager.g_instance.pushState(new CreditsState)
  7511. };
  7512. t.prototype.onMoreGamesTouch = function() {
  7513. Play68.goHome()
  7514. };
  7515. t.prototype.onPlayTouch = function() {
  7516. StateManager.g_instance.pushState(new ShadeInState(new SelectLevelState))
  7517. };
  7518. t.prototype.resume = function() {
  7519. this.configureYAlign()
  7520. };
  7521. return t
  7522. }(GameState);
  7523. var ShadeInState = function(e) {
  7524. function t(t) {
  7525. var n = this;
  7526. e.call(this);
  7527. this.nextState = null;
  7528. this.nextState = t;
  7529. this.shader = new createjs.Shape;
  7530. this.shader.graphics.beginFill("#ffffff");
  7531. this.shader.graphics.drawRect(0, 0, Constants.ASSETS_WIDTH, Constants.SCREEN_HEIGHT);
  7532. this.shader.graphics.endFill();
  7533. this.addChild(this.shader);
  7534. this.shader.alpha = 0;
  7535. createjs.Tween.get(this.shader, {
  7536. loop: false
  7537. }).to({
  7538. alpha: 1
  7539. }, 400, createjs.Ease.linear).call(function() {
  7540. return n.onFinishShade()
  7541. })
  7542. }
  7543. __extends(t, e);
  7544. t.prototype.onFinishShade = function() {
  7545. StateManager.g_instance.changeState(this.nextState);
  7546. StateManager.g_instance.pushState(new ShadeOutState)
  7547. };
  7548. t.prototype.setNextState = function(e) {
  7549. this.nextState = e
  7550. };
  7551. return t
  7552. }(GameState);
  7553. var ShadeOutState = function(e) {
  7554. function t() {
  7555. var t = this;
  7556. e.call(this);
  7557. this.shader = new createjs.Shape;
  7558. this.shader.graphics.beginFill("#ffffff");
  7559. this.shader.graphics.drawRect(0, 0, Constants.ASSETS_WIDTH, Constants.SCREEN_HEIGHT);
  7560. this.shader.graphics.endFill();
  7561. this.addChild(this.shader);
  7562. createjs.Tween.get(this.shader, {
  7563. loop: false
  7564. }).to({
  7565. alpha: 0
  7566. }, 400, createjs.Ease.linear).call(function() {
  7567. return t.onFinishShade()
  7568. })
  7569. }
  7570. __extends(t, e);
  7571. t.prototype.onFinishShade = function() {
  7572. StateManager.g_instance.popState()
  7573. };
  7574. return t
  7575. }(GameState);
  7576. var ShadeInCircleState = function(e) {
  7577. function t(t) {
  7578. var n = this;
  7579. e.call(this);
  7580. this.nextState = null;
  7581. this.nextState = t;
  7582. this.shader = new createjs.Shape;
  7583. this.shader.graphics.beginFill("#ffffff");
  7584. this.shader.graphics.drawRect(0, 0, Constants.ASSETS_WIDTH, Constants.SCREEN_HEIGHT);
  7585. this.shader.graphics.endFill();
  7586. this.addChild(this.shader);
  7587. this.shader.alpha = 0;
  7588. createjs.Tween.get(this.shader, {
  7589. loop: false
  7590. }).wait(400).to({
  7591. alpha: 1
  7592. }, 400, createjs.Ease.linear).call(function() {
  7593. return n.onFinishShade()
  7594. });
  7595. this.shining = AssetsManager.g_instance.getCenteredImageWithProxy(Constants.IMAGE_BIG_SHINING);
  7596. this.addChild(this.shining);
  7597. this.shining.x = Constants.ASSETS_WIDTH / 2;
  7598. this.shining.y = Constants.ASSETS_HEIGHT / 2;
  7599. createjs.Tween.get(this.shining, {
  7600. loop: false
  7601. }).to({
  7602. scaleX: 3.5,
  7603. scaleY: 3.5
  7604. }, 800, createjs.Ease.linear);
  7605. this.shining.alpha = 0;
  7606. createjs.Tween.get(this.shining, {
  7607. loop: false
  7608. }).to({
  7609. alpha: 1
  7610. }, 400, createjs.Ease.linear);
  7611. createjs.Tween.get(this.shining, {
  7612. loop: false
  7613. }).to({
  7614. rotation: 100
  7615. }, 800, createjs.Ease.linear)
  7616. }
  7617. __extends(t, e);
  7618. t.prototype.onFinishShade = function() {
  7619. StateManager.g_instance.changeState(this.nextState);
  7620. StateManager.g_instance.pushState(new ShadeOutState)
  7621. };
  7622. t.prototype.setNextState = function(e) {
  7623. this.nextState = e
  7624. };
  7625. return t
  7626. }(GameState);
  7627. var CreditsState = function(e) {
  7628. function t() {
  7629. e.call(this);
  7630. this.hiddingNow = false;
  7631. this.shader = new createjs.Shape;
  7632. this.shader.graphics.beginFill("#ffffff");
  7633. this.shader.graphics.drawRect(0, 0, Constants.ASSETS_WIDTH, Constants.SCREEN_HEIGHT);
  7634. this.shader.graphics.endFill();
  7635. this.addChild(this.shader);
  7636. this.shader.alpha = 0;
  7637. createjs.Tween.get(this.shader, {
  7638. loop: false
  7639. }).to({
  7640. alpha: .82
  7641. }, 500, createjs.Ease.linear);
  7642. this.container = new createjs.Container;
  7643. this.addChild(this.container);
  7644. this.container.alpha = 0;
  7645. createjs.Tween.get(this.container, {
  7646. loop: false
  7647. }).to({
  7648. alpha: 1
  7649. }, 500, createjs.Ease.linear);
  7650. var t = ["PROGRAMMING / GAME DESIGN:", "Konstantin Boronenkov", "", "", "ART:", "Vladimir Makarov", "Anna Turkova", "", "", "MUSIC / SOUND:", "Alexander Ahuro", "", "", "Hypnocat Studio 2014", "gibbetsfeedback@gmail.com"];
  7651. for (var n = 0; n < t.length; n++) {
  7652. var r = new createjs.Text(t[n], "bold 35px Times New Roman", "#222222");
  7653. r.textAlign = "center";
  7654. this.container.addChild(r);
  7655. r.x = Constants.ASSETS_WIDTH / 2;
  7656. r.y = 100 + n * 40
  7657. }
  7658. }
  7659. __extends(t, e);
  7660. t.prototype.onMouseDown = function(e, t) {
  7661. this.hide()
  7662. };
  7663. t.prototype.hide = function() {
  7664. if (!this.hiddingNow) {
  7665. createjs.Tween.get(this.shader, {
  7666. loop: false
  7667. }).to({
  7668. alpha: 0
  7669. }, 400, createjs.Ease.linear).call(function() {
  7670. StateManager.g_instance.popState()
  7671. });
  7672. createjs.Tween.get(this.container, {
  7673. loop: false
  7674. }).to({
  7675. alpha: 0
  7676. }, 400, createjs.Ease.linear);
  7677. this.hiddingNow = true
  7678. }
  7679. };
  7680. return t
  7681. }(GameState);
  7682. var GameData = function() {
  7683. function e() {
  7684. this.levelsCompleted = 0;
  7685. this.totalScore = 0;
  7686. this.levels = [{
  7687. form: [
  7688. [0, 1, 1, 1, 1, 1, 1, 0],
  7689. [0, 1, 1, 1, 1, 1, 1, 0],
  7690. [0, 1, 1, 1, 1, 1, 1, 0],
  7691. [0, 1, 1, 1, 1, 1, 1, 0],
  7692. [0, 1, 1, 1, 1, 1, 1, 0],
  7693. [0, 1, 1, 1, 1, 1, 1, 0],
  7694. [0, 1, 1, 1, 1, 1, 1, 0],
  7695. [0, 0, 0, 0, 0, 0, 0, 0]
  7696. ],
  7697. dirt: null,
  7698. chips: [
  7699. [0, 5, 3, 2, 1, 2, 5, 0],
  7700. [0, 1, 2, 1, 2, 1, 4, 0],
  7701. [0, 3, 1, 5, 1, 5, 1, 0],
  7702. [0, 1, 2, 3, 3, 2, 4, 0],
  7703. [0, 2, 3, 5, 1, 4, 1, 0],
  7704. [0, 2, 5, 3, 5, 1, 4, 0],
  7705. [0, 1, 2, 3, 1, 4, 1, 0],
  7706. [0, 0, 0, 0, 0, 0, 0, 0]
  7707. ],
  7708. chip_types: 5,
  7709. moves: 25,
  7710. chip_goal: 4,
  7711. chip_goal_count: 13
  7712. }, {
  7713. form: [
  7714. [0, 0, 1, 0, 0, 1, 0, 0],
  7715. [0, 1, 1, 1, 1, 1, 1, 0],
  7716. [1, 1, 1, 1, 1, 1, 1, 1],
  7717. [0, 1, 1, 1, 1, 1, 1, 0],
  7718. [0, 1, 1, 1, 1, 1, 1, 0],
  7719. [1, 1, 1, 1, 1, 1, 1, 1],
  7720. [0, 1, 1, 1, 1, 1, 1, 0],
  7721. [0, 0, 1, 0, 0, 1, 0, 0]
  7722. ],
  7723. dirt: null,
  7724. chips: [
  7725. [0, 0, 4, 0, 0, 1, 0, 0],
  7726. [0, 1, 2, 2, 3, 4, 5, 0],
  7727. [2, 1, 3, 3, 4, 1, 2, 3],
  7728. [0, 4, 1, 5, 4, 4, 2, 0],
  7729. [0, 3, 4, 1, 2, 3, 1, 0],
  7730. [1, 2, 3, 5, 5, 3, 5, 2],
  7731. [0, 5, 1, 5, 4, 2, 2, 0],
  7732. [0, 0, 5, 0, 0, 1, 0, 0]
  7733. ],
  7734. chip_types: 5,
  7735. moves: 30,
  7736. chip_goal: 1,
  7737. chip_goal_count: 20
  7738. }, {
  7739. form: [
  7740. [0, 0, 0, 0, 0, 0, 0, 0],
  7741. [0, 1, 1, 1, 1, 1, 1, 0],
  7742. [0, 1, 1, 1, 1, 1, 1, 0],
  7743. [0, 1, 1, 1, 1, 1, 1, 0],
  7744. [0, 1, 1, 1, 1, 1, 1, 0],
  7745. [0, 1, 1, 1, 1, 1, 1, 0],
  7746. [0, 1, 1, 1, 1, 1, 1, 0],
  7747. [0, 0, 0, 0, 0, 0, 0, 0]
  7748. ],
  7749. dirt: [
  7750. [0, 0, 0, 0, 0, 0, 0, 0],
  7751. [0, 0, 1, 1, 1, 1, 0, 0],
  7752. [0, 0, 1, 1, 1, 1, 0, 0],
  7753. [0, 0, 1, 1, 1, 1, 0, 0],
  7754. [0, 0, 1, 1, 1, 1, 0, 0],
  7755. [0, 0, 1, 1, 1, 1, 0, 0],
  7756. [0, 0, 1, 1, 1, 1, 0, 0],
  7757. [0, 0, 0, 0, 0, 0, 0, 0]
  7758. ],
  7759. chips: [
  7760. [0, 0, 0, 0, 0, 0, 0, 0],
  7761. [0, 1, 2, 4, 3, 4, 5, 0],
  7762. [0, 3, 3, 5, 2, 1, 5, 0],
  7763. [0, 2, 4, 1, 2, 6, 6, 0],
  7764. [0, 2, 4, 2, 3, 3, 4, 0],
  7765. [0, 1, 2, 3, 4, 6, 6, 0],
  7766. [0, 2, 1, 5, 5, 4, 2, 0],
  7767. [0, 0, 0, 0, 0, 0, 0, 0]
  7768. ],
  7769. chip_types: 6,
  7770. moves: 40,
  7771. chip_goal: 0,
  7772. chip_goal_count: 0
  7773. }, {
  7774. form: [
  7775. [0, 1, 1, 1, 1, 1, 1, 0],
  7776. [0, 1, 1, 1, 1, 1, 1, 0],
  7777. [0, 1, 1, 1, 1, 1, 1, 0],
  7778. [0, 1, 1, 0, 0, 1, 1, 0],
  7779. [0, 1, 1, 0, 0, 1, 1, 0],
  7780. [0, 1, 1, 1, 1, 1, 1, 0],
  7781. [0, 1, 1, 1, 1, 1, 1, 0],
  7782. [0, 1, 1, 1, 1, 1, 1, 0]
  7783. ],
  7784. dirt: [
  7785. [0, 0, 0, 0, 0, 0, 0, 0],
  7786. [0, 1, 1, 1, 1, 1, 1, 0],
  7787. [0, 1, 1, 1, 1, 1, 1, 0],
  7788. [0, 1, 1, 0, 0, 1, 1, 0],
  7789. [0, 1, 1, 0, 0, 1, 1, 0],
  7790. [0, 1, 1, 1, 1, 1, 1, 0],
  7791. [0, 1, 1, 1, 1, 1, 1, 0],
  7792. [0, 0, 0, 0, 0, 0, 0, 0]
  7793. ],
  7794. chips: [
  7795. [0, 4, 3, 1, 4, 3, 1, 0],
  7796. [0, 1, 1, 2, 1, 1, 4, 0],
  7797. [0, 2, 1, 1, 2, 3, 1, 0],
  7798. [0, 3, 3, 0, 0, 1, 2, 0],
  7799. [0, 4, 4, 0, 0, 2, 1, 0],
  7800. [0, 4, 4, 2, 2, 1, 2, 0],
  7801. [0, 2, 3, 3, 4, 4, 1, 0],
  7802. [0, 1, 2, 2, 3, 4, 1, 0]
  7803. ],
  7804. chip_types: 4,
  7805. moves: 25,
  7806. chip_goal: 0,
  7807. chip_goal_count: 0
  7808. }, {
  7809. form: [
  7810. [0, 0, 0, 1, 1, 0, 0, 0],
  7811. [0, 0, 1, 1, 1, 1, 0, 0],
  7812. [0, 1, 1, 1, 1, 1, 1, 0],
  7813. [1, 1, 1, 1, 1, 1, 1, 1],
  7814. [1, 1, 1, 1, 1, 1, 1, 1],
  7815. [0, 1, 1, 1, 1, 1, 1, 0],
  7816. [0, 0, 1, 1, 1, 1, 0, 0],
  7817. [0, 0, 0, 1, 1, 0, 0, 0]
  7818. ],
  7819. dirt: [
  7820. [0, 0, 0, 1, 1, 0, 0, 0],
  7821. [0, 0, 1, 1, 1, 1, 0, 0],
  7822. [0, 1, 1, 1, 1, 1, 1, 0],
  7823. [1, 1, 1, 1, 1, 1, 1, 1],
  7824. [1, 1, 1, 1, 1, 1, 1, 1],
  7825. [0, 1, 1, 1, 1, 1, 1, 0],
  7826. [0, 0, 1, 1, 1, 1, 0, 0],
  7827. [0, 0, 0, 1, 1, 0, 0, 0]
  7828. ],
  7829. chips: [
  7830. [0, 0, 0, 2, 1, 0, 0, 0],
  7831. [0, 0, 3, 2, 2, 1, 0, 0],
  7832. [0, 5, 1, 9, 9, 4, 4, 0],
  7833. [3, 1, 9, 9, 9, 9, 2, 1],
  7834. [1, 3, 9, 9, 9, 9, 4, 5],
  7835. [0, 1, 2, 9, 9, 1, 2, 0],
  7836. [0, 0, 3, 2, 2, 4, 0, 0],
  7837. [0, 0, 0, 3, 2, 0, 0, 0]
  7838. ],
  7839. chip_types: 5,
  7840. moves: 25,
  7841. chip_goal: 0,
  7842. chip_goal_count: 0
  7843. }, {
  7844. form: [
  7845. [1, 1, 1, 1, 1, 1, 1, 1],
  7846. [1, 1, 1, 1, 1, 1, 1, 1],
  7847. [1, 1, 1, 1, 1, 1, 1, 1],
  7848. [1, 1, 1, 1, 1, 1, 1, 1],
  7849. [1, 1, 1, 1, 1, 1, 1, 1],
  7850. [1, 1, 1, 1, 1, 1, 1, 1],
  7851. [1, 1, 1, 1, 1, 1, 1, 1],
  7852. [1, 1, 1, 1, 1, 1, 1, 1]
  7853. ],
  7854. dirt: null,
  7855. chips: [
  7856. [2, 3, 4, 5, 5, 1, 6, 6],
  7857. [9, 9, 9, 9, 9, 9, 9, 9],
  7858. [1, 2, 2, 3, 3, 2, 4, 1],
  7859. [9, 9, 9, 9, 9, 9, 9, 9],
  7860. [2, 2, 1, 2, 1, 5, 4, 6],
  7861. [9, 9, 9, 9, 9, 9, 9, 9],
  7862. [4, 5, 6, 2, 1, 3, 2, 2],
  7863. [9, 9, 9, 9, 9, 9, 9, 9]
  7864. ],
  7865. chip_types: 6,
  7866. moves: 20,
  7867. chip_goal: 3,
  7868. chip_goal_count: 20
  7869. }, {
  7870. form: [
  7871. [1, 1, 1, 1, 1, 1, 1, 1],
  7872. [1, 1, 1, 1, 1, 1, 1, 1],
  7873. [1, 1, 1, 1, 1, 1, 1, 1],
  7874. [0, 0, 0, 0, 0, 0, 0, 0],
  7875. [1, 1, 1, 1, 1, 1, 1, 1],
  7876. [1, 1, 1, 1, 1, 1, 1, 1],
  7877. [1, 1, 1, 1, 1, 1, 1, 1],
  7878. [1, 1, 1, 1, 1, 1, 1, 1]
  7879. ],
  7880. dirt: null,
  7881. chips: [
  7882. [1, 2, 6, 5, 1, 5, 1, 2],
  7883. [4, 1, 3, 3, 2, 3, 5, 5],
  7884. [1, 2, 1, 6, 6, 2, 1, 6],
  7885. [0, 0, 0, 0, 0, 0, 0, 0],
  7886. [2, 3, 2, 5, 6, 5, 1, 2],
  7887. [2, 3, 2, 1, 2, 4, 2, 3],
  7888. [3, 6, 6, 2, 1, 3, 3, 2],
  7889. [6, 1, 2, 4, 4, 1, 4, 4]
  7890. ],
  7891. chip_types: 6,
  7892. moves: 30,
  7893. chip_goal: 4,
  7894. chip_goal_count: 12
  7895. }, {
  7896. form: [
  7897. [1, 1, 1, 1, 1, 1, 1, 1],
  7898. [1, 1, 1, 1, 1, 1, 1, 1],
  7899. [1, 1, 1, 1, 1, 1, 1, 1],
  7900. [1, 1, 1, 1, 1, 1, 1, 1],
  7901. [1, 1, 1, 1, 1, 1, 1, 1],
  7902. [1, 1, 1, 1, 1, 1, 1, 1],
  7903. [1, 1, 0, 1, 1, 0, 1, 1],
  7904. [1, 0, 0, 0, 0, 0, 0, 1]
  7905. ],
  7906. dirt: [
  7907. [0, 0, 0, 1, 1, 0, 0, 0],
  7908. [0, 1, 1, 1, 1, 1, 1, 0],
  7909. [0, 1, 1, 1, 1, 1, 1, 0],
  7910. [0, 1, 1, 1, 1, 1, 1, 0],
  7911. [0, 1, 1, 1, 1, 1, 1, 0],
  7912. [0, 1, 1, 1, 1, 1, 1, 0],
  7913. [0, 0, 0, 1, 1, 0, 0, 0],
  7914. [0, 0, 0, 0, 0, 0, 0, 0]
  7915. ],
  7916. chips: [
  7917. [5, 5, 1, 3, 5, 4, 1, 2],
  7918. [2, 2, 5, 1, 3, 4, 5, 2],
  7919. [1, 2, 2, 1, 3, 3, 4, 5],
  7920. [5, 3, 4, 4, 1, 4, 3, 1],
  7921. [2, 1, 2, 3, 2, 4, 2, 5],
  7922. [1, 2, 1, 2, 5, 1, 4, 2],
  7923. [5, 4, 0, 2, 1, 0, 3, 3],
  7924. [3, 0, 0, 0, 0, 0, 0, 3]
  7925. ],
  7926. chip_types: 5,
  7927. moves: 30,
  7928. chip_goal: 0,
  7929. chip_goal_count: 0
  7930. }, {
  7931. form: [
  7932. [0, 0, 0, 1, 1, 0, 0, 0],
  7933. [0, 0, 0, 1, 1, 0, 0, 0],
  7934. [0, 1, 1, 1, 1, 1, 1, 0],
  7935. [1, 1, 1, 1, 1, 1, 1, 1],
  7936. [1, 1, 1, 1, 1, 1, 1, 1],
  7937. [0, 1, 1, 1, 1, 1, 1, 0],
  7938. [0, 0, 0, 1, 1, 0, 0, 0],
  7939. [0, 0, 0, 1, 1, 0, 0, 0]
  7940. ],
  7941. dirt: [
  7942. [0, 0, 0, 1, 1, 0, 0, 0],
  7943. [0, 0, 0, 1, 1, 0, 0, 0],
  7944. [0, 1, 1, 1, 1, 1, 1, 0],
  7945. [1, 1, 1, 1, 1, 1, 1, 1],
  7946. [1, 1, 1, 1, 1, 1, 1, 1],
  7947. [0, 1, 1, 1, 1, 1, 1, 0],
  7948. [0, 0, 0, 1, 1, 0, 0, 0],
  7949. [0, 0, 0, 1, 1, 0, 0, 0]
  7950. ],
  7951. chips: [
  7952. [0, 0, 0, 9, 9, 0, 0, 0],
  7953. [0, 0, 0, 9, 9, 0, 0, 0],
  7954. [0, 2, 3, 9, 9, 2, 4, 0],
  7955. [3, 4, 2, 9, 9, 3, 4, 1],
  7956. [1, 2, 4, 9, 9, 2, 2, 4],
  7957. [0, 2, 1, 9, 9, 2, 1, 0],
  7958. [0, 0, 3, 9, 9, 3, 0, 0],
  7959. [0, 0, 0, 9, 9, 0, 0, 0]
  7960. ],
  7961. chip_types: 4,
  7962. moves: 30,
  7963. chip_goal: 0,
  7964. chip_goal_count: 0
  7965. }, {
  7966. form: [
  7967. [0, 1, 1, 1, 1, 1, 1, 0],
  7968. [1, 1, 1, 1, 1, 1, 1, 1],
  7969. [1, 1, 1, 1, 1, 1, 1, 1],
  7970. [1, 1, 1, 0, 0, 1, 1, 1],
  7971. [1, 1, 1, 0, 0, 1, 1, 1],
  7972. [1, 1, 1, 1, 1, 1, 1, 1],
  7973. [1, 1, 1, 1, 1, 1, 1, 1],
  7974. [0, 1, 1, 1, 1, 1, 1, 0]
  7975. ],
  7976. dirt: null,
  7977. chips: [
  7978. [0, 2, 6, 5, 1, 5, 1, 0],
  7979. [4, 1, 3, 3, 2, 3, 5, 5],
  7980. [1, 2, 1, 6, 6, 2, 1, 6],
  7981. [7, 7, 1, 0, 0, 2, 1, 3],
  7982. [1, 5, 6, 0, 0, 6, 7, 7],
  7983. [2, 3, 2, 1, 2, 4, 2, 3],
  7984. [3, 6, 6, 2, 1, 3, 3, 2],
  7985. [0, 1, 2, 4, 4, 1, 4, 0]
  7986. ],
  7987. chip_types: 7,
  7988. moves: 25,
  7989. chip_goal: 7,
  7990. chip_goal_count: 8
  7991. }, {
  7992. form: [
  7993. [1, 1, 1, 1, 1, 1, 1, 1],
  7994. [1, 1, 1, 1, 1, 1, 1, 1],
  7995. [0, 0, 1, 1, 1, 1, 1, 1],
  7996. [0, 0, 0, 1, 1, 1, 1, 1],
  7997. [0, 0, 0, 0, 1, 1, 1, 1],
  7998. [0, 0, 0, 0, 0, 1, 1, 1],
  7999. [0, 0, 0, 0, 0, 0, 1, 1],
  8000. [0, 0, 0, 0, 0, 0, 1, 1]
  8001. ],
  8002. dirt: null,
  8003. chips: [
  8004. [1, 2, 6, 5, 1, 5, 5, 9],
  8005. [2, 1, 3, 3, 2, 3, 5, 9],
  8006. [0, 0, 1, 6, 6, 2, 1, 9],
  8007. [0, 0, 0, 3, 3, 2, 1, 9],
  8008. [0, 0, 0, 0, 1, 6, 7, 9],
  8009. [0, 0, 0, 0, 0, 3, 2, 9],
  8010. [0, 0, 0, 0, 0, 0, 3, 9],
  8011. [0, 0, 0, 0, 0, 0, 3, 9]
  8012. ],
  8013. chip_types: 7,
  8014. moves: 21,
  8015. chip_goal: 6,
  8016. chip_goal_count: 12
  8017. }, {
  8018. form: [
  8019. [0, 0, 1, 1, 1, 1, 1, 1],
  8020. [0, 0, 0, 1, 1, 1, 1, 1],
  8021. [1, 0, 0, 0, 1, 1, 1, 1],
  8022. [1, 1, 0, 0, 0, 1, 1, 1],
  8023. [1, 1, 1, 0, 0, 0, 1, 1],
  8024. [1, 1, 1, 1, 0, 0, 0, 1],
  8025. [1, 1, 1, 1, 1, 0, 0, 0],
  8026. [1, 1, 1, 1, 1, 1, 0, 0]
  8027. ],
  8028. dirt: [
  8029. [0, 0, 0, 0, 0, 0, 0, 0],
  8030. [0, 0, 0, 0, 0, 0, 0, 0],
  8031. [1, 0, 0, 0, 0, 0, 0, 0],
  8032. [1, 1, 0, 0, 0, 0, 0, 0],
  8033. [1, 1, 1, 0, 0, 0, 0, 0],
  8034. [1, 1, 1, 1, 0, 0, 0, 0],
  8035. [1, 1, 1, 1, 1, 0, 0, 0],
  8036. [1, 1, 1, 1, 1, 1, 0, 0]
  8037. ],
  8038. chips: [
  8039. [0, 0, 9, 1, 1, 4, 9, 9],
  8040. [0, 0, 0, 5, 4, 2, 9, 9],
  8041. [2, 0, 0, 0, 2, 1, 1, 2],
  8042. [1, 2, 0, 0, 0, 5, 5, 4],
  8043. [2, 1, 3, 0, 0, 0, 1, 1],
  8044. [1, 2, 5, 3, 0, 0, 0, 4],
  8045. [9, 9, 5, 1, 5, 0, 0, 0],
  8046. [9, 9, 1, 4, 1, 9, 0, 0]
  8047. ],
  8048. chip_types: 5,
  8049. moves: 45,
  8050. chip_goal: 0,
  8051. chip_goal_count: 0
  8052. }, {
  8053. form: [
  8054. [1, 1, 1, 1, 1, 1, 1, 1],
  8055. [1, 1, 1, 1, 1, 1, 1, 1],
  8056. [1, 1, 1, 1, 1, 1, 1, 1],
  8057. [1, 1, 1, 1, 1, 1, 1, 1],
  8058. [1, 1, 1, 1, 1, 1, 1, 1],
  8059. [1, 1, 1, 1, 1, 1, 1, 1],
  8060. [1, 0, 1, 0, 0, 1, 0, 1],
  8061. [1, 0, 0, 0, 0, 0, 0, 1]
  8062. ],
  8063. dirt: [
  8064. [0, 0, 0, 0, 0, 0, 0, 0],
  8065. [0, 0, 0, 0, 0, 0, 0, 0],
  8066. [0, 0, 0, 0, 0, 0, 0, 0],
  8067. [0, 0, 0, 0, 0, 0, 0, 0],
  8068. [0, 1, 1, 1, 1, 1, 1, 0],
  8069. [0, 1, 1, 1, 1, 1, 1, 0],
  8070. [0, 0, 1, 0, 0, 1, 0, 0],
  8071. [0, 0, 0, 0, 0, 0, 0, 0]
  8072. ],
  8073. chips: [
  8074. [2, 1, 5, 4, 2, 3, 3, 2],
  8075. [4, 5, 3, 4, 4, 5, 4, 1],
  8076. [5, 4, 3, 5, 5, 3, 5, 4],
  8077. [3, 4, 5, 4, 3, 4, 3, 5],
  8078. [9, 9, 9, 9, 9, 9, 9, 9],
  8079. [9, 9, 9, 9, 9, 9, 9, 9],
  8080. [9, 0, 9, 0, 0, 9, 0, 9],
  8081. [9, 0, 0, 0, 0, 0, 0, 9]
  8082. ],
  8083. chip_types: 5,
  8084. moves: 30,
  8085. chip_goal: 0,
  8086. chip_goal_count: 0
  8087. }, {
  8088. form: [
  8089. [1, 1, 1, 1, 1, 1, 1, 1],
  8090. [1, 1, 1, 0, 1, 1, 1, 0],
  8091. [1, 0, 1, 1, 1, 0, 1, 1],
  8092. [1, 1, 1, 1, 1, 1, 1, 1],
  8093. [1, 1, 1, 1, 1, 1, 1, 1],
  8094. [0, 1, 0, 1, 0, 1, 0, 1],
  8095. [0, 1, 0, 1, 0, 1, 0, 1],
  8096. [1, 1, 1, 1, 1, 1, 1, 1]
  8097. ],
  8098. dirt: null,
  8099. chips: [
  8100. [4, 4, 3, 3, 4, 4, 1, 1],
  8101. [2, 4, 2, 0, 1, 4, 1, 0],
  8102. [3, 0, 4, 2, 2, 0, 3, 1],
  8103. [2, 3, 1, 4, 1, 2, 1, 3],
  8104. [4, 4, 1, 2, 3, 1, 3, 4],
  8105. [0, 2, 0, 1, 0, 2, 0, 4],
  8106. [0, 1, 0, 1, 0, 1, 0, 2],
  8107. [1, 2, 3, 4, 1, 2, 1, 1]
  8108. ],
  8109. chip_types: 4,
  8110. moves: 20,
  8111. chip_goal: 2,
  8112. chip_goal_count: 35
  8113. }, {
  8114. form: [
  8115. [1, 1, 1, 1, 1, 1, 1, 1],
  8116. [1, 1, 1, 1, 1, 1, 1, 1],
  8117. [1, 0, 0, 1, 1, 0, 0, 1],
  8118. [1, 1, 1, 1, 1, 1, 1, 1],
  8119. [1, 1, 1, 1, 1, 1, 1, 1],
  8120. [1, 1, 1, 1, 1, 1, 1, 1],
  8121. [1, 1, 1, 1, 1, 1, 1, 1],
  8122. [1, 1, 0, 0, 0, 0, 1, 1]
  8123. ],
  8124. dirt: null,
  8125. chips: [
  8126. [9, 2, 3, 9, 9, 3, 4, 9],
  8127. [9, 5, 6, 9, 9, 6, 1, 9],
  8128. [9, 0, 0, 9, 9, 4, 4, 9],
  8129. [9, 3, 2, 9, 9, 2, 2, 9],
  8130. [9, 5, 6, 9, 9, 4, 1, 9],
  8131. [9, 1, 6, 9, 9, 4, 6, 9],
  8132. [9, 6, 1, 9, 9, 5, 6, 9],
  8133. [9, 1, 0, 0, 0, 0, 1, 9]
  8134. ],
  8135. chip_types: 6,
  8136. moves: 23,
  8137. chip_goal: 1,
  8138. chip_goal_count: 20
  8139. }, {
  8140. form: [
  8141. [1, 1, 1, 0, 0, 1, 1, 1],
  8142. [1, 1, 1, 0, 0, 1, 1, 1],
  8143. [1, 1, 1, 0, 0, 1, 1, 1],
  8144. [1, 1, 1, 1, 1, 1, 1, 1],
  8145. [1, 1, 1, 1, 1, 1, 1, 1],
  8146. [1, 1, 1, 0, 0, 1, 1, 1],
  8147. [1, 1, 1, 0, 0, 1, 1, 1],
  8148. [1, 1, 1, 0, 0, 1, 1, 1]
  8149. ],
  8150. dirt: null,
  8151. chips: [
  8152. [1, 1, 2, 0, 0, 2, 2, 7],
  8153. [2, 1, 2, 0, 0, 1, 3, 1],
  8154. [6, 6, 5, 0, 0, 2, 2, 1],
  8155. [5, 6, 6, 9, 9, 1, 6, 5],
  8156. [1, 2, 3, 9, 9, 3, 6, 5],
  8157. [7, 3, 2, 0, 0, 2, 7, 1],
  8158. [1, 7, 7, 0, 0, 1, 7, 1],
  8159. [9, 9, 9, 0, 0, 9, 9, 9]
  8160. ],
  8161. chip_types: 7,
  8162. moves: 36,
  8163. chip_goal: 7,
  8164. chip_goal_count: 20
  8165. }, {
  8166. form: [
  8167. [0, 0, 0, 1, 1, 0, 0, 0],
  8168. [0, 0, 0, 1, 1, 0, 0, 0],
  8169. [0, 0, 1, 1, 1, 1, 0, 0],
  8170. [0, 1, 1, 1, 1, 1, 1, 0],
  8171. [0, 1, 1, 1, 1, 1, 1, 0],
  8172. [0, 0, 1, 1, 1, 1, 0, 0],
  8173. [0, 0, 0, 1, 1, 0, 0, 0],
  8174. [0, 0, 0, 1, 1, 0, 0, 0]
  8175. ],
  8176. dirt: null,
  8177. chips: [
  8178. [0, 0, 0, 2, 3, 0, 0, 0],
  8179. [0, 0, 0, 4, 5, 0, 0, 0],
  8180. [0, 0, 1, 2, 2, 3, 2, 0],
  8181. [0, 1, 3, 4, 5, 3, 4, 0],
  8182. [0, 1, 3, 4, 2, 2, 3, 0],
  8183. [0, 0, 1, 2, 3, 4, 0, 0],
  8184. [0, 0, 0, 1, 1, 0, 0, 0],
  8185. [0, 0, 0, 1, 1, 0, 0, 0]
  8186. ],
  8187. chip_types: 5,
  8188. moves: 18,
  8189. chip_goal: 5,
  8190. chip_goal_count: 15
  8191. }, {
  8192. form: [
  8193. [1, 1, 1, 1, 1, 1, 1, 1],
  8194. [1, 1, 1, 1, 1, 1, 1, 1],
  8195. [1, 0, 0, 1, 1, 0, 0, 1],
  8196. [1, 1, 1, 1, 1, 1, 1, 1],
  8197. [1, 0, 0, 1, 1, 0, 0, 1],
  8198. [1, 1, 1, 1, 1, 1, 1, 1],
  8199. [1, 1, 1, 1, 1, 1, 1, 1],
  8200. [1, 1, 1, 1, 1, 1, 1, 1]
  8201. ],
  8202. dirt: [
  8203. [1, 1, 1, 1, 1, 1, 1, 1],
  8204. [1, 1, 1, 1, 1, 1, 1, 1],
  8205. [1, 0, 0, 1, 1, 0, 0, 1],
  8206. [1, 1, 1, 1, 1, 1, 1, 1],
  8207. [1, 0, 0, 1, 1, 0, 0, 1],
  8208. [1, 1, 1, 1, 1, 1, 1, 1],
  8209. [1, 1, 1, 1, 1, 1, 1, 1],
  8210. [1, 1, 1, 1, 1, 1, 1, 1]
  8211. ],
  8212. chips: [
  8213. [5, 4, 3, 4, 5, 4, 5, 4],
  8214. [4, 5, 4, 5, 3, 5, 4, 3],
  8215. [3, 0, 0, 5, 3, 0, 0, 2],
  8216. [1, 1, 3, 1, 1, 5, 1, 1],
  8217. [2, 0, 0, 1, 3, 0, 0, 2],
  8218. [3, 1, 4, 3, 1, 5, 2, 1],
  8219. [1, 5, 1, 3, 1, 4, 1, 2],
  8220. [1, 5, 1, 2, 5, 1, 2, 1]
  8221. ],
  8222. chip_types: 5,
  8223. moves: 26,
  8224. chip_goal: 0,
  8225. chip_goal_count: 0
  8226. }, {
  8227. form: [
  8228. [1, 1, 1, 1, 1, 1, 1, 1],
  8229. [1, 1, 1, 1, 1, 1, 1, 1],
  8230. [1, 1, 1, 1, 1, 1, 1, 1],
  8231. [1, 1, 1, 1, 1, 1, 1, 1],
  8232. [1, 1, 1, 1, 1, 1, 1, 1],
  8233. [1, 1, 1, 1, 1, 1, 1, 1],
  8234. [1, 1, 1, 1, 1, 1, 1, 1],
  8235. [1, 1, 1, 1, 1, 1, 1, 1]
  8236. ],
  8237. dirt: [
  8238. [0, 0, 0, 0, 0, 0, 0, 0],
  8239. [0, 1, 0, 1, 0, 1, 0, 1],
  8240. [0, 1, 0, 1, 0, 1, 0, 1],
  8241. [0, 1, 0, 1, 0, 1, 0, 1],
  8242. [0, 1, 0, 1, 0, 1, 0, 1],
  8243. [0, 1, 0, 1, 0, 1, 0, 1],
  8244. [0, 1, 0, 1, 0, 1, 0, 1],
  8245. [0, 0, 0, 0, 0, 0, 0, 0]
  8246. ],
  8247. chips: [
  8248. [1, 2, 1, 2, 2, 3, 4, 1],
  8249. [7, 7, 6, 5, 4, 6, 5, 7],
  8250. [2, 3, 4, 5, 4, 5, 2, 1],
  8251. [2, 6, 6, 4, 5, 5, 6, 7],
  8252. [9, 9, 9, 9, 9, 9, 9, 9],
  8253. [2, 1, 3, 4, 5, 4, 3, 3],
  8254. [1, 2, 3, 4, 5, 4, 3, 3],
  8255. [1, 2, 4, 3, 4, 5, 7, 7]
  8256. ],
  8257. chip_types: 7,
  8258. moves: 50,
  8259. chip_goal: 0,
  8260. chip_goal_count: 0
  8261. }, {
  8262. form: [
  8263. [1, 1, 1, 1, 1, 1, 1, 1],
  8264. [1, 1, 1, 1, 1, 1, 1, 1],
  8265. [1, 1, 1, 1, 1, 1, 1, 1],
  8266. [1, 1, 1, 1, 1, 1, 1, 1],
  8267. [1, 1, 1, 1, 1, 1, 1, 1],
  8268. [1, 1, 1, 1, 1, 1, 1, 1],
  8269. [1, 1, 1, 1, 1, 1, 1, 1],
  8270. [1, 1, 1, 1, 1, 1, 1, 1]
  8271. ],
  8272. dirt: [
  8273. [1, 0, 1, 0, 1, 0, 1, 0],
  8274. [0, 1, 0, 1, 0, 1, 0, 1],
  8275. [1, 0, 1, 0, 1, 0, 1, 0],
  8276. [0, 1, 0, 1, 0, 1, 0, 1],
  8277. [1, 0, 1, 0, 1, 0, 1, 0],
  8278. [0, 1, 0, 1, 0, 1, 0, 1],
  8279. [1, 0, 1, 0, 1, 0, 1, 0],
  8280. [0, 1, 0, 1, 0, 1, 0, 1]
  8281. ],
  8282. chips: [
  8283. [5, 5, 4, 9, 9, 2, 3, 4],
  8284. [1, 2, 1, 9, 9, 3, 5, 5],
  8285. [3, 4, 5, 9, 9, 5, 4, 3],
  8286. [3, 5, 1, 9, 9, 3, 2, 1],
  8287. [2, 1, 2, 9, 9, 1, 5, 2],
  8288. [1, 5, 9, 9, 9, 9, 3, 1],
  8289. [3, 9, 9, 9, 9, 9, 9, 4],
  8290. [9, 9, 9, 9, 9, 9, 9, 9]
  8291. ],
  8292. chip_types: 5,
  8293. moves: 26,
  8294. chip_goal: 0,
  8295. chip_goal_count: 0
  8296. }, {
  8297. form: [
  8298. [1, 1, 1, 1, 1, 1, 1, 1],
  8299. [1, 1, 1, 1, 1, 1, 1, 1],
  8300. [0, 1, 1, 1, 1, 1, 1, 0],
  8301. [0, 0, 1, 1, 1, 1, 0, 0],
  8302. [0, 1, 1, 1, 1, 1, 1, 0],
  8303. [1, 1, 1, 1, 1, 1, 1, 1],
  8304. [1, 1, 1, 1, 1, 1, 1, 1],
  8305. [1, 1, 1, 0, 0, 1, 1, 1]
  8306. ],
  8307. dirt: [
  8308. [1, 1, 1, 0, 0, 1, 1, 1],
  8309. [1, 1, 1, 0, 0, 1, 1, 1],
  8310. [0, 1, 1, 0, 0, 1, 1, 0],
  8311. [0, 0, 0, 0, 0, 0, 0, 0],
  8312. [0, 0, 0, 0, 0, 0, 0, 0],
  8313. [1, 1, 1, 0, 0, 1, 1, 1],
  8314. [1, 1, 1, 0, 0, 1, 1, 1],
  8315. [1, 1, 1, 0, 0, 1, 1, 1]
  8316. ],
  8317. chips: [
  8318. [1, 5, 4, 4, 1, 1, 3, 2],
  8319. [1, 5, 3, 1, 1, 5, 1, 2],
  8320. [0, 1, 3, 2, 4, 4, 3, 0],
  8321. [0, 0, 4, 1, 2, 1, 0, 0],
  8322. [0, 2, 3, 5, 5, 4, 2, 0],
  8323. [9, 9, 9, 1, 2, 9, 9, 9],
  8324. [9, 9, 9, 3, 4, 9, 9, 9],
  8325. [9, 9, 9, 0, 0, 9, 9, 9]
  8326. ],
  8327. chip_types: 5,
  8328. moves: 45,
  8329. chip_goal: 0,
  8330. chip_goal_count: 0
  8331. }, {
  8332. form: [
  8333. [1, 1, 1, 1, 1, 1, 1, 1],
  8334. [1, 1, 1, 1, 1, 1, 1, 1],
  8335. [1, 1, 0, 0, 0, 0, 1, 1],
  8336. [1, 1, 0, 1, 1, 0, 1, 1],
  8337. [1, 1, 0, 0, 0, 0, 1, 1],
  8338. [1, 1, 1, 1, 1, 1, 1, 1],
  8339. [1, 1, 1, 1, 1, 1, 1, 1],
  8340. [1, 1, 1, 1, 1, 1, 1, 1]
  8341. ],
  8342. dirt: [
  8343. [0, 0, 0, 0, 0, 0, 0, 0],
  8344. [0, 0, 0, 0, 0, 0, 0, 0],
  8345. [0, 0, 0, 0, 0, 0, 0, 0],
  8346. [0, 0, 0, 1, 1, 0, 0, 0],
  8347. [0, 0, 0, 0, 0, 0, 0, 0],
  8348. [0, 0, 0, 0, 0, 0, 0, 0],
  8349. [0, 0, 0, 0, 0, 0, 0, 0],
  8350. [0, 0, 0, 0, 0, 0, 0, 0]
  8351. ],
  8352. chips: [
  8353. [5, 4, 3, 5, 2, 5, 3, 4],
  8354. [1, 2, 1, 2, 1, 2, 1, 2],
  8355. [2, 1, 0, 0, 0, 0, 1, 1],
  8356. [1, 3, 0, 1, 1, 0, 3, 1],
  8357. [4, 5, 0, 0, 0, 0, 1, 5],
  8358. [1, 4, 1, 4, 4, 5, 1, 1],
  8359. [5, 1, 3, 4, 1, 4, 2, 5],
  8360. [1, 5, 1, 3, 2, 3, 1, 1]
  8361. ],
  8362. chip_types: 5,
  8363. moves: 30,
  8364. chip_goal: 0,
  8365. chip_goal_count: 0
  8366. }, {
  8367. form: [
  8368. [1, 0, 1, 0, 1, 0, 1, 0],
  8369. [1, 1, 1, 1, 1, 1, 1, 1],
  8370. [1, 1, 1, 1, 1, 1, 1, 1],
  8371. [1, 1, 1, 1, 1, 1, 1, 1],
  8372. [1, 1, 1, 1, 1, 1, 1, 1],
  8373. [1, 1, 1, 1, 1, 1, 1, 1],
  8374. [1, 1, 1, 1, 1, 1, 1, 1],
  8375. [1, 0, 1, 0, 1, 0, 1, 0]
  8376. ],
  8377. dirt: [
  8378. [1, 0, 1, 0, 1, 0, 1, 0],
  8379. [0, 0, 0, 0, 0, 0, 0, 0],
  8380. [0, 0, 0, 0, 0, 0, 0, 0],
  8381. [0, 0, 0, 0, 0, 0, 0, 0],
  8382. [0, 0, 0, 0, 0, 0, 0, 0],
  8383. [0, 0, 0, 0, 0, 0, 0, 0],
  8384. [1, 0, 1, 0, 1, 0, 1, 0],
  8385. [1, 0, 1, 0, 1, 0, 1, 0]
  8386. ],
  8387. chips: [
  8388. [2, 0, 5, 0, 3, 0, 2, 0],
  8389. [3, 4, 5, 4, 1, 2, 5, 5],
  8390. [3, 3, 4, 3, 1, 1, 2, 1],
  8391. [5, 2, 1, 1, 2, 5, 1, 3],
  8392. [5, 1, 4, 3, 1, 3, 2, 1],
  8393. [1, 2, 1, 2, 3, 2, 1, 5],
  8394. [5, 3, 4, 4, 5, 5, 2, 1],
  8395. [1, 0, 4, 0, 3, 0, 1, 0]
  8396. ],
  8397. chip_types: 5,
  8398. moves: 40,
  8399. chip_goal: 0,
  8400. chip_goal_count: 0
  8401. }, {
  8402. form: [
  8403. [1, 1, 1, 1, 1, 1, 1, 1],
  8404. [1, 1, 1, 1, 1, 1, 1, 1],
  8405. [1, 1, 0, 1, 1, 1, 1, 1],
  8406. [1, 0, 0, 1, 1, 1, 1, 1],
  8407. [1, 1, 1, 1, 1, 1, 1, 1],
  8408. [1, 1, 1, 1, 1, 0, 0, 1],
  8409. [1, 1, 1, 1, 1, 0, 1, 1],
  8410. [1, 1, 1, 1, 1, 1, 1, 1]
  8411. ],
  8412. dirt: [
  8413. [0, 0, 0, 0, 0, 0, 0, 0],
  8414. [1, 1, 1, 1, 0, 0, 0, 0],
  8415. [1, 1, 0, 1, 0, 0, 0, 0],
  8416. [1, 0, 0, 1, 0, 0, 0, 0],
  8417. [1, 1, 1, 1, 1, 1, 1, 1],
  8418. [0, 0, 0, 0, 1, 0, 0, 1],
  8419. [0, 0, 0, 0, 1, 0, 1, 1],
  8420. [0, 0, 0, 0, 1, 1, 1, 1]
  8421. ],
  8422. chips: [
  8423. [5, 4, 3, 5, 2, 1, 1, 2],
  8424. [3, 5, 4, 5, 4, 3, 1, 2],
  8425. [1, 5, 0, 2, 1, 2, 3, 4],
  8426. [1, 0, 0, 2, 1, 2, 3, 4],
  8427. [4, 3, 4, 5, 2, 4, 5, 5],
  8428. [3, 5, 4, 2, 1, 0, 0, 1],
  8429. [3, 2, 3, 1, 2, 0, 1, 4],
  8430. [5, 4, 4, 5, 3, 5, 1, 1]
  8431. ],
  8432. chip_types: 5,
  8433. moves: 30,
  8434. chip_goal: 0,
  8435. chip_goal_count: 0
  8436. }, {
  8437. form: [
  8438. [1, 1, 1, 0, 0, 0, 0, 0],
  8439. [1, 1, 1, 1, 0, 0, 0, 0],
  8440. [1, 1, 1, 1, 1, 0, 0, 0],
  8441. [1, 1, 1, 1, 1, 1, 0, 0],
  8442. [0, 1, 1, 1, 1, 1, 1, 0],
  8443. [0, 0, 1, 1, 1, 1, 1, 1],
  8444. [0, 0, 0, 1, 1, 1, 1, 1],
  8445. [0, 0, 0, 0, 1, 1, 1, 1]
  8446. ],
  8447. dirt: [
  8448. [1, 1, 1, 0, 0, 0, 0, 0],
  8449. [1, 1, 1, 1, 0, 0, 0, 0],
  8450. [1, 1, 1, 1, 1, 0, 0, 0],
  8451. [1, 1, 1, 1, 1, 1, 0, 0],
  8452. [0, 1, 1, 1, 1, 1, 1, 0],
  8453. [0, 0, 1, 1, 1, 1, 1, 1],
  8454. [0, 0, 0, 1, 1, 1, 1, 1],
  8455. [0, 0, 0, 0, 1, 1, 1, 1]
  8456. ],
  8457. chips: [
  8458. [1, 7, 1, 0, 0, 0, 0, 0],
  8459. [5, 6, 4, 5, 0, 0, 0, 0],
  8460. [3, 2, 4, 5, 3, 0, 0, 0],
  8461. [1, 1, 3, 2, 3, 1, 0, 0],
  8462. [0, 4, 5, 4, 4, 7, 2, 0],
  8463. [0, 0, 5, 1, 5, 7, 7, 1],
  8464. [0, 0, 0, 1, 3, 5, 6, 7],
  8465. [0, 0, 0, 0, 2, 1, 6, 7]
  8466. ],
  8467. chip_types: 7,
  8468. moves: 40,
  8469. chip_goal: 0,
  8470. chip_goal_count: 0
  8471. }, {
  8472. form: [
  8473. [1, 1, 1, 1, 1, 1, 1, 1],
  8474. [1, 0, 1, 0, 1, 0, 1, 0],
  8475. [1, 1, 1, 1, 1, 1, 1, 1],
  8476. [1, 0, 1, 0, 1, 0, 1, 0],
  8477. [1, 1, 1, 1, 1, 1, 1, 1],
  8478. [1, 0, 1, 0, 1, 0, 1, 0],
  8479. [1, 1, 1, 1, 1, 1, 1, 1],
  8480. [1, 0, 1, 0, 1, 0, 1, 0]
  8481. ],
  8482. dirt: [
  8483. [1, 1, 1, 1, 1, 1, 1, 1],
  8484. [1, 0, 1, 0, 1, 0, 1, 0],
  8485. [1, 1, 1, 1, 1, 1, 1, 1],
  8486. [1, 0, 1, 0, 1, 0, 1, 0],
  8487. [1, 1, 1, 1, 1, 1, 1, 1],
  8488. [1, 0, 1, 0, 1, 0, 1, 0],
  8489. [1, 1, 1, 1, 1, 1, 1, 1],
  8490. [1, 0, 1, 0, 1, 0, 1, 0]
  8491. ],
  8492. chips: [
  8493. [1, 4, 1, 4, 1, 4, 3, 2],
  8494. [2, 0, 1, 0, 3, 0, 3, 0],
  8495. [3, 1, 3, 1, 4, 1, 4, 1],
  8496. [2, 0, 4, 0, 1, 0, 3, 0],
  8497. [4, 1, 3, 1, 3, 1, 2, 2],
  8498. [2, 0, 1, 0, 2, 0, 4, 0],
  8499. [1, 1, 2, 1, 3, 1, 2, 1],
  8500. [2, 0, 1, 0, 1, 0, 2, 0]
  8501. ],
  8502. chip_types: 4,
  8503. moves: 17,
  8504. chip_goal: 0,
  8505. chip_goal_count: 0
  8506. }, {
  8507. form: [
  8508. [1, 1, 1, 1, 1, 1, 1, 1],
  8509. [1, 1, 1, 1, 1, 1, 1, 1],
  8510. [1, 1, 1, 1, 1, 1, 1, 1],
  8511. [1, 1, 1, 1, 1, 1, 1, 1],
  8512. [1, 1, 1, 1, 1, 1, 1, 1],
  8513. [1, 1, 1, 1, 1, 1, 1, 1],
  8514. [0, 0, 0, 0, 0, 0, 0, 0],
  8515. [1, 1, 1, 1, 1, 1, 1, 1]
  8516. ],
  8517. dirt: [
  8518. [0, 0, 0, 0, 0, 0, 0, 0],
  8519. [0, 0, 0, 0, 0, 0, 0, 0],
  8520. [0, 0, 0, 0, 0, 0, 0, 0],
  8521. [0, 0, 0, 0, 0, 0, 0, 0],
  8522. [0, 0, 0, 0, 0, 0, 0, 0],
  8523. [0, 0, 0, 0, 0, 0, 0, 0],
  8524. [0, 0, 0, 0, 0, 0, 0, 0],
  8525. [1, 1, 1, 1, 1, 1, 1, 1]
  8526. ],
  8527. chips: [
  8528. [1, 3, 6, 6, 5, 5, 2, 1],
  8529. [3, 1, 6, 6, 5, 5, 2, 3],
  8530. [1, 2, 3, 3, 2, 1, 4, 6],
  8531. [2, 1, 2, 4, 5, 6, 1, 6],
  8532. [3, 1, 2, 4, 3, 5, 6, 1],
  8533. [1, 3, 4, 3, 4, 5, 1, 2],
  8534. [0, 0, 0, 0, 0, 0, 0, 0],
  8535. [1, 3, 4, 1, 2, 1, 2, 1]
  8536. ],
  8537. chip_types: 6,
  8538. moves: 20,
  8539. chip_goal: 0,
  8540. chip_goal_count: 0
  8541. }]
  8542. }
  8543. e.getInstance = function() {
  8544. if (this.instance == null) {
  8545. this.instance = new e
  8546. }
  8547. return this.instance
  8548. };
  8549. e.prototype.save = function() {
  8550. try {
  8551. window.localStorage.setItem("levelsCompleted", this.levelsCompleted.toString());
  8552. window.localStorage.setItem("totalScore", this.totalScore.toString())
  8553. } catch (e) {}
  8554. };
  8555. e.prototype.load = function() {
  8556. try {
  8557. this.levelsCompleted = +window.localStorage.getItem("levelsCompleted") || 0;
  8558. this.totalScore = +window.localStorage.getItem("totalScore") || 0
  8559. } catch (e) {}
  8560. };
  8561. e.prototype.onWinLevel = function(e, t) {
  8562. this.totalScore += t;
  8563. if (e == this.levelsCompleted) {
  8564. this.levelsCompleted = e + 1;
  8565. if (this.levelsCompleted > this.getTotalLevels()) {
  8566. this.levelsCompleted = this.getTotalLevels()
  8567. }
  8568. }
  8569. updateShare(e + 1, t);
  8570. Play68.setRankingLevelScoreDesc(e + 1, t);
  8571. this.save()
  8572. };
  8573. e.prototype.getTotalScore = function() {
  8574. return this.totalScore
  8575. };
  8576. e.prototype.levelsAvailable = function() {
  8577. if (Constants.g_DEBUG) {
  8578. return this.getTotalLevels()
  8579. }
  8580. return this.levelsCompleted + 1
  8581. };
  8582. e.prototype.getLevelDef = function(e) {
  8583. return this.levels[e]
  8584. };
  8585. e.prototype.getTotalLevels = function() {
  8586. return this.levels.length
  8587. };
  8588. e.instance = null;
  8589. return e
  8590. }();
  8591. var DNButton = function(e) {
  8592. function t(t, n) {
  8593. e.call(this);
  8594. this.selected = false;
  8595. this.func = null;
  8596. this.func = n;
  8597. this.picture = AssetsManager.g_instance.getCenteredImage(t);
  8598. this.addChild(this.picture);
  8599. this.picWidth = this.picture.getBounds().width * 1.15;
  8600. this.picHeight = this.picture.getBounds().height * 1.15
  8601. }
  8602. __extends(t, e);
  8603. t.prototype.select = function() {
  8604. if (!this.selected) {
  8605. createjs.Tween.removeTweens(this);
  8606. createjs.Tween.get(this, {
  8607. loop: false
  8608. }).to({
  8609. scaleX: 1.15,
  8610. scaleY: 1.15
  8611. }, 150, createjs.Ease.linear);
  8612. this.selected = true
  8613. }
  8614. };
  8615. t.prototype.deselect = function() {
  8616. if (this.selected) {
  8617. createjs.Tween.removeTweens(this);
  8618. createjs.Tween.get(this, {
  8619. loop: false
  8620. }).to({
  8621. scaleX: 1,
  8622. scaleY: 1
  8623. }, 150, createjs.Ease.linear);
  8624. this.selected = false
  8625. }
  8626. };
  8627. t.prototype.onMouseDown = function(e, n) {
  8628. if (this.hitTestSmart(e, n)) {
  8629. if (!t.wasActionThisFrame) {
  8630. t.wasActionThisFrame = true
  8631. } else {
  8632. return
  8633. }
  8634. this.liveTime = 0;
  8635. this.select()
  8636. }
  8637. };
  8638. t.prototype.onMouseUp = function(e, n) {
  8639. if (this.hitTestSmart(e, n) && this.selected) {
  8640. if (!t.wasActionThisFrame) {
  8641. t.wasActionThisFrame = true
  8642. } else {
  8643. return
  8644. }
  8645. SoundManager.g_instance.play(SoundManager.SOUND_CLICK);
  8646. this.runFunc()
  8647. }
  8648. this.deselect()
  8649. };
  8650. t.prototype.runFunc = function() {
  8651. if (this.func) {
  8652. this.func()
  8653. } else {
  8654. console.log("error! DNButton without func")
  8655. }
  8656. };
  8657. t.prototype.onMouseMove = function(e, n) {
  8658. if (!this.hitTestSmart(e, n)) {
  8659. if (!t.wasActionThisFrame) {
  8660. t.wasActionThisFrame = true
  8661. } else {
  8662. return
  8663. }
  8664. this.deselect()
  8665. }
  8666. };
  8667. t.prototype.hitTestSmart = function(e, t) {
  8668. if (!this.parent || !this.visible) {
  8669. return false
  8670. }
  8671. var n = this.localToGlobal(0, 0);
  8672. n.x /= Constants.SCREEN_SCALE;
  8673. n.y /= Constants.SCREEN_SCALE;
  8674. return e > n.x - this.picWidth / 2 && e < n.x + this.picWidth / 2 && t > n.y - this.picHeight / 2 && t < n.y + this.picHeight / 2
  8675. };
  8676. t.wasActionThisFrame = false;
  8677. return t
  8678. }(GameObject);
  8679. var DNTextField = function(e) {
  8680. function t(t, n, r) {
  8681. e.call(this);
  8682. this.textWidth = 0;
  8683. this.fontNamePrefix = "";
  8684. this.letterDistance = 0;
  8685. if (n) {
  8686. this.fontNamePrefix = n
  8687. }
  8688. if (r) {
  8689. this.letterDistance = r
  8690. }
  8691. this.setText(t)
  8692. }
  8693. __extends(t, e);
  8694. t.prototype.setText = function(e) {
  8695. this.removeAllChildren();
  8696. var t = 0;
  8697. for (var n = 0; n < e.length; n++) {
  8698. var r = e.charAt(n);
  8699. var i = AssetsManager.g_instance.getImage(this.fontNamePrefix + r);
  8700. this.addChild(i);
  8701. i.x = t;
  8702. t += i.getBounds().width + this.letterDistance
  8703. }
  8704. this.textWidth = t
  8705. };
  8706. t.prototype.getWidth = function() {
  8707. return this.textWidth
  8708. };
  8709. return t
  8710. }(createjs.Container);
  8711. var FlyingPoints = function(e) {
  8712. function t(t) {
  8713. e.call(this);
  8714. this.label = new DNTextField("p" + t.toString(), "", -10);
  8715. this.addChild(this.label)
  8716. }
  8717. __extends(t, e);
  8718. t.prototype.update = function(t) {
  8719. e.prototype.update.call(this, t);
  8720. this.y -= t * 150;
  8721. if (this.liveTime > .5) {
  8722. this.alpha -= t * 3.5
  8723. }
  8724. if (this.liveTime >= 1.5) {
  8725. this.kill()
  8726. }
  8727. };
  8728. return t
  8729. }(GameObject);
  8730. var ConvertToBonusEffect = function(e) {
  8731. function t(t) {
  8732. e.call(this);
  8733. this.chip = t;
  8734. this.addChild(AssetsManager.g_instance.getCenteredImage(Constants.IMAGE_SHINING));
  8735. this.scaleX = this.scaleY = 2.5
  8736. }
  8737. __extends(t, e);
  8738. t.prototype.update = function(t) {
  8739. e.prototype.update.call(this, t);
  8740. this.rotation += t * Math.PI * 35;
  8741. if (this.scaleX > 1) {
  8742. this.scaleX -= t * 3;
  8743. this.scaleY -= t * 3
  8744. }
  8745. if (this.chip.isMatching()) {
  8746. this.alpha -= t * 4
  8747. }
  8748. this.x = this.chip.x;
  8749. this.y = this.chip.y - Constants.CELL_SIZE / 2;
  8750. if (this.chip.isDead()) {
  8751. this.kill()
  8752. }
  8753. };
  8754. return t
  8755. }(GameObject);
  8756. var KillLineEffect = function(e) {
  8757. function t(t) {
  8758. e.call(this);
  8759. this.speed = t;
  8760. this.addChild(AssetsManager.g_instance.getCenteredImage(Constants.IMAGE_SICKLE));
  8761. if (t.x < 0) {
  8762. this.rotation = 180
  8763. }
  8764. if (t.x > 0) {
  8765. this.rotation = 0
  8766. }
  8767. if (t.y < 0) {
  8768. this.rotation = -90
  8769. }
  8770. if (t.y > 0) {
  8771. this.rotation = +90
  8772. }
  8773. }
  8774. __extends(t, e);
  8775. t.prototype.update = function(t) {
  8776. e.prototype.update.call(this, t);
  8777. this.x += t * this.speed.x;
  8778. this.y += t * this.speed.y;
  8779. if (this.x > Constants.ASSETS_WIDTH + 172 / 2) {
  8780. this.kill()
  8781. }
  8782. if (this.x < -172 / 2) {
  8783. this.kill()
  8784. }
  8785. if (this.y < 300 && this.speed.y < 0) {
  8786. this.alpha -= t * 6
  8787. }
  8788. if (this.y < -106 / 2) {
  8789. this.kill()
  8790. }
  8791. if (this.y > Constants.SCREEN_HEIGHT + 106 / 2) {
  8792. this.kill()
  8793. }
  8794. };
  8795. return t
  8796. }(GameObject);
  8797. var KillColorEffect = function(e) {
  8798. function t(t, n) {
  8799. e.call(this);
  8800. var r = 2e3;
  8801. this.addChild(AssetsManager.g_instance.getCenteredImage(Constants.IMAGE_DROP));
  8802. var i = new createjs.Point(n.x - t.x, n.y - t.y);
  8803. this.distance = Math.sqrt(i.x * i.x + i.y * i.y);
  8804. this.maxTime = this.distance / r;
  8805. var s = i.x / this.distance;
  8806. this.speed = new createjs.Point(i.x / this.distance * r, i.y / this.distance * r);
  8807. this.rotation = Utils.RadToGrad(Math.atan2(i.y, i.x))
  8808. }
  8809. __extends(t, e);
  8810. t.prototype.update = function(t) {
  8811. e.prototype.update.call(this, t);
  8812. if (this.liveTime < this.maxTime) {
  8813. this.x += t * this.speed.x;
  8814. this.y += t * this.speed.y
  8815. } else {
  8816. this.alpha -= t * 3.5;
  8817. if (this.alpha <= 0) {
  8818. this.kill()
  8819. }
  8820. }
  8821. };
  8822. return t
  8823. }(GameObject);
  8824. var TimeIsUpEffect = function(e) {
  8825. function t(t) {
  8826. e.call(this);
  8827. this.stage = 0;
  8828. this.addChild(AssetsManager.g_instance.getCenteredImage(t));
  8829. this.x = 350;
  8830. this.y = 400;
  8831. this.setScale(0);
  8832. this.alpha = -1
  8833. }
  8834. __extends(t, e);
  8835. t.prototype.update = function(t) {
  8836. e.prototype.update.call(this, t);
  8837. switch (this.stage) {
  8838. case 0:
  8839. {
  8840. this.alpha += t * 4;
  8841. this.setScale(this.scaleX + t * 2);
  8842. if (this.scaleX > 1) {
  8843. this.setScale(1);
  8844. this.alpha = 1;
  8845. this.liveTime = 0;
  8846. this.stage = 1;
  8847. createjs.Tween.get(this, {
  8848. loop: false
  8849. }).wait(1400).to({
  8850. alpha: 0
  8851. }, 500, createjs.Ease.linear)
  8852. }
  8853. }
  8854. break;
  8855. case 1:
  8856. {
  8857. this.setScale(1 + Math.sin(this.liveTime * 5) * .07)
  8858. }
  8859. break
  8860. }
  8861. };
  8862. t.prototype.setScale = function(e) {
  8863. this.scaleX = this.scaleY = e
  8864. };
  8865. return t
  8866. }(GameObject);
  8867. var MoveHint = function(e) {
  8868. function t(t) {
  8869. e.call(this);
  8870. this.arrow1 = new createjs.Container;
  8871. this.arrow2 = new createjs.Container;
  8872. this.hidding = false;
  8873. var n = AssetsManager.g_instance.getCenteredImage(Constants.IMAGE_HINT_ARROW);
  8874. this.arrow1.addChild(n);
  8875. this.addChild(this.arrow1);
  8876. this.arrow1.y -= 18;
  8877. var r = AssetsManager.g_instance.getCenteredImage(Constants.IMAGE_HINT_ARROW);
  8878. this.arrow2.addChild(r);
  8879. this.addChild(this.arrow2);
  8880. this.arrow2.y += 18;
  8881. this.arrow2.rotation = 180;
  8882. if (t) {
  8883. this.rotation = 90
  8884. }
  8885. this.alpha = 0
  8886. }
  8887. __extends(t, e);
  8888. t.prototype.update = function(t) {
  8889. if (this.liveTime <= .5) {
  8890. this.alpha = this.liveTime * 2
  8891. }
  8892. e.prototype.update.call(this, t);
  8893. this.arrow1.x = Math.sin(this.liveTime * 7) * 5;
  8894. this.arrow2.x = -this.arrow1.x;
  8895. if (this.liveTime > 20) {
  8896. this.hide()
  8897. }
  8898. if (this.hidding) {
  8899. this.alpha -= t * 3;
  8900. if (this.alpha <= 0) {
  8901. this.kill()
  8902. }
  8903. }
  8904. };
  8905. t.prototype.hide = function() {
  8906. this.hidding = true
  8907. };
  8908. return t
  8909. }(GameObject);
  8910. var ShowAwesomeEffect = function(e) {
  8911. function t() {
  8912. e.call(this);
  8913. this.addChild(AssetsManager.g_instance.getCenteredImage(Constants.IMAGE_AWESOME));
  8914. this.alpha = 0;
  8915. createjs.Tween.get(this, {
  8916. loop: false
  8917. }).to({
  8918. alpha: 1
  8919. }, 300, createjs.Ease.linear);
  8920. this.scaleX = this.scaleY = .5;
  8921. createjs.Tween.get(this, {
  8922. loop: false
  8923. }).to({
  8924. scaleX: 1,
  8925. scaleY: 1
  8926. }, 500, createjs.Ease.backOut)
  8927. }
  8928. __extends(t, e);
  8929. t.prototype.update = function(t) {
  8930. e.prototype.update.call(this, t);
  8931. if (this.liveTime > .7) {
  8932. this.alpha -= t * 3;
  8933. this.scaleX += t;
  8934. this.scaleY += t;
  8935. if (this.alpha <= 0) {
  8936. this.kill()
  8937. }
  8938. }
  8939. };
  8940. return t
  8941. }(GameObject);
  8942. var SuperbEffect = function(e) {
  8943. function t() {
  8944. e.call(this);
  8945. this.addChild(AssetsManager.g_instance.getCenteredImage(Constants.IMAGE_SUPERB));
  8946. this.alpha = 0;
  8947. createjs.Tween.get(this, {
  8948. loop: false
  8949. }).to({
  8950. alpha: 1
  8951. }, 300, createjs.Ease.linear);
  8952. this.scaleX = this.scaleY = .5;
  8953. createjs.Tween.get(this, {
  8954. loop: false
  8955. }).to({
  8956. scaleX: 1,
  8957. scaleY: 1
  8958. }, 500, createjs.Ease.backOut)
  8959. }
  8960. __extends(t, e);
  8961. t.prototype.update = function(t) {
  8962. e.prototype.update.call(this, t);
  8963. if (this.liveTime > .7) {
  8964. this.alpha -= t * 3;
  8965. this.scaleX += t;
  8966. this.scaleY += t;
  8967. if (this.alpha <= 0) {
  8968. this.kill()
  8969. }
  8970. }
  8971. };
  8972. return t
  8973. }(GameObject);
  8974. var PortraitLockState = function(e) {
  8975. function t() {
  8976. e.call(this);
  8977. this.scaleX = this.scaleY = 1 / Constants.SCREEN_SCALE;
  8978. var t = Constants.W * Constants.PIXEL_RATIO;
  8979. var n = Constants.H * Constants.PIXEL_RATIO;
  8980. var r = new createjs.Shape;
  8981. r.graphics.beginFill("#4aa4c2");
  8982. r.graphics.drawRect(0, 0, t, n);
  8983. r.graphics.endFill();
  8984. this.addChild(r);
  8985. var i = AssetsManager.g_instance.getCenteredImage(Constants.IMAGE_ROTATE);
  8986. var s = new createjs.Container;
  8987. this.addChild(s);
  8988. s.addChild(i);
  8989. s.x = t / 2;
  8990. s.y = n / 2
  8991. }
  8992. __extends(t, e);
  8993. t.prototype.onOrientationChanged = function(e) {
  8994. if (!e) {
  8995. StateManager.g_instance.popState()
  8996. }
  8997. };
  8998. return t
  8999. }(GameState);
  9000. var StatusPointsControl = function(e) {
  9001. function t(t, n) {
  9002. e.call(this);
  9003. this.smallPoints = new Array;
  9004. this.offset = 50;
  9005. var r = this.offset * (t - 1);
  9006. for (var i = 0; i < t; i++) {
  9007. var s = AssetsManager.g_instance.getCenteredImageWithProxy(Constants.IMAGE_POINTS_CONTROL_SMALL);
  9008. this.smallPoints.push(s);
  9009. this.addChild(s);
  9010. s.x = i * this.offset - r / 2
  9011. }
  9012. this.bigPoint = AssetsManager.g_instance.getCenteredImageWithProxy(Constants.IMAGE_POINTS_CONTROL_BIG);
  9013. this.addChild(this.bigPoint);
  9014. this.forcedSetActiveElement(n)
  9015. }
  9016. __extends(t, e);
  9017. t.prototype.setActiveElement = function(e) {
  9018. if (this.curElement != e && e >= 0 && e < this.smallPoints.length) {
  9019. this.bigPoint.scaleX = this.bigPoint.scaleY = .5
  9020. } else {
  9021. return
  9022. }
  9023. for (var t = 0; t < this.smallPoints.length; t++) {
  9024. this.smallPoints[t].visible = true
  9025. }
  9026. this.curElement = e;
  9027. if (this.curElement < 0) {
  9028. this.curElement = 0
  9029. }
  9030. if (this.curElement > this.smallPoints.length - 1) {
  9031. this.curElement = this.smallPoints.length - 1
  9032. }
  9033. this.smallPoints[this.curElement].visible = false;
  9034. this.bigPoint.x = this.smallPoints[this.curElement].x;
  9035. this.bigPoint.y = this.smallPoints[this.curElement].y;
  9036. this.bigPoint.scaleX = this.bigPoint.scaleY = .5;
  9037. createjs.Tween.get(this.bigPoint, {
  9038. loop: false
  9039. }).to({
  9040. scaleX: 1,
  9041. scaleY: 1
  9042. }, 300, createjs.Ease.backOut)
  9043. };
  9044. t.prototype.forcedSetActiveElement = function(e) {
  9045. this.setActiveElement(e);
  9046. this.bigPoint.scaleX = this.bigPoint.scaleY = 1
  9047. };
  9048. t.prototype.getActiveElement = function() {
  9049. return this.curElement
  9050. };
  9051. return t
  9052. }(createjs.Container);
  9053. var SelectLevelState = function(e) {
  9054. function t() {
  9055. var t = this;
  9056. e.call(this);
  9057. this.touchPointY = 0;
  9058. this.layer = new createjs.Container;
  9059. this.tween = null;
  9060. this.ySpeed = 0;
  9061. this.yAcc = 1e3;
  9062. this.calcSpeedCache = 0;
  9063. this.slidePositions = new Array;
  9064. this.levelsPositions = [39, 1449, 188, 1445, 365, 1411, 465, 1338, 499, 1235, 385, 1166, 253, 1142, 113, 1086, 40, 968, 119, 851, 263, 818, 403, 800, 541, 750, 505, 630, 346, 578, 193, 548, 64, 480, 55, 352, 186, 303, 330, 348, 488, 350, 571, 252, 537, 137, 411, 87, 266, 85, 124, 97, 43, 10];
  9065. var n = new DNButton(Constants.IMAGE_BUTTON_EXIT, function() {
  9066. return t.onExitTouch()
  9067. });
  9068. this.addGuiObject(n);
  9069. this.addChild(this.layer);
  9070. var r = AssetsManager.g_instance.getImage(Constants.IMAGE_GLOBAL_MAP);
  9071. this.layer.addChild(r);
  9072. this.mapH = r.getBounds().height;
  9073. this.layer.y = -1e3;
  9074. var i = 62;
  9075. var s = 200;
  9076. for (var o = 0; o < this.levelsPositions.length / 2; o++) {
  9077. var u = new SelectLevelButton(Constants.IMAGE_LEVEL_BUTTON, function() {}, o);
  9078. this.addGuiObject(u);
  9079. this.layer.addChild(u);
  9080. u.x = Constants.ASSETS_WIDTH - (this.levelsPositions[o * 2] + i);
  9081. u.y = this.levelsPositions[o * 2 + 1] + s
  9082. }
  9083. var a = AssetsManager.g_instance.getImage(Constants.IMAGE_SELECT_LEVEL_BACK);
  9084. this.addChild(a);
  9085. var f = new createjs.Container;
  9086. f.addChild(n);
  9087. f.x = 68;
  9088. f.y = 70;
  9089. f.scaleX = f.scaleY = .9;
  9090. this.addChild(f);
  9091. this.checkConstrains()
  9092. }
  9093. __extends(t, e);
  9094. t.prototype.onExitTouch = function() {
  9095. StateManager.g_instance.pushState(new ShadeInState(new MainMenuState))
  9096. };
  9097. t.prototype.onLevelTouch = function(e) {
  9098. StateManager.g_instance.pushState(new ShadeInState(new PlayState(e, true)))
  9099. };
  9100. t.prototype.onMouseDown = function(t, n) {
  9101. e.prototype.onMouseDown.call(this, t, n);
  9102. this.touchPointY = this.layer.y - n;
  9103. this.slidePositions.length = 0;
  9104. this.slidePositions.push({
  9105. liveTime: this.liveTime,
  9106. y: n
  9107. })
  9108. };
  9109. t.prototype.update = function(t) {
  9110. e.prototype.update.call(this, t);
  9111. if (!StateManager.g_instance.isMouseDownNow()) {
  9112. if (this.ySpeed != 0) {
  9113. this.layer.y += this.ySpeed * t;
  9114. if (this.ySpeed > 0) {
  9115. this.ySpeed -= t * this.yAcc;
  9116. if (this.ySpeed < 0) {
  9117. this.ySpeed = 0
  9118. }
  9119. } else {
  9120. this.ySpeed += t * this.yAcc;
  9121. if (this.ySpeed > 0) {
  9122. this.ySpeed = 0
  9123. }
  9124. }
  9125. }
  9126. }
  9127. this.checkConstrains()
  9128. };
  9129. t.prototype.onMouseMove = function(t, n) {
  9130. e.prototype.onMouseMove.call(this, t, n);
  9131. this.layer.y = n + this.touchPointY;
  9132. this.checkConstrains();
  9133. this.slidePositions.push({
  9134. liveTime: this.liveTime,
  9135. y: n
  9136. });
  9137. if (this.slidePositions.length > 100) {
  9138. this.calcSpeedCache = this.calcYSpeed();
  9139. this.slidePositions.length = 0
  9140. }
  9141. };
  9142. t.prototype.checkConstrains = function() {
  9143. if (this.layer.y > 0) {
  9144. this.layer.y = 0;
  9145. this.ySpeed = 0
  9146. }
  9147. if (Constants.g_isPC) {
  9148. if (this.layer.y < Constants.ASSETS_HEIGHT - this.mapH) {
  9149. this.layer.y = Constants.ASSETS_HEIGHT - this.mapH;
  9150. this.ySpeed = 0
  9151. }
  9152. } else {
  9153. if (this.layer.y < Constants.SCREEN_HEIGHT - this.mapH) {
  9154. this.layer.y = Constants.SCREEN_HEIGHT - this.mapH;
  9155. this.ySpeed = 0
  9156. }
  9157. }
  9158. };
  9159. t.prototype.onMouseUp = function(t, n) {
  9160. e.prototype.onMouseUp.call(this, t, n);
  9161. this.slidePositions.push({
  9162. liveTime: this.liveTime,
  9163. y: n
  9164. });
  9165. this.ySpeed = this.calcYSpeed()
  9166. };
  9167. t.prototype.calcYSpeed = function() {
  9168. if (this.slidePositions.length < 2) {
  9169. return this.calcSpeedCache
  9170. }
  9171. var e = .2;
  9172. var t;
  9173. for (t = this.slidePositions.length - 2; t > 0; --t) {
  9174. if (this.liveTime - this.slidePositions[t]["liveTime"] >= e) {
  9175. break
  9176. }
  9177. }
  9178. var n = this.liveTime - this.slidePositions[t]["liveTime"];
  9179. if (n < 1e-5) {
  9180. return 0
  9181. }
  9182. return (this.slidePositions[this.slidePositions.length - 1]["y"] - this.slidePositions[t]["y"]) / n
  9183. };
  9184. return t
  9185. }(GameState);
  9186. var LevelDef = function() {
  9187. function e() {}
  9188. return e
  9189. }();
  9190. var HeartParticle = function(e) {
  9191. function t(t, n) {
  9192. e.call(this);
  9193. this.rotSpeed = Utils.RandomRange(-120, 120);
  9194. this.speedX = t;
  9195. this.speedY = n;
  9196. this.addChild(AssetsManager.g_instance.getCenteredImage(Constants.IMAGE_HEART_PARTICLE));
  9197. this.alpha = 0
  9198. }
  9199. __extends(t, e);
  9200. t.prototype.update = function(t) {
  9201. e.prototype.update.call(this, t);
  9202. this.rotation += this.rotSpeed * t;
  9203. this.x += this.speedX * t;
  9204. this.y += this.speedY * t;
  9205. if (this.liveTime > .3) {
  9206. this.alpha -= t * 3;
  9207. if (this.alpha <= 0) {
  9208. this.kill()
  9209. }
  9210. } else {
  9211. this.alpha += t * 4
  9212. }
  9213. };
  9214. return t
  9215. }(GameObject);
  9216. var AutoreleaseEffect = function(e) {
  9217. function t() {
  9218. e.call(this);
  9219. this.frames = new Array;
  9220. this.frame = 0;
  9221. for (var t = 1; t <= 11; t++) {
  9222. this.frames.push(AssetsManager.g_instance.getCenteredImageWithProxy("boom_" + t))
  9223. }
  9224. this.update(10)
  9225. }
  9226. __extends(t, e);
  9227. t.prototype.update = function(t) {
  9228. e.prototype.update.call(this, t);
  9229. if (this.liveTime > .045) {
  9230. this.liveTime = 0;
  9231. this.frame++;
  9232. if (this.frame >= this.frames.length) {
  9233. this.frame = this.frames.length - 1;
  9234. this.kill()
  9235. }
  9236. this.removeAllChildren();
  9237. var n = this.frames[this.frame];
  9238. this.addChild(n);
  9239. n.y = -19;
  9240. this.scaleX = this.scaleY = 2
  9241. }
  9242. };
  9243. return t
  9244. }(GameObject);
  9245. var PauseState = function(e) {
  9246. function t() {
  9247. var t = this;
  9248. e.call(this);
  9249. this.panel = new createjs.Container;
  9250. this.hiddingNow = false;
  9251. t.soundTouched = false;
  9252. this.shader = new createjs.Shape;
  9253. this.shader.graphics.beginFill("#000000");
  9254. this.shader.graphics.drawRect(0, 0, Constants.ASSETS_WIDTH, Constants.SCREEN_HEIGHT);
  9255. this.shader.graphics.endFill();
  9256. this.addChild(this.shader);
  9257. this.shader.alpha = 0;
  9258. createjs.Tween.get(this.shader, {
  9259. loop: false
  9260. }).wait(300).to({
  9261. alpha: .4
  9262. }, 800, createjs.Ease.linear);
  9263. this.addChild(this.panel);
  9264. this.panel.x = Constants.ASSETS_WIDTH / 2;
  9265. this.panel.y = Constants.SCREEN_HEIGHT * .5;
  9266. var n = AssetsManager.g_instance.getCenteredImage(Constants.IMAGE_MESSAGE_WINDOW);
  9267. this.panel.addChild(n);
  9268. var r = new DNButton(Constants.IMAGE_BUTTON_CLOSE, function() {
  9269. return t.hide()
  9270. });
  9271. this.panel.addChild(r);
  9272. this.addGuiObject(r);
  9273. r.x = 235;
  9274. r.y = -190;
  9275. var i = new DNButton(Constants.IMAGE_BUTTON_RESTART, function() {
  9276. return t.onRestartTouch()
  9277. });
  9278. this.panel.addChild(i);
  9279. this.addGuiObject(i);
  9280. i.x = -150;
  9281. i.y = 100;
  9282. var s = new DNButton(Constants.IMAGE_BUTTON_EXIT, function() {
  9283. return t.onExitTouch()
  9284. });
  9285. this.panel.addChild(s);
  9286. this.addGuiObject(s);
  9287. s.x = 0;
  9288. s.y = 100;
  9289. this.setSoundButton();
  9290. this.panel.alpha = 0;
  9291. createjs.Tween.get(this.panel, {
  9292. loop: false
  9293. }).to({
  9294. alpha: 1
  9295. }, 200, createjs.Ease.linear);
  9296. this.panel.scaleX = .7;
  9297. this.panel.scaleY = .7;
  9298. createjs.Tween.get(this.panel, {
  9299. loop: false
  9300. }).to({
  9301. scaleX: 1,
  9302. scaleY: 1
  9303. }, 400, createjs.Ease.backOut)
  9304. }
  9305. __extends(t, e);
  9306. t.prototype.setSoundButton = function() {
  9307. var e = this;
  9308. if (this.soundButton && this.soundButton.parent) {
  9309. this.soundButton.parent.removeChild(this.soundButton)
  9310. }
  9311. var t = SoundManager.g_instance.isSoundEnabled();
  9312. this.soundButton = new DNButton(t ? Constants.IMAGE_BUTTON_SOUND_ON : Constants.IMAGE_BUTTON_SOUND_OFF, function() {
  9313. return e.onSoundTouch()
  9314. });
  9315. this.panel.addChild(this.soundButton);
  9316. this.addGuiObject(this.soundButton);
  9317. this.soundButton.x = +150;
  9318. this.soundButton.y = 100
  9319. };
  9320. t.prototype.hide = function() {
  9321. if (!this.hiddingNow) {
  9322. createjs.Tween.get(this.shader, {
  9323. loop: false
  9324. }).to({
  9325. alpha: 0
  9326. }, 400, createjs.Ease.linear).call(function() {
  9327. StateManager.g_instance.popState()
  9328. });
  9329. createjs.Tween.get(this.panel, {
  9330. loop: false
  9331. }).to({
  9332. y: -300
  9333. }, 300, createjs.Ease.backIn);
  9334. createjs.Tween.get(this.panel, {
  9335. loop: false
  9336. }).to({
  9337. alpha: 0
  9338. }, 300, createjs.Ease.linear);
  9339. this.hiddingNow = true
  9340. }
  9341. };
  9342. t.prototype.update = function(t) {
  9343. e.prototype.update.call(this, t)
  9344. };
  9345. t.prototype.onRestartTouch = function() {
  9346. StateManager.g_instance.pushState(new ShadeInCircleState(new PlayState(PlayState.g_curLevel, false)))
  9347. };
  9348. t.prototype.onExitTouch = function() {
  9349. StateManager.g_instance.pushState(new ShadeInState(new SelectLevelState))
  9350. };
  9351. t.prototype.onSoundTouch = function() {
  9352. var e = this;
  9353. if (e.soundTouched == false) {
  9354. e.soundTouched = true;
  9355. SoundManager.g_instance.setSoundEnabled(!SoundManager.g_instance.isSoundEnabled());
  9356. this.setSoundButton();
  9357. setTimeout(function() {
  9358. e.soundTouched = false
  9359. }, 500)
  9360. }
  9361. };
  9362. return t
  9363. }(GameState);
  9364. var PlayState = function(e) {
  9365. function t(n, r) {
  9366. var i = this;
  9367. e.call(this);
  9368. this.INPUT_STATE_WAIT_SELECTION = "INPUT_STATE_WAIT_SELECTION";
  9369. this.INPUT_STATE_LOCK = "INPUT_STATE_LOCK";
  9370. this.INPUT_STATE_WAIT_SPAWN = "INPUT_STATE_WAIT_SPAWN";
  9371. this.INPUT_STATE_SHIFT = "INPUT_STATE_SHIFT";
  9372. this.INPUT_STATE_MATCHING = "INPUT_STATE_MATCHING";
  9373. this.INPUT_STATE_WAIT_NEXT_ROUND = "INPUT_STATE_WAIT_NEXT_ROUND";
  9374. this.matchInARow = 0;
  9375. this.inputState = null;
  9376. this.goal = t.GOAL_DIRT;
  9377. this.goalLabel = new DNTextField("0", "font_", -3);
  9378. this.dirtCount = 0;
  9379. this.fieldWidth = 8;
  9380. this.fieldHeight = 8;
  9381. this.selectedChip = null;
  9382. this.swapChip1 = null;
  9383. this.swapChip2 = null;
  9384. this.lastMovedChip = null;
  9385. this.dirtLayer = new createjs.Container;
  9386. this.underChipsLayer = new createjs.Container;
  9387. this.backChipsLayer = new createjs.Container;
  9388. this.holeLayer = new createjs.Container;
  9389. this.edgesLayer = new createjs.Container;
  9390. this.frontChipsLayer = new createjs.Container;
  9391. this.inputStateTime = 0;
  9392. this.score = 0;
  9393. this.tmpScore = 0;
  9394. this.scoreLabel = new DNTextField("00000", "font_", -3);
  9395. this.moves = 30;
  9396. this.movesLabel = new DNTextField("50", "font_", -3);
  9397. this.findedMatchPos1 = null;
  9398. this.findedMatchPos2 = null;
  9399. this.moveHint = null;
  9400. this.chipTypesCount = 5;
  9401. this.awesomeEffectTime = 0;
  9402. this.superbEffectTime = 0;
  9403. this.waitLose = false;
  9404. this.waitLoseTime = 0;
  9405. this.waitWin = false;
  9406. this.waitWinTime = 0;
  9407. this.lastDropSoundTime = -10;
  9408. this.lastDropID = -1;
  9409. this.lastSound = null;
  9410. try {
  9411. t.g_curLevel = n;
  9412. var s = AssetsManager.g_instance.getImage(Constants.IMAGE_BACK);
  9413. this.addChild(s);
  9414. t.g_instance = this;
  9415. this.chipTypesCount = GameData.getInstance().getLevelDef(n).chip_types;
  9416. this.field = new Array(this.fieldWidth);
  9417. for (var o = 0; o < this.fieldWidth; o++) {
  9418. this.field[o] = new Array(this.fieldHeight)
  9419. }
  9420. this.addChild(this.holeLayer);
  9421. this.addChild(this.dirtLayer);
  9422. this.addChild(this.edgesLayer);
  9423. this.addChild(this.underChipsLayer);
  9424. this.addChild(this.backChipsLayer);
  9425. this.addChild(this.frontChipsLayer);
  9426. this.matchInARow = 0;
  9427. this.spawnDefinedChips(GameData.getInstance().getLevelDef(n).chips);
  9428. var u = GameData.getInstance().getLevelDef(n).form;
  9429. for (var a = 0; a < this.fieldWidth; a++) {
  9430. for (var f = 0; f < this.fieldHeight; f++) {
  9431. if (u[f][a] == 0) {
  9432. this.field[a][f].convertToHole();
  9433. this.holeLayer.addChild(this.field[a][f]);
  9434. var l = this.getXPosByXIndex(a) - Constants.CELL_SIZE / 2;
  9435. var c = this.getYPosByYIndex(f) - Constants.CELL_SIZE;
  9436. if (f > 0 && u[f - 1][a] != 0 && a > 0 && u[f][a - 1] != 0) {
  9437. var h = AssetsManager.g_instance.getImage(Constants.IMAGE_BORDER_CORNER);
  9438. h.x = l - 4;
  9439. h.y = c - 4;
  9440. this.edgesLayer.addChild(h)
  9441. }
  9442. if (f > 0 && u[f - 1][a] != 0 && a < this.fieldWidth - 1 && u[f][a + 1] != 0) {
  9443. var p = AssetsManager.g_instance.getImage(Constants.IMAGE_BORDER_CORNER);
  9444. p.x = l + Constants.CELL_SIZE + 8 - 4;
  9445. p.y = c - 4;
  9446. p.rotation = +90;
  9447. this.edgesLayer.addChild(p)
  9448. }
  9449. if (f < this.fieldHeight - 1 && u[f + 1][a] != 0 && a > 0 && u[f][a - 1] != 0) {
  9450. var d = AssetsManager.g_instance.getImage(Constants.IMAGE_BORDER_CORNER);
  9451. d.x = l - 4;
  9452. d.y = c + Constants.CELL_SIZE + 8 - 4;
  9453. d.rotation = -90;
  9454. this.edgesLayer.addChild(d)
  9455. }
  9456. if (f < this.fieldHeight - 1 && u[f + 1][a] != 0 && a < this.fieldWidth - 1 && u[f][a + 1] != 0) {
  9457. var v = AssetsManager.g_instance.getImage(Constants.IMAGE_BORDER_CORNER);
  9458. v.x = l + Constants.CELL_SIZE + 8 - 4;
  9459. v.y = c + Constants.CELL_SIZE + 8 - 4;
  9460. v.rotation = -180;
  9461. this.edgesLayer.addChild(v)
  9462. }
  9463. } else {
  9464. var m = AssetsManager.g_instance.getImage(Constants.IMAGE_CELL);
  9465. this.holeLayer.addChild(m);
  9466. m.x = this.getXPosByXIndex(a) - Constants.CELL_SIZE / 2;
  9467. m.y = this.getYPosByYIndex(f) - Constants.CELL_SIZE;
  9468. if (a > 0 && u[f][a - 1] == 0) {
  9469. var g = AssetsManager.g_instance.getImage(Constants.IMAGE_BORDER_SIDE);
  9470. g.rotation = -90;
  9471. g.x = m.x - 4;
  9472. g.y = m.y + Constants.CELL_SIZE;
  9473. this.edgesLayer.addChildAt(g, 0)
  9474. }
  9475. if (a < this.fieldWidth - 1 && u[f][a + 1] == 0) {
  9476. var y = AssetsManager.g_instance.getImage(Constants.IMAGE_BORDER_SIDE);
  9477. y.rotation = -90;
  9478. y.x = m.x + Constants.CELL_SIZE - 4;
  9479. y.y = m.y + Constants.CELL_SIZE;
  9480. this.edgesLayer.addChildAt(y, 0)
  9481. }
  9482. if (f > 0 && u[f - 1][a] == 0) {
  9483. var b = AssetsManager.g_instance.getImage(Constants.IMAGE_BORDER_SIDE);
  9484. b.x = m.x;
  9485. b.y = m.y - 4;
  9486. this.edgesLayer.addChildAt(b, 0)
  9487. }
  9488. if (f < this.fieldHeight - 1 && u[f + 1][a] == 0) {
  9489. var w = AssetsManager.g_instance.getImage(Constants.IMAGE_BORDER_SIDE);
  9490. w.x = m.x;
  9491. w.y = m.y + Constants.CELL_SIZE - 4;
  9492. this.edgesLayer.addChildAt(w, 0)
  9493. }
  9494. if (f > 0 && u[f - 1][a] == 0 && a > 0 && u[f][a - 1] == 0) {
  9495. var h = AssetsManager.g_instance.getImage(Constants.IMAGE_BORDER_CORNER);
  9496. h.x = m.x - 4;
  9497. h.y = m.y - 4;
  9498. this.edgesLayer.addChild(h)
  9499. }
  9500. if (f > 0 && u[f - 1][a] == 0 && a < this.fieldWidth - 1 && u[f][a + 1] == 0) {
  9501. var p = AssetsManager.g_instance.getImage(Constants.IMAGE_BORDER_CORNER);
  9502. p.x = m.x + Constants.CELL_SIZE + 8 - 4;
  9503. p.y = m.y - 4;
  9504. p.rotation = +90;
  9505. this.edgesLayer.addChild(p)
  9506. }
  9507. if (f < this.fieldHeight - 1 && u[f + 1][a] == 0 && a > 0 && u[f][a - 1] == 0) {
  9508. var d = AssetsManager.g_instance.getImage(Constants.IMAGE_BORDER_CORNER);
  9509. d.x = m.x - 4;
  9510. d.y = m.y + Constants.CELL_SIZE + 8 - 4;
  9511. d.rotation = -90;
  9512. this.edgesLayer.addChild(d)
  9513. }
  9514. if (f < this.fieldHeight - 1 && u[f + 1][a] == 0 && a < this.fieldWidth - 1 && u[f][a + 1] == 0) {
  9515. var v = AssetsManager.g_instance.getImage(Constants.IMAGE_BORDER_CORNER);
  9516. v.x = m.x + Constants.CELL_SIZE + 8 - 4;
  9517. v.y = m.y + Constants.CELL_SIZE + 8 - 4;
  9518. v.rotation = -180;
  9519. this.edgesLayer.addChild(v)
  9520. }
  9521. }
  9522. }
  9523. }
  9524. this.holeLayer.cache(0, 0, Constants.ASSETS_WIDTH, Constants.ASSETS_HEIGHT, 1);
  9525. this.edgesLayer.cache(0, 0, Constants.ASSETS_WIDTH, Constants.ASSETS_HEIGHT, 1);
  9526. this.fieldDirt = new Array(this.fieldWidth);
  9527. for (var o = 0; o < this.fieldWidth; o++) {
  9528. this.fieldDirt[o] = new Array(this.fieldHeight)
  9529. }
  9530. var E = GameData.getInstance().getLevelDef(n).dirt;
  9531. if (E) {
  9532. this.goal = t.GOAL_DIRT;
  9533. for (var a = 0; a < this.fieldWidth; a++) {
  9534. for (var f = 0; f < this.fieldHeight; f++) {
  9535. if (E[f][a] != 0) {
  9536. this.dirtCount++;
  9537. var S = AssetsManager.g_instance.getCenteredBitmapWithProxy(Constants.IMAGE_DIRT);
  9538. S.x = this.getXPosByXIndex(a) - 1;
  9539. S.y = this.getYPosByYIndex(f) - Constants.CELL_SIZE / 2 + 3;
  9540. this.dirtLayer.addChild(S);
  9541. this.fieldDirt[a][f] = S
  9542. }
  9543. }
  9544. }
  9545. this.goalLabel.setText(this.dirtCount.toString())
  9546. } else {
  9547. this.goal = t.GOAL_COUNT;
  9548. this.goalChipID = GameData.getInstance().getLevelDef(n).chip_goal;
  9549. this.chipGoalCount = GameData.getInstance().getLevelDef(n).chip_goal_count;
  9550. this.goalLabel.setText(this.chipGoalCount.toString())
  9551. }
  9552. this.addChild(AssetsManager.g_instance.getImage(Constants.IMAGE_GUI));
  9553. var x = new createjs.Container;
  9554. x.scaleX = x.scaleY = .7;
  9555. var T = new DNButton(Constants.IMAGE_BUTTON_PAUSE, function() {
  9556. return i.onPauseClick()
  9557. });
  9558. x.addChild(T);
  9559. this.addGuiObject(T);
  9560. x.x = 55;
  9561. x.y = 154;
  9562. this.addChild(x);
  9563. this.addChild(this.scoreLabel);
  9564. this.scoreLabel.x = 168;
  9565. this.scoreLabel.y = 134;
  9566. this.moves = GameData.getInstance().getLevelDef(n).moves;
  9567. this.addChild(this.movesLabel);
  9568. this.movesLabel.x = 370;
  9569. this.movesLabel.y = 134;
  9570. this.movesLabel.setText(this.moves.toString());
  9571. this.addChild(this.goalLabel);
  9572. this.goalLabel.x = 570;
  9573. this.goalLabel.y = 134;
  9574. if (this.goal == t.GOAL_DIRT) {
  9575. var N = AssetsManager.g_instance.getImage(Constants.IMAGE_DIRT);
  9576. N.scaleX = N.scaleY = .45;
  9577. this.addChild(N);
  9578. N.x = 506;
  9579. N.y = 130
  9580. } else {
  9581. var C = AssetsManager.g_instance.getCenteredImageWithProxy("cake_" + this.goalChipID);
  9582. C.scaleX = C.scaleY = .66;
  9583. this.addChild(C);
  9584. C.x = 525;
  9585. C.y = 149
  9586. } if (r) {
  9587. var k = new TaskEffect(this.goal, this.chipGoalCount, this.goalChipID);
  9588. this.addGameObject(k);
  9589. this.addChild(k)
  9590. }
  9591. this.configureYAlign()
  9592. } catch (L) {
  9593. console.log(L, "playstate::constructor")
  9594. }
  9595. }
  9596. __extends(t, e);
  9597. t.prototype.onPauseClick = function() {
  9598. StateManager.g_instance.pushState(new PauseState)
  9599. };
  9600. t.prototype.createChip = function(e, t, n) {
  9601. var r = Utils.RandomRangeInt(1, this.chipTypesCount);
  9602. var i = new Chip(r, e, t, this.getYPosByYIndex(t), n);
  9603. i.setIncexes(e, t);
  9604. this.addGameObjectAtPos(i, this.backChipsLayer, this.getXPosByXIndex(e), -Constants.CELL_SIZE);
  9605. this.field[e][t] = i
  9606. };
  9607. t.prototype.createChipWithColorID = function(e, t, n, r) {
  9608. var i = new Chip(r, e, t, this.getYPosByYIndex(t), n);
  9609. i.setIncexes(e, t);
  9610. this.addGameObjectAtPos(i, this.backChipsLayer, this.getXPosByXIndex(e), -Constants.CELL_SIZE);
  9611. this.field[e][t] = i
  9612. };
  9613. t.prototype.getXPosByXIndex = function(e) {
  9614. return e * Constants.CELL_SIZE + Constants.CELL_SIZE / 2 + Constants.FIELD_OFFSET_X
  9615. };
  9616. t.prototype.getYPosByYIndex = function(e) {
  9617. return e * Constants.CELL_SIZE + Constants.CELL_SIZE / 2 + Constants.FIELD_OFFSET_Y
  9618. };
  9619. t.prototype.update = function(n) {
  9620. e.prototype.update.call(this, n);
  9621. if (this.waitWin) {
  9622. this.waitWinTime += n;
  9623. if (this.waitWinTime > 2.4) {
  9624. StateManager.g_instance.pushState(new WinState(t.g_curLevel, this.score));
  9625. return
  9626. }
  9627. }
  9628. if (this.waitLose) {
  9629. this.waitLoseTime += n;
  9630. if (this.waitLoseTime > 2.4) {
  9631. StateManager.g_instance.pushState(new GameOverState(0, 0));
  9632. return
  9633. }
  9634. }
  9635. this.inputStateTime += n;
  9636. if (this.inputState != this.INPUT_STATE_WAIT_SELECTION) {
  9637. if (this.moveHint) {
  9638. if (this.moveHint.isDead()) {
  9639. this.moveHint = null
  9640. } else {
  9641. this.moveHint.hide()
  9642. }
  9643. }
  9644. }
  9645. switch (this.inputState) {
  9646. case this.INPUT_STATE_WAIT_SELECTION:
  9647. {
  9648. try {
  9649. var r = 3;
  9650. if (this.inputStateTime > r && this.moveHint && !this.moveHint.parent) {
  9651. this.addGameObjectAt(this.moveHint, this)
  9652. }
  9653. } catch (i) {}
  9654. }
  9655. break;
  9656. case this.INPUT_STATE_WAIT_SPAWN:
  9657. if (this.allChipsNormal()) {
  9658. this.matchMatches(this.findMatches())
  9659. }
  9660. break;
  9661. case this.INPUT_STATE_SHIFT:
  9662. if (this.allChipsNormal()) {
  9663. this.matchMatches(this.findMatches())
  9664. }
  9665. break;
  9666. case this.INPUT_STATE_MATCHING:
  9667. if (this.inputStateTime > Constants.MATCH_TIME / 2) {
  9668. this.shiftChips()
  9669. }
  9670. break
  9671. }
  9672. if (this.tmpScore < this.score) {
  9673. this.tmpScore += 17;
  9674. if (this.tmpScore > this.score) {
  9675. this.tmpScore = this.score
  9676. }
  9677. var s = this.tmpScore.toString();
  9678. switch (s.length) {
  9679. case 1:
  9680. s = "0000" + s;
  9681. break;
  9682. case 2:
  9683. s = "000" + s;
  9684. break;
  9685. case 3:
  9686. s = "00" + s;
  9687. break;
  9688. case 4:
  9689. s = "0" + s;
  9690. break
  9691. }
  9692. this.scoreLabel.setText(s)
  9693. }
  9694. };
  9695. t.prototype.allChipsNormal = function() {
  9696. for (var e = 0; e < this.fieldWidth; e++) {
  9697. for (var t = 0; t < this.fieldHeight; t++) {
  9698. if (this.field[e][t] != null && !this.field[e][t].isNormal()) {
  9699. return false
  9700. }
  9701. }
  9702. }
  9703. return true
  9704. };
  9705. t.prototype.canExchange = function(e, t) {
  9706. try {
  9707. if (e == t) {
  9708. return false
  9709. }
  9710. if (e.isHole() || t.isHole()) {
  9711. return false
  9712. }
  9713. var n = e.getIndeces().x - t.getIndeces().x;
  9714. var r = e.getIndeces().y - t.getIndeces().y
  9715. } catch (i) {
  9716. return false
  9717. }
  9718. return Math.abs(n) == 1 && r == 0 || Math.abs(r) == 1 && n == 0
  9719. };
  9720. t.prototype.exchangeChips = function(e, t) {
  9721. var n = this;
  9722. try {
  9723. var r = e.x;
  9724. var i = e.y;
  9725. var s = e.getIndexX();
  9726. var o = e.getIndexY();
  9727. var u = t.x;
  9728. var a = t.y;
  9729. var f = t.getIndexX();
  9730. var l = t.getIndexY();
  9731. this.field[s][o] = t;
  9732. this.field[f][l] = e;
  9733. e.exchange(f, l);
  9734. t.exchange(s, o);
  9735. this.swapChip1 = e;
  9736. this.swapChip2 = t;
  9737. createjs.Tween.get(e, {
  9738. loop: false
  9739. }).to({
  9740. x: u,
  9741. y: a
  9742. }, Constants.EXCHANGE_TIME * 1e3, createjs.Ease.linear).call(function() {
  9743. return n.onExchangeEnded()
  9744. });
  9745. createjs.Tween.get(t, {
  9746. loop: false
  9747. }).to({
  9748. x: r,
  9749. y: i
  9750. }, Constants.EXCHANGE_TIME * 1e3, createjs.Ease.linear);
  9751. this.selectedChip = null;
  9752. this.setInpunState(this.INPUT_STATE_LOCK)
  9753. } catch (c) {}
  9754. };
  9755. t.prototype.addConverToBonusEffect = function(e) {
  9756. var t = new ConvertToBonusEffect(e);
  9757. this.addGameObjectAtPos(t, this.underChipsLayer, e.x, e.y - Constants.CELL_SIZE / 2)
  9758. };
  9759. t.prototype.matchMatches = function(e) {
  9760. try {
  9761. if (e.length != 0) {
  9762. switch (this.matchInARow) {
  9763. case 0:
  9764. SoundManager.g_instance.play(SoundManager.SOUND_MATCH_1);
  9765. break;
  9766. case 1:
  9767. SoundManager.g_instance.play(SoundManager.SOUND_MATCH_2);
  9768. break;
  9769. case 2:
  9770. SoundManager.g_instance.play(SoundManager.SOUND_MATCH_3);
  9771. break;
  9772. case 3:
  9773. SoundManager.g_instance.play(SoundManager.SOUND_MATCH_4);
  9774. break;
  9775. default:
  9776. SoundManager.g_instance.play(SoundManager.SOUND_MATCH_5);
  9777. break
  9778. }
  9779. var t = false;
  9780. for (var n = 0; n < e.length; n++) {
  9781. for (var r = 0; r < e[n].length; r++) {
  9782. e[n][r].match(Chip.MATCH_REASON_SIMPLE)
  9783. }
  9784. if (e[n].length == 4) {
  9785. var i = false;
  9786. for (var s = 0; s < e[n].length; s++) {
  9787. if (e[n][s] == this.lastMovedChip) {
  9788. i = true;
  9789. t = true;
  9790. this.lastMovedChip.convertToBonus(Chip.BONUS_4, Math.random() < .5);
  9791. this.lastMovedChip = null;
  9792. break
  9793. }
  9794. }
  9795. if (!i) {
  9796. t = true;
  9797. e[n][Utils.RandomRangeInt(1, 2)].convertToBonus(Chip.BONUS_4)
  9798. }
  9799. }
  9800. if (e[n].length >= 5) {
  9801. var i = false;
  9802. for (var s = 0; s < e[n].length; s++) {
  9803. if (e[n][s] == this.lastMovedChip) {
  9804. t = true;
  9805. i = true;
  9806. this.lastMovedChip.convertToBonus(Chip.BONUS_5);
  9807. this.lastMovedChip = null;
  9808. break
  9809. }
  9810. }
  9811. if (!i) {
  9812. t = true;
  9813. e[n][Utils.RandomRangeInt(1, e[n].length - 2)].convertToBonus(Chip.BONUS_5)
  9814. }
  9815. }
  9816. }
  9817. if (!t) {
  9818. for (var n = 0; n < e.length; n++) {
  9819. for (var r = 0; r < e[n].length; r++) {
  9820. if (e[n][r].isDoubleMatched()) {
  9821. e[n][r].convertToBonus(Chip.BONUS_BOMB);
  9822. n = 100;
  9823. break
  9824. }
  9825. }
  9826. }
  9827. }
  9828. this.setInpunState(this.INPUT_STATE_MATCHING)
  9829. } else {
  9830. this.shiftChips()
  9831. }
  9832. } catch (o) {
  9833. console.log(o, "playstate::matchmatches")
  9834. }
  9835. };
  9836. t.prototype.matchBonus = function(e, t) {
  9837. try {
  9838. if (e.getBonusType() == Chip.BONUS_4) {
  9839. SoundManager.g_instance.play(SoundManager.SOUND_LINE);
  9840. var n = e.isHorizontal();
  9841. if (n) {
  9842. var r = e.getIndexY();
  9843. for (var i = 0; i < this.fieldWidth; i++) {
  9844. if (this.field[i][r] != null) {
  9845. this.field[i][r].match(Chip.MATCH_REASON_BONUS_EFFECT_4_HOR)
  9846. }
  9847. }
  9848. this.addGameObjectAtPos(new KillLineEffect(new createjs.Point(+1200, 0)), this, e.x, e.y - Constants.CELL_SIZE / 2);
  9849. this.addGameObjectAtPos(new KillLineEffect(new createjs.Point(-1200, 0)), this, e.x, e.y - Constants.CELL_SIZE / 2)
  9850. } else {
  9851. var s = e.getIndexX();
  9852. for (var i = 0; i < this.fieldHeight; i++) {
  9853. if (this.field[s][i] != null) {
  9854. this.field[s][i].match(Chip.MATCH_REASON_BONUS_EFFECT_4_VERT)
  9855. }
  9856. }
  9857. this.addGameObjectAtPos(new KillLineEffect(new createjs.Point(0, -1200)), this, e.x, e.y - Constants.CELL_SIZE / 2);
  9858. this.addGameObjectAtPos(new KillLineEffect(new createjs.Point(0, +1200)), this, e.x, e.y - Constants.CELL_SIZE / 2)
  9859. }
  9860. }
  9861. if (e.getBonusType() == Chip.BONUS_5) {
  9862. SoundManager.g_instance.play(SoundManager.SOUND_KILL_COLOR);
  9863. e.match(Chip.MATCH_REASON_I_AM_BONUS);
  9864. var o = new createjs.Point(e.x, e.y);
  9865. var u = t.getColorID();
  9866. if (u != -1) {
  9867. for (var a = 0; a < this.fieldWidth; a++) {
  9868. for (var f = 0; f < this.fieldHeight; f++) {
  9869. if (this.field[a][f] != null) {
  9870. if (this.field[a][f].getColorID() == u) {
  9871. var l = new createjs.Point(this.field[a][f].x, this.field[a][f].y - Constants.CELL_SIZE / 2);
  9872. this.addGameObjectAtPos(new KillColorEffect(o, l), this, o.x, o.y);
  9873. this.field[a][f].match(Chip.MATCH_REASON_BONUS_EFFECT_5)
  9874. }
  9875. }
  9876. }
  9877. }
  9878. }
  9879. }
  9880. if (e.getBonusType() == Chip.BONUS_BOMB) {
  9881. this.boom(e);
  9882. e.match(Chip.MATCH_REASON_I_AM_BONUS);
  9883. t.match(Chip.MATCH_REASON_EXCHANGE_WIHT_BONUS)
  9884. }
  9885. this.setInpunState(this.INPUT_STATE_MATCHING)
  9886. } catch (c) {}
  9887. };
  9888. t.prototype.boom = function(e) {
  9889. try {
  9890. SoundManager.g_instance.play(SoundManager.SOUND_BOOM);
  9891. var t = e.getIndexX();
  9892. var n = e.getIndexY();
  9893. var r = 1;
  9894. for (var i = t - r; i <= t + r; i++) {
  9895. for (var s = n - r; s <= n + r; s++) {
  9896. if (this.validCoords(i, s) && this.field[i][s] != null) {
  9897. this.field[i][s].match(Chip.MATCH_REASON_BONUS_EFFECT_4_HOR)
  9898. }
  9899. }
  9900. }
  9901. var o = new AutoreleaseEffect;
  9902. this.addGameObjectAtPos(o, this, e.x, e.y)
  9903. } catch (u) {}
  9904. };
  9905. t.prototype.validCoords = function(e, t) {
  9906. return e >= 0 && e < this.fieldWidth && t >= 0 && t < this.fieldHeight
  9907. };
  9908. t.prototype.onExchangeEnded = function() {
  9909. try {
  9910. var e = this.swapChip1 != null || this.swapChip2 != null;
  9911. var t = false;
  9912. if (e) {
  9913. if (this.swapChip1.isBonus()) {
  9914. t = true
  9915. }
  9916. if (this.swapChip2.isBonus()) {
  9917. t = true
  9918. }
  9919. }
  9920. var n = this.findMatches();
  9921. if (n.length == 0) {
  9922. if (!t) {
  9923. if (e) {
  9924. this.exchangeChips(this.swapChip1, this.swapChip2);
  9925. this.swapChip1 = null;
  9926. this.swapChip2 = null
  9927. } else {
  9928. this.setInpunState(this.INPUT_STATE_WAIT_SELECTION)
  9929. }
  9930. }
  9931. } else {
  9932. this.decreseMoves();
  9933. this.matchMatches(n)
  9934. } if (e && t) {
  9935. if (this.swapChip1.isBonus()) {
  9936. this.matchBonus(this.swapChip1, this.swapChip2)
  9937. }
  9938. if (this.swapChip2.isBonus()) {
  9939. this.matchBonus(this.swapChip2, this.swapChip1)
  9940. }
  9941. this.decreseMoves()
  9942. }
  9943. } catch (r) {
  9944. console.log(r, "playstate::exchangeended")
  9945. }
  9946. };
  9947. t.prototype.decreseMoves = function() {
  9948. this.moves--;
  9949. if (this.moves < 0) {
  9950. this.moves = 0
  9951. }
  9952. this.movesLabel.setText(this.moves.toString())
  9953. };
  9954. t.prototype.findMatches = function() {
  9955. try {
  9956. var e = Array();
  9957. for (var t = 0; t < this.fieldHeight; t++) {
  9958. for (var n = 0; n < this.fieldWidth;) {
  9959. var r = -1;
  9960. var i = 0;
  9961. var s = new Array;
  9962. for (var o = n; o < this.fieldWidth; o++) {
  9963. if (this.field[o][t] == null || this.field[o][t].isBonus() || this.field[o][t].getColorID() == -1) {
  9964. break
  9965. } else {
  9966. if (r == -1) {
  9967. r = this.field[o][t].getColorID()
  9968. }
  9969. } if (this.field[o][t].getColorID() == r) {
  9970. s.push(this.field[o][t]);
  9971. i++
  9972. } else {
  9973. break
  9974. }
  9975. }
  9976. if (i >= 3) {
  9977. e.push(s)
  9978. }
  9979. if (i != 0) {
  9980. n += i
  9981. } else {
  9982. n++
  9983. }
  9984. }
  9985. }
  9986. for (var n = 0; n < this.fieldWidth; n++) {
  9987. for (var t = 0; t < this.fieldHeight; t) {
  9988. var r = -1;
  9989. var i = 0;
  9990. var s = new Array;
  9991. for (var o = t; o < this.fieldHeight; o++) {
  9992. if (this.field[n][o] == null || this.field[n][o].isBonus() || this.field[n][o].getColorID() == -1) {
  9993. break
  9994. } else {
  9995. if (r == -1) {
  9996. r = this.field[n][o].getColorID()
  9997. }
  9998. } if (this.field[n][o].getColorID() == r) {
  9999. s.push(this.field[n][o]);
  10000. i++
  10001. } else {
  10002. break
  10003. }
  10004. }
  10005. if (i >= 3) {
  10006. e.push(s)
  10007. }
  10008. if (i != 0) {
  10009. t += i
  10010. } else {
  10011. t++
  10012. }
  10013. }
  10014. }
  10015. } catch (u) {}
  10016. return e
  10017. };
  10018. t.prototype.onMouseUp = function(t, n) {
  10019. e.prototype.onMouseUp.call(this, t, n);
  10020. this.selectedChip = null
  10021. };
  10022. t.prototype.onMouseDown = function(t, n) {
  10023. e.prototype.onMouseDown.call(this, t, n);
  10024. n -= this.y;
  10025. if (this.inputState != this.INPUT_STATE_WAIT_SELECTION) {
  10026. return
  10027. }
  10028. var r = this.checkChipSelection(t, n);
  10029. if (r) {
  10030. if (r == this.selectedChip) {
  10031. return
  10032. }
  10033. if (!this.selectedChip) {
  10034. this.selectedChip = r;
  10035. this.selectedChip.select()
  10036. } else {
  10037. if (this.canExchange(this.selectedChip, r)) {
  10038. this.lastMovedChip = this.selectedChip;
  10039. this.exchangeChips(this.selectedChip, r);
  10040. SoundManager.g_instance.play(SoundManager.SOUND_EXCHANGE)
  10041. } else {
  10042. this.selectedChip.deselect();
  10043. this.selectedChip = r;
  10044. this.selectedChip.select()
  10045. }
  10046. }
  10047. }
  10048. };
  10049. t.prototype.onMouseMove = function(t, n) {
  10050. e.prototype.onMouseMove.call(this, t, n);
  10051. if (this.inputState != this.INPUT_STATE_WAIT_SELECTION) {
  10052. return
  10053. }
  10054. this.onMouseDown(t, n)
  10055. };
  10056. t.prototype.shiftChips = function() {
  10057. this.matchInARow++;
  10058. var e = false;
  10059. for (var t = 0; t < this.fieldWidth; t++) {
  10060. for (var n = this.fieldHeight - 1; n >= 0; n--) {
  10061. var r = this.field[t][n];
  10062. if (!r) {
  10063. continue
  10064. }
  10065. if (r.isHole()) {
  10066. continue
  10067. }
  10068. for (var i = this.fieldHeight - 1; i > n; i--) {
  10069. if (this.field[t][i] == null) {
  10070. e = true;
  10071. var s = i;
  10072. this.field[t][n].shiftDown(s, this.getYPosByYIndex(s));
  10073. this.field[t][s] = this.field[t][n];
  10074. this.field[t][n] = null;
  10075. break
  10076. }
  10077. }
  10078. }
  10079. }
  10080. if (e) {
  10081. this.setInpunState(this.INPUT_STATE_SHIFT)
  10082. } else {
  10083. this.spawnNewChips()
  10084. }
  10085. };
  10086. t.prototype.spawnNewChips = function() {
  10087. var e = 0;
  10088. for (var t = 0; t < this.fieldWidth; t++) {
  10089. var n = -1;
  10090. for (var r = this.fieldHeight - 1; r >= 0; r--) {
  10091. if (this.field[t][r] == null) {
  10092. if (n == -1) {
  10093. n = r
  10094. }
  10095. e++;
  10096. this.createChip(t, r, (n - r) * .13)
  10097. }
  10098. }
  10099. }
  10100. if (e > 0) {
  10101. this.setInpunState(this.INPUT_STATE_WAIT_SPAWN)
  10102. } else {
  10103. this.setInpunState(this.INPUT_STATE_WAIT_SELECTION)
  10104. }
  10105. };
  10106. t.prototype.spawnDefinedChips = function(e) {
  10107. for (var t = 0; t < this.fieldWidth; t++) {
  10108. for (var n = 0; n < this.fieldHeight; n++) {
  10109. this.createChipWithColorID(t, n, (7 - n) * .13 + t * .11, e[n][t])
  10110. }
  10111. }
  10112. this.setInpunState(this.INPUT_STATE_WAIT_SPAWN)
  10113. };
  10114. t.prototype.checkChipSelection = function(e, t) {
  10115. for (var n = 0; n < this.fieldWidth; n++) {
  10116. for (var r = 0; r < this.fieldHeight; r++) {
  10117. var i = this.field[n][r];
  10118. if (i) {
  10119. if (Math.abs(i.x - e) < Constants.CELL_SIZE / 2 && i.y > t && i.y < t + Constants.CELL_SIZE) {
  10120. return i
  10121. }
  10122. }
  10123. }
  10124. }
  10125. return null
  10126. };
  10127. t.prototype.setInpunState = function(e) {
  10128. try {
  10129. this.inputState = e;
  10130. this.inputStateTime = 0;
  10131. if (this.inputState == this.INPUT_STATE_WAIT_SELECTION) {
  10132. this.matchInARow = 0;
  10133. if (this.findMoves()) {
  10134. var t = this.field[this.findedMatchPos1.x][this.findedMatchPos1.y];
  10135. var n = this.field[this.findedMatchPos2.x][this.findedMatchPos2.y];
  10136. this.moveHint = new MoveHint(this.findedMatchPos1.y != this.findedMatchPos2.y);
  10137. this.moveHint.x = (t.x + n.x) / 2;
  10138. this.moveHint.y = (t.y + n.y) / 2 - Constants.CELL_SIZE / 2
  10139. } else {
  10140. this.moveHint = null;
  10141. for (var r = 0; r < 100; r++) {
  10142. var i = this.field[Utils.RandomRangeInt(0, this.fieldWidth - 1)][Utils.RandomRangeInt(0, this.fieldHeight - 1)];
  10143. if (!i.isHole() && !i.isBonus() && !i.isStoneHeart()) {
  10144. i.convertToBonus([Chip.BONUS_BOMB, Chip.BONUS_4, Chip.BONUS_5][Utils.RandomRangeInt(0, 2)]);
  10145. break
  10146. }
  10147. }
  10148. } if (this.moves <= 0) {
  10149. this.lose()
  10150. }
  10151. }
  10152. } catch (s) {
  10153. this.inputState = this.INPUT_STATE_WAIT_SELECTION
  10154. }
  10155. };
  10156. t.prototype.takeStockMatch = function(e) {
  10157. var n = e.getIndexX();
  10158. var r = e.getIndexY();
  10159. if (this.field[n][r] == e) {
  10160. if (this.goal == t.GOAL_COUNT) {
  10161. if (e.getColorID() == this.goalChipID) {
  10162. this.chipGoalCount--;
  10163. if (this.chipGoalCount <= 0) {
  10164. this.chipGoalCount = 0;
  10165. this.win()
  10166. }
  10167. this.goalLabel.setText(this.chipGoalCount.toString())
  10168. }
  10169. }
  10170. }
  10171. };
  10172. t.prototype.clearCell = function(e) {
  10173. var n = e.getIndexX();
  10174. var r = e.getIndexY();
  10175. if (this.field[n][r] == e) {
  10176. if (this.goal == t.GOAL_COUNT) {
  10177. if (e.getColorID() == this.goalChipID) {
  10178. this.chipGoalCount--;
  10179. if (this.chipGoalCount <= 0) {
  10180. this.chipGoalCount = 0;
  10181. this.win()
  10182. }
  10183. this.goalLabel.setText(this.chipGoalCount.toString())
  10184. }
  10185. }
  10186. if (e.getMatchReason() == Chip.MATCH_REASON_BONUS_EFFECT_5 || e.getMatchReason() == Chip.MATCH_REASON_BONUS_EFFECT_4_HOR || e.getMatchReason() == Chip.MATCH_REASON_BONUS_EFFECT_4_VERT) {
  10187. this.runParticleEffect(e.x, e.y - Constants.CELL_SIZE / 2)
  10188. }
  10189. this.field[n][r] = null
  10190. }
  10191. this.tryClearDirt(n, r);
  10192. if (!e.isStoneHeart()) {
  10193. this.tryClearStoneHeart(n, r)
  10194. }
  10195. };
  10196. t.prototype.tryClearDirt = function(e, n) {
  10197. var r = this.fieldDirt[e][n];
  10198. if (r) {
  10199. createjs.Tween.get(r, {
  10200. loop: false
  10201. }).to({
  10202. alpha: 0
  10203. }, 250, createjs.Ease.linear);
  10204. this.fieldDirt[e][n] = null;
  10205. if (--this.dirtCount == 0) {
  10206. this.win()
  10207. }
  10208. }
  10209. if (this.goal == t.GOAL_DIRT) {
  10210. this.goalLabel.setText(this.dirtCount.toString())
  10211. }
  10212. };
  10213. t.prototype.tryClearStoneHeart = function(e, t) {
  10214. try {
  10215. var n;
  10216. n = this.getChipAt(e + 1, t);
  10217. if (n && n.isStoneHeart()) {
  10218. n.fallDown()
  10219. }
  10220. n = this.getChipAt(e - 1, t);
  10221. if (n && n.isStoneHeart()) {
  10222. n.fallDown()
  10223. }
  10224. n = this.getChipAt(e, t + 1);
  10225. if (n && n.isStoneHeart()) {
  10226. n.fallDown()
  10227. }
  10228. n = this.getChipAt(e, t - 1);
  10229. if (n && n.isStoneHeart()) {
  10230. n.fallDown()
  10231. }
  10232. } catch (r) {}
  10233. };
  10234. t.prototype.finishLevel = function() {
  10235. for (var e = 0; e < this.fieldWidth; e++) {
  10236. for (var t = 0; t < this.fieldHeight; t++) {
  10237. if (this.field[e][t] != null && this.field[e][t].isNormal()) {
  10238. this.field[e][t].fallDown()
  10239. }
  10240. }
  10241. }
  10242. };
  10243. t.prototype.lose = function() {
  10244. if (!this.waitLose) {
  10245. this.waitLose = true;
  10246. this.addGameObjectAt(new TimeIsUpEffect(Constants.IMAGE_OUT_OF_MOVES), this);
  10247. SoundManager.g_instance.play(SoundManager.SOUND_LOSE)
  10248. }
  10249. };
  10250. t.prototype.win = function() {
  10251. if (!this.waitWin) {
  10252. this.waitWin = true;
  10253. SoundManager.g_instance.play(SoundManager.SOUND_WIN)
  10254. }
  10255. };
  10256. t.prototype.addPointsAt = function(e, t) {
  10257. if (e.getBonusType() == null) {
  10258. var n = 40;
  10259. switch (t) {
  10260. case Chip.MATCH_REASON_EXCHANGE_WIHT_BONUS:
  10261. n = 40;
  10262. break;
  10263. case Chip.MATCH_REASON_BONUS_EFFECT_5:
  10264. n = 100;
  10265. break;
  10266. case Chip.MATCH_REASON_BONUS_EFFECT_4_HOR:
  10267. n = 90;
  10268. break;
  10269. case Chip.MATCH_REASON_BONUS_EFFECT_4_VERT:
  10270. n = 120;
  10271. break;
  10272. case Chip.MATCH_REASON_I_AM_BONUS:
  10273. n = 150;
  10274. break;
  10275. default:
  10276. n = 40 + this.matchInARow * 20;
  10277. break
  10278. }
  10279. var r = new FlyingPoints(n);
  10280. this.score += n;
  10281. var i = e.x - Constants.CELL_SIZE / 2;
  10282. var s = e.y - Constants.CELL_SIZE / 2;
  10283. this.tryShowAwesome(i, s);
  10284. this.tryShowSuperb(i, s);
  10285. this.addGameObjectAtPos(r, this, i, s)
  10286. }
  10287. };
  10288. t.prototype.tryShowSuperb = function(e, t) {
  10289. if (this.matchInARow >= 3 && this.superbEffectTime != this.liveTime) {
  10290. this.superbEffectTime = this.liveTime;
  10291. var n = new SuperbEffect;
  10292. this.addGameObjectAtPos(n, this, e, t);
  10293. SoundManager.g_instance.play(SoundManager.SOUND_AWESOME);
  10294. if (n.x < 120) {
  10295. n.x = 120
  10296. }
  10297. if (n.x > Constants.ASSETS_WIDTH - 120) {
  10298. n.x = Constants.ASSETS_WIDTH - 120
  10299. }
  10300. this.score += 500;
  10301. return true
  10302. }
  10303. return false
  10304. };
  10305. t.prototype.tryShowAwesome = function(e, t) {
  10306. if (this.matchInARow == 2 && this.awesomeEffectTime != this.liveTime) {
  10307. this.awesomeEffectTime = this.liveTime;
  10308. var n = new ShowAwesomeEffect;
  10309. this.addGameObjectAtPos(n, this, e, t);
  10310. SoundManager.g_instance.play(SoundManager.SOUND_AWESOME);
  10311. if (n.x < 120) {
  10312. n.x = 120
  10313. }
  10314. if (n.x > Constants.ASSETS_WIDTH - 120) {
  10315. n.x = Constants.ASSETS_WIDTH - 120
  10316. }
  10317. this.score += 200;
  10318. return true
  10319. }
  10320. return false
  10321. };
  10322. t.prototype.findMoves = function() {
  10323. try {
  10324. var e = [
  10325. [2, -1],
  10326. [3, 0],
  10327. [2, 1]
  10328. ];
  10329. var t = [
  10330. [-1, -1],
  10331. [-2, 0],
  10332. [-1, 1]
  10333. ];
  10334. var n = [
  10335. [1, -1],
  10336. [1, 1]
  10337. ];
  10338. for (var r = 0; r < this.fieldHeight; r++) {
  10339. for (var i = 0; i < this.fieldWidth - 1; i++) {
  10340. if (this.field[i][r].getColorID() == this.field[i + 1][r].getColorID()) {
  10341. if (this.findPattern(i, r, this.field[i][r].getColorID(), e, i + 2, r)) {
  10342. return true
  10343. }
  10344. if (this.findPattern(i, r, this.field[i][r].getColorID(), t, i - 1, r)) {
  10345. return true
  10346. }
  10347. }
  10348. }
  10349. }
  10350. for (var r = 0; r < this.fieldHeight; r++) {
  10351. for (var i = 0; i < this.fieldWidth - 2; i++) {
  10352. if (this.field[i][r].getColorID() == this.field[i + 2][r].getColorID()) {
  10353. if (this.findPattern(i, r, this.field[i][r].getColorID(), n, i + 1, r)) {
  10354. return true
  10355. }
  10356. }
  10357. }
  10358. }
  10359. var s = [
  10360. [-1, 2],
  10361. [0, 3],
  10362. [1, 2]
  10363. ];
  10364. var o = [
  10365. [-1, -1],
  10366. [0, -2],
  10367. [1, -1]
  10368. ];
  10369. var u = [
  10370. [-1, 1],
  10371. [1, 1]
  10372. ];
  10373. for (var r = 0; r < this.fieldHeight - 1; r++) {
  10374. for (var i = 0; i < this.fieldWidth; i++) {
  10375. if (this.field[i][r].getColorID() == this.field[i][r + 1].getColorID()) {
  10376. if (this.findPattern(i, r, this.field[i][r].getColorID(), s, i, r + 2)) {
  10377. return true
  10378. }
  10379. if (this.findPattern(i, r, this.field[i][r].getColorID(), o, i, r - 1)) {
  10380. return true
  10381. }
  10382. }
  10383. }
  10384. }
  10385. for (var r = 0; r < this.fieldHeight - 2; r++) {
  10386. for (var i = 0; i < this.fieldWidth; i++) {
  10387. if (this.field[i][r].getColorID() == this.field[i][r + 2].getColorID()) {
  10388. if (this.findPattern(i, r, this.field[i][r].getColorID(), u, i, r + 1)) {
  10389. return true
  10390. }
  10391. }
  10392. }
  10393. }
  10394. } catch (a) {
  10395. console.log(a, "playstate::findmoves");
  10396. return false
  10397. }
  10398. return false
  10399. };
  10400. t.prototype.findPattern = function(e, t, n, r, i, s) {
  10401. if (n <= 0) {
  10402. return false
  10403. }
  10404. if (i < 0 || i >= this.fieldWidth || s < 0 || s >= this.fieldHeight) {
  10405. return false
  10406. }
  10407. if (this.field[i][s] && this.field[i][s].isHole()) {
  10408. return false
  10409. }
  10410. for (var o = 0; o < r.length; o++) {
  10411. var u = this.getColorAt(e + r[o][0], t + r[o][1]);
  10412. if (u <= 0) {
  10413. continue
  10414. }
  10415. if (u == n) {
  10416. this.findedMatchPos1 = new createjs.Point(i, s);
  10417. this.findedMatchPos2 = new createjs.Point(e + r[o][0], t + r[o][1]);
  10418. return true
  10419. }
  10420. }
  10421. return false
  10422. };
  10423. t.prototype.setHintIndeces = function(e, t, n, r) {
  10424. this.findedMatchPos1 = new createjs.Point(e, t);
  10425. this.findedMatchPos2 = new createjs.Point(n, r)
  10426. };
  10427. t.prototype.getChipAt = function(e, t) {
  10428. if (e < 0 || t < 0 || e >= this.fieldWidth || t >= this.fieldHeight || !this.field[e][t] || this.field[e][t].isHole()) {
  10429. return null
  10430. }
  10431. return this.field[e][t]
  10432. };
  10433. t.prototype.getColorAt = function(e, t) {
  10434. if (e < 0 || t < 0 || e >= this.fieldWidth || t >= this.fieldHeight || !this.field[e][t] == null) {
  10435. return -1
  10436. }
  10437. return this.field[e][t].getColorID()
  10438. };
  10439. t.prototype.onShiftEnded = function() {
  10440. if (this.liveTime != this.lastDropSoundTime) {
  10441. this.lastDropSoundTime = this.liveTime;
  10442. var e = Utils.RandomRangeInt(0, 2);
  10443. for (var t = 0; e == this.lastDropID && t < 10; t++) {
  10444. e = Utils.RandomRangeInt(0, 2)
  10445. }
  10446. this.lastDropID = e;
  10447. switch (e) {
  10448. case 0:
  10449. SoundManager.g_instance.play(SoundManager.SOUND_DROP_1);
  10450. break;
  10451. case 1:
  10452. SoundManager.g_instance.play(SoundManager.SOUND_DROP_2);
  10453. break;
  10454. case 2:
  10455. SoundManager.g_instance.play(SoundManager.SOUND_DROP_3);
  10456. break
  10457. }
  10458. }
  10459. };
  10460. t.prototype.configureYAlign = function() {
  10461. if (Constants.g_isPC) {
  10462. return
  10463. }
  10464. if (Constants.SCREEN_HEIGHT < Constants.ASSETS_HEIGHT) {
  10465. this.y = Constants.SCREEN_HEIGHT - Constants.ASSETS_HEIGHT
  10466. } else if (Constants.SCREEN_HEIGHT > Constants.ASSETS_HEIGHT) {
  10467. this.y = (Constants.SCREEN_HEIGHT - Constants.ASSETS_HEIGHT) / 2;
  10468. var e = new createjs.Shape;
  10469. e.graphics.beginFill("#b5389c");
  10470. e.graphics.drawRect(0, Constants.ASSETS_HEIGHT, Constants.ASSETS_WIDTH, Constants.SCREEN_HEIGHT - Constants.ASSETS_HEIGHT + 1);
  10471. e.graphics.endFill();
  10472. this.addChild(e);
  10473. var t = new createjs.Shape;
  10474. t.graphics.beginFill("#b5389c");
  10475. t.graphics.drawRect(0, Constants.ASSETS_HEIGHT - Constants.SCREEN_HEIGHT, Constants.ASSETS_WIDTH, Constants.SCREEN_HEIGHT - Constants.ASSETS_HEIGHT);
  10476. t.graphics.endFill();
  10477. this.addChild(t)
  10478. }
  10479. };
  10480. t.prototype.runParticleEffect = function(e, t) {
  10481. var n = 80;
  10482. var r = Utils.RandomRangeInt(3, 4);
  10483. for (var i = 0; i < r; i++) {
  10484. var s = Utils.RadToGrad(Utils.RandomRange(0, 360));
  10485. var o = new HeartParticle(Math.cos(s) * n, Math.sin(s) * n);
  10486. this.addGameObject(o);
  10487. this.addChild(o);
  10488. o.x = e + Utils.RandomRange(-Constants.CELL_SIZE / 3, Constants.CELL_SIZE / 3);
  10489. o.y = t + Utils.RandomRange(-Constants.CELL_SIZE / 3, Constants.CELL_SIZE / 3)
  10490. }
  10491. };
  10492. t.g_curLevel = -1;
  10493. t.GOAL_DIRT = "GOAL_DIRT";
  10494. t.GOAL_COUNT = "GOAL_COUNT";
  10495. return t
  10496. }(GameState);
  10497. var SelectLevelButton = function(e) {
  10498. function t(t, n, r) {
  10499. e.call(this, t, n);
  10500. this.locked = false;
  10501. this.levelNum = r;
  10502. if (r < GameData.getInstance().levelsAvailable()) {
  10503. var i = new DNTextField((r + 1).toString(), "sel_", -6);
  10504. this.addChild(i);
  10505. var s = .65;
  10506. i.scaleX = i.scaleY = s;
  10507. i.x = -i.getBounds().width / 2 * s + 5;
  10508. i.y = -i.getBounds().height / 2 * s - 7
  10509. } else {
  10510. this.locked = true;
  10511. var o = AssetsManager.g_instance.getCenteredImage(Constants.IMAGE_LOCK);
  10512. o.y -= 5;
  10513. o.x += 4;
  10514. this.addChild(o)
  10515. }
  10516. }
  10517. __extends(t, e);
  10518. t.prototype.onMouseDown = function(t, n) {
  10519. if (this.locked) {
  10520. return
  10521. }
  10522. e.prototype.onMouseDown.call(this, t, n);
  10523. this.touchY = n
  10524. };
  10525. t.prototype.onMouseUp = function(t, n) {
  10526. if (Math.abs(n - this.touchY) > 30) {
  10527. this.deselect();
  10528. return
  10529. }
  10530. e.prototype.onMouseUp.call(this, t, n)
  10531. };
  10532. t.prototype.runFunc = function() {
  10533. StateManager.g_instance.pushState(new ShadeInState(new PlayState(this.levelNum, true)))
  10534. };
  10535. return t
  10536. }(DNButton);
  10537. var TaskEffect = function(e) {
  10538. function t(t, n, r) {
  10539. var i = this;
  10540. e.call(this);
  10541. if (t == PlayState.GOAL_DIRT) {
  10542. var s = AssetsManager.g_instance.getCenteredImageWithProxy(Constants.IMAGE_TASK_PANEL);
  10543. this.addChild(s);
  10544. this.addChild(s);
  10545. var o = new createjs.Text(StringManager.getInstance().getString(StringManager.STRING_CLEAR), "bold 33px Times New Roman", "#6f6aa4");
  10546. o.textAlign = "center";
  10547. o.y = -23;
  10548. s.addChild(o)
  10549. } else {
  10550. var s = AssetsManager.g_instance.getCenteredImageWithProxy(Constants.IMAGE_TASK_PANEL);
  10551. this.addChild(s);
  10552. var o = new createjs.Text(StringManager.getInstance().getString(StringManager.STRING_REMOVE), "bold 33px Times New Roman", "#6f6aa4");
  10553. o.textAlign = "right";
  10554. o.y = -23;
  10555. s.addChild(o);
  10556. var u = new DNTextField(n.toString(), "font_", -3);
  10557. s.addChild(u);
  10558. u.x = 10;
  10559. u.y = -20;
  10560. var a = AssetsManager.g_instance.getCenteredImageWithProxy("cake_" + r);
  10561. a.scaleX = a.scaleY = .7;
  10562. s.addChild(a);
  10563. a.x = 92;
  10564. a.y = -2
  10565. }
  10566. this.y = -200;
  10567. this.x = Constants.ASSETS_WIDTH * .5;
  10568. this.alpha = 0;
  10569. createjs.Tween.get(this, {
  10570. loop: false
  10571. }).wait(1300).to({
  10572. y: Constants.ASSETS_HEIGHT * .5,
  10573. alpha: 1
  10574. }, 650, createjs.Ease.backOut).wait(2200).to({
  10575. y: Constants.ASSETS_HEIGHT + 200,
  10576. alpha: 0
  10577. }, 400, createjs.Ease.backIn).call(function() {
  10578. return i.kill()
  10579. })
  10580. }
  10581. __extends(t, e);
  10582. return t
  10583. }(GameObject);
  10584. var WinState = function(e) {
  10585. function t(t, n) {
  10586. var r = this;
  10587. e.call(this);
  10588. this.panel = new createjs.Container;
  10589. this.hiddingNow = false;
  10590. GameData.getInstance().onWinLevel(t, n);
  10591. this.shader = new createjs.Shape;
  10592. this.shader.graphics.beginFill("#000000");
  10593. this.shader.graphics.drawRect(0, 0, Constants.ASSETS_WIDTH, Constants.SCREEN_HEIGHT);
  10594. this.shader.graphics.endFill();
  10595. this.addChild(this.shader);
  10596. this.shader.alpha = 0;
  10597. this.shaderTween = createjs.Tween.get(this.shader, {
  10598. loop: false
  10599. }).wait(400).to({
  10600. alpha: .4
  10601. }, 800, createjs.Ease.linear);
  10602. this.addChild(this.panel);
  10603. this.panel.x = Constants.ASSETS_WIDTH / 2;
  10604. this.panel.y = Constants.SCREEN_HEIGHT / 2;
  10605. var i = AssetsManager.g_instance.getCenteredImage(Constants.IMAGE_MESSAGE_WINDOW);
  10606. this.panel.addChild(i);
  10607. var s = new DNButton(Constants.IMAGE_BUTTON_RESTART, function() {
  10608. return r.onRestartTouch()
  10609. });
  10610. this.panel.addChild(s);
  10611. this.addGuiObject(s);
  10612. s.x = 0;
  10613. s.y = 125;
  10614. var o = new DNButton(Constants.IMAGE_BUTTON_EXIT, function() {
  10615. return r.onExitTouch()
  10616. });
  10617. this.panel.addChild(o);
  10618. this.addGuiObject(o);
  10619. o.x = -150;
  10620. o.y = 125;
  10621. var u = new DNButton(Constants.IMAGE_BUTTON_PLAY, function() {
  10622. return r.onNextTouch()
  10623. });
  10624. this.panel.addChild(u);
  10625. this.addGuiObject(u);
  10626. u.x = +150;
  10627. u.y = 125;
  10628. var a = AssetsManager.g_instance.getCenteredImageWithProxy(Constants.IMAGE_WIN_CAPTION);
  10629. this.panel.addChild(a);
  10630. a.y = -270;
  10631. var f = -180;
  10632. var l = +180;
  10633. this.panel.alpha = 0;
  10634. createjs.Tween.get(this.panel, {
  10635. loop: false
  10636. }).to({
  10637. alpha: 1
  10638. }, 200, createjs.Ease.linear);
  10639. this.panel.scaleX = .7;
  10640. this.panel.scaleY = .7;
  10641. createjs.Tween.get(this.panel, {
  10642. loop: false
  10643. }).to({
  10644. scaleX: 1,
  10645. scaleY: 1
  10646. }, 400, createjs.Ease.backOut);
  10647. var c = AssetsManager.g_instance.getImage(Constants.IMAGE_WIN_STRINGS);
  10648. this.panel.addChild(c);
  10649. c.x = -170;
  10650. c.y = -120;
  10651. var h = new DNTextField(Utils.GetScoreString(n), "font_", 0);
  10652. this.panel.addChild(h);
  10653. h.x = -68;
  10654. h.y = -104;
  10655. h.scaleX = h.scaleY = 1.15;
  10656. var p = new DNTextField(Utils.GetScoreString(GameData.getInstance().getTotalScore()), "font_", 0);
  10657. this.panel.addChild(p);
  10658. p.x = -68;
  10659. p.y = -17;
  10660. p.scaleX = p.scaleY = 1.15;
  10661. try {
  10662. SG_Hooks.levelUp(t, n)
  10663. } catch (d) {
  10664. console.log("error SG_Hooks.levelUp(level, score);")
  10665. }
  10666. }
  10667. __extends(t, e);
  10668. t.prototype.hide = function() {
  10669. if (!this.hiddingNow) {
  10670. createjs.Tween.get(this.shader, {
  10671. loop: false
  10672. }).to({
  10673. alpha: 0
  10674. }, 400, createjs.Ease.linear).call(function() {
  10675. StateManager.g_instance.popState()
  10676. });
  10677. createjs.Tween.get(this.panel, {
  10678. loop: false
  10679. }).to({
  10680. y: -300
  10681. }, 300, createjs.Ease.backIn);
  10682. createjs.Tween.get(this.panel, {
  10683. loop: false
  10684. }).to({
  10685. alpha: 0
  10686. }, 300, createjs.Ease.linear);
  10687. this.hiddingNow = true
  10688. }
  10689. };
  10690. t.prototype.onRestartTouch = function() {
  10691. StateManager.g_instance.pushState(new ShadeInCircleState(new PlayState(PlayState.g_curLevel, false)))
  10692. };
  10693. t.prototype.onExitTouch = function() {
  10694. StateManager.g_instance.pushState(new ShadeInState(new SelectLevelState))
  10695. };
  10696. t.prototype.onNextTouch = function() {
  10697. if (PlayState.g_curLevel + 1 < GameData.getInstance().levelsAvailable()) {
  10698. StateManager.g_instance.pushState(new ShadeInState(new PlayState(PlayState.g_curLevel + 1, true)))
  10699. } else {
  10700. StateManager.g_instance.pushState(new ShadeInState(new SelectLevelState))
  10701. }
  10702. };
  10703. return t
  10704. }(GameState);
  10705. //58