ext-debug.js 1.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141
  1. /*
  2. This file is part of Ext JS 7.4.0.42
  3. Copyright (c) 2011-2021 Sencha Inc
  4. license: http://www.sencha.com/legal/sencha-software-license-agreement
  5. Contact: http://www.sencha.com/contact
  6. Commercial Usage
  7. Licensees holding valid commercial licenses may use this file in accordance with the Commercial
  8. Software License Agreement referenced above or, alternatively, in accordance with the
  9. terms contained in a written agreement between you and Sencha.
  10. If you are unsure which license is appropriate for your use, please contact the sales department
  11. at http://www.sencha.com/contact.
  12. Version: 7.4.0.42 Build date: 2021-05-04 14:42:24 (669f575eb1592a96aa3fb58a602faf3b96d819ea)
  13. */
  14. var Ext = Ext || {};
  15. (function(manifest){
  16. if(!Ext.manifest) {
  17. Ext.manifest = manifest;
  18. } else {
  19. for(var name in manifest) {
  20. Ext.manifest[name] = manifest[name];
  21. }
  22. }
  23. })({
  24. "paths": {
  25. "Ext": "../classic/classic/src",
  26. "Ext.AbstractManager": "../packages/core/src/AbstractManager.js",
  27. "Ext.Ajax": "../packages/core/src/Ajax.js",
  28. "Ext.AnimationQueue": "../packages/core/src/AnimationQueue.js",
  29. "Ext.ComponentManager": "../packages/core/src/ComponentManager.js",
  30. "Ext.ComponentQuery": "../packages/core/src/ComponentQuery.js",
  31. "Ext.Deferred": "../packages/core/src/Deferred.js",
  32. "Ext.Evented": "../packages/core/src/Evented.js",
  33. "Ext.Factory": "../packages/core/src/mixin/Factoryable.js",
  34. "Ext.GlobalEvents": "../packages/core/src/GlobalEvents.js",
  35. "Ext.Glyph": "../packages/core/src/Glyph.js",
  36. "Ext.JSON": "../packages/core/src/JSON.js",
  37. "Ext.Mixin": "../packages/core/src/class/Mixin.js",
  38. "Ext.Msg": "../classic/classic/src/window/MessageBox.js",
  39. "Ext.Progress": "../packages/core/src/Progress.js",
  40. "Ext.ProgressBase": "../packages/core/src/ProgressBase.js",
  41. "Ext.Promise": "../packages/core/src/Promise.js",
  42. "Ext.String.format": "../packages/core/src/Template.js",
  43. "Ext.TaskQueue": "../packages/core/src/TaskQueue.js",
  44. "Ext.Template": "../packages/core/src/Template.js",
  45. "Ext.Widget": "../packages/core/src/Widget.js",
  46. "Ext.XTemplate": "../packages/core/src/XTemplate.js",
  47. "Ext.app": "../packages/core/src/app",
  48. "Ext.data": "../packages/core/src/data",
  49. "Ext.direct": "../packages/core/src/direct",
  50. "Ext.dom": "../packages/core/src/dom",
  51. "Ext.dom.ButtonElement": "../classic/classic/src/dom/ButtonElement.js",
  52. "Ext.dom.Layer": "../classic/classic/src/dom/Layer.js",
  53. "Ext.drag": "../packages/core/src/drag",
  54. "Ext.event": "../packages/core/src/event",
  55. "Ext.event.publisher.MouseEnterLeave": "../classic/classic/src/event/publisher/MouseEnterLeave.js",
  56. "Ext.field": "../packages/core/src/field",
  57. "Ext.fx.Animation": "../packages/core/src/fx/Animation.js",
  58. "Ext.fx.Runner": "../packages/core/src/fx/Runner.js",
  59. "Ext.fx.State": "../packages/core/src/fx/State.js",
  60. "Ext.fx.animation": "../packages/core/src/fx/animation",
  61. "Ext.fx.easing": "../packages/core/src/fx/easing",
  62. "Ext.fx.runner": "../packages/core/src/fx/runner",
  63. "Ext.grid.AdvancedGroupStore": "../packages/core/src/grid/AdvancedGroupStore.js",
  64. "Ext.grid.plugin.BaseFilterBar": "../packages/core/src/grid/plugin/BaseFilterBar.js",
  65. "Ext.grid.plugin.BaseGroupingPanel": "../packages/core/src/grid/plugin/BaseGroupingPanel.js",
  66. "Ext.grid.plugin.BaseSummaries": "../packages/core/src/grid/plugin/BaseSummaries.js",
  67. "Ext.list": "../packages/core/src/list",
  68. "Ext.mixin": "../packages/core/src/mixin",
  69. "Ext.parse": "../packages/core/src/parse",
  70. "Ext.perf": "../packages/core/src/perf",
  71. "Ext.plugin.Abstract": "../packages/core/src/plugin/Abstract.js",
  72. "Ext.plugin.AbstractClipboard": "../packages/core/src/plugin/AbstractClipboard.js",
  73. "Ext.plugin.MouseEnter": "../packages/core/src/plugin/MouseEnter.js",
  74. "Ext.promise": "../packages/core/src/promise",
  75. "Ext.route": "../packages/core/src/route",
  76. "Ext.sparkline": "../packages/core/src/sparkline",
  77. "Ext.util": "../packages/core/src/util",
  78. "Ext.util.Animate": "../classic/classic/src/util/Animate.js",
  79. "Ext.util.ComponentDragger": "../classic/classic/src/util/ComponentDragger.js",
  80. "Ext.util.ElementContainer": "../classic/classic/src/util/ElementContainer.js",
  81. "Ext.util.Floating": "../classic/classic/src/util/Floating.js",
  82. "Ext.util.Format.format": "../packages/core/src/Template.js",
  83. "Ext.util.Memento": "../classic/classic/src/util/Memento.js",
  84. "Ext.util.ProtoElement": "../classic/classic/src/util/ProtoElement.js",
  85. "Ext.util.Queue": "../classic/classic/src/util/Queue.js",
  86. "Ext.util.Renderable": "../classic/classic/src/util/Renderable.js",
  87. "Ext.util.StoreHolder": "../classic/classic/src/util/StoreHolder.js",
  88. "Ext.util.TsvDecoder": "../packages/core/src/util/TSV.js"
  89. },
  90. "loadOrder": [
  91. {
  92. "path": "../packages/core/src/class/Mixin.js",
  93. "requires": [],
  94. "uses": [],
  95. "idx": 0
  96. },
  97. {
  98. "path": "../packages/core/src/util/DelayedTask.js",
  99. "requires": [],
  100. "uses": [
  101. 77
  102. ],
  103. "idx": 1
  104. },
  105. {
  106. "path": "../packages/core/src/util/Event.js",
  107. "requires": [
  108. 1
  109. ],
  110. "uses": [
  111. 24
  112. ],
  113. "idx": 2
  114. },
  115. {
  116. "path": "../packages/core/src/mixin/Identifiable.js",
  117. "requires": [],
  118. "uses": [],
  119. "idx": 3
  120. },
  121. {
  122. "path": "../packages/core/src/mixin/Observable.js",
  123. "requires": [
  124. 0,
  125. 2,
  126. 3
  127. ],
  128. "uses": [
  129. 52
  130. ],
  131. "idx": 4
  132. },
  133. {
  134. "path": "../packages/core/src/util/HashMap.js",
  135. "requires": [
  136. 4
  137. ],
  138. "uses": [],
  139. "idx": 5
  140. },
  141. {
  142. "path": "../packages/core/src/AbstractManager.js",
  143. "requires": [
  144. 5
  145. ],
  146. "uses": [],
  147. "idx": 6
  148. },
  149. {
  150. "path": "../packages/core/src/promise/Consequence.js",
  151. "requires": [],
  152. "uses": [
  153. 8
  154. ],
  155. "idx": 7
  156. },
  157. {
  158. "path": "../packages/core/src/promise/Deferred.js",
  159. "requires": [
  160. 7
  161. ],
  162. "uses": [
  163. 9
  164. ],
  165. "idx": 8
  166. },
  167. {
  168. "path": "../packages/core/src/promise/Promise.js",
  169. "requires": [
  170. 8
  171. ],
  172. "uses": [],
  173. "idx": 9
  174. },
  175. {
  176. "path": "../packages/core/src/Promise.js",
  177. "requires": [
  178. 9
  179. ],
  180. "uses": [
  181. 8
  182. ],
  183. "idx": 10
  184. },
  185. {
  186. "path": "../packages/core/src/Deferred.js",
  187. "requires": [
  188. 8,
  189. 10
  190. ],
  191. "uses": [
  192. 9
  193. ],
  194. "idx": 11
  195. },
  196. {
  197. "path": "../packages/core/src/mixin/Factoryable.js",
  198. "requires": [],
  199. "uses": [],
  200. "idx": 12
  201. },
  202. {
  203. "path": "../packages/core/src/data/request/Base.js",
  204. "requires": [
  205. 11,
  206. 12
  207. ],
  208. "uses": [
  209. 17
  210. ],
  211. "idx": 13
  212. },
  213. {
  214. "path": "../packages/core/src/data/flash/BinaryXhr.js",
  215. "requires": [],
  216. "uses": [
  217. 77
  218. ],
  219. "idx": 14
  220. },
  221. {
  222. "path": "../packages/core/src/data/request/Ajax.js",
  223. "requires": [
  224. 13,
  225. 14
  226. ],
  227. "uses": [],
  228. "idx": 15
  229. },
  230. {
  231. "path": "../packages/core/src/data/request/Form.js",
  232. "requires": [
  233. 13
  234. ],
  235. "uses": [],
  236. "idx": 16
  237. },
  238. {
  239. "path": "../packages/core/src/data/Connection.js",
  240. "requires": [
  241. 4,
  242. 11,
  243. 14,
  244. 15,
  245. 16
  246. ],
  247. "uses": [
  248. 12,
  249. 49
  250. ],
  251. "idx": 17
  252. },
  253. {
  254. "path": "../packages/core/src/Ajax.js",
  255. "requires": [
  256. 17
  257. ],
  258. "uses": [],
  259. "idx": 18
  260. },
  261. {
  262. "path": "../packages/core/src/AnimationQueue.js",
  263. "requires": [],
  264. "uses": [],
  265. "idx": 19
  266. },
  267. {
  268. "path": "../packages/core/src/mixin/Bufferable.js",
  269. "requires": [
  270. 0
  271. ],
  272. "uses": [],
  273. "idx": 20
  274. },
  275. {
  276. "path": "../packages/core/src/ComponentManager.js",
  277. "requires": [
  278. 20
  279. ],
  280. "uses": [
  281. 24,
  282. 36,
  283. 49,
  284. 89
  285. ],
  286. "idx": 21
  287. },
  288. {
  289. "path": "../packages/core/src/util/Operators.js",
  290. "requires": [],
  291. "uses": [],
  292. "idx": 22
  293. },
  294. {
  295. "path": "../packages/core/src/util/LruCache.js",
  296. "requires": [
  297. 5
  298. ],
  299. "uses": [],
  300. "idx": 23
  301. },
  302. {
  303. "path": "../packages/core/src/ComponentQuery.js",
  304. "requires": [
  305. 21,
  306. 22,
  307. 23
  308. ],
  309. "uses": [
  310. 95
  311. ],
  312. "idx": 24
  313. },
  314. {
  315. "path": "../packages/core/src/Evented.js",
  316. "requires": [
  317. 4
  318. ],
  319. "uses": [],
  320. "idx": 25
  321. },
  322. {
  323. "path": "../packages/core/src/util/Positionable.js",
  324. "requires": [],
  325. "uses": [
  326. 34,
  327. 49
  328. ],
  329. "idx": 26
  330. },
  331. {
  332. "path": "../packages/core/src/dom/UnderlayPool.js",
  333. "requires": [],
  334. "uses": [
  335. 49
  336. ],
  337. "idx": 27
  338. },
  339. {
  340. "path": "../packages/core/src/dom/Underlay.js",
  341. "requires": [
  342. 27
  343. ],
  344. "uses": [],
  345. "idx": 28
  346. },
  347. {
  348. "path": "../packages/core/src/dom/Shadow.js",
  349. "requires": [
  350. 28
  351. ],
  352. "uses": [],
  353. "idx": 29
  354. },
  355. {
  356. "path": "../packages/core/src/dom/Shim.js",
  357. "requires": [
  358. 28
  359. ],
  360. "uses": [],
  361. "idx": 30
  362. },
  363. {
  364. "path": "../packages/core/src/dom/ElementEvent.js",
  365. "requires": [
  366. 2
  367. ],
  368. "uses": [
  369. 37
  370. ],
  371. "idx": 31
  372. },
  373. {
  374. "path": "../packages/core/src/event/publisher/Publisher.js",
  375. "requires": [],
  376. "uses": [],
  377. "idx": 32
  378. },
  379. {
  380. "path": "../packages/core/src/util/Offset.js",
  381. "requires": [],
  382. "uses": [],
  383. "idx": 33
  384. },
  385. {
  386. "path": "../packages/core/src/util/Region.js",
  387. "requires": [
  388. 33
  389. ],
  390. "uses": [
  391. 49
  392. ],
  393. "idx": 34
  394. },
  395. {
  396. "path": "../packages/core/src/util/Point.js",
  397. "requires": [
  398. 34
  399. ],
  400. "uses": [],
  401. "idx": 35
  402. },
  403. {
  404. "path": "../packages/core/src/event/Event.js",
  405. "requires": [
  406. 35
  407. ],
  408. "uses": [
  409. 37,
  410. 77
  411. ],
  412. "idx": 36
  413. },
  414. {
  415. "path": "../packages/core/src/event/publisher/Dom.js",
  416. "requires": [
  417. 32,
  418. 36
  419. ],
  420. "uses": [
  421. 77
  422. ],
  423. "idx": 37
  424. },
  425. {
  426. "path": "../packages/core/src/event/publisher/Gesture.js",
  427. "requires": [
  428. 19,
  429. 35,
  430. 37
  431. ],
  432. "uses": [
  433. 36,
  434. 49,
  435. 313,
  436. 324,
  437. 325,
  438. 326,
  439. 327,
  440. 328,
  441. 329,
  442. 330,
  443. 331,
  444. 332,
  445. 333,
  446. 334
  447. ],
  448. "idx": 38
  449. },
  450. {
  451. "path": "../packages/core/src/mixin/Templatable.js",
  452. "requires": [
  453. 0
  454. ],
  455. "uses": [
  456. 49
  457. ],
  458. "idx": 39
  459. },
  460. {
  461. "path": "../packages/core/src/TaskQueue.js",
  462. "requires": [
  463. 19
  464. ],
  465. "uses": [],
  466. "idx": 40
  467. },
  468. {
  469. "path": "../packages/core/src/util/sizemonitor/Abstract.js",
  470. "requires": [
  471. 39,
  472. 40
  473. ],
  474. "uses": [],
  475. "idx": 41
  476. },
  477. {
  478. "path": "../packages/core/src/util/sizemonitor/Scroll.js",
  479. "requires": [
  480. 41
  481. ],
  482. "uses": [
  483. 40
  484. ],
  485. "idx": 42
  486. },
  487. {
  488. "path": "../packages/core/src/util/SizeMonitor.js",
  489. "requires": [
  490. 42
  491. ],
  492. "uses": [],
  493. "idx": 43
  494. },
  495. {
  496. "path": "../packages/core/src/event/publisher/ElementSize.js",
  497. "requires": [
  498. 32,
  499. 43
  500. ],
  501. "uses": [
  502. 40
  503. ],
  504. "idx": 44
  505. },
  506. {
  507. "path": "../packages/core/src/util/paintmonitor/Abstract.js",
  508. "requires": [],
  509. "uses": [
  510. 49
  511. ],
  512. "idx": 45
  513. },
  514. {
  515. "path": "../packages/core/src/util/paintmonitor/CssAnimation.js",
  516. "requires": [
  517. 45
  518. ],
  519. "uses": [],
  520. "idx": 46
  521. },
  522. {
  523. "path": "../packages/core/src/util/PaintMonitor.js",
  524. "requires": [
  525. 46
  526. ],
  527. "uses": [],
  528. "idx": 47
  529. },
  530. {
  531. "path": "../packages/core/src/event/publisher/ElementPaint.js",
  532. "requires": [
  533. 32,
  534. 40,
  535. 47
  536. ],
  537. "uses": [],
  538. "idx": 48
  539. },
  540. {
  541. "path": "../packages/core/src/dom/Element.js",
  542. "requires": [
  543. 4,
  544. 26,
  545. 29,
  546. 30,
  547. 31,
  548. 37,
  549. 38,
  550. 44,
  551. 48
  552. ],
  553. "uses": [
  554. 32,
  555. 34,
  556. 36,
  557. 75,
  558. 76,
  559. 95,
  560. 102,
  561. 253,
  562. 314,
  563. 335,
  564. 346,
  565. 348
  566. ],
  567. "idx": 49
  568. },
  569. {
  570. "path": "../packages/core/src/util/BasicFilter.js",
  571. "requires": [],
  572. "uses": [],
  573. "idx": 50
  574. },
  575. {
  576. "path": "../packages/core/src/util/Filter.js",
  577. "requires": [
  578. 50
  579. ],
  580. "uses": [],
  581. "idx": 51
  582. },
  583. {
  584. "path": "../packages/core/src/util/Observable.js",
  585. "requires": [
  586. 4
  587. ],
  588. "uses": [],
  589. "idx": 52
  590. },
  591. {
  592. "path": "../packages/core/src/util/AbstractMixedCollection.js",
  593. "requires": [
  594. 51,
  595. 52
  596. ],
  597. "uses": [],
  598. "idx": 53
  599. },
  600. {
  601. "path": "../packages/core/src/util/Sorter.js",
  602. "requires": [],
  603. "uses": [],
  604. "idx": 54
  605. },
  606. {
  607. "path": "../packages/core/src/util/Sortable.js",
  608. "requires": [
  609. 54
  610. ],
  611. "uses": [
  612. 56
  613. ],
  614. "idx": 55
  615. },
  616. {
  617. "path": "../packages/core/src/util/MixedCollection.js",
  618. "requires": [
  619. 53,
  620. 55
  621. ],
  622. "uses": [],
  623. "idx": 56
  624. },
  625. {
  626. "path": "../packages/core/src/util/TaskRunner.js",
  627. "requires": [],
  628. "uses": [],
  629. "idx": 57
  630. },
  631. {
  632. "path": "../classic/classic/src/fx/target/Target.js",
  633. "requires": [],
  634. "uses": [],
  635. "idx": 58
  636. },
  637. {
  638. "path": "../classic/classic/src/fx/target/Element.js",
  639. "requires": [
  640. 58
  641. ],
  642. "uses": [],
  643. "idx": 59
  644. },
  645. {
  646. "path": "../classic/classic/src/fx/target/ElementCSS.js",
  647. "requires": [
  648. 59
  649. ],
  650. "uses": [],
  651. "idx": 60
  652. },
  653. {
  654. "path": "../classic/classic/src/fx/target/CompositeElement.js",
  655. "requires": [
  656. 59
  657. ],
  658. "uses": [],
  659. "idx": 61
  660. },
  661. {
  662. "path": "../classic/classic/src/fx/target/CompositeElementCSS.js",
  663. "requires": [
  664. 60,
  665. 61
  666. ],
  667. "uses": [],
  668. "idx": 62
  669. },
  670. {
  671. "path": "../classic/classic/src/fx/target/Sprite.js",
  672. "requires": [
  673. 58
  674. ],
  675. "uses": [],
  676. "idx": 63
  677. },
  678. {
  679. "path": "../classic/classic/src/fx/target/CompositeSprite.js",
  680. "requires": [
  681. 63
  682. ],
  683. "uses": [],
  684. "idx": 64
  685. },
  686. {
  687. "path": "../classic/classic/src/fx/target/Component.js",
  688. "requires": [
  689. 58
  690. ],
  691. "uses": [
  692. 77
  693. ],
  694. "idx": 65
  695. },
  696. {
  697. "path": "../classic/classic/src/fx/Queue.js",
  698. "requires": [
  699. 5
  700. ],
  701. "uses": [],
  702. "idx": 66
  703. },
  704. {
  705. "path": "../classic/classic/src/fx/Manager.js",
  706. "requires": [
  707. 56,
  708. 57,
  709. 59,
  710. 60,
  711. 61,
  712. 62,
  713. 63,
  714. 64,
  715. 65,
  716. 66
  717. ],
  718. "uses": [],
  719. "idx": 67
  720. },
  721. {
  722. "path": "../classic/classic/src/fx/Animator.js",
  723. "requires": [
  724. 52,
  725. 67
  726. ],
  727. "uses": [
  728. 73
  729. ],
  730. "idx": 68
  731. },
  732. {
  733. "path": "../classic/classic/src/fx/CubicBezier.js",
  734. "requires": [],
  735. "uses": [],
  736. "idx": 69
  737. },
  738. {
  739. "path": "../classic/classic/src/fx/Easing.js",
  740. "requires": [
  741. 69
  742. ],
  743. "uses": [],
  744. "idx": 70
  745. },
  746. {
  747. "path": "../classic/classic/src/fx/DrawPath.js",
  748. "requires": [],
  749. "uses": [],
  750. "idx": 71
  751. },
  752. {
  753. "path": "../classic/classic/src/fx/PropertyHandler.js",
  754. "requires": [
  755. 71
  756. ],
  757. "uses": [],
  758. "idx": 72
  759. },
  760. {
  761. "path": "../classic/classic/src/fx/Anim.js",
  762. "requires": [
  763. 52,
  764. 67,
  765. 68,
  766. 69,
  767. 70,
  768. 72
  769. ],
  770. "uses": [],
  771. "idx": 73
  772. },
  773. {
  774. "path": "../classic/classic/src/util/Animate.js",
  775. "requires": [
  776. 67,
  777. 73
  778. ],
  779. "uses": [],
  780. "idx": 74
  781. },
  782. {
  783. "path": "../packages/core/src/dom/Fly.js",
  784. "requires": [
  785. 49
  786. ],
  787. "uses": [],
  788. "idx": 75
  789. },
  790. {
  791. "path": "../packages/core/src/dom/CompositeElementLite.js",
  792. "requires": [
  793. 75
  794. ],
  795. "uses": [
  796. 49
  797. ],
  798. "idx": 76
  799. },
  800. {
  801. "path": "../packages/core/src/GlobalEvents.js",
  802. "requires": [
  803. 4,
  804. 49
  805. ],
  806. "uses": [
  807. 21
  808. ],
  809. "idx": 77
  810. },
  811. {
  812. "path": "../packages/core/src/Glyph.js",
  813. "requires": [],
  814. "uses": [],
  815. "idx": 78
  816. },
  817. {
  818. "path": "../packages/core/src/JSON.js",
  819. "requires": [],
  820. "uses": [],
  821. "idx": 79
  822. },
  823. {
  824. "path": "../packages/core/src/Manifest.js",
  825. "requires": [],
  826. "uses": [],
  827. "idx": 80
  828. },
  829. {
  830. "path": "../packages/core/src/mixin/Inheritable.js",
  831. "requires": [
  832. 0
  833. ],
  834. "uses": [
  835. 21
  836. ],
  837. "idx": 81
  838. },
  839. {
  840. "path": "../packages/core/src/mixin/Bindable.js",
  841. "requires": [],
  842. "uses": [
  843. 12
  844. ],
  845. "idx": 82
  846. },
  847. {
  848. "path": "../packages/core/src/mixin/ComponentDelegation.js",
  849. "requires": [
  850. 0,
  851. 4
  852. ],
  853. "uses": [
  854. 2
  855. ],
  856. "idx": 83
  857. },
  858. {
  859. "path": "../packages/core/src/plugin/Abstract.js",
  860. "requires": [
  861. 3
  862. ],
  863. "uses": [],
  864. "idx": 84
  865. },
  866. {
  867. "path": "../packages/core/src/mixin/Pluggable.js",
  868. "requires": [
  869. 84
  870. ],
  871. "uses": [],
  872. "idx": 85
  873. },
  874. {
  875. "path": "../packages/core/src/mixin/Keyboard.js",
  876. "requires": [
  877. 0
  878. ],
  879. "uses": [
  880. 36
  881. ],
  882. "idx": 86
  883. },
  884. {
  885. "path": "../packages/core/src/mixin/Focusable.js",
  886. "requires": [],
  887. "uses": [
  888. 21,
  889. 24,
  890. 36,
  891. 49
  892. ],
  893. "idx": 87
  894. },
  895. {
  896. "path": "../packages/core/src/mixin/Accessible.js",
  897. "requires": [
  898. 0
  899. ],
  900. "uses": [],
  901. "idx": 88
  902. },
  903. {
  904. "path": "../packages/core/src/Widget.js",
  905. "requires": [
  906. 12,
  907. 25,
  908. 49,
  909. 81,
  910. 82,
  911. 83,
  912. 85,
  913. 86,
  914. 87,
  915. 88
  916. ],
  917. "uses": [
  918. 21,
  919. 24,
  920. 98
  921. ],
  922. "idx": 89
  923. },
  924. {
  925. "path": "../packages/core/src/mixin/Responsive.js",
  926. "requires": [
  927. 0
  928. ],
  929. "uses": [
  930. 49
  931. ],
  932. "idx": 90
  933. },
  934. {
  935. "path": "../classic/classic/src/ResponsiveWidget.js",
  936. "requires": [
  937. 90
  938. ],
  939. "uses": [],
  940. "idx": 91
  941. },
  942. {
  943. "path": "../packages/core/src/ProgressBase.js",
  944. "requires": [],
  945. "uses": [
  946. 98
  947. ],
  948. "idx": 92
  949. },
  950. {
  951. "path": "../packages/core/src/Progress.js",
  952. "requires": [
  953. 89,
  954. 92
  955. ],
  956. "uses": [],
  957. "idx": 93
  958. },
  959. {
  960. "path": "../packages/core/src/util/Format.js",
  961. "requires": [],
  962. "uses": [
  963. 95,
  964. 253
  965. ],
  966. "idx": 94
  967. },
  968. {
  969. "path": "../packages/core/src/Template.js",
  970. "requires": [
  971. 94
  972. ],
  973. "uses": [
  974. 253
  975. ],
  976. "idx": 95
  977. },
  978. {
  979. "path": "../packages/core/src/util/XTemplateParser.js",
  980. "requires": [],
  981. "uses": [],
  982. "idx": 96
  983. },
  984. {
  985. "path": "../packages/core/src/util/XTemplateCompiler.js",
  986. "requires": [
  987. 96
  988. ],
  989. "uses": [],
  990. "idx": 97
  991. },
  992. {
  993. "path": "../packages/core/src/XTemplate.js",
  994. "requires": [
  995. 95,
  996. 97
  997. ],
  998. "uses": [],
  999. "idx": 98
  1000. },
  1001. {
  1002. "path": "../packages/core/src/app/EventDomain.js",
  1003. "requires": [
  1004. 2
  1005. ],
  1006. "uses": [],
  1007. "idx": 99
  1008. },
  1009. {
  1010. "path": "../packages/core/src/app/domain/Component.js",
  1011. "requires": [
  1012. 89,
  1013. 99
  1014. ],
  1015. "uses": [],
  1016. "idx": 100
  1017. },
  1018. {
  1019. "path": "../classic/classic/src/util/ProtoElement.js",
  1020. "requires": [],
  1021. "uses": [
  1022. 49,
  1023. 253
  1024. ],
  1025. "idx": 101
  1026. },
  1027. {
  1028. "path": "../packages/core/src/dom/CompositeElement.js",
  1029. "requires": [
  1030. 76
  1031. ],
  1032. "uses": [],
  1033. "idx": 102
  1034. },
  1035. {
  1036. "path": "../classic/classic/src/plugin/Manager.js",
  1037. "requires": [],
  1038. "uses": [],
  1039. "idx": 103
  1040. },
  1041. {
  1042. "path": "../packages/core/src/util/CSS.js",
  1043. "requires": [],
  1044. "uses": [
  1045. 49
  1046. ],
  1047. "idx": 104
  1048. },
  1049. {
  1050. "path": "../packages/core/src/fx/easing/Abstract.js",
  1051. "requires": [],
  1052. "uses": [],
  1053. "idx": 105
  1054. },
  1055. {
  1056. "path": "../packages/core/src/fx/easing/Linear.js",
  1057. "requires": [
  1058. 105
  1059. ],
  1060. "uses": [],
  1061. "idx": 106
  1062. },
  1063. {
  1064. "path": "../packages/core/src/util/translatable/Abstract.js",
  1065. "requires": [
  1066. 12,
  1067. 25,
  1068. 106
  1069. ],
  1070. "uses": [
  1071. 19
  1072. ],
  1073. "idx": 107
  1074. },
  1075. {
  1076. "path": "../packages/core/src/util/translatable/Dom.js",
  1077. "requires": [
  1078. 107
  1079. ],
  1080. "uses": [],
  1081. "idx": 108
  1082. },
  1083. {
  1084. "path": "../packages/core/src/util/translatable/ScrollPosition.js",
  1085. "requires": [
  1086. 108
  1087. ],
  1088. "uses": [],
  1089. "idx": 109
  1090. },
  1091. {
  1092. "path": "../classic/classic/src/scroll/Scroller.js",
  1093. "requires": [
  1094. 11,
  1095. 12,
  1096. 20,
  1097. 25,
  1098. 104,
  1099. 109
  1100. ],
  1101. "uses": [
  1102. 77,
  1103. 471
  1104. ],
  1105. "idx": 110
  1106. },
  1107. {
  1108. "path": "../classic/classic/src/util/Floating.js",
  1109. "requires": [],
  1110. "uses": [
  1111. 21,
  1112. 49,
  1113. 75,
  1114. 423
  1115. ],
  1116. "idx": 111
  1117. },
  1118. {
  1119. "path": "../classic/classic/src/util/ElementContainer.js",
  1120. "requires": [],
  1121. "uses": [],
  1122. "idx": 112
  1123. },
  1124. {
  1125. "path": "../classic/classic/src/util/Renderable.js",
  1126. "requires": [
  1127. 49
  1128. ],
  1129. "uses": [
  1130. 98,
  1131. 117,
  1132. 253
  1133. ],
  1134. "idx": 113
  1135. },
  1136. {
  1137. "path": "../classic/classic/src/state/Provider.js",
  1138. "requires": [
  1139. 52
  1140. ],
  1141. "uses": [],
  1142. "idx": 114
  1143. },
  1144. {
  1145. "path": "../classic/classic/src/state/Manager.js",
  1146. "requires": [
  1147. 114
  1148. ],
  1149. "uses": [],
  1150. "idx": 115
  1151. },
  1152. {
  1153. "path": "../classic/classic/src/state/Stateful.js",
  1154. "requires": [
  1155. 57,
  1156. 115
  1157. ],
  1158. "uses": [],
  1159. "idx": 116
  1160. },
  1161. {
  1162. "path": "../classic/classic/src/Component.js",
  1163. "requires": [
  1164. 21,
  1165. 24,
  1166. 26,
  1167. 52,
  1168. 74,
  1169. 77,
  1170. 81,
  1171. 82,
  1172. 83,
  1173. 84,
  1174. 86,
  1175. 87,
  1176. 88,
  1177. 101,
  1178. 102,
  1179. 103,
  1180. 110,
  1181. 111,
  1182. 112,
  1183. 113,
  1184. 116
  1185. ],
  1186. "uses": [
  1187. 1,
  1188. 49,
  1189. 67,
  1190. 98,
  1191. 253,
  1192. 418,
  1193. 419,
  1194. 420,
  1195. 423,
  1196. 431,
  1197. 433,
  1198. 498,
  1199. 666,
  1200. 686
  1201. ],
  1202. "idx": 117
  1203. },
  1204. {
  1205. "path": "../classic/classic/src/Responsive.js",
  1206. "requires": [
  1207. 90,
  1208. 91
  1209. ],
  1210. "uses": [],
  1211. "idx": 118
  1212. },
  1213. {
  1214. "path": "../classic/classic/src/layout/container/border/Region.js",
  1215. "requires": [],
  1216. "uses": [],
  1217. "idx": 119
  1218. },
  1219. {
  1220. "path": "../packages/core/src/app/EventBus.js",
  1221. "requires": [
  1222. 100
  1223. ],
  1224. "uses": [
  1225. 99
  1226. ],
  1227. "idx": 120
  1228. },
  1229. {
  1230. "path": "../packages/core/src/app/domain/Global.js",
  1231. "requires": [
  1232. 77,
  1233. 99
  1234. ],
  1235. "uses": [],
  1236. "idx": 121
  1237. },
  1238. {
  1239. "path": "../packages/core/src/route/Handler.js",
  1240. "requires": [],
  1241. "uses": [],
  1242. "idx": 122
  1243. },
  1244. {
  1245. "path": "../packages/core/src/route/Action.js",
  1246. "requires": [],
  1247. "uses": [
  1248. 11
  1249. ],
  1250. "idx": 123
  1251. },
  1252. {
  1253. "path": "../packages/core/src/route/Route.js",
  1254. "requires": [
  1255. 122,
  1256. 123
  1257. ],
  1258. "uses": [
  1259. 10,
  1260. 126
  1261. ],
  1262. "idx": 124
  1263. },
  1264. {
  1265. "path": "../packages/core/src/util/History.js",
  1266. "requires": [
  1267. 52
  1268. ],
  1269. "uses": [],
  1270. "idx": 125
  1271. },
  1272. {
  1273. "path": "../packages/core/src/route/Router.js",
  1274. "requires": [
  1275. 123,
  1276. 124,
  1277. 125
  1278. ],
  1279. "uses": [
  1280. 122
  1281. ],
  1282. "idx": 126
  1283. },
  1284. {
  1285. "path": "../packages/core/src/route/Mixin.js",
  1286. "requires": [
  1287. 0,
  1288. 122,
  1289. 126
  1290. ],
  1291. "uses": [
  1292. 125
  1293. ],
  1294. "idx": 127
  1295. },
  1296. {
  1297. "path": "../packages/core/src/app/BaseController.js",
  1298. "requires": [
  1299. 4,
  1300. 120,
  1301. 121,
  1302. 127
  1303. ],
  1304. "uses": [
  1305. 226
  1306. ],
  1307. "idx": 128
  1308. },
  1309. {
  1310. "path": "../packages/core/src/app/Util.js",
  1311. "requires": [],
  1312. "uses": [],
  1313. "idx": 129
  1314. },
  1315. {
  1316. "path": "../packages/core/src/util/CollectionKey.js",
  1317. "requires": [
  1318. 3
  1319. ],
  1320. "uses": [],
  1321. "idx": 130
  1322. },
  1323. {
  1324. "path": "../packages/core/src/util/Grouper.js",
  1325. "requires": [
  1326. 54
  1327. ],
  1328. "uses": [
  1329. 221
  1330. ],
  1331. "idx": 131
  1332. },
  1333. {
  1334. "path": "../packages/core/src/util/Collection.js",
  1335. "requires": [
  1336. 4,
  1337. 51,
  1338. 54,
  1339. 130,
  1340. 131
  1341. ],
  1342. "uses": [
  1343. 178,
  1344. 179,
  1345. 180,
  1346. 181
  1347. ],
  1348. "idx": 132
  1349. },
  1350. {
  1351. "path": "../packages/core/src/data/Range.js",
  1352. "requires": [
  1353. 1,
  1354. 11
  1355. ],
  1356. "uses": [],
  1357. "idx": 133
  1358. },
  1359. {
  1360. "path": "../packages/core/src/util/ObjectTemplate.js",
  1361. "requires": [
  1362. 98
  1363. ],
  1364. "uses": [],
  1365. "idx": 134
  1366. },
  1367. {
  1368. "path": "../packages/core/src/data/schema/Role.js",
  1369. "requires": [],
  1370. "uses": [
  1371. 12
  1372. ],
  1373. "idx": 135
  1374. },
  1375. {
  1376. "path": "../packages/core/src/data/schema/Association.js",
  1377. "requires": [
  1378. 135
  1379. ],
  1380. "uses": [],
  1381. "idx": 136
  1382. },
  1383. {
  1384. "path": "../packages/core/src/data/schema/OneToOne.js",
  1385. "requires": [
  1386. 136
  1387. ],
  1388. "uses": [],
  1389. "idx": 137
  1390. },
  1391. {
  1392. "path": "../packages/core/src/data/schema/ManyToOne.js",
  1393. "requires": [
  1394. 136
  1395. ],
  1396. "uses": [],
  1397. "idx": 138
  1398. },
  1399. {
  1400. "path": "../packages/core/src/data/schema/ManyToMany.js",
  1401. "requires": [
  1402. 136
  1403. ],
  1404. "uses": [],
  1405. "idx": 139
  1406. },
  1407. {
  1408. "path": "../packages/core/src/util/Inflector.js",
  1409. "requires": [],
  1410. "uses": [],
  1411. "idx": 140
  1412. },
  1413. {
  1414. "path": "../packages/core/src/data/schema/Namer.js",
  1415. "requires": [
  1416. 12,
  1417. 140
  1418. ],
  1419. "uses": [],
  1420. "idx": 141
  1421. },
  1422. {
  1423. "path": "../packages/core/src/data/schema/Schema.js",
  1424. "requires": [
  1425. 12,
  1426. 134,
  1427. 137,
  1428. 138,
  1429. 139,
  1430. 141
  1431. ],
  1432. "uses": [],
  1433. "idx": 142
  1434. },
  1435. {
  1436. "path": "../packages/core/src/data/AbstractStore.js",
  1437. "requires": [
  1438. 4,
  1439. 12,
  1440. 51,
  1441. 132,
  1442. 133,
  1443. 142
  1444. ],
  1445. "uses": [
  1446. 185
  1447. ],
  1448. "idx": 143
  1449. },
  1450. {
  1451. "path": "../packages/core/src/data/Error.js",
  1452. "requires": [],
  1453. "uses": [],
  1454. "idx": 144
  1455. },
  1456. {
  1457. "path": "../packages/core/src/data/ErrorCollection.js",
  1458. "requires": [
  1459. 56,
  1460. 144
  1461. ],
  1462. "uses": [
  1463. 154
  1464. ],
  1465. "idx": 145
  1466. },
  1467. {
  1468. "path": "../packages/core/src/data/operation/Operation.js",
  1469. "requires": [],
  1470. "uses": [],
  1471. "idx": 146
  1472. },
  1473. {
  1474. "path": "../packages/core/src/data/operation/Create.js",
  1475. "requires": [
  1476. 146
  1477. ],
  1478. "uses": [],
  1479. "idx": 147
  1480. },
  1481. {
  1482. "path": "../packages/core/src/data/operation/Destroy.js",
  1483. "requires": [
  1484. 146
  1485. ],
  1486. "uses": [],
  1487. "idx": 148
  1488. },
  1489. {
  1490. "path": "../packages/core/src/data/operation/Read.js",
  1491. "requires": [
  1492. 146
  1493. ],
  1494. "uses": [],
  1495. "idx": 149
  1496. },
  1497. {
  1498. "path": "../packages/core/src/data/operation/Update.js",
  1499. "requires": [
  1500. 146
  1501. ],
  1502. "uses": [],
  1503. "idx": 150
  1504. },
  1505. {
  1506. "path": "../packages/core/src/data/SortTypes.js",
  1507. "requires": [],
  1508. "uses": [],
  1509. "idx": 151
  1510. },
  1511. {
  1512. "path": "../packages/core/src/data/validator/Validator.js",
  1513. "requires": [
  1514. 12
  1515. ],
  1516. "uses": [],
  1517. "idx": 152
  1518. },
  1519. {
  1520. "path": "../packages/core/src/data/summary/Base.js",
  1521. "requires": [
  1522. 12
  1523. ],
  1524. "uses": [],
  1525. "idx": 153
  1526. },
  1527. {
  1528. "path": "../packages/core/src/data/field/Field.js",
  1529. "requires": [
  1530. 12,
  1531. 151,
  1532. 152,
  1533. 153
  1534. ],
  1535. "uses": [],
  1536. "idx": 154
  1537. },
  1538. {
  1539. "path": "../packages/core/src/data/field/Array.js",
  1540. "requires": [
  1541. 154
  1542. ],
  1543. "uses": [],
  1544. "idx": 155
  1545. },
  1546. {
  1547. "path": "../packages/core/src/data/field/Boolean.js",
  1548. "requires": [
  1549. 154
  1550. ],
  1551. "uses": [],
  1552. "idx": 156
  1553. },
  1554. {
  1555. "path": "../packages/core/src/data/field/Date.js",
  1556. "requires": [
  1557. 154
  1558. ],
  1559. "uses": [],
  1560. "idx": 157
  1561. },
  1562. {
  1563. "path": "../packages/core/src/data/field/Integer.js",
  1564. "requires": [
  1565. 154
  1566. ],
  1567. "uses": [],
  1568. "idx": 158
  1569. },
  1570. {
  1571. "path": "../packages/core/src/data/field/Number.js",
  1572. "requires": [
  1573. 158
  1574. ],
  1575. "uses": [],
  1576. "idx": 159
  1577. },
  1578. {
  1579. "path": "../packages/core/src/data/field/String.js",
  1580. "requires": [
  1581. 154
  1582. ],
  1583. "uses": [],
  1584. "idx": 160
  1585. },
  1586. {
  1587. "path": "../packages/core/src/data/identifier/Generator.js",
  1588. "requires": [
  1589. 12
  1590. ],
  1591. "uses": [],
  1592. "idx": 161
  1593. },
  1594. {
  1595. "path": "../packages/core/src/data/identifier/Sequential.js",
  1596. "requires": [
  1597. 161
  1598. ],
  1599. "uses": [],
  1600. "idx": 162
  1601. },
  1602. {
  1603. "path": "../packages/core/src/data/Model.js",
  1604. "requires": [
  1605. 142,
  1606. 145,
  1607. 146,
  1608. 147,
  1609. 148,
  1610. 149,
  1611. 150,
  1612. 152,
  1613. 154,
  1614. 155,
  1615. 156,
  1616. 157,
  1617. 158,
  1618. 159,
  1619. 160,
  1620. 161,
  1621. 162
  1622. ],
  1623. "uses": [
  1624. 12,
  1625. 165,
  1626. 252
  1627. ],
  1628. "idx": 163
  1629. },
  1630. {
  1631. "path": "../packages/core/src/data/ResultSet.js",
  1632. "requires": [],
  1633. "uses": [],
  1634. "idx": 164
  1635. },
  1636. {
  1637. "path": "../packages/core/src/data/reader/Reader.js",
  1638. "requires": [
  1639. 4,
  1640. 12,
  1641. 23,
  1642. 98,
  1643. 164
  1644. ],
  1645. "uses": [
  1646. 142
  1647. ],
  1648. "idx": 165
  1649. },
  1650. {
  1651. "path": "../packages/core/src/data/writer/Writer.js",
  1652. "requires": [
  1653. 12
  1654. ],
  1655. "uses": [],
  1656. "idx": 166
  1657. },
  1658. {
  1659. "path": "../packages/core/src/data/proxy/Proxy.js",
  1660. "requires": [
  1661. 4,
  1662. 12,
  1663. 142,
  1664. 165,
  1665. 166
  1666. ],
  1667. "uses": [
  1668. 146,
  1669. 147,
  1670. 148,
  1671. 149,
  1672. 150,
  1673. 163,
  1674. 194
  1675. ],
  1676. "idx": 167
  1677. },
  1678. {
  1679. "path": "../packages/core/src/data/proxy/Client.js",
  1680. "requires": [
  1681. 167
  1682. ],
  1683. "uses": [],
  1684. "idx": 168
  1685. },
  1686. {
  1687. "path": "../packages/core/src/data/proxy/Memory.js",
  1688. "requires": [
  1689. 168
  1690. ],
  1691. "uses": [
  1692. 51,
  1693. 55
  1694. ],
  1695. "idx": 169
  1696. },
  1697. {
  1698. "path": "../packages/core/src/data/ProxyStore.js",
  1699. "requires": [
  1700. 143,
  1701. 146,
  1702. 147,
  1703. 148,
  1704. 149,
  1705. 150,
  1706. 163,
  1707. 167,
  1708. 169
  1709. ],
  1710. "uses": [
  1711. 142
  1712. ],
  1713. "idx": 170
  1714. },
  1715. {
  1716. "path": "../packages/core/src/util/Group.js",
  1717. "requires": [
  1718. 132
  1719. ],
  1720. "uses": [],
  1721. "idx": 171
  1722. },
  1723. {
  1724. "path": "../packages/core/src/data/Group.js",
  1725. "requires": [
  1726. 171
  1727. ],
  1728. "uses": [],
  1729. "idx": 172
  1730. },
  1731. {
  1732. "path": "../packages/core/src/data/LocalStore.js",
  1733. "requires": [
  1734. 0,
  1735. 172
  1736. ],
  1737. "uses": [
  1738. 132
  1739. ],
  1740. "idx": 173
  1741. },
  1742. {
  1743. "path": "../packages/core/src/data/proxy/Server.js",
  1744. "requires": [
  1745. 167
  1746. ],
  1747. "uses": [
  1748. 95,
  1749. 249
  1750. ],
  1751. "idx": 174
  1752. },
  1753. {
  1754. "path": "../packages/core/src/data/proxy/Ajax.js",
  1755. "requires": [
  1756. 18,
  1757. 174
  1758. ],
  1759. "uses": [],
  1760. "idx": 175
  1761. },
  1762. {
  1763. "path": "../packages/core/src/data/reader/Json.js",
  1764. "requires": [
  1765. 79,
  1766. 165
  1767. ],
  1768. "uses": [],
  1769. "idx": 176
  1770. },
  1771. {
  1772. "path": "../packages/core/src/data/writer/Json.js",
  1773. "requires": [
  1774. 166
  1775. ],
  1776. "uses": [],
  1777. "idx": 177
  1778. },
  1779. {
  1780. "path": "../packages/core/src/util/SorterCollection.js",
  1781. "requires": [
  1782. 54,
  1783. 132
  1784. ],
  1785. "uses": [],
  1786. "idx": 178
  1787. },
  1788. {
  1789. "path": "../packages/core/src/util/FilterCollection.js",
  1790. "requires": [
  1791. 51,
  1792. 132
  1793. ],
  1794. "uses": [],
  1795. "idx": 179
  1796. },
  1797. {
  1798. "path": "../packages/core/src/util/GrouperCollection.js",
  1799. "requires": [
  1800. 131,
  1801. 178
  1802. ],
  1803. "uses": [],
  1804. "idx": 180
  1805. },
  1806. {
  1807. "path": "../packages/core/src/util/GroupCollection.js",
  1808. "requires": [
  1809. 132,
  1810. 171,
  1811. 178,
  1812. 179,
  1813. 180
  1814. ],
  1815. "uses": [],
  1816. "idx": 181
  1817. },
  1818. {
  1819. "path": "../packages/core/src/data/Store.js",
  1820. "requires": [
  1821. 1,
  1822. 163,
  1823. 170,
  1824. 173,
  1825. 175,
  1826. 176,
  1827. 177,
  1828. 181
  1829. ],
  1830. "uses": [
  1831. 131,
  1832. 185
  1833. ],
  1834. "idx": 182
  1835. },
  1836. {
  1837. "path": "../packages/core/src/data/reader/Array.js",
  1838. "requires": [
  1839. 176
  1840. ],
  1841. "uses": [],
  1842. "idx": 183
  1843. },
  1844. {
  1845. "path": "../packages/core/src/data/ArrayStore.js",
  1846. "requires": [
  1847. 169,
  1848. 182,
  1849. 183
  1850. ],
  1851. "uses": [],
  1852. "idx": 184
  1853. },
  1854. {
  1855. "path": "../packages/core/src/data/StoreManager.js",
  1856. "requires": [
  1857. 56,
  1858. 184
  1859. ],
  1860. "uses": [
  1861. 12,
  1862. 169,
  1863. 177,
  1864. 182,
  1865. 183
  1866. ],
  1867. "idx": 185
  1868. },
  1869. {
  1870. "path": "../packages/core/src/app/domain/Store.js",
  1871. "requires": [
  1872. 99,
  1873. 143
  1874. ],
  1875. "uses": [],
  1876. "idx": 186
  1877. },
  1878. {
  1879. "path": "../packages/core/src/app/Controller.js",
  1880. "requires": [
  1881. 21,
  1882. 100,
  1883. 128,
  1884. 129,
  1885. 185,
  1886. 186
  1887. ],
  1888. "uses": [
  1889. 24,
  1890. 142
  1891. ],
  1892. "idx": 187
  1893. },
  1894. {
  1895. "path": "../packages/core/src/app/Application.js",
  1896. "requires": [
  1897. 56,
  1898. 125,
  1899. 187
  1900. ],
  1901. "uses": [
  1902. 126
  1903. ],
  1904. "idx": 188
  1905. },
  1906. {
  1907. "path": "../packages/core/src/app/Profile.js",
  1908. "requires": [
  1909. 4,
  1910. 187
  1911. ],
  1912. "uses": [],
  1913. "idx": 189
  1914. },
  1915. {
  1916. "path": "../packages/core/src/app/domain/View.js",
  1917. "requires": [
  1918. 89,
  1919. 99
  1920. ],
  1921. "uses": [],
  1922. "idx": 190
  1923. },
  1924. {
  1925. "path": "../packages/core/src/app/ViewController.js",
  1926. "requires": [
  1927. 12,
  1928. 128,
  1929. 190
  1930. ],
  1931. "uses": [],
  1932. "idx": 191
  1933. },
  1934. {
  1935. "path": "../packages/core/src/util/Bag.js",
  1936. "requires": [],
  1937. "uses": [],
  1938. "idx": 192
  1939. },
  1940. {
  1941. "path": "../packages/core/src/util/Scheduler.js",
  1942. "requires": [
  1943. 4,
  1944. 192
  1945. ],
  1946. "uses": [
  1947. 77
  1948. ],
  1949. "idx": 193
  1950. },
  1951. {
  1952. "path": "../packages/core/src/data/Batch.js",
  1953. "requires": [
  1954. 4
  1955. ],
  1956. "uses": [],
  1957. "idx": 194
  1958. },
  1959. {
  1960. "path": "../packages/core/src/data/matrix/Slice.js",
  1961. "requires": [],
  1962. "uses": [],
  1963. "idx": 195
  1964. },
  1965. {
  1966. "path": "../packages/core/src/data/matrix/Side.js",
  1967. "requires": [
  1968. 195
  1969. ],
  1970. "uses": [],
  1971. "idx": 196
  1972. },
  1973. {
  1974. "path": "../packages/core/src/data/matrix/Matrix.js",
  1975. "requires": [
  1976. 196
  1977. ],
  1978. "uses": [],
  1979. "idx": 197
  1980. },
  1981. {
  1982. "path": "../packages/core/src/data/session/ChangesVisitor.js",
  1983. "requires": [],
  1984. "uses": [],
  1985. "idx": 198
  1986. },
  1987. {
  1988. "path": "../packages/core/src/data/session/ChildChangesVisitor.js",
  1989. "requires": [
  1990. 198
  1991. ],
  1992. "uses": [],
  1993. "idx": 199
  1994. },
  1995. {
  1996. "path": "../packages/core/src/data/session/BatchVisitor.js",
  1997. "requires": [],
  1998. "uses": [
  1999. 194
  2000. ],
  2001. "idx": 200
  2002. },
  2003. {
  2004. "path": "../packages/core/src/mixin/Dirty.js",
  2005. "requires": [],
  2006. "uses": [],
  2007. "idx": 201
  2008. },
  2009. {
  2010. "path": "../packages/core/src/data/Session.js",
  2011. "requires": [
  2012. 4,
  2013. 142,
  2014. 194,
  2015. 197,
  2016. 198,
  2017. 199,
  2018. 200,
  2019. 201
  2020. ],
  2021. "uses": [],
  2022. "idx": 202
  2023. },
  2024. {
  2025. "path": "../packages/core/src/util/Schedulable.js",
  2026. "requires": [],
  2027. "uses": [],
  2028. "idx": 203
  2029. },
  2030. {
  2031. "path": "../packages/core/src/app/bind/BaseBinding.js",
  2032. "requires": [
  2033. 203
  2034. ],
  2035. "uses": [],
  2036. "idx": 204
  2037. },
  2038. {
  2039. "path": "../packages/core/src/app/bind/Binding.js",
  2040. "requires": [
  2041. 204
  2042. ],
  2043. "uses": [],
  2044. "idx": 205
  2045. },
  2046. {
  2047. "path": "../packages/core/src/app/bind/AbstractStub.js",
  2048. "requires": [
  2049. 203,
  2050. 205
  2051. ],
  2052. "uses": [],
  2053. "idx": 206
  2054. },
  2055. {
  2056. "path": "../packages/core/src/app/bind/Stub.js",
  2057. "requires": [
  2058. 205,
  2059. 206
  2060. ],
  2061. "uses": [
  2062. 211
  2063. ],
  2064. "idx": 207
  2065. },
  2066. {
  2067. "path": "../packages/core/src/app/bind/LinkStub.js",
  2068. "requires": [
  2069. 207
  2070. ],
  2071. "uses": [],
  2072. "idx": 208
  2073. },
  2074. {
  2075. "path": "../packages/core/src/app/bind/RootStub.js",
  2076. "requires": [
  2077. 206,
  2078. 207,
  2079. 208
  2080. ],
  2081. "uses": [],
  2082. "idx": 209
  2083. },
  2084. {
  2085. "path": "../packages/core/src/app/bind/Multi.js",
  2086. "requires": [
  2087. 204
  2088. ],
  2089. "uses": [],
  2090. "idx": 210
  2091. },
  2092. {
  2093. "path": "../packages/core/src/app/bind/Formula.js",
  2094. "requires": [
  2095. 23,
  2096. 203
  2097. ],
  2098. "uses": [],
  2099. "idx": 211
  2100. },
  2101. {
  2102. "path": "../packages/core/src/util/Fly.js",
  2103. "requires": [],
  2104. "uses": [],
  2105. "idx": 212
  2106. },
  2107. {
  2108. "path": "../packages/core/src/parse/Tokenizer.js",
  2109. "requires": [
  2110. 212
  2111. ],
  2112. "uses": [],
  2113. "idx": 213
  2114. },
  2115. {
  2116. "path": "../packages/core/src/parse/Symbol.js",
  2117. "requires": [],
  2118. "uses": [],
  2119. "idx": 214
  2120. },
  2121. {
  2122. "path": "../packages/core/src/parse/symbol/Constant.js",
  2123. "requires": [
  2124. 214
  2125. ],
  2126. "uses": [],
  2127. "idx": 215
  2128. },
  2129. {
  2130. "path": "../packages/core/src/parse/symbol/Infix.js",
  2131. "requires": [
  2132. 214
  2133. ],
  2134. "uses": [],
  2135. "idx": 216
  2136. },
  2137. {
  2138. "path": "../packages/core/src/parse/symbol/InfixRight.js",
  2139. "requires": [
  2140. 216
  2141. ],
  2142. "uses": [],
  2143. "idx": 217
  2144. },
  2145. {
  2146. "path": "../packages/core/src/parse/symbol/Paren.js",
  2147. "requires": [
  2148. 214
  2149. ],
  2150. "uses": [],
  2151. "idx": 218
  2152. },
  2153. {
  2154. "path": "../packages/core/src/parse/symbol/Prefix.js",
  2155. "requires": [
  2156. 214
  2157. ],
  2158. "uses": [],
  2159. "idx": 219
  2160. },
  2161. {
  2162. "path": "../packages/core/src/parse/Parser.js",
  2163. "requires": [
  2164. 212,
  2165. 213,
  2166. 215,
  2167. 217,
  2168. 218,
  2169. 219
  2170. ],
  2171. "uses": [
  2172. 214,
  2173. 216
  2174. ],
  2175. "idx": 220
  2176. },
  2177. {
  2178. "path": "../packages/core/src/app/bind/Parser.js",
  2179. "requires": [
  2180. 94,
  2181. 220
  2182. ],
  2183. "uses": [],
  2184. "idx": 221
  2185. },
  2186. {
  2187. "path": "../packages/core/src/app/bind/Template.js",
  2188. "requires": [
  2189. 94,
  2190. 221
  2191. ],
  2192. "uses": [],
  2193. "idx": 222
  2194. },
  2195. {
  2196. "path": "../packages/core/src/app/bind/TemplateBinding.js",
  2197. "requires": [
  2198. 204,
  2199. 210,
  2200. 222
  2201. ],
  2202. "uses": [],
  2203. "idx": 223
  2204. },
  2205. {
  2206. "path": "../packages/core/src/data/ChainedStore.js",
  2207. "requires": [
  2208. 143,
  2209. 173
  2210. ],
  2211. "uses": [
  2212. 95,
  2213. 185
  2214. ],
  2215. "idx": 224
  2216. },
  2217. {
  2218. "path": "../packages/core/src/app/ViewModel.js",
  2219. "requires": [
  2220. 3,
  2221. 12,
  2222. 193,
  2223. 202,
  2224. 208,
  2225. 209,
  2226. 210,
  2227. 211,
  2228. 223,
  2229. 224
  2230. ],
  2231. "uses": [
  2232. 1,
  2233. 142
  2234. ],
  2235. "idx": 225
  2236. },
  2237. {
  2238. "path": "../packages/core/src/app/domain/Controller.js",
  2239. "requires": [
  2240. 99,
  2241. 187
  2242. ],
  2243. "uses": [
  2244. 128
  2245. ],
  2246. "idx": 226
  2247. },
  2248. {
  2249. "path": "../packages/core/src/direct/Manager.js",
  2250. "requires": [
  2251. 4,
  2252. 56
  2253. ],
  2254. "uses": [
  2255. 95
  2256. ],
  2257. "idx": 227
  2258. },
  2259. {
  2260. "path": "../packages/core/src/direct/Provider.js",
  2261. "requires": [
  2262. 4,
  2263. 227
  2264. ],
  2265. "uses": [
  2266. 18
  2267. ],
  2268. "idx": 228
  2269. },
  2270. {
  2271. "path": "../packages/core/src/app/domain/Direct.js",
  2272. "requires": [
  2273. 99,
  2274. 228
  2275. ],
  2276. "uses": [],
  2277. "idx": 229
  2278. },
  2279. {
  2280. "path": "../packages/core/src/data/PageMap.js",
  2281. "requires": [
  2282. 23
  2283. ],
  2284. "uses": [],
  2285. "idx": 230
  2286. },
  2287. {
  2288. "path": "../packages/core/src/data/BufferedStore.js",
  2289. "requires": [
  2290. 51,
  2291. 54,
  2292. 131,
  2293. 170,
  2294. 230
  2295. ],
  2296. "uses": [
  2297. 178,
  2298. 179,
  2299. 181
  2300. ],
  2301. "idx": 231
  2302. },
  2303. {
  2304. "path": "../packages/core/src/data/ClientStore.js",
  2305. "requires": [
  2306. 169,
  2307. 182
  2308. ],
  2309. "uses": [],
  2310. "idx": 232
  2311. },
  2312. {
  2313. "path": "../packages/core/src/data/proxy/Direct.js",
  2314. "requires": [
  2315. 174,
  2316. 227
  2317. ],
  2318. "uses": [],
  2319. "idx": 233
  2320. },
  2321. {
  2322. "path": "../packages/core/src/data/DirectStore.js",
  2323. "requires": [
  2324. 182,
  2325. 233
  2326. ],
  2327. "uses": [],
  2328. "idx": 234
  2329. },
  2330. {
  2331. "path": "../packages/core/src/data/JsonP.js",
  2332. "requires": [],
  2333. "uses": [],
  2334. "idx": 235
  2335. },
  2336. {
  2337. "path": "../packages/core/src/data/proxy/JsonP.js",
  2338. "requires": [
  2339. 174,
  2340. 235
  2341. ],
  2342. "uses": [],
  2343. "idx": 236
  2344. },
  2345. {
  2346. "path": "../packages/core/src/data/JsonPStore.js",
  2347. "requires": [
  2348. 176,
  2349. 182,
  2350. 236
  2351. ],
  2352. "uses": [],
  2353. "idx": 237
  2354. },
  2355. {
  2356. "path": "../packages/core/src/data/JsonStore.js",
  2357. "requires": [
  2358. 175,
  2359. 176,
  2360. 177,
  2361. 182
  2362. ],
  2363. "uses": [],
  2364. "idx": 238
  2365. },
  2366. {
  2367. "path": "../packages/core/src/data/ModelManager.js",
  2368. "requires": [
  2369. 142
  2370. ],
  2371. "uses": [
  2372. 163
  2373. ],
  2374. "idx": 239
  2375. },
  2376. {
  2377. "path": "../packages/core/src/data/NodeInterface.js",
  2378. "requires": [
  2379. 4,
  2380. 156,
  2381. 158,
  2382. 160,
  2383. 177
  2384. ],
  2385. "uses": [
  2386. 142
  2387. ],
  2388. "idx": 240
  2389. },
  2390. {
  2391. "path": "../packages/core/src/mixin/Queryable.js",
  2392. "requires": [],
  2393. "uses": [
  2394. 24
  2395. ],
  2396. "idx": 241
  2397. },
  2398. {
  2399. "path": "../packages/core/src/data/TreeModel.js",
  2400. "requires": [
  2401. 163,
  2402. 240,
  2403. 241
  2404. ],
  2405. "uses": [],
  2406. "idx": 242
  2407. },
  2408. {
  2409. "path": "../packages/core/src/data/NodeStore.js",
  2410. "requires": [
  2411. 182,
  2412. 240,
  2413. 242
  2414. ],
  2415. "uses": [
  2416. 163
  2417. ],
  2418. "idx": 243
  2419. },
  2420. {
  2421. "path": "../packages/core/src/data/query/Compiler.js",
  2422. "requires": [],
  2423. "uses": [
  2424. 79
  2425. ],
  2426. "idx": 244
  2427. },
  2428. {
  2429. "path": "../packages/core/src/data/query/Converter.js",
  2430. "requires": [],
  2431. "uses": [],
  2432. "idx": 245
  2433. },
  2434. {
  2435. "path": "../packages/core/src/data/query/Stringifier.js",
  2436. "requires": [],
  2437. "uses": [
  2438. 79
  2439. ],
  2440. "idx": 246
  2441. },
  2442. {
  2443. "path": "../packages/core/src/data/query/Parser.js",
  2444. "requires": [
  2445. 220
  2446. ],
  2447. "uses": [],
  2448. "idx": 247
  2449. },
  2450. {
  2451. "path": "../packages/core/src/data/Query.js",
  2452. "requires": [
  2453. 3,
  2454. 12,
  2455. 50,
  2456. 244,
  2457. 245,
  2458. 246,
  2459. 247
  2460. ],
  2461. "uses": [],
  2462. "idx": 248
  2463. },
  2464. {
  2465. "path": "../packages/core/src/data/Request.js",
  2466. "requires": [],
  2467. "uses": [],
  2468. "idx": 249
  2469. },
  2470. {
  2471. "path": "../packages/core/src/data/TreeStore.js",
  2472. "requires": [
  2473. 54,
  2474. 182,
  2475. 240,
  2476. 242
  2477. ],
  2478. "uses": [
  2479. 163
  2480. ],
  2481. "idx": 250
  2482. },
  2483. {
  2484. "path": "../packages/core/src/data/Types.js",
  2485. "requires": [
  2486. 151
  2487. ],
  2488. "uses": [],
  2489. "idx": 251
  2490. },
  2491. {
  2492. "path": "../packages/core/src/data/Validation.js",
  2493. "requires": [
  2494. 163
  2495. ],
  2496. "uses": [],
  2497. "idx": 252
  2498. },
  2499. {
  2500. "path": "../packages/core/src/dom/Helper.js",
  2501. "requires": [],
  2502. "uses": [
  2503. 95
  2504. ],
  2505. "idx": 253
  2506. },
  2507. {
  2508. "path": "../packages/core/src/dom/Query.js",
  2509. "requires": [
  2510. 22,
  2511. 253
  2512. ],
  2513. "uses": [
  2514. 23
  2515. ],
  2516. "idx": 254
  2517. },
  2518. {
  2519. "path": "../packages/core/src/data/reader/Xml.js",
  2520. "requires": [
  2521. 165,
  2522. 254
  2523. ],
  2524. "uses": [],
  2525. "idx": 255
  2526. },
  2527. {
  2528. "path": "../packages/core/src/data/writer/Xml.js",
  2529. "requires": [
  2530. 166
  2531. ],
  2532. "uses": [],
  2533. "idx": 256
  2534. },
  2535. {
  2536. "path": "../packages/core/src/data/XmlStore.js",
  2537. "requires": [
  2538. 175,
  2539. 182,
  2540. 255,
  2541. 256
  2542. ],
  2543. "uses": [],
  2544. "idx": 257
  2545. },
  2546. {
  2547. "path": "../packages/core/src/data/identifier/Negative.js",
  2548. "requires": [
  2549. 162
  2550. ],
  2551. "uses": [],
  2552. "idx": 258
  2553. },
  2554. {
  2555. "path": "../packages/core/src/data/identifier/Uuid.js",
  2556. "requires": [
  2557. 161
  2558. ],
  2559. "uses": [],
  2560. "idx": 259
  2561. },
  2562. {
  2563. "path": "../packages/core/src/data/proxy/WebStorage.js",
  2564. "requires": [
  2565. 162,
  2566. 168
  2567. ],
  2568. "uses": [
  2569. 54,
  2570. 95,
  2571. 164
  2572. ],
  2573. "idx": 260
  2574. },
  2575. {
  2576. "path": "../packages/core/src/data/proxy/LocalStorage.js",
  2577. "requires": [
  2578. 260
  2579. ],
  2580. "uses": [],
  2581. "idx": 261
  2582. },
  2583. {
  2584. "path": "../packages/core/src/data/proxy/Rest.js",
  2585. "requires": [
  2586. 175
  2587. ],
  2588. "uses": [],
  2589. "idx": 262
  2590. },
  2591. {
  2592. "path": "../packages/core/src/data/proxy/SessionStorage.js",
  2593. "requires": [
  2594. 260
  2595. ],
  2596. "uses": [],
  2597. "idx": 263
  2598. },
  2599. {
  2600. "path": "../packages/core/src/data/schema/BelongsTo.js",
  2601. "requires": [],
  2602. "uses": [],
  2603. "idx": 264
  2604. },
  2605. {
  2606. "path": "../packages/core/src/data/schema/HasMany.js",
  2607. "requires": [],
  2608. "uses": [],
  2609. "idx": 265
  2610. },
  2611. {
  2612. "path": "../packages/core/src/data/schema/HasOne.js",
  2613. "requires": [],
  2614. "uses": [],
  2615. "idx": 266
  2616. },
  2617. {
  2618. "path": "../packages/core/src/data/schema/Reference.js",
  2619. "requires": [],
  2620. "uses": [],
  2621. "idx": 267
  2622. },
  2623. {
  2624. "path": "../packages/core/src/data/summary/Sum.js",
  2625. "requires": [
  2626. 153
  2627. ],
  2628. "uses": [],
  2629. "idx": 268
  2630. },
  2631. {
  2632. "path": "../packages/core/src/data/summary/Average.js",
  2633. "requires": [
  2634. 268
  2635. ],
  2636. "uses": [],
  2637. "idx": 269
  2638. },
  2639. {
  2640. "path": "../packages/core/src/data/summary/Count.js",
  2641. "requires": [
  2642. 153
  2643. ],
  2644. "uses": [],
  2645. "idx": 270
  2646. },
  2647. {
  2648. "path": "../packages/core/src/data/summary/Max.js",
  2649. "requires": [
  2650. 153
  2651. ],
  2652. "uses": [],
  2653. "idx": 271
  2654. },
  2655. {
  2656. "path": "../packages/core/src/data/summary/Min.js",
  2657. "requires": [
  2658. 153
  2659. ],
  2660. "uses": [],
  2661. "idx": 272
  2662. },
  2663. {
  2664. "path": "../packages/core/src/data/summary/None.js",
  2665. "requires": [
  2666. 153
  2667. ],
  2668. "uses": [],
  2669. "idx": 273
  2670. },
  2671. {
  2672. "path": "../packages/core/src/data/summary/Variance.js",
  2673. "requires": [
  2674. 153,
  2675. 269
  2676. ],
  2677. "uses": [
  2678. 12
  2679. ],
  2680. "idx": 274
  2681. },
  2682. {
  2683. "path": "../packages/core/src/data/summary/StdDev.js",
  2684. "requires": [
  2685. 274
  2686. ],
  2687. "uses": [],
  2688. "idx": 275
  2689. },
  2690. {
  2691. "path": "../packages/core/src/data/summary/VarianceP.js",
  2692. "requires": [
  2693. 274
  2694. ],
  2695. "uses": [],
  2696. "idx": 276
  2697. },
  2698. {
  2699. "path": "../packages/core/src/data/summary/StdDevP.js",
  2700. "requires": [
  2701. 276
  2702. ],
  2703. "uses": [],
  2704. "idx": 277
  2705. },
  2706. {
  2707. "path": "../packages/core/src/data/validator/AbstractDate.js",
  2708. "requires": [
  2709. 152
  2710. ],
  2711. "uses": [],
  2712. "idx": 278
  2713. },
  2714. {
  2715. "path": "../packages/core/src/data/validator/Bound.js",
  2716. "requires": [
  2717. 152
  2718. ],
  2719. "uses": [
  2720. 95
  2721. ],
  2722. "idx": 279
  2723. },
  2724. {
  2725. "path": "../packages/core/src/data/validator/Format.js",
  2726. "requires": [
  2727. 152
  2728. ],
  2729. "uses": [],
  2730. "idx": 280
  2731. },
  2732. {
  2733. "path": "../packages/core/src/data/validator/CIDRv4.js",
  2734. "requires": [
  2735. 280
  2736. ],
  2737. "uses": [],
  2738. "idx": 281
  2739. },
  2740. {
  2741. "path": "../packages/core/src/data/validator/CIDRv6.js",
  2742. "requires": [
  2743. 280
  2744. ],
  2745. "uses": [],
  2746. "idx": 282
  2747. },
  2748. {
  2749. "path": "../packages/core/src/data/validator/Number.js",
  2750. "requires": [
  2751. 152
  2752. ],
  2753. "uses": [
  2754. 94
  2755. ],
  2756. "idx": 283
  2757. },
  2758. {
  2759. "path": "../packages/core/src/data/validator/Currency.js",
  2760. "requires": [
  2761. 283
  2762. ],
  2763. "uses": [
  2764. 94
  2765. ],
  2766. "idx": 284
  2767. },
  2768. {
  2769. "path": "../packages/core/src/data/validator/CurrencyUS.js",
  2770. "requires": [
  2771. 284
  2772. ],
  2773. "uses": [],
  2774. "idx": 285
  2775. },
  2776. {
  2777. "path": "../packages/core/src/data/validator/Date.js",
  2778. "requires": [
  2779. 278
  2780. ],
  2781. "uses": [],
  2782. "idx": 286
  2783. },
  2784. {
  2785. "path": "../packages/core/src/data/validator/DateTime.js",
  2786. "requires": [
  2787. 278
  2788. ],
  2789. "uses": [],
  2790. "idx": 287
  2791. },
  2792. {
  2793. "path": "../packages/core/src/data/validator/Email.js",
  2794. "requires": [
  2795. 280
  2796. ],
  2797. "uses": [],
  2798. "idx": 288
  2799. },
  2800. {
  2801. "path": "../packages/core/src/data/validator/List.js",
  2802. "requires": [
  2803. 152
  2804. ],
  2805. "uses": [],
  2806. "idx": 289
  2807. },
  2808. {
  2809. "path": "../packages/core/src/data/validator/Exclusion.js",
  2810. "requires": [
  2811. 289
  2812. ],
  2813. "uses": [],
  2814. "idx": 290
  2815. },
  2816. {
  2817. "path": "../packages/core/src/data/validator/IPAddress.js",
  2818. "requires": [
  2819. 280
  2820. ],
  2821. "uses": [],
  2822. "idx": 291
  2823. },
  2824. {
  2825. "path": "../packages/core/src/data/validator/Inclusion.js",
  2826. "requires": [
  2827. 289
  2828. ],
  2829. "uses": [],
  2830. "idx": 292
  2831. },
  2832. {
  2833. "path": "../packages/core/src/data/validator/Length.js",
  2834. "requires": [
  2835. 279
  2836. ],
  2837. "uses": [],
  2838. "idx": 293
  2839. },
  2840. {
  2841. "path": "../packages/core/src/data/validator/Presence.js",
  2842. "requires": [
  2843. 152
  2844. ],
  2845. "uses": [],
  2846. "idx": 294
  2847. },
  2848. {
  2849. "path": "../packages/core/src/data/validator/NotNull.js",
  2850. "requires": [
  2851. 294
  2852. ],
  2853. "uses": [],
  2854. "idx": 295
  2855. },
  2856. {
  2857. "path": "../packages/core/src/data/validator/Phone.js",
  2858. "requires": [
  2859. 280
  2860. ],
  2861. "uses": [],
  2862. "idx": 296
  2863. },
  2864. {
  2865. "path": "../packages/core/src/data/validator/Range.js",
  2866. "requires": [
  2867. 279
  2868. ],
  2869. "uses": [],
  2870. "idx": 297
  2871. },
  2872. {
  2873. "path": "../packages/core/src/data/validator/Time.js",
  2874. "requires": [
  2875. 278
  2876. ],
  2877. "uses": [],
  2878. "idx": 298
  2879. },
  2880. {
  2881. "path": "../packages/core/src/data/validator/Url.js",
  2882. "requires": [
  2883. 280
  2884. ],
  2885. "uses": [],
  2886. "idx": 299
  2887. },
  2888. {
  2889. "path": "../packages/core/src/data/virtual/Group.js",
  2890. "requires": [],
  2891. "uses": [],
  2892. "idx": 300
  2893. },
  2894. {
  2895. "path": "../packages/core/src/data/virtual/Page.js",
  2896. "requires": [],
  2897. "uses": [],
  2898. "idx": 301
  2899. },
  2900. {
  2901. "path": "../packages/core/src/data/virtual/PageMap.js",
  2902. "requires": [
  2903. 301
  2904. ],
  2905. "uses": [],
  2906. "idx": 302
  2907. },
  2908. {
  2909. "path": "../packages/core/src/data/virtual/Range.js",
  2910. "requires": [
  2911. 133
  2912. ],
  2913. "uses": [],
  2914. "idx": 303
  2915. },
  2916. {
  2917. "path": "../packages/core/src/data/virtual/Store.js",
  2918. "requires": [
  2919. 170,
  2920. 178,
  2921. 179,
  2922. 302,
  2923. 303
  2924. ],
  2925. "uses": [
  2926. 131,
  2927. 132,
  2928. 163,
  2929. 300
  2930. ],
  2931. "idx": 304
  2932. },
  2933. {
  2934. "path": "../packages/core/src/direct/Event.js",
  2935. "requires": [],
  2936. "uses": [],
  2937. "idx": 305
  2938. },
  2939. {
  2940. "path": "../packages/core/src/direct/RemotingEvent.js",
  2941. "requires": [
  2942. 305
  2943. ],
  2944. "uses": [
  2945. 227
  2946. ],
  2947. "idx": 306
  2948. },
  2949. {
  2950. "path": "../packages/core/src/direct/ExceptionEvent.js",
  2951. "requires": [
  2952. 306
  2953. ],
  2954. "uses": [],
  2955. "idx": 307
  2956. },
  2957. {
  2958. "path": "../packages/core/src/direct/JsonProvider.js",
  2959. "requires": [
  2960. 228
  2961. ],
  2962. "uses": [
  2963. 227,
  2964. 307
  2965. ],
  2966. "idx": 308
  2967. },
  2968. {
  2969. "path": "../packages/core/src/direct/PollingProvider.js",
  2970. "requires": [
  2971. 18,
  2972. 57,
  2973. 307,
  2974. 308
  2975. ],
  2976. "uses": [
  2977. 227,
  2978. 409
  2979. ],
  2980. "idx": 309
  2981. },
  2982. {
  2983. "path": "../packages/core/src/direct/RemotingMethod.js",
  2984. "requires": [],
  2985. "uses": [],
  2986. "idx": 310
  2987. },
  2988. {
  2989. "path": "../packages/core/src/direct/Transaction.js",
  2990. "requires": [],
  2991. "uses": [],
  2992. "idx": 311
  2993. },
  2994. {
  2995. "path": "../packages/core/src/direct/RemotingProvider.js",
  2996. "requires": [
  2997. 1,
  2998. 56,
  2999. 227,
  3000. 308,
  3001. 310,
  3002. 311
  3003. ],
  3004. "uses": [
  3005. 79,
  3006. 307
  3007. ],
  3008. "idx": 312
  3009. },
  3010. {
  3011. "path": "../packages/core/src/dom/GarbageCollector.js",
  3012. "requires": [],
  3013. "uses": [
  3014. 49
  3015. ],
  3016. "idx": 313
  3017. },
  3018. {
  3019. "path": "../packages/core/src/dom/TouchAction.js",
  3020. "requires": [
  3021. 35,
  3022. 49
  3023. ],
  3024. "uses": [],
  3025. "idx": 314
  3026. },
  3027. {
  3028. "path": "../packages/core/src/drag/Constraint.js",
  3029. "requires": [
  3030. 12
  3031. ],
  3032. "uses": [
  3033. 34
  3034. ],
  3035. "idx": 315
  3036. },
  3037. {
  3038. "path": "../packages/core/src/drag/Info.js",
  3039. "requires": [
  3040. 10
  3041. ],
  3042. "uses": [],
  3043. "idx": 316
  3044. },
  3045. {
  3046. "path": "../packages/core/src/drag/Item.js",
  3047. "requires": [
  3048. 3,
  3049. 4
  3050. ],
  3051. "uses": [],
  3052. "idx": 317
  3053. },
  3054. {
  3055. "path": "../packages/core/src/drag/Manager.js",
  3056. "requires": [],
  3057. "uses": [
  3058. 49,
  3059. 81,
  3060. 316
  3061. ],
  3062. "idx": 318
  3063. },
  3064. {
  3065. "path": "../packages/core/src/drag/Source.js",
  3066. "requires": [
  3067. 77,
  3068. 315,
  3069. 317
  3070. ],
  3071. "uses": [
  3072. 12,
  3073. 316
  3074. ],
  3075. "idx": 319
  3076. },
  3077. {
  3078. "path": "../packages/core/src/drag/Target.js",
  3079. "requires": [
  3080. 317,
  3081. 318
  3082. ],
  3083. "uses": [],
  3084. "idx": 320
  3085. },
  3086. {
  3087. "path": "../packages/core/src/drag/proxy/None.js",
  3088. "requires": [
  3089. 12
  3090. ],
  3091. "uses": [],
  3092. "idx": 321
  3093. },
  3094. {
  3095. "path": "../packages/core/src/drag/proxy/Original.js",
  3096. "requires": [
  3097. 321
  3098. ],
  3099. "uses": [],
  3100. "idx": 322
  3101. },
  3102. {
  3103. "path": "../packages/core/src/drag/proxy/Placeholder.js",
  3104. "requires": [
  3105. 321
  3106. ],
  3107. "uses": [],
  3108. "idx": 323
  3109. },
  3110. {
  3111. "path": "../packages/core/src/event/gesture/Recognizer.js",
  3112. "requires": [
  3113. 3,
  3114. 38
  3115. ],
  3116. "uses": [],
  3117. "idx": 324
  3118. },
  3119. {
  3120. "path": "../packages/core/src/event/gesture/SingleTouch.js",
  3121. "requires": [
  3122. 324
  3123. ],
  3124. "uses": [],
  3125. "idx": 325
  3126. },
  3127. {
  3128. "path": "../packages/core/src/event/gesture/DoubleTap.js",
  3129. "requires": [
  3130. 325
  3131. ],
  3132. "uses": [
  3133. 49
  3134. ],
  3135. "idx": 326
  3136. },
  3137. {
  3138. "path": "../packages/core/src/event/gesture/Drag.js",
  3139. "requires": [
  3140. 325
  3141. ],
  3142. "uses": [
  3143. 49
  3144. ],
  3145. "idx": 327
  3146. },
  3147. {
  3148. "path": "../packages/core/src/event/gesture/Swipe.js",
  3149. "requires": [
  3150. 325
  3151. ],
  3152. "uses": [],
  3153. "idx": 328
  3154. },
  3155. {
  3156. "path": "../packages/core/src/event/gesture/EdgeSwipe.js",
  3157. "requires": [
  3158. 328
  3159. ],
  3160. "uses": [
  3161. 49
  3162. ],
  3163. "idx": 329
  3164. },
  3165. {
  3166. "path": "../packages/core/src/event/gesture/LongPress.js",
  3167. "requires": [
  3168. 325
  3169. ],
  3170. "uses": [
  3171. 38,
  3172. 49,
  3173. 327
  3174. ],
  3175. "idx": 330
  3176. },
  3177. {
  3178. "path": "../packages/core/src/event/gesture/MultiTouch.js",
  3179. "requires": [
  3180. 324
  3181. ],
  3182. "uses": [],
  3183. "idx": 331
  3184. },
  3185. {
  3186. "path": "../packages/core/src/event/gesture/Pinch.js",
  3187. "requires": [
  3188. 331
  3189. ],
  3190. "uses": [],
  3191. "idx": 332
  3192. },
  3193. {
  3194. "path": "../packages/core/src/event/gesture/Rotate.js",
  3195. "requires": [
  3196. 331
  3197. ],
  3198. "uses": [],
  3199. "idx": 333
  3200. },
  3201. {
  3202. "path": "../packages/core/src/event/gesture/Tap.js",
  3203. "requires": [
  3204. 325
  3205. ],
  3206. "uses": [
  3207. 49
  3208. ],
  3209. "idx": 334
  3210. },
  3211. {
  3212. "path": "../packages/core/src/event/publisher/Focus.js",
  3213. "requires": [
  3214. 37,
  3215. 49,
  3216. 75,
  3217. 77
  3218. ],
  3219. "uses": [
  3220. 36
  3221. ],
  3222. "idx": 335
  3223. },
  3224. {
  3225. "path": "../packages/core/src/field/InputMask.js",
  3226. "requires": [],
  3227. "uses": [],
  3228. "idx": 336
  3229. },
  3230. {
  3231. "path": "../packages/core/src/fx/State.js",
  3232. "requires": [],
  3233. "uses": [],
  3234. "idx": 337
  3235. },
  3236. {
  3237. "path": "../packages/core/src/fx/animation/Abstract.js",
  3238. "requires": [
  3239. 12,
  3240. 25,
  3241. 337
  3242. ],
  3243. "uses": [],
  3244. "idx": 338
  3245. },
  3246. {
  3247. "path": "../packages/core/src/fx/animation/Slide.js",
  3248. "requires": [
  3249. 338
  3250. ],
  3251. "uses": [],
  3252. "idx": 339
  3253. },
  3254. {
  3255. "path": "../packages/core/src/fx/animation/SlideOut.js",
  3256. "requires": [
  3257. 339
  3258. ],
  3259. "uses": [],
  3260. "idx": 340
  3261. },
  3262. {
  3263. "path": "../packages/core/src/fx/animation/Fade.js",
  3264. "requires": [
  3265. 338
  3266. ],
  3267. "uses": [],
  3268. "idx": 341
  3269. },
  3270. {
  3271. "path": "../packages/core/src/fx/animation/FadeOut.js",
  3272. "requires": [
  3273. 341
  3274. ],
  3275. "uses": [],
  3276. "idx": 342
  3277. },
  3278. {
  3279. "path": "../packages/core/src/fx/animation/Flip.js",
  3280. "requires": [
  3281. 338
  3282. ],
  3283. "uses": [],
  3284. "idx": 343
  3285. },
  3286. {
  3287. "path": "../packages/core/src/fx/animation/Pop.js",
  3288. "requires": [
  3289. 338
  3290. ],
  3291. "uses": [],
  3292. "idx": 344
  3293. },
  3294. {
  3295. "path": "../packages/core/src/fx/animation/PopOut.js",
  3296. "requires": [
  3297. 344
  3298. ],
  3299. "uses": [],
  3300. "idx": 345
  3301. },
  3302. {
  3303. "path": "../packages/core/src/fx/Animation.js",
  3304. "requires": [
  3305. 339,
  3306. 340,
  3307. 341,
  3308. 342,
  3309. 343,
  3310. 344,
  3311. 345
  3312. ],
  3313. "uses": [
  3314. 338
  3315. ],
  3316. "idx": 346
  3317. },
  3318. {
  3319. "path": "../packages/core/src/fx/runner/Css.js",
  3320. "requires": [
  3321. 25,
  3322. 346
  3323. ],
  3324. "uses": [
  3325. 49
  3326. ],
  3327. "idx": 347
  3328. },
  3329. {
  3330. "path": "../packages/core/src/fx/runner/CssTransition.js",
  3331. "requires": [
  3332. 19,
  3333. 347
  3334. ],
  3335. "uses": [
  3336. 346
  3337. ],
  3338. "idx": 348
  3339. },
  3340. {
  3341. "path": "../packages/core/src/fx/Runner.js",
  3342. "requires": [
  3343. 348
  3344. ],
  3345. "uses": [],
  3346. "idx": 349
  3347. },
  3348. {
  3349. "path": "../packages/core/src/fx/animation/Cube.js",
  3350. "requires": [
  3351. 338
  3352. ],
  3353. "uses": [],
  3354. "idx": 350
  3355. },
  3356. {
  3357. "path": "../packages/core/src/fx/animation/Wipe.js",
  3358. "requires": [
  3359. 346
  3360. ],
  3361. "uses": [],
  3362. "idx": 351
  3363. },
  3364. {
  3365. "path": "../packages/core/src/fx/animation/WipeOut.js",
  3366. "requires": [
  3367. 351
  3368. ],
  3369. "uses": [],
  3370. "idx": 352
  3371. },
  3372. {
  3373. "path": "../packages/core/src/fx/easing/Bounce.js",
  3374. "requires": [
  3375. 105
  3376. ],
  3377. "uses": [],
  3378. "idx": 353
  3379. },
  3380. {
  3381. "path": "../packages/core/src/fx/easing/Momentum.js",
  3382. "requires": [
  3383. 105
  3384. ],
  3385. "uses": [],
  3386. "idx": 354
  3387. },
  3388. {
  3389. "path": "../packages/core/src/fx/easing/BoundMomentum.js",
  3390. "requires": [
  3391. 105,
  3392. 353,
  3393. 354
  3394. ],
  3395. "uses": [],
  3396. "idx": 355
  3397. },
  3398. {
  3399. "path": "../packages/core/src/fx/easing/EaseIn.js",
  3400. "requires": [
  3401. 106
  3402. ],
  3403. "uses": [],
  3404. "idx": 356
  3405. },
  3406. {
  3407. "path": "../packages/core/src/fx/easing/EaseOut.js",
  3408. "requires": [
  3409. 106
  3410. ],
  3411. "uses": [],
  3412. "idx": 357
  3413. },
  3414. {
  3415. "path": "../packages/core/src/fx/easing/Easing.js",
  3416. "requires": [
  3417. 106
  3418. ],
  3419. "uses": [],
  3420. "idx": 358
  3421. },
  3422. {
  3423. "path": "../packages/core/src/fx/runner/CssAnimation.js",
  3424. "requires": [
  3425. 347
  3426. ],
  3427. "uses": [
  3428. 346
  3429. ],
  3430. "idx": 359
  3431. },
  3432. {
  3433. "path": "../packages/core/src/grid/AdvancedGroupStore.js",
  3434. "requires": [
  3435. 20,
  3436. 52
  3437. ],
  3438. "uses": [
  3439. 132
  3440. ],
  3441. "idx": 360
  3442. },
  3443. {
  3444. "path": "../packages/core/src/grid/plugin/BaseFilterBar.js",
  3445. "requires": [
  3446. 84
  3447. ],
  3448. "uses": [
  3449. 12
  3450. ],
  3451. "idx": 361
  3452. },
  3453. {
  3454. "path": "../packages/core/src/grid/plugin/BaseGroupingPanel.js",
  3455. "requires": [
  3456. 84
  3457. ],
  3458. "uses": [],
  3459. "idx": 362
  3460. },
  3461. {
  3462. "path": "../packages/core/src/grid/plugin/BaseSummaries.js",
  3463. "requires": [
  3464. 84,
  3465. 153,
  3466. 268,
  3467. 269,
  3468. 270,
  3469. 271,
  3470. 272,
  3471. 273,
  3472. 274,
  3473. 275,
  3474. 276,
  3475. 277
  3476. ],
  3477. "uses": [
  3478. 12
  3479. ],
  3480. "idx": 363
  3481. },
  3482. {
  3483. "path": "../packages/core/src/list/AbstractTreeItem.js",
  3484. "requires": [
  3485. 89
  3486. ],
  3487. "uses": [],
  3488. "idx": 364
  3489. },
  3490. {
  3491. "path": "../packages/core/src/list/RootTreeItem.js",
  3492. "requires": [
  3493. 364
  3494. ],
  3495. "uses": [],
  3496. "idx": 365
  3497. },
  3498. {
  3499. "path": "../packages/core/src/mixin/ItemRippler.js",
  3500. "requires": [],
  3501. "uses": [],
  3502. "idx": 366
  3503. },
  3504. {
  3505. "path": "../packages/core/src/list/TreeItem.js",
  3506. "requires": [
  3507. 89,
  3508. 364
  3509. ],
  3510. "uses": [],
  3511. "idx": 367
  3512. },
  3513. {
  3514. "path": "../packages/core/src/list/Tree.js",
  3515. "requires": [
  3516. 89,
  3517. 365,
  3518. 366,
  3519. 367
  3520. ],
  3521. "uses": [
  3522. 163,
  3523. 185
  3524. ],
  3525. "idx": 368
  3526. },
  3527. {
  3528. "path": "../packages/core/src/mixin/ConfigProxy.js",
  3529. "requires": [
  3530. 0
  3531. ],
  3532. "uses": [],
  3533. "idx": 369
  3534. },
  3535. {
  3536. "path": "../packages/core/src/mixin/ConfigState.js",
  3537. "requires": [
  3538. 0
  3539. ],
  3540. "uses": [],
  3541. "idx": 370
  3542. },
  3543. {
  3544. "path": "../packages/core/src/mixin/Container.js",
  3545. "requires": [
  3546. 0
  3547. ],
  3548. "uses": [
  3549. 21
  3550. ],
  3551. "idx": 371
  3552. },
  3553. {
  3554. "path": "../packages/core/src/util/KeyMap.js",
  3555. "requires": [],
  3556. "uses": [],
  3557. "idx": 372
  3558. },
  3559. {
  3560. "path": "../packages/core/src/util/KeyNav.js",
  3561. "requires": [
  3562. 372
  3563. ],
  3564. "uses": [
  3565. 36
  3566. ],
  3567. "idx": 373
  3568. },
  3569. {
  3570. "path": "../packages/core/src/mixin/FocusableContainer.js",
  3571. "requires": [
  3572. 0,
  3573. 373
  3574. ],
  3575. "uses": [
  3576. 21
  3577. ],
  3578. "idx": 374
  3579. },
  3580. {
  3581. "path": "../packages/core/src/mixin/Hookable.js",
  3582. "requires": [
  3583. 0
  3584. ],
  3585. "uses": [],
  3586. "idx": 375
  3587. },
  3588. {
  3589. "path": "../packages/core/src/mixin/Mashup.js",
  3590. "requires": [
  3591. 0
  3592. ],
  3593. "uses": [
  3594. 95
  3595. ],
  3596. "idx": 376
  3597. },
  3598. {
  3599. "path": "../packages/core/src/mixin/Selectable.js",
  3600. "requires": [
  3601. 0
  3602. ],
  3603. "uses": [
  3604. 132
  3605. ],
  3606. "idx": 377
  3607. },
  3608. {
  3609. "path": "../packages/core/src/mixin/StoreWatcher.js",
  3610. "requires": [],
  3611. "uses": [],
  3612. "idx": 378
  3613. },
  3614. {
  3615. "path": "../packages/core/src/mixin/StyleCacher.js",
  3616. "requires": [
  3617. 0
  3618. ],
  3619. "uses": [],
  3620. "idx": 379
  3621. },
  3622. {
  3623. "path": "../packages/core/src/mixin/Traversable.js",
  3624. "requires": [
  3625. 0
  3626. ],
  3627. "uses": [],
  3628. "idx": 380
  3629. },
  3630. {
  3631. "path": "../packages/core/src/perf/Accumulator.js",
  3632. "requires": [
  3633. 98
  3634. ],
  3635. "uses": [],
  3636. "idx": 381
  3637. },
  3638. {
  3639. "path": "../packages/core/src/perf/Monitor.js",
  3640. "requires": [
  3641. 381
  3642. ],
  3643. "uses": [],
  3644. "idx": 382
  3645. },
  3646. {
  3647. "path": "../packages/core/src/plugin/AbstractClipboard.js",
  3648. "requires": [
  3649. 84,
  3650. 372
  3651. ],
  3652. "uses": [
  3653. 49
  3654. ],
  3655. "idx": 383
  3656. },
  3657. {
  3658. "path": "../packages/core/src/plugin/MouseEnter.js",
  3659. "requires": [
  3660. 84
  3661. ],
  3662. "uses": [],
  3663. "idx": 384
  3664. },
  3665. {
  3666. "path": "../packages/core/src/sparkline/Shape.js",
  3667. "requires": [],
  3668. "uses": [],
  3669. "idx": 385
  3670. },
  3671. {
  3672. "path": "../packages/core/src/sparkline/CanvasBase.js",
  3673. "requires": [
  3674. 385
  3675. ],
  3676. "uses": [],
  3677. "idx": 386
  3678. },
  3679. {
  3680. "path": "../packages/core/src/sparkline/CanvasCanvas.js",
  3681. "requires": [
  3682. 386
  3683. ],
  3684. "uses": [],
  3685. "idx": 387
  3686. },
  3687. {
  3688. "path": "../packages/core/src/sparkline/VmlCanvas.js",
  3689. "requires": [
  3690. 386
  3691. ],
  3692. "uses": [],
  3693. "idx": 388
  3694. },
  3695. {
  3696. "path": "../packages/core/src/util/Color.js",
  3697. "requires": [],
  3698. "uses": [],
  3699. "idx": 389
  3700. },
  3701. {
  3702. "path": "../packages/core/src/sparkline/Base.js",
  3703. "requires": [
  3704. 89,
  3705. 98,
  3706. 387,
  3707. 388,
  3708. 389
  3709. ],
  3710. "uses": [],
  3711. "idx": 390
  3712. },
  3713. {
  3714. "path": "../packages/core/src/sparkline/BarBase.js",
  3715. "requires": [
  3716. 390
  3717. ],
  3718. "uses": [],
  3719. "idx": 391
  3720. },
  3721. {
  3722. "path": "../packages/core/src/sparkline/RangeMap.js",
  3723. "requires": [],
  3724. "uses": [],
  3725. "idx": 392
  3726. },
  3727. {
  3728. "path": "../packages/core/src/sparkline/Bar.js",
  3729. "requires": [
  3730. 391,
  3731. 392
  3732. ],
  3733. "uses": [],
  3734. "idx": 393
  3735. },
  3736. {
  3737. "path": "../packages/core/src/sparkline/Box.js",
  3738. "requires": [
  3739. 390
  3740. ],
  3741. "uses": [],
  3742. "idx": 394
  3743. },
  3744. {
  3745. "path": "../packages/core/src/sparkline/Bullet.js",
  3746. "requires": [
  3747. 390
  3748. ],
  3749. "uses": [],
  3750. "idx": 395
  3751. },
  3752. {
  3753. "path": "../packages/core/src/sparkline/Discrete.js",
  3754. "requires": [
  3755. 391
  3756. ],
  3757. "uses": [],
  3758. "idx": 396
  3759. },
  3760. {
  3761. "path": "../packages/core/src/sparkline/Line.js",
  3762. "requires": [
  3763. 390,
  3764. 392
  3765. ],
  3766. "uses": [],
  3767. "idx": 397
  3768. },
  3769. {
  3770. "path": "../packages/core/src/sparkline/Pie.js",
  3771. "requires": [
  3772. 390
  3773. ],
  3774. "uses": [],
  3775. "idx": 398
  3776. },
  3777. {
  3778. "path": "../packages/core/src/sparkline/TriState.js",
  3779. "requires": [
  3780. 391,
  3781. 392
  3782. ],
  3783. "uses": [],
  3784. "idx": 399
  3785. },
  3786. {
  3787. "path": "../packages/core/src/util/Base64.js",
  3788. "requires": [],
  3789. "uses": [],
  3790. "idx": 400
  3791. },
  3792. {
  3793. "path": "../packages/core/src/util/DelimitedValue.js",
  3794. "requires": [],
  3795. "uses": [],
  3796. "idx": 401
  3797. },
  3798. {
  3799. "path": "../packages/core/src/util/CSV.js",
  3800. "requires": [
  3801. 401
  3802. ],
  3803. "uses": [],
  3804. "idx": 402
  3805. },
  3806. {
  3807. "path": "../packages/core/src/util/ClickRepeater.js",
  3808. "requires": [
  3809. 4
  3810. ],
  3811. "uses": [],
  3812. "idx": 403
  3813. },
  3814. {
  3815. "path": "../packages/core/src/util/Cookies.js",
  3816. "requires": [],
  3817. "uses": [],
  3818. "idx": 404
  3819. },
  3820. {
  3821. "path": "../packages/core/src/util/ItemCollection.js",
  3822. "requires": [
  3823. 56
  3824. ],
  3825. "uses": [],
  3826. "idx": 405
  3827. },
  3828. {
  3829. "path": "../packages/core/src/util/LocalStorage.js",
  3830. "requires": [],
  3831. "uses": [],
  3832. "idx": 406
  3833. },
  3834. {
  3835. "path": "../packages/core/src/util/Spans.js",
  3836. "requires": [],
  3837. "uses": [],
  3838. "idx": 407
  3839. },
  3840. {
  3841. "path": "../packages/core/src/util/TSV.js",
  3842. "requires": [
  3843. 401
  3844. ],
  3845. "uses": [],
  3846. "idx": 408
  3847. },
  3848. {
  3849. "path": "../packages/core/src/util/TaskManager.js",
  3850. "requires": [
  3851. 57
  3852. ],
  3853. "uses": [],
  3854. "idx": 409
  3855. },
  3856. {
  3857. "path": "../packages/core/src/util/TextMetrics.js",
  3858. "requires": [
  3859. 49
  3860. ],
  3861. "uses": [
  3862. 75
  3863. ],
  3864. "idx": 410
  3865. },
  3866. {
  3867. "path": "../packages/core/src/util/paintmonitor/OverflowChange.js",
  3868. "requires": [
  3869. 45
  3870. ],
  3871. "uses": [],
  3872. "idx": 411
  3873. },
  3874. {
  3875. "path": "../packages/core/src/util/sizemonitor/OverflowChange.js",
  3876. "requires": [
  3877. 41
  3878. ],
  3879. "uses": [
  3880. 40
  3881. ],
  3882. "idx": 412
  3883. },
  3884. {
  3885. "path": "../packages/core/src/util/translatable/CssPosition.js",
  3886. "requires": [
  3887. 108
  3888. ],
  3889. "uses": [],
  3890. "idx": 413
  3891. },
  3892. {
  3893. "path": "../packages/core/src/util/translatable/CssTransform.js",
  3894. "requires": [
  3895. 108
  3896. ],
  3897. "uses": [],
  3898. "idx": 414
  3899. },
  3900. {
  3901. "path": "../packages/core/src/util/translatable/ScrollParent.js",
  3902. "requires": [
  3903. 108
  3904. ],
  3905. "uses": [],
  3906. "idx": 415
  3907. },
  3908. {
  3909. "path": "../classic/classic/src/Action.js",
  3910. "requires": [],
  3911. "uses": [],
  3912. "idx": 416
  3913. },
  3914. {
  3915. "path": "../classic/classic/src/ElementLoader.js",
  3916. "requires": [
  3917. 52
  3918. ],
  3919. "uses": [
  3920. 17,
  3921. 18
  3922. ],
  3923. "idx": 417
  3924. },
  3925. {
  3926. "path": "../classic/classic/src/ComponentLoader.js",
  3927. "requires": [
  3928. 417
  3929. ],
  3930. "uses": [],
  3931. "idx": 418
  3932. },
  3933. {
  3934. "path": "../classic/classic/src/layout/SizeModel.js",
  3935. "requires": [],
  3936. "uses": [],
  3937. "idx": 419
  3938. },
  3939. {
  3940. "path": "../classic/classic/src/layout/Layout.js",
  3941. "requires": [
  3942. 12,
  3943. 98,
  3944. 419
  3945. ],
  3946. "uses": [
  3947. 666
  3948. ],
  3949. "idx": 420
  3950. },
  3951. {
  3952. "path": "../classic/classic/src/layout/container/Container.js",
  3953. "requires": [
  3954. 98,
  3955. 112,
  3956. 420
  3957. ],
  3958. "uses": [
  3959. 253
  3960. ],
  3961. "idx": 421
  3962. },
  3963. {
  3964. "path": "../classic/classic/src/layout/container/Auto.js",
  3965. "requires": [
  3966. 421
  3967. ],
  3968. "uses": [
  3969. 98
  3970. ],
  3971. "idx": 422
  3972. },
  3973. {
  3974. "path": "../classic/classic/src/ZIndexManager.js",
  3975. "requires": [
  3976. 77,
  3977. 178,
  3978. 179
  3979. ],
  3980. "uses": [
  3981. 49,
  3982. 132
  3983. ],
  3984. "idx": 423
  3985. },
  3986. {
  3987. "path": "../classic/classic/src/container/Container.js",
  3988. "requires": [
  3989. 56,
  3990. 117,
  3991. 241,
  3992. 371,
  3993. 374,
  3994. 405,
  3995. 416,
  3996. 422,
  3997. 423
  3998. ],
  3999. "uses": [
  4000. 12,
  4001. 21,
  4002. 24,
  4003. 49
  4004. ],
  4005. "idx": 424
  4006. },
  4007. {
  4008. "path": "../classic/classic/src/layout/container/Editor.js",
  4009. "requires": [
  4010. 421
  4011. ],
  4012. "uses": [],
  4013. "idx": 425
  4014. },
  4015. {
  4016. "path": "../classic/classic/src/Editor.js",
  4017. "requires": [
  4018. 424,
  4019. 425
  4020. ],
  4021. "uses": [
  4022. 1,
  4023. 21
  4024. ],
  4025. "idx": 426
  4026. },
  4027. {
  4028. "path": "../classic/classic/src/EventManager.js",
  4029. "requires": [],
  4030. "uses": [
  4031. 77
  4032. ],
  4033. "idx": 427
  4034. },
  4035. {
  4036. "path": "../classic/classic/src/Gadget.js",
  4037. "requires": [],
  4038. "uses": [],
  4039. "idx": 428
  4040. },
  4041. {
  4042. "path": "../classic/classic/src/Img.js",
  4043. "requires": [
  4044. 78,
  4045. 117
  4046. ],
  4047. "uses": [],
  4048. "idx": 429
  4049. },
  4050. {
  4051. "path": "../classic/classic/src/util/StoreHolder.js",
  4052. "requires": [
  4053. 185
  4054. ],
  4055. "uses": [],
  4056. "idx": 430
  4057. },
  4058. {
  4059. "path": "../classic/classic/src/LoadMask.js",
  4060. "requires": [
  4061. 117,
  4062. 430
  4063. ],
  4064. "uses": [
  4065. 49,
  4066. 77,
  4067. 185
  4068. ],
  4069. "idx": 431
  4070. },
  4071. {
  4072. "path": "../classic/classic/src/layout/component/Component.js",
  4073. "requires": [
  4074. 420
  4075. ],
  4076. "uses": [],
  4077. "idx": 432
  4078. },
  4079. {
  4080. "path": "../classic/classic/src/layout/component/Auto.js",
  4081. "requires": [
  4082. 432
  4083. ],
  4084. "uses": [],
  4085. "idx": 433
  4086. },
  4087. {
  4088. "path": "../classic/classic/src/layout/component/ProgressBar.js",
  4089. "requires": [
  4090. 433
  4091. ],
  4092. "uses": [],
  4093. "idx": 434
  4094. },
  4095. {
  4096. "path": "../classic/classic/src/ProgressBar.js",
  4097. "requires": [
  4098. 92,
  4099. 95,
  4100. 102,
  4101. 117,
  4102. 409,
  4103. 434
  4104. ],
  4105. "uses": [
  4106. 73
  4107. ],
  4108. "idx": 435
  4109. },
  4110. {
  4111. "path": "../classic/classic/src/dom/ButtonElement.js",
  4112. "requires": [
  4113. 49
  4114. ],
  4115. "uses": [],
  4116. "idx": 436
  4117. },
  4118. {
  4119. "path": "../classic/classic/src/button/Manager.js",
  4120. "requires": [],
  4121. "uses": [],
  4122. "idx": 437
  4123. },
  4124. {
  4125. "path": "../classic/classic/src/menu/Manager.js",
  4126. "requires": [],
  4127. "uses": [
  4128. 21,
  4129. 110,
  4130. 117,
  4131. 613
  4132. ],
  4133. "idx": 438
  4134. },
  4135. {
  4136. "path": "../classic/classic/src/button/Button.js",
  4137. "requires": [
  4138. 78,
  4139. 117,
  4140. 241,
  4141. 403,
  4142. 410,
  4143. 436,
  4144. 437,
  4145. 438
  4146. ],
  4147. "uses": [
  4148. 49,
  4149. 553
  4150. ],
  4151. "idx": 439
  4152. },
  4153. {
  4154. "path": "../classic/classic/src/button/Split.js",
  4155. "requires": [
  4156. 439
  4157. ],
  4158. "uses": [
  4159. 49,
  4160. 437
  4161. ],
  4162. "idx": 440
  4163. },
  4164. {
  4165. "path": "../classic/classic/src/button/Cycle.js",
  4166. "requires": [
  4167. 440
  4168. ],
  4169. "uses": [],
  4170. "idx": 441
  4171. },
  4172. {
  4173. "path": "../classic/classic/src/layout/container/SegmentedButton.js",
  4174. "requires": [
  4175. 421
  4176. ],
  4177. "uses": [],
  4178. "idx": 442
  4179. },
  4180. {
  4181. "path": "../classic/classic/src/button/Segmented.js",
  4182. "requires": [
  4183. 424,
  4184. 439,
  4185. 442
  4186. ],
  4187. "uses": [],
  4188. "idx": 443
  4189. },
  4190. {
  4191. "path": "../classic/classic/src/panel/Bar.js",
  4192. "requires": [
  4193. 424
  4194. ],
  4195. "uses": [],
  4196. "idx": 444
  4197. },
  4198. {
  4199. "path": "../classic/classic/src/panel/Title.js",
  4200. "requires": [
  4201. 78,
  4202. 117
  4203. ],
  4204. "uses": [],
  4205. "idx": 445
  4206. },
  4207. {
  4208. "path": "../classic/classic/src/panel/Tool.js",
  4209. "requires": [
  4210. 78,
  4211. 117
  4212. ],
  4213. "uses": [
  4214. 553
  4215. ],
  4216. "idx": 446
  4217. },
  4218. {
  4219. "path": "../classic/classic/src/panel/Header.js",
  4220. "requires": [
  4221. 433,
  4222. 444,
  4223. 445,
  4224. 446
  4225. ],
  4226. "uses": [
  4227. 21
  4228. ],
  4229. "idx": 447
  4230. },
  4231. {
  4232. "path": "../classic/classic/src/layout/container/boxOverflow/None.js",
  4233. "requires": [
  4234. 12
  4235. ],
  4236. "uses": [],
  4237. "idx": 448
  4238. },
  4239. {
  4240. "path": "../classic/classic/src/layout/container/boxOverflow/Scroller.js",
  4241. "requires": [
  4242. 4,
  4243. 49,
  4244. 403,
  4245. 448
  4246. ],
  4247. "uses": [
  4248. 117
  4249. ],
  4250. "idx": 449
  4251. },
  4252. {
  4253. "path": "../classic/classic/src/dd/DragDropManager.js",
  4254. "requires": [
  4255. 34,
  4256. 35
  4257. ],
  4258. "uses": [
  4259. 49,
  4260. 481,
  4261. 553
  4262. ],
  4263. "idx": 450
  4264. },
  4265. {
  4266. "path": "../classic/classic/src/resizer/Splitter.js",
  4267. "requires": [
  4268. 98,
  4269. 117
  4270. ],
  4271. "uses": [
  4272. 477
  4273. ],
  4274. "idx": 451
  4275. },
  4276. {
  4277. "path": "../classic/classic/src/layout/container/Box.js",
  4278. "requires": [
  4279. 94,
  4280. 421,
  4281. 448,
  4282. 449,
  4283. 450,
  4284. 451
  4285. ],
  4286. "uses": [
  4287. 12,
  4288. 419,
  4289. 433
  4290. ],
  4291. "idx": 452
  4292. },
  4293. {
  4294. "path": "../classic/classic/src/layout/container/HBox.js",
  4295. "requires": [
  4296. 452
  4297. ],
  4298. "uses": [],
  4299. "idx": 453
  4300. },
  4301. {
  4302. "path": "../classic/classic/src/layout/container/VBox.js",
  4303. "requires": [
  4304. 452
  4305. ],
  4306. "uses": [],
  4307. "idx": 454
  4308. },
  4309. {
  4310. "path": "../classic/classic/src/toolbar/Toolbar.js",
  4311. "requires": [
  4312. 424,
  4313. 433,
  4314. 453,
  4315. 454
  4316. ],
  4317. "uses": [
  4318. 117,
  4319. 384,
  4320. 535,
  4321. 556,
  4322. 702,
  4323. 703
  4324. ],
  4325. "idx": 455
  4326. },
  4327. {
  4328. "path": "../classic/classic/src/dd/DragDrop.js",
  4329. "requires": [
  4330. 450
  4331. ],
  4332. "uses": [
  4333. 49
  4334. ],
  4335. "idx": 456
  4336. },
  4337. {
  4338. "path": "../classic/classic/src/dd/DD.js",
  4339. "requires": [
  4340. 450,
  4341. 456
  4342. ],
  4343. "uses": [
  4344. 49
  4345. ],
  4346. "idx": 457
  4347. },
  4348. {
  4349. "path": "../classic/classic/src/dd/DDProxy.js",
  4350. "requires": [
  4351. 457
  4352. ],
  4353. "uses": [
  4354. 450
  4355. ],
  4356. "idx": 458
  4357. },
  4358. {
  4359. "path": "../classic/classic/src/dd/StatusProxy.js",
  4360. "requires": [
  4361. 117
  4362. ],
  4363. "uses": [],
  4364. "idx": 459
  4365. },
  4366. {
  4367. "path": "../classic/classic/src/dd/DragSource.js",
  4368. "requires": [
  4369. 450,
  4370. 458,
  4371. 459
  4372. ],
  4373. "uses": [
  4374. 433
  4375. ],
  4376. "idx": 460
  4377. },
  4378. {
  4379. "path": "../classic/classic/src/panel/Proxy.js",
  4380. "requires": [],
  4381. "uses": [
  4382. 49
  4383. ],
  4384. "idx": 461
  4385. },
  4386. {
  4387. "path": "../classic/classic/src/panel/DD.js",
  4388. "requires": [
  4389. 460,
  4390. 461
  4391. ],
  4392. "uses": [],
  4393. "idx": 462
  4394. },
  4395. {
  4396. "path": "../classic/classic/src/layout/component/Dock.js",
  4397. "requires": [
  4398. 432
  4399. ],
  4400. "uses": [
  4401. 24,
  4402. 49,
  4403. 419
  4404. ],
  4405. "idx": 463
  4406. },
  4407. {
  4408. "path": "../classic/classic/src/util/Memento.js",
  4409. "requires": [],
  4410. "uses": [],
  4411. "idx": 464
  4412. },
  4413. {
  4414. "path": "../classic/classic/src/container/DockingContainer.js",
  4415. "requires": [
  4416. 49,
  4417. 56
  4418. ],
  4419. "uses": [
  4420. 24,
  4421. 253,
  4422. 405
  4423. ],
  4424. "idx": 465
  4425. },
  4426. {
  4427. "path": "../classic/classic/src/panel/Panel.js",
  4428. "requires": [
  4429. 49,
  4430. 56,
  4431. 73,
  4432. 98,
  4433. 424,
  4434. 447,
  4435. 455,
  4436. 462,
  4437. 463,
  4438. 464,
  4439. 465
  4440. ],
  4441. "uses": [
  4442. 1,
  4443. 21,
  4444. 34,
  4445. 94,
  4446. 101,
  4447. 102,
  4448. 117,
  4449. 253,
  4450. 373,
  4451. 422,
  4452. 433,
  4453. 446,
  4454. 498
  4455. ],
  4456. "idx": 466
  4457. },
  4458. {
  4459. "path": "../classic/classic/src/layout/container/Table.js",
  4460. "requires": [
  4461. 421
  4462. ],
  4463. "uses": [],
  4464. "idx": 467
  4465. },
  4466. {
  4467. "path": "../classic/classic/src/container/ButtonGroup.js",
  4468. "requires": [
  4469. 466,
  4470. 467
  4471. ],
  4472. "uses": [],
  4473. "idx": 468
  4474. },
  4475. {
  4476. "path": "../classic/classic/src/container/Monitor.js",
  4477. "requires": [],
  4478. "uses": [
  4479. 24,
  4480. 56
  4481. ],
  4482. "idx": 469
  4483. },
  4484. {
  4485. "path": "../classic/classic/src/plugin/Viewport.js",
  4486. "requires": [
  4487. 84,
  4488. 118
  4489. ],
  4490. "uses": [
  4491. 49,
  4492. 90,
  4493. 419
  4494. ],
  4495. "idx": 470
  4496. },
  4497. {
  4498. "path": "../classic/classic/src/container/Viewport.js",
  4499. "requires": [
  4500. 118,
  4501. 424,
  4502. 470
  4503. ],
  4504. "uses": [],
  4505. "idx": 471
  4506. },
  4507. {
  4508. "path": "../classic/classic/src/layout/container/Anchor.js",
  4509. "requires": [
  4510. 422
  4511. ],
  4512. "uses": [],
  4513. "idx": 472
  4514. },
  4515. {
  4516. "path": "../classic/classic/src/dashboard/Panel.js",
  4517. "requires": [
  4518. 466
  4519. ],
  4520. "uses": [
  4521. 21
  4522. ],
  4523. "idx": 473
  4524. },
  4525. {
  4526. "path": "../classic/classic/src/dashboard/Column.js",
  4527. "requires": [
  4528. 424,
  4529. 472,
  4530. 473
  4531. ],
  4532. "uses": [],
  4533. "idx": 474
  4534. },
  4535. {
  4536. "path": "../classic/classic/src/layout/container/Column.js",
  4537. "requires": [
  4538. 422
  4539. ],
  4540. "uses": [],
  4541. "idx": 475
  4542. },
  4543. {
  4544. "path": "../classic/classic/src/dd/DragTracker.js",
  4545. "requires": [
  4546. 52
  4547. ],
  4548. "uses": [
  4549. 34,
  4550. 117,
  4551. 373
  4552. ],
  4553. "idx": 476
  4554. },
  4555. {
  4556. "path": "../classic/classic/src/resizer/SplitterTracker.js",
  4557. "requires": [
  4558. 34,
  4559. 476
  4560. ],
  4561. "uses": [
  4562. 49,
  4563. 106
  4564. ],
  4565. "idx": 477
  4566. },
  4567. {
  4568. "path": "../classic/classic/src/layout/container/ColumnSplitterTracker.js",
  4569. "requires": [
  4570. 477
  4571. ],
  4572. "uses": [],
  4573. "idx": 478
  4574. },
  4575. {
  4576. "path": "../classic/classic/src/layout/container/ColumnSplitter.js",
  4577. "requires": [
  4578. 451,
  4579. 478
  4580. ],
  4581. "uses": [],
  4582. "idx": 479
  4583. },
  4584. {
  4585. "path": "../classic/classic/src/layout/container/Dashboard.js",
  4586. "requires": [
  4587. 475,
  4588. 479
  4589. ],
  4590. "uses": [
  4591. 433
  4592. ],
  4593. "idx": 480
  4594. },
  4595. {
  4596. "path": "../classic/classic/src/dd/DDTarget.js",
  4597. "requires": [
  4598. 456
  4599. ],
  4600. "uses": [],
  4601. "idx": 481
  4602. },
  4603. {
  4604. "path": "../classic/classic/src/dd/ScrollManager.js",
  4605. "requires": [
  4606. 450
  4607. ],
  4608. "uses": [],
  4609. "idx": 482
  4610. },
  4611. {
  4612. "path": "../classic/classic/src/dd/DropTarget.js",
  4613. "requires": [
  4614. 481,
  4615. 482
  4616. ],
  4617. "uses": [],
  4618. "idx": 483
  4619. },
  4620. {
  4621. "path": "../classic/classic/src/dashboard/DropZone.js",
  4622. "requires": [
  4623. 483
  4624. ],
  4625. "uses": [],
  4626. "idx": 484
  4627. },
  4628. {
  4629. "path": "../classic/classic/src/dashboard/Part.js",
  4630. "requires": [
  4631. 3,
  4632. 12,
  4633. 134
  4634. ],
  4635. "uses": [],
  4636. "idx": 485
  4637. },
  4638. {
  4639. "path": "../classic/classic/src/dashboard/Dashboard.js",
  4640. "requires": [
  4641. 466,
  4642. 474,
  4643. 480,
  4644. 484,
  4645. 485
  4646. ],
  4647. "uses": [
  4648. 12,
  4649. 115,
  4650. 132
  4651. ],
  4652. "idx": 486
  4653. },
  4654. {
  4655. "path": "../classic/classic/src/dd/DragZone.js",
  4656. "requires": [
  4657. 460
  4658. ],
  4659. "uses": [
  4660. 482,
  4661. 488
  4662. ],
  4663. "idx": 487
  4664. },
  4665. {
  4666. "path": "../classic/classic/src/dd/Registry.js",
  4667. "requires": [],
  4668. "uses": [],
  4669. "idx": 488
  4670. },
  4671. {
  4672. "path": "../classic/classic/src/dd/DropZone.js",
  4673. "requires": [
  4674. 483,
  4675. 488
  4676. ],
  4677. "uses": [
  4678. 450
  4679. ],
  4680. "idx": 489
  4681. },
  4682. {
  4683. "path": "../classic/classic/src/dom/Layer.js",
  4684. "requires": [
  4685. 49
  4686. ],
  4687. "uses": [
  4688. 253
  4689. ],
  4690. "idx": 490
  4691. },
  4692. {
  4693. "path": "../classic/classic/src/enums.js",
  4694. "requires": [],
  4695. "uses": [],
  4696. "idx": 491
  4697. },
  4698. {
  4699. "path": "../classic/classic/src/event/publisher/MouseEnterLeave.js",
  4700. "requires": [
  4701. 37
  4702. ],
  4703. "uses": [],
  4704. "idx": 492
  4705. },
  4706. {
  4707. "path": "../classic/classic/src/flash/Component.js",
  4708. "requires": [
  4709. 117
  4710. ],
  4711. "uses": [],
  4712. "idx": 493
  4713. },
  4714. {
  4715. "path": "../classic/classic/src/form/action/Action.js",
  4716. "requires": [],
  4717. "uses": [],
  4718. "idx": 494
  4719. },
  4720. {
  4721. "path": "../classic/classic/src/form/action/Load.js",
  4722. "requires": [
  4723. 17,
  4724. 494
  4725. ],
  4726. "uses": [
  4727. 18
  4728. ],
  4729. "idx": 495
  4730. },
  4731. {
  4732. "path": "../classic/classic/src/form/action/Submit.js",
  4733. "requires": [
  4734. 494
  4735. ],
  4736. "uses": [
  4737. 18,
  4738. 253
  4739. ],
  4740. "idx": 496
  4741. },
  4742. {
  4743. "path": "../classic/classic/src/form/action/StandardSubmit.js",
  4744. "requires": [
  4745. 496
  4746. ],
  4747. "uses": [],
  4748. "idx": 497
  4749. },
  4750. {
  4751. "path": "../classic/classic/src/util/ComponentDragger.js",
  4752. "requires": [
  4753. 476
  4754. ],
  4755. "uses": [
  4756. 34,
  4757. 49
  4758. ],
  4759. "idx": 498
  4760. },
  4761. {
  4762. "path": "../classic/classic/src/window/Window.js",
  4763. "requires": [
  4764. 34,
  4765. 466,
  4766. 498
  4767. ],
  4768. "uses": [],
  4769. "idx": 499
  4770. },
  4771. {
  4772. "path": "../classic/classic/src/form/Labelable.js",
  4773. "requires": [
  4774. 0,
  4775. 98
  4776. ],
  4777. "uses": [
  4778. 49,
  4779. 552
  4780. ],
  4781. "idx": 500
  4782. },
  4783. {
  4784. "path": "../classic/classic/src/form/field/Field.js",
  4785. "requires": [],
  4786. "uses": [],
  4787. "idx": 501
  4788. },
  4789. {
  4790. "path": "../classic/classic/src/form/field/Base.js",
  4791. "requires": [
  4792. 1,
  4793. 98,
  4794. 117,
  4795. 500,
  4796. 501
  4797. ],
  4798. "uses": [
  4799. 95,
  4800. 253
  4801. ],
  4802. "idx": 502
  4803. },
  4804. {
  4805. "path": "../classic/classic/src/layout/component/field/Text.js",
  4806. "requires": [
  4807. 433
  4808. ],
  4809. "uses": [],
  4810. "idx": 503
  4811. },
  4812. {
  4813. "path": "../classic/classic/src/form/field/VTypes.js",
  4814. "requires": [],
  4815. "uses": [],
  4816. "idx": 504
  4817. },
  4818. {
  4819. "path": "../classic/classic/src/form/trigger/Trigger.js",
  4820. "requires": [
  4821. 12,
  4822. 403
  4823. ],
  4824. "uses": [
  4825. 49,
  4826. 98
  4827. ],
  4828. "idx": 505
  4829. },
  4830. {
  4831. "path": "../classic/classic/src/form/field/Text.js",
  4832. "requires": [
  4833. 410,
  4834. 419,
  4835. 502,
  4836. 503,
  4837. 504,
  4838. 505
  4839. ],
  4840. "uses": [
  4841. 94,
  4842. 95,
  4843. 102
  4844. ],
  4845. "idx": 506
  4846. },
  4847. {
  4848. "path": "../classic/classic/src/form/field/TextArea.js",
  4849. "requires": [
  4850. 1,
  4851. 98,
  4852. 506
  4853. ],
  4854. "uses": [
  4855. 94,
  4856. 410
  4857. ],
  4858. "idx": 507
  4859. },
  4860. {
  4861. "path": "../classic/classic/src/window/MessageBox.js",
  4862. "requires": [
  4863. 435,
  4864. 439,
  4865. 453,
  4866. 455,
  4867. 472,
  4868. 499,
  4869. 506,
  4870. 507
  4871. ],
  4872. "uses": [
  4873. 117,
  4874. 424,
  4875. 433,
  4876. 434
  4877. ],
  4878. "idx": 508
  4879. },
  4880. {
  4881. "path": "../classic/classic/src/form/Basic.js",
  4882. "requires": [
  4883. 1,
  4884. 52,
  4885. 56,
  4886. 145,
  4887. 495,
  4888. 496,
  4889. 497,
  4890. 508
  4891. ],
  4892. "uses": [
  4893. 469
  4894. ],
  4895. "idx": 509
  4896. },
  4897. {
  4898. "path": "../classic/classic/src/layout/component/field/FieldContainer.js",
  4899. "requires": [
  4900. 433
  4901. ],
  4902. "uses": [],
  4903. "idx": 510
  4904. },
  4905. {
  4906. "path": "../classic/classic/src/form/FieldAncestor.js",
  4907. "requires": [
  4908. 0,
  4909. 469
  4910. ],
  4911. "uses": [],
  4912. "idx": 511
  4913. },
  4914. {
  4915. "path": "../classic/classic/src/form/FieldContainer.js",
  4916. "requires": [
  4917. 424,
  4918. 500,
  4919. 510,
  4920. 511
  4921. ],
  4922. "uses": [],
  4923. "idx": 512
  4924. },
  4925. {
  4926. "path": "../classic/classic/src/layout/container/CheckboxGroup.js",
  4927. "requires": [
  4928. 421
  4929. ],
  4930. "uses": [
  4931. 253
  4932. ],
  4933. "idx": 513
  4934. },
  4935. {
  4936. "path": "../classic/classic/src/form/CheckboxManager.js",
  4937. "requires": [
  4938. 56
  4939. ],
  4940. "uses": [],
  4941. "idx": 514
  4942. },
  4943. {
  4944. "path": "../classic/classic/src/form/field/Checkbox.js",
  4945. "requires": [
  4946. 98,
  4947. 502,
  4948. 514
  4949. ],
  4950. "uses": [],
  4951. "idx": 515
  4952. },
  4953. {
  4954. "path": "../classic/classic/src/form/CheckboxGroup.js",
  4955. "requires": [
  4956. 501,
  4957. 502,
  4958. 512,
  4959. 513,
  4960. 515
  4961. ],
  4962. "uses": [],
  4963. "idx": 516
  4964. },
  4965. {
  4966. "path": "../classic/classic/src/form/FieldSet.js",
  4967. "requires": [
  4968. 424,
  4969. 511
  4970. ],
  4971. "uses": [
  4972. 49,
  4973. 101,
  4974. 117,
  4975. 253,
  4976. 433,
  4977. 446,
  4978. 472,
  4979. 515,
  4980. 669
  4981. ],
  4982. "idx": 517
  4983. },
  4984. {
  4985. "path": "../classic/classic/src/form/Label.js",
  4986. "requires": [
  4987. 94,
  4988. 117
  4989. ],
  4990. "uses": [],
  4991. "idx": 518
  4992. },
  4993. {
  4994. "path": "../classic/classic/src/form/Panel.js",
  4995. "requires": [
  4996. 57,
  4997. 466,
  4998. 509,
  4999. 511
  5000. ],
  5001. "uses": [
  5002. 409
  5003. ],
  5004. "idx": 519
  5005. },
  5006. {
  5007. "path": "../classic/classic/src/form/RadioManager.js",
  5008. "requires": [
  5009. 56
  5010. ],
  5011. "uses": [],
  5012. "idx": 520
  5013. },
  5014. {
  5015. "path": "../classic/classic/src/form/field/Radio.js",
  5016. "requires": [
  5017. 515,
  5018. 520
  5019. ],
  5020. "uses": [],
  5021. "idx": 521
  5022. },
  5023. {
  5024. "path": "../classic/classic/src/form/RadioGroup.js",
  5025. "requires": [
  5026. 516,
  5027. 521
  5028. ],
  5029. "uses": [
  5030. 520
  5031. ],
  5032. "idx": 522
  5033. },
  5034. {
  5035. "path": "../classic/classic/src/form/action/DirectAction.js",
  5036. "requires": [
  5037. 0
  5038. ],
  5039. "uses": [
  5040. 227
  5041. ],
  5042. "idx": 523
  5043. },
  5044. {
  5045. "path": "../classic/classic/src/form/action/DirectLoad.js",
  5046. "requires": [
  5047. 227,
  5048. 495,
  5049. 523
  5050. ],
  5051. "uses": [],
  5052. "idx": 524
  5053. },
  5054. {
  5055. "path": "../classic/classic/src/form/action/DirectSubmit.js",
  5056. "requires": [
  5057. 227,
  5058. 496,
  5059. 523
  5060. ],
  5061. "uses": [],
  5062. "idx": 525
  5063. },
  5064. {
  5065. "path": "../classic/classic/src/form/field/Picker.js",
  5066. "requires": [
  5067. 373,
  5068. 506
  5069. ],
  5070. "uses": [],
  5071. "idx": 526
  5072. },
  5073. {
  5074. "path": "../classic/classic/src/selection/Model.js",
  5075. "requires": [
  5076. 4,
  5077. 12,
  5078. 192,
  5079. 430
  5080. ],
  5081. "uses": [],
  5082. "idx": 527
  5083. },
  5084. {
  5085. "path": "../classic/classic/src/selection/DataViewModel.js",
  5086. "requires": [
  5087. 373,
  5088. 527
  5089. ],
  5090. "uses": [],
  5091. "idx": 528
  5092. },
  5093. {
  5094. "path": "../classic/classic/src/view/NavigationModel.js",
  5095. "requires": [
  5096. 12,
  5097. 52,
  5098. 430
  5099. ],
  5100. "uses": [
  5101. 373
  5102. ],
  5103. "idx": 529
  5104. },
  5105. {
  5106. "path": "../classic/classic/src/view/AbstractView.js",
  5107. "requires": [
  5108. 75,
  5109. 76,
  5110. 104,
  5111. 117,
  5112. 430,
  5113. 431,
  5114. 528,
  5115. 529
  5116. ],
  5117. "uses": [
  5118. 1,
  5119. 12,
  5120. 49,
  5121. 95,
  5122. 98,
  5123. 185,
  5124. 253
  5125. ],
  5126. "idx": 530
  5127. },
  5128. {
  5129. "path": "../classic/classic/src/view/View.js",
  5130. "requires": [
  5131. 530
  5132. ],
  5133. "uses": [],
  5134. "idx": 531
  5135. },
  5136. {
  5137. "path": "../classic/classic/src/view/BoundListKeyNav.js",
  5138. "requires": [
  5139. 529
  5140. ],
  5141. "uses": [
  5142. 36,
  5143. 373
  5144. ],
  5145. "idx": 532
  5146. },
  5147. {
  5148. "path": "../classic/classic/src/layout/component/BoundList.js",
  5149. "requires": [
  5150. 433
  5151. ],
  5152. "uses": [],
  5153. "idx": 533
  5154. },
  5155. {
  5156. "path": "../classic/classic/src/toolbar/Item.js",
  5157. "requires": [
  5158. 117,
  5159. 455
  5160. ],
  5161. "uses": [],
  5162. "idx": 534
  5163. },
  5164. {
  5165. "path": "../classic/classic/src/toolbar/TextItem.js",
  5166. "requires": [
  5167. 98,
  5168. 455,
  5169. 534
  5170. ],
  5171. "uses": [],
  5172. "idx": 535
  5173. },
  5174. {
  5175. "path": "../classic/classic/src/form/trigger/Spinner.js",
  5176. "requires": [
  5177. 505
  5178. ],
  5179. "uses": [],
  5180. "idx": 536
  5181. },
  5182. {
  5183. "path": "../classic/classic/src/form/field/Spinner.js",
  5184. "requires": [
  5185. 373,
  5186. 506,
  5187. 536
  5188. ],
  5189. "uses": [],
  5190. "idx": 537
  5191. },
  5192. {
  5193. "path": "../classic/classic/src/form/field/Number.js",
  5194. "requires": [
  5195. 537
  5196. ],
  5197. "uses": [
  5198. 94,
  5199. 95
  5200. ],
  5201. "idx": 538
  5202. },
  5203. {
  5204. "path": "../classic/classic/src/toolbar/Paging.js",
  5205. "requires": [
  5206. 430,
  5207. 455,
  5208. 535,
  5209. 538
  5210. ],
  5211. "uses": [
  5212. 95,
  5213. 433,
  5214. 503,
  5215. 536
  5216. ],
  5217. "idx": 539
  5218. },
  5219. {
  5220. "path": "../classic/classic/src/view/BoundList.js",
  5221. "requires": [
  5222. 49,
  5223. 241,
  5224. 531,
  5225. 532,
  5226. 533,
  5227. 539
  5228. ],
  5229. "uses": [
  5230. 98,
  5231. 433
  5232. ],
  5233. "idx": 540
  5234. },
  5235. {
  5236. "path": "../classic/classic/src/form/field/ComboBox.js",
  5237. "requires": [
  5238. 1,
  5239. 185,
  5240. 430,
  5241. 526,
  5242. 540
  5243. ],
  5244. "uses": [
  5245. 49,
  5246. 51,
  5247. 98,
  5248. 132,
  5249. 163,
  5250. 179,
  5251. 253,
  5252. 373,
  5253. 528,
  5254. 532,
  5255. 533
  5256. ],
  5257. "idx": 541
  5258. },
  5259. {
  5260. "path": "../classic/classic/src/picker/Month.js",
  5261. "requires": [
  5262. 98,
  5263. 117,
  5264. 403,
  5265. 439
  5266. ],
  5267. "uses": [
  5268. 433
  5269. ],
  5270. "idx": 542
  5271. },
  5272. {
  5273. "path": "../classic/classic/src/picker/Date.js",
  5274. "requires": [
  5275. 67,
  5276. 98,
  5277. 117,
  5278. 373,
  5279. 403,
  5280. 439,
  5281. 440,
  5282. 542
  5283. ],
  5284. "uses": [
  5285. 95,
  5286. 253,
  5287. 433
  5288. ],
  5289. "idx": 543
  5290. },
  5291. {
  5292. "path": "../classic/classic/src/form/field/Date.js",
  5293. "requires": [
  5294. 526,
  5295. 543
  5296. ],
  5297. "uses": [
  5298. 95,
  5299. 433
  5300. ],
  5301. "idx": 544
  5302. },
  5303. {
  5304. "path": "../classic/classic/src/form/field/Display.js",
  5305. "requires": [
  5306. 94,
  5307. 98,
  5308. 502
  5309. ],
  5310. "uses": [],
  5311. "idx": 545
  5312. },
  5313. {
  5314. "path": "../classic/classic/src/form/field/FileButton.js",
  5315. "requires": [
  5316. 439
  5317. ],
  5318. "uses": [],
  5319. "idx": 546
  5320. },
  5321. {
  5322. "path": "../classic/classic/src/form/trigger/Component.js",
  5323. "requires": [
  5324. 505
  5325. ],
  5326. "uses": [],
  5327. "idx": 547
  5328. },
  5329. {
  5330. "path": "../classic/classic/src/form/field/File.js",
  5331. "requires": [
  5332. 506,
  5333. 546,
  5334. 547
  5335. ],
  5336. "uses": [
  5337. 433
  5338. ],
  5339. "idx": 548
  5340. },
  5341. {
  5342. "path": "../classic/classic/src/form/field/Hidden.js",
  5343. "requires": [
  5344. 502
  5345. ],
  5346. "uses": [],
  5347. "idx": 549
  5348. },
  5349. {
  5350. "path": "../classic/classic/src/tip/Tip.js",
  5351. "requires": [
  5352. 466
  5353. ],
  5354. "uses": [
  5355. 35,
  5356. 117
  5357. ],
  5358. "idx": 550
  5359. },
  5360. {
  5361. "path": "../classic/classic/src/tip/ToolTip.js",
  5362. "requires": [
  5363. 33,
  5364. 550
  5365. ],
  5366. "uses": [
  5367. 35,
  5368. 75
  5369. ],
  5370. "idx": 551
  5371. },
  5372. {
  5373. "path": "../classic/classic/src/tip/QuickTip.js",
  5374. "requires": [
  5375. 551
  5376. ],
  5377. "uses": [],
  5378. "idx": 552
  5379. },
  5380. {
  5381. "path": "../classic/classic/src/tip/QuickTipManager.js",
  5382. "requires": [
  5383. 552
  5384. ],
  5385. "uses": [],
  5386. "idx": 553
  5387. },
  5388. {
  5389. "path": "../classic/classic/src/picker/Color.js",
  5390. "requires": [
  5391. 98,
  5392. 117
  5393. ],
  5394. "uses": [],
  5395. "idx": 554
  5396. },
  5397. {
  5398. "path": "../classic/classic/src/layout/component/field/HtmlEditor.js",
  5399. "requires": [
  5400. 510
  5401. ],
  5402. "uses": [],
  5403. "idx": 555
  5404. },
  5405. {
  5406. "path": "../classic/classic/src/toolbar/Separator.js",
  5407. "requires": [
  5408. 455,
  5409. 534
  5410. ],
  5411. "uses": [],
  5412. "idx": 556
  5413. },
  5414. {
  5415. "path": "../classic/classic/src/layout/container/boxOverflow/Menu.js",
  5416. "requires": [
  5417. 439,
  5418. 448,
  5419. 556
  5420. ],
  5421. "uses": [
  5422. 433,
  5423. 449,
  5424. 454,
  5425. 463,
  5426. 515,
  5427. 611,
  5428. 613,
  5429. 702
  5430. ],
  5431. "idx": 557
  5432. },
  5433. {
  5434. "path": "../classic/classic/src/form/field/HtmlEditor.js",
  5435. "requires": [
  5436. 94,
  5437. 409,
  5438. 454,
  5439. 455,
  5440. 501,
  5441. 512,
  5442. 534,
  5443. 553,
  5444. 554,
  5445. 555,
  5446. 557
  5447. ],
  5448. "uses": [
  5449. 1,
  5450. 95,
  5451. 117,
  5452. 253,
  5453. 433,
  5454. 449,
  5455. 463,
  5456. 613
  5457. ],
  5458. "idx": 558
  5459. },
  5460. {
  5461. "path": "../classic/classic/src/view/TagKeyNav.js",
  5462. "requires": [
  5463. 532
  5464. ],
  5465. "uses": [],
  5466. "idx": 559
  5467. },
  5468. {
  5469. "path": "../classic/classic/src/form/field/Tag.js",
  5470. "requires": [
  5471. 182,
  5472. 224,
  5473. 527,
  5474. 541,
  5475. 559
  5476. ],
  5477. "uses": [
  5478. 51,
  5479. 95,
  5480. 98,
  5481. 169,
  5482. 176,
  5483. 177,
  5484. 410
  5485. ],
  5486. "idx": 560
  5487. },
  5488. {
  5489. "path": "../classic/classic/src/picker/Time.js",
  5490. "requires": [
  5491. 182,
  5492. 540
  5493. ],
  5494. "uses": [
  5495. 51
  5496. ],
  5497. "idx": 561
  5498. },
  5499. {
  5500. "path": "../classic/classic/src/form/field/Time.js",
  5501. "requires": [
  5502. 532,
  5503. 541,
  5504. 544,
  5505. 561
  5506. ],
  5507. "uses": [
  5508. 95,
  5509. 98,
  5510. 528,
  5511. 533
  5512. ],
  5513. "idx": 562
  5514. },
  5515. {
  5516. "path": "../classic/classic/src/form/field/Trigger.js",
  5517. "requires": [
  5518. 253,
  5519. 403,
  5520. 506
  5521. ],
  5522. "uses": [],
  5523. "idx": 563
  5524. },
  5525. {
  5526. "path": "../classic/classic/src/grid/CellContext.js",
  5527. "requires": [],
  5528. "uses": [],
  5529. "idx": 564
  5530. },
  5531. {
  5532. "path": "../classic/classic/src/grid/CellEditor.js",
  5533. "requires": [
  5534. 426
  5535. ],
  5536. "uses": [
  5537. 49,
  5538. 424
  5539. ],
  5540. "idx": 565
  5541. },
  5542. {
  5543. "path": "../classic/classic/src/grid/ColumnComponentLayout.js",
  5544. "requires": [
  5545. 433
  5546. ],
  5547. "uses": [],
  5548. "idx": 566
  5549. },
  5550. {
  5551. "path": "../classic/classic/src/layout/container/Fit.js",
  5552. "requires": [
  5553. 421
  5554. ],
  5555. "uses": [],
  5556. "idx": 567
  5557. },
  5558. {
  5559. "path": "../classic/classic/src/panel/Table.js",
  5560. "requires": [
  5561. 466,
  5562. 567
  5563. ],
  5564. "uses": [
  5565. 1,
  5566. 77,
  5567. 115,
  5568. 185,
  5569. 225,
  5570. 253,
  5571. 564,
  5572. 571,
  5573. 578,
  5574. 588,
  5575. 626,
  5576. 627,
  5577. 687,
  5578. 688,
  5579. 689
  5580. ],
  5581. "idx": 568
  5582. },
  5583. {
  5584. "path": "../classic/classic/src/grid/ColumnLayout.js",
  5585. "requires": [
  5586. 453,
  5587. 568
  5588. ],
  5589. "uses": [],
  5590. "idx": 569
  5591. },
  5592. {
  5593. "path": "../classic/classic/src/grid/ColumnManager.js",
  5594. "requires": [],
  5595. "uses": [],
  5596. "idx": 570
  5597. },
  5598. {
  5599. "path": "../classic/classic/src/grid/NavigationModel.js",
  5600. "requires": [
  5601. 529
  5602. ],
  5603. "uses": [
  5604. 21,
  5605. 36,
  5606. 49,
  5607. 75,
  5608. 117,
  5609. 373,
  5610. 564
  5611. ],
  5612. "idx": 571
  5613. },
  5614. {
  5615. "path": "../classic/classic/src/view/TableLayout.js",
  5616. "requires": [
  5617. 433
  5618. ],
  5619. "uses": [],
  5620. "idx": 572
  5621. },
  5622. {
  5623. "path": "../classic/classic/src/grid/locking/RowSynchronizer.js",
  5624. "requires": [],
  5625. "uses": [],
  5626. "idx": 573
  5627. },
  5628. {
  5629. "path": "../classic/classic/src/view/NodeCache.js",
  5630. "requires": [
  5631. 76
  5632. ],
  5633. "uses": [
  5634. 49,
  5635. 75
  5636. ],
  5637. "idx": 574
  5638. },
  5639. {
  5640. "path": "../classic/classic/src/scroll/TableScroller.js",
  5641. "requires": [
  5642. 110
  5643. ],
  5644. "uses": [
  5645. 10
  5646. ],
  5647. "idx": 575
  5648. },
  5649. {
  5650. "path": "../classic/classic/src/view/Table.js",
  5651. "requires": [
  5652. 1,
  5653. 56,
  5654. 75,
  5655. 241,
  5656. 531,
  5657. 564,
  5658. 572,
  5659. 573,
  5660. 574,
  5661. 575
  5662. ],
  5663. "uses": [
  5664. 12,
  5665. 49,
  5666. 98,
  5667. 117,
  5668. 163,
  5669. 588
  5670. ],
  5671. "idx": 576
  5672. },
  5673. {
  5674. "path": "../classic/classic/src/grid/Panel.js",
  5675. "requires": [
  5676. 568,
  5677. 576
  5678. ],
  5679. "uses": [],
  5680. "idx": 577
  5681. },
  5682. {
  5683. "path": "../classic/classic/src/grid/RowContext.js",
  5684. "requires": [],
  5685. "uses": [
  5686. 12
  5687. ],
  5688. "idx": 578
  5689. },
  5690. {
  5691. "path": "../classic/classic/src/grid/RowEditorButtons.js",
  5692. "requires": [
  5693. 424
  5694. ],
  5695. "uses": [
  5696. 433,
  5697. 439,
  5698. 466
  5699. ],
  5700. "idx": 579
  5701. },
  5702. {
  5703. "path": "../classic/classic/src/grid/RowEditor.js",
  5704. "requires": [
  5705. 373,
  5706. 519,
  5707. 551,
  5708. 579
  5709. ],
  5710. "uses": [
  5711. 49,
  5712. 67,
  5713. 77,
  5714. 422,
  5715. 424,
  5716. 433,
  5717. 463,
  5718. 545,
  5719. 564
  5720. ],
  5721. "idx": 580
  5722. },
  5723. {
  5724. "path": "../classic/classic/src/grid/Scroller.js",
  5725. "requires": [],
  5726. "uses": [],
  5727. "idx": 581
  5728. },
  5729. {
  5730. "path": "../classic/classic/src/view/DropZone.js",
  5731. "requires": [
  5732. 489
  5733. ],
  5734. "uses": [
  5735. 117,
  5736. 433
  5737. ],
  5738. "idx": 582
  5739. },
  5740. {
  5741. "path": "../classic/classic/src/grid/ViewDropZone.js",
  5742. "requires": [
  5743. 582
  5744. ],
  5745. "uses": [],
  5746. "idx": 583
  5747. },
  5748. {
  5749. "path": "../classic/classic/src/grid/plugin/HeaderResizer.js",
  5750. "requires": [
  5751. 34,
  5752. 84,
  5753. 476
  5754. ],
  5755. "uses": [
  5756. 589
  5757. ],
  5758. "idx": 584
  5759. },
  5760. {
  5761. "path": "../classic/classic/src/grid/header/DragZone.js",
  5762. "requires": [
  5763. 487
  5764. ],
  5765. "uses": [],
  5766. "idx": 585
  5767. },
  5768. {
  5769. "path": "../classic/classic/src/grid/header/DropZone.js",
  5770. "requires": [
  5771. 489
  5772. ],
  5773. "uses": [
  5774. 450
  5775. ],
  5776. "idx": 586
  5777. },
  5778. {
  5779. "path": "../classic/classic/src/grid/plugin/HeaderReorderer.js",
  5780. "requires": [
  5781. 84,
  5782. 585,
  5783. 586
  5784. ],
  5785. "uses": [],
  5786. "idx": 587
  5787. },
  5788. {
  5789. "path": "../classic/classic/src/grid/header/Container.js",
  5790. "requires": [
  5791. 373,
  5792. 424,
  5793. 569,
  5794. 584,
  5795. 587
  5796. ],
  5797. "uses": [
  5798. 1,
  5799. 117,
  5800. 433,
  5801. 449,
  5802. 454,
  5803. 463,
  5804. 570,
  5805. 589,
  5806. 611,
  5807. 612,
  5808. 613
  5809. ],
  5810. "idx": 588
  5811. },
  5812. {
  5813. "path": "../classic/classic/src/grid/column/Column.js",
  5814. "requires": [
  5815. 221,
  5816. 566,
  5817. 569,
  5818. 588
  5819. ],
  5820. "uses": [
  5821. 54,
  5822. 94,
  5823. 117,
  5824. 131,
  5825. 584
  5826. ],
  5827. "idx": 589
  5828. },
  5829. {
  5830. "path": "../classic/classic/src/grid/column/ActionProxy.js",
  5831. "requires": [],
  5832. "uses": [],
  5833. "idx": 590
  5834. },
  5835. {
  5836. "path": "../classic/classic/src/grid/column/Action.js",
  5837. "requires": [
  5838. 78,
  5839. 94,
  5840. 589,
  5841. 590
  5842. ],
  5843. "uses": [
  5844. 49
  5845. ],
  5846. "idx": 591
  5847. },
  5848. {
  5849. "path": "../classic/classic/src/grid/column/Boolean.js",
  5850. "requires": [
  5851. 589
  5852. ],
  5853. "uses": [],
  5854. "idx": 592
  5855. },
  5856. {
  5857. "path": "../classic/classic/src/grid/column/Check.js",
  5858. "requires": [
  5859. 589
  5860. ],
  5861. "uses": [
  5862. 564
  5863. ],
  5864. "idx": 593
  5865. },
  5866. {
  5867. "path": "../classic/classic/src/grid/column/Date.js",
  5868. "requires": [
  5869. 589
  5870. ],
  5871. "uses": [
  5872. 94
  5873. ],
  5874. "idx": 594
  5875. },
  5876. {
  5877. "path": "../classic/classic/src/grid/column/Groups.js",
  5878. "requires": [
  5879. 589
  5880. ],
  5881. "uses": [],
  5882. "idx": 595
  5883. },
  5884. {
  5885. "path": "../classic/classic/src/grid/column/Number.js",
  5886. "requires": [
  5887. 94,
  5888. 589
  5889. ],
  5890. "uses": [],
  5891. "idx": 596
  5892. },
  5893. {
  5894. "path": "../classic/classic/src/grid/column/RowNumberer.js",
  5895. "requires": [
  5896. 589
  5897. ],
  5898. "uses": [
  5899. 564
  5900. ],
  5901. "idx": 597
  5902. },
  5903. {
  5904. "path": "../classic/classic/src/grid/column/Template.js",
  5905. "requires": [
  5906. 98,
  5907. 589
  5908. ],
  5909. "uses": [
  5910. 593
  5911. ],
  5912. "idx": 598
  5913. },
  5914. {
  5915. "path": "../classic/classic/src/grid/column/Widget.js",
  5916. "requires": [
  5917. 379,
  5918. 589
  5919. ],
  5920. "uses": [],
  5921. "idx": 599
  5922. },
  5923. {
  5924. "path": "../classic/classic/src/grid/feature/Feature.js",
  5925. "requires": [
  5926. 52
  5927. ],
  5928. "uses": [],
  5929. "idx": 600
  5930. },
  5931. {
  5932. "path": "../classic/classic/src/grid/feature/AbstractSummary.js",
  5933. "requires": [
  5934. 600
  5935. ],
  5936. "uses": [
  5937. 12
  5938. ],
  5939. "idx": 601
  5940. },
  5941. {
  5942. "path": "../classic/classic/src/grid/feature/AdvancedGroupStore.js",
  5943. "requires": [
  5944. 360
  5945. ],
  5946. "uses": [],
  5947. "idx": 602
  5948. },
  5949. {
  5950. "path": "../classic/classic/src/grid/feature/AdvancedGrouping.js",
  5951. "requires": [
  5952. 595,
  5953. 600,
  5954. 602
  5955. ],
  5956. "uses": [
  5957. 98,
  5958. 422,
  5959. 566
  5960. ],
  5961. "idx": 603
  5962. },
  5963. {
  5964. "path": "../classic/classic/src/grid/feature/AdvancedGroupingSummary.js",
  5965. "requires": [
  5966. 603
  5967. ],
  5968. "uses": [
  5969. 1,
  5970. 117,
  5971. 433
  5972. ],
  5973. "idx": 604
  5974. },
  5975. {
  5976. "path": "../classic/classic/src/grid/feature/GroupStore.js",
  5977. "requires": [
  5978. 52
  5979. ],
  5980. "uses": [
  5981. 132
  5982. ],
  5983. "idx": 605
  5984. },
  5985. {
  5986. "path": "../classic/classic/src/grid/feature/Grouping.js",
  5987. "requires": [
  5988. 600,
  5989. 601,
  5990. 605
  5991. ],
  5992. "uses": [
  5993. 98,
  5994. 163
  5995. ],
  5996. "idx": 606
  5997. },
  5998. {
  5999. "path": "../classic/classic/src/grid/feature/GroupingSummary.js",
  6000. "requires": [
  6001. 606
  6002. ],
  6003. "uses": [],
  6004. "idx": 607
  6005. },
  6006. {
  6007. "path": "../classic/classic/src/grid/feature/RowBody.js",
  6008. "requires": [
  6009. 600
  6010. ],
  6011. "uses": [
  6012. 98
  6013. ],
  6014. "idx": 608
  6015. },
  6016. {
  6017. "path": "../classic/classic/src/grid/feature/Summary.js",
  6018. "requires": [
  6019. 601
  6020. ],
  6021. "uses": [
  6022. 117,
  6023. 163,
  6024. 433
  6025. ],
  6026. "idx": 609
  6027. },
  6028. {
  6029. "path": "../classic/classic/src/menu/Item.js",
  6030. "requires": [
  6031. 78,
  6032. 117,
  6033. 241
  6034. ],
  6035. "uses": [
  6036. 438,
  6037. 553
  6038. ],
  6039. "idx": 610
  6040. },
  6041. {
  6042. "path": "../classic/classic/src/menu/CheckItem.js",
  6043. "requires": [
  6044. 610
  6045. ],
  6046. "uses": [
  6047. 438
  6048. ],
  6049. "idx": 611
  6050. },
  6051. {
  6052. "path": "../classic/classic/src/menu/Separator.js",
  6053. "requires": [
  6054. 610
  6055. ],
  6056. "uses": [],
  6057. "idx": 612
  6058. },
  6059. {
  6060. "path": "../classic/classic/src/menu/Menu.js",
  6061. "requires": [
  6062. 438,
  6063. 454,
  6064. 466,
  6065. 610,
  6066. 611,
  6067. 612
  6068. ],
  6069. "uses": [
  6070. 1,
  6071. 21,
  6072. 36,
  6073. 49,
  6074. 373,
  6075. 433
  6076. ],
  6077. "idx": 613
  6078. },
  6079. {
  6080. "path": "../classic/classic/src/grid/filters/filter/Base.js",
  6081. "requires": [
  6082. 12,
  6083. 449,
  6084. 454,
  6085. 463,
  6086. 613
  6087. ],
  6088. "uses": [
  6089. 1,
  6090. 51
  6091. ],
  6092. "idx": 614
  6093. },
  6094. {
  6095. "path": "../classic/classic/src/grid/filters/filter/SingleFilter.js",
  6096. "requires": [
  6097. 614
  6098. ],
  6099. "uses": [],
  6100. "idx": 615
  6101. },
  6102. {
  6103. "path": "../classic/classic/src/grid/filters/filter/Boolean.js",
  6104. "requires": [
  6105. 615
  6106. ],
  6107. "uses": [],
  6108. "idx": 616
  6109. },
  6110. {
  6111. "path": "../classic/classic/src/grid/filters/filter/TriFilter.js",
  6112. "requires": [
  6113. 614
  6114. ],
  6115. "uses": [],
  6116. "idx": 617
  6117. },
  6118. {
  6119. "path": "../classic/classic/src/grid/filters/filter/Date.js",
  6120. "requires": [
  6121. 433,
  6122. 611,
  6123. 617
  6124. ],
  6125. "uses": [
  6126. 449,
  6127. 454,
  6128. 463,
  6129. 543,
  6130. 679
  6131. ],
  6132. "idx": 618
  6133. },
  6134. {
  6135. "path": "../classic/classic/src/grid/filters/filter/List.js",
  6136. "requires": [
  6137. 615
  6138. ],
  6139. "uses": [
  6140. 182,
  6141. 185
  6142. ],
  6143. "idx": 619
  6144. },
  6145. {
  6146. "path": "../classic/classic/src/grid/filters/filter/Number.js",
  6147. "requires": [
  6148. 503,
  6149. 536,
  6150. 617
  6151. ],
  6152. "uses": [
  6153. 538
  6154. ],
  6155. "idx": 620
  6156. },
  6157. {
  6158. "path": "../classic/classic/src/grid/filters/filter/String.js",
  6159. "requires": [
  6160. 503,
  6161. 506,
  6162. 615
  6163. ],
  6164. "uses": [
  6165. 51
  6166. ],
  6167. "idx": 621
  6168. },
  6169. {
  6170. "path": "../classic/classic/src/grid/filters/Filters.js",
  6171. "requires": [
  6172. 84,
  6173. 430,
  6174. 614,
  6175. 615,
  6176. 616,
  6177. 617,
  6178. 618,
  6179. 619,
  6180. 620,
  6181. 621
  6182. ],
  6183. "uses": [
  6184. 12
  6185. ],
  6186. "idx": 622
  6187. },
  6188. {
  6189. "path": "../classic/classic/src/grid/locking/HeaderContainer.js",
  6190. "requires": [
  6191. 570,
  6192. 588
  6193. ],
  6194. "uses": [],
  6195. "idx": 623
  6196. },
  6197. {
  6198. "path": "../classic/classic/src/grid/locking/View.js",
  6199. "requires": [
  6200. 52,
  6201. 87,
  6202. 117,
  6203. 430,
  6204. 530,
  6205. 576
  6206. ],
  6207. "uses": [
  6208. 110,
  6209. 431,
  6210. 564
  6211. ],
  6212. "idx": 624
  6213. },
  6214. {
  6215. "path": "../classic/classic/src/scroll/LockingScroller.js",
  6216. "requires": [
  6217. 110
  6218. ],
  6219. "uses": [
  6220. 10
  6221. ],
  6222. "idx": 625
  6223. },
  6224. {
  6225. "path": "../classic/classic/src/grid/locking/Lockable.js",
  6226. "requires": [
  6227. 117,
  6228. 576,
  6229. 588,
  6230. 623,
  6231. 624,
  6232. 625
  6233. ],
  6234. "uses": [
  6235. 1,
  6236. 34,
  6237. 110,
  6238. 185,
  6239. 422,
  6240. 433,
  6241. 451,
  6242. 452,
  6243. 466,
  6244. 568
  6245. ],
  6246. "idx": 626
  6247. },
  6248. {
  6249. "path": "../classic/classic/src/grid/plugin/BufferedRenderer.js",
  6250. "requires": [
  6251. 84,
  6252. 573
  6253. ],
  6254. "uses": [
  6255. 1,
  6256. 49,
  6257. 117
  6258. ],
  6259. "idx": 627
  6260. },
  6261. {
  6262. "path": "../classic/classic/src/grid/plugin/Editing.js",
  6263. "requires": [
  6264. 4,
  6265. 84,
  6266. 373,
  6267. 502,
  6268. 576,
  6269. 589
  6270. ],
  6271. "uses": [
  6272. 21,
  6273. 117,
  6274. 433,
  6275. 564
  6276. ],
  6277. "idx": 628
  6278. },
  6279. {
  6280. "path": "../classic/classic/src/grid/plugin/CellEditing.js",
  6281. "requires": [
  6282. 1,
  6283. 565,
  6284. 628
  6285. ],
  6286. "uses": [
  6287. 56,
  6288. 425,
  6289. 433,
  6290. 564
  6291. ],
  6292. "idx": 629
  6293. },
  6294. {
  6295. "path": "../classic/classic/src/grid/plugin/Clipboard.js",
  6296. "requires": [
  6297. 94,
  6298. 383,
  6299. 408
  6300. ],
  6301. "uses": [
  6302. 564
  6303. ],
  6304. "idx": 630
  6305. },
  6306. {
  6307. "path": "../classic/classic/src/grid/plugin/DragDrop.js",
  6308. "requires": [
  6309. 84
  6310. ],
  6311. "uses": [
  6312. 583,
  6313. 708
  6314. ],
  6315. "idx": 631
  6316. },
  6317. {
  6318. "path": "../classic/classic/src/grid/plugin/grouping/Column.js",
  6319. "requires": [
  6320. 117,
  6321. 610,
  6322. 611,
  6323. 612,
  6324. 613
  6325. ],
  6326. "uses": [],
  6327. "idx": 632
  6328. },
  6329. {
  6330. "path": "../classic/classic/src/grid/plugin/grouping/DragZone.js",
  6331. "requires": [
  6332. 487
  6333. ],
  6334. "uses": [],
  6335. "idx": 633
  6336. },
  6337. {
  6338. "path": "../classic/classic/src/grid/plugin/grouping/DropZone.js",
  6339. "requires": [
  6340. 489
  6341. ],
  6342. "uses": [
  6343. 131,
  6344. 450
  6345. ],
  6346. "idx": 634
  6347. },
  6348. {
  6349. "path": "../classic/classic/src/grid/plugin/grouping/Panel.js",
  6350. "requires": [
  6351. 374,
  6352. 433,
  6353. 466,
  6354. 475,
  6355. 632,
  6356. 633,
  6357. 634
  6358. ],
  6359. "uses": [
  6360. 438,
  6361. 612
  6362. ],
  6363. "idx": 635
  6364. },
  6365. {
  6366. "path": "../classic/classic/src/grid/plugin/GroupingPanel.js",
  6367. "requires": [
  6368. 362,
  6369. 635
  6370. ],
  6371. "uses": [],
  6372. "idx": 636
  6373. },
  6374. {
  6375. "path": "../classic/classic/src/grid/plugin/RowEditing.js",
  6376. "requires": [
  6377. 580,
  6378. 628
  6379. ],
  6380. "uses": [],
  6381. "idx": 637
  6382. },
  6383. {
  6384. "path": "../classic/classic/src/grid/plugin/RowExpander.js",
  6385. "requires": [
  6386. 84,
  6387. 608
  6388. ],
  6389. "uses": [
  6390. 98,
  6391. 589
  6392. ],
  6393. "idx": 638
  6394. },
  6395. {
  6396. "path": "../classic/classic/src/grid/plugin/RowWidget.js",
  6397. "requires": [
  6398. 3,
  6399. 379,
  6400. 638
  6401. ],
  6402. "uses": [
  6403. 84,
  6404. 608
  6405. ],
  6406. "idx": 639
  6407. },
  6408. {
  6409. "path": "../classic/classic/src/grid/plugin/Summaries.js",
  6410. "requires": [
  6411. 363
  6412. ],
  6413. "uses": [],
  6414. "idx": 640
  6415. },
  6416. {
  6417. "path": "../classic/classic/src/grid/plugin/filterbar/Operator.js",
  6418. "requires": [
  6419. 84
  6420. ],
  6421. "uses": [
  6422. 449,
  6423. 454,
  6424. 463,
  6425. 613
  6426. ],
  6427. "idx": 641
  6428. },
  6429. {
  6430. "path": "../classic/classic/src/grid/plugin/filterbar/filters/Base.js",
  6431. "requires": [
  6432. 12,
  6433. 503,
  6434. 506,
  6435. 641
  6436. ],
  6437. "uses": [
  6438. 1,
  6439. 51
  6440. ],
  6441. "idx": 642
  6442. },
  6443. {
  6444. "path": "../classic/classic/src/grid/plugin/filterbar/filters/SingleFilter.js",
  6445. "requires": [
  6446. 642
  6447. ],
  6448. "uses": [],
  6449. "idx": 643
  6450. },
  6451. {
  6452. "path": "../classic/classic/src/grid/plugin/filterbar/filters/String.js",
  6453. "requires": [
  6454. 503,
  6455. 506,
  6456. 643
  6457. ],
  6458. "uses": [],
  6459. "idx": 644
  6460. },
  6461. {
  6462. "path": "../classic/classic/src/grid/plugin/filterbar/filters/Date.js",
  6463. "requires": [
  6464. 503,
  6465. 544,
  6466. 643
  6467. ],
  6468. "uses": [],
  6469. "idx": 645
  6470. },
  6471. {
  6472. "path": "../classic/classic/src/grid/plugin/filterbar/filters/Number.js",
  6473. "requires": [
  6474. 503,
  6475. 536,
  6476. 538,
  6477. 643
  6478. ],
  6479. "uses": [],
  6480. "idx": 646
  6481. },
  6482. {
  6483. "path": "../classic/classic/src/grid/plugin/filterbar/filters/Boolean.js",
  6484. "requires": [
  6485. 503,
  6486. 541,
  6487. 643
  6488. ],
  6489. "uses": [],
  6490. "idx": 647
  6491. },
  6492. {
  6493. "path": "../classic/classic/src/grid/plugin/filterbar/filters/None.js",
  6494. "requires": [
  6495. 117,
  6496. 433,
  6497. 642
  6498. ],
  6499. "uses": [],
  6500. "idx": 648
  6501. },
  6502. {
  6503. "path": "../classic/classic/src/grid/plugin/filterbar/filters/List.js",
  6504. "requires": [
  6505. 503,
  6506. 541,
  6507. 643
  6508. ],
  6509. "uses": [],
  6510. "idx": 649
  6511. },
  6512. {
  6513. "path": "../classic/classic/src/grid/plugin/filterbar/filters/InList.js",
  6514. "requires": [
  6515. 649
  6516. ],
  6517. "uses": [],
  6518. "idx": 650
  6519. },
  6520. {
  6521. "path": "../classic/classic/src/grid/plugin/filterbar/FilterBar.js",
  6522. "requires": [
  6523. 361,
  6524. 644,
  6525. 645,
  6526. 646,
  6527. 647,
  6528. 648,
  6529. 649,
  6530. 650
  6531. ],
  6532. "uses": [
  6533. 424,
  6534. 433,
  6535. 453
  6536. ],
  6537. "idx": 651
  6538. },
  6539. {
  6540. "path": "../classic/classic/src/grid/property/Grid.js",
  6541. "requires": [
  6542. 577
  6543. ],
  6544. "uses": [
  6545. 21,
  6546. 98,
  6547. 163,
  6548. 425,
  6549. 433,
  6550. 502,
  6551. 503,
  6552. 506,
  6553. 536,
  6554. 538,
  6555. 541,
  6556. 544,
  6557. 564,
  6558. 565,
  6559. 576,
  6560. 629,
  6561. 653,
  6562. 656
  6563. ],
  6564. "idx": 652
  6565. },
  6566. {
  6567. "path": "../classic/classic/src/grid/property/HeaderContainer.js",
  6568. "requires": [
  6569. 94,
  6570. 588
  6571. ],
  6572. "uses": [],
  6573. "idx": 653
  6574. },
  6575. {
  6576. "path": "../classic/classic/src/grid/property/Property.js",
  6577. "requires": [
  6578. 163
  6579. ],
  6580. "uses": [],
  6581. "idx": 654
  6582. },
  6583. {
  6584. "path": "../classic/classic/src/grid/property/Reader.js",
  6585. "requires": [
  6586. 165
  6587. ],
  6588. "uses": [
  6589. 164
  6590. ],
  6591. "idx": 655
  6592. },
  6593. {
  6594. "path": "../classic/classic/src/grid/property/Store.js",
  6595. "requires": [
  6596. 169,
  6597. 182,
  6598. 654,
  6599. 655
  6600. ],
  6601. "uses": [
  6602. 177
  6603. ],
  6604. "idx": 656
  6605. },
  6606. {
  6607. "path": "../classic/classic/src/grid/selection/Selection.js",
  6608. "requires": [],
  6609. "uses": [],
  6610. "idx": 657
  6611. },
  6612. {
  6613. "path": "../classic/classic/src/grid/selection/Cells.js",
  6614. "requires": [
  6615. 657
  6616. ],
  6617. "uses": [
  6618. 564
  6619. ],
  6620. "idx": 658
  6621. },
  6622. {
  6623. "path": "../classic/classic/src/grid/selection/Columns.js",
  6624. "requires": [
  6625. 657
  6626. ],
  6627. "uses": [
  6628. 564
  6629. ],
  6630. "idx": 659
  6631. },
  6632. {
  6633. "path": "../classic/classic/src/grid/selection/Replicator.js",
  6634. "requires": [
  6635. 84
  6636. ],
  6637. "uses": [],
  6638. "idx": 660
  6639. },
  6640. {
  6641. "path": "../classic/classic/src/grid/selection/Rows.js",
  6642. "requires": [
  6643. 132,
  6644. 657
  6645. ],
  6646. "uses": [
  6647. 564
  6648. ],
  6649. "idx": 661
  6650. },
  6651. {
  6652. "path": "../classic/classic/src/grid/selection/SelectionExtender.js",
  6653. "requires": [
  6654. 476
  6655. ],
  6656. "uses": [
  6657. 49,
  6658. 409
  6659. ],
  6660. "idx": 662
  6661. },
  6662. {
  6663. "path": "../classic/classic/src/grid/selection/SpreadsheetModel.js",
  6664. "requires": [
  6665. 527,
  6666. 597,
  6667. 657,
  6668. 658,
  6669. 659,
  6670. 661,
  6671. 662
  6672. ],
  6673. "uses": [
  6674. 409,
  6675. 422,
  6676. 482,
  6677. 564,
  6678. 566,
  6679. 593
  6680. ],
  6681. "idx": 663
  6682. },
  6683. {
  6684. "path": "../classic/classic/src/util/Queue.js",
  6685. "requires": [],
  6686. "uses": [],
  6687. "idx": 664
  6688. },
  6689. {
  6690. "path": "../classic/classic/src/layout/ContextItem.js",
  6691. "requires": [],
  6692. "uses": [
  6693. 56,
  6694. 67,
  6695. 73,
  6696. 419
  6697. ],
  6698. "idx": 665
  6699. },
  6700. {
  6701. "path": "../classic/classic/src/layout/Context.js",
  6702. "requires": [
  6703. 67,
  6704. 73,
  6705. 382,
  6706. 420,
  6707. 664,
  6708. 665
  6709. ],
  6710. "uses": [],
  6711. "idx": 666
  6712. },
  6713. {
  6714. "path": "../classic/classic/src/layout/SizePolicy.js",
  6715. "requires": [],
  6716. "uses": [],
  6717. "idx": 667
  6718. },
  6719. {
  6720. "path": "../classic/classic/src/layout/component/Body.js",
  6721. "requires": [
  6722. 433
  6723. ],
  6724. "uses": [],
  6725. "idx": 668
  6726. },
  6727. {
  6728. "path": "../classic/classic/src/layout/component/FieldSet.js",
  6729. "requires": [
  6730. 668
  6731. ],
  6732. "uses": [],
  6733. "idx": 669
  6734. },
  6735. {
  6736. "path": "../classic/classic/src/layout/container/Absolute.js",
  6737. "requires": [
  6738. 472
  6739. ],
  6740. "uses": [],
  6741. "idx": 670
  6742. },
  6743. {
  6744. "path": "../classic/classic/src/layout/container/Accordion.js",
  6745. "requires": [
  6746. 454
  6747. ],
  6748. "uses": [],
  6749. "idx": 671
  6750. },
  6751. {
  6752. "path": "../classic/classic/src/resizer/BorderSplitter.js",
  6753. "requires": [
  6754. 451
  6755. ],
  6756. "uses": [
  6757. 683
  6758. ],
  6759. "idx": 672
  6760. },
  6761. {
  6762. "path": "../classic/classic/src/layout/container/Border.js",
  6763. "requires": [
  6764. 73,
  6765. 119,
  6766. 421,
  6767. 672
  6768. ],
  6769. "uses": [
  6770. 94,
  6771. 433
  6772. ],
  6773. "idx": 673
  6774. },
  6775. {
  6776. "path": "../classic/classic/src/layout/container/Card.js",
  6777. "requires": [
  6778. 567
  6779. ],
  6780. "uses": [
  6781. 49
  6782. ],
  6783. "idx": 674
  6784. },
  6785. {
  6786. "path": "../classic/classic/src/layout/container/Center.js",
  6787. "requires": [
  6788. 567
  6789. ],
  6790. "uses": [],
  6791. "idx": 675
  6792. },
  6793. {
  6794. "path": "../classic/classic/src/layout/container/Form.js",
  6795. "requires": [
  6796. 422
  6797. ],
  6798. "uses": [],
  6799. "idx": 676
  6800. },
  6801. {
  6802. "path": "../classic/classic/src/menu/Bar.js",
  6803. "requires": [
  6804. 613
  6805. ],
  6806. "uses": [],
  6807. "idx": 677
  6808. },
  6809. {
  6810. "path": "../classic/classic/src/menu/ColorPicker.js",
  6811. "requires": [
  6812. 554,
  6813. 613
  6814. ],
  6815. "uses": [
  6816. 433,
  6817. 438
  6818. ],
  6819. "idx": 678
  6820. },
  6821. {
  6822. "path": "../classic/classic/src/menu/DatePicker.js",
  6823. "requires": [
  6824. 543,
  6825. 613
  6826. ],
  6827. "uses": [
  6828. 433,
  6829. 438
  6830. ],
  6831. "idx": 679
  6832. },
  6833. {
  6834. "path": "../classic/classic/src/panel/Pinnable.js",
  6835. "requires": [
  6836. 0
  6837. ],
  6838. "uses": [
  6839. 433,
  6840. 446
  6841. ],
  6842. "idx": 680
  6843. },
  6844. {
  6845. "path": "../classic/classic/src/plugin/LazyItems.js",
  6846. "requires": [
  6847. 84
  6848. ],
  6849. "uses": [],
  6850. "idx": 681
  6851. },
  6852. {
  6853. "path": "../classic/classic/src/plugin/Responsive.js",
  6854. "requires": [
  6855. 84,
  6856. 118
  6857. ],
  6858. "uses": [],
  6859. "idx": 682
  6860. },
  6861. {
  6862. "path": "../classic/classic/src/resizer/BorderSplitterTracker.js",
  6863. "requires": [
  6864. 34,
  6865. 477
  6866. ],
  6867. "uses": [],
  6868. "idx": 683
  6869. },
  6870. {
  6871. "path": "../classic/classic/src/resizer/Handle.js",
  6872. "requires": [
  6873. 117
  6874. ],
  6875. "uses": [],
  6876. "idx": 684
  6877. },
  6878. {
  6879. "path": "../classic/classic/src/resizer/ResizeTracker.js",
  6880. "requires": [
  6881. 476
  6882. ],
  6883. "uses": [
  6884. 49
  6885. ],
  6886. "idx": 685
  6887. },
  6888. {
  6889. "path": "../classic/classic/src/resizer/Resizer.js",
  6890. "requires": [
  6891. 52
  6892. ],
  6893. "uses": [
  6894. 49,
  6895. 95,
  6896. 117,
  6897. 685
  6898. ],
  6899. "idx": 686
  6900. },
  6901. {
  6902. "path": "../classic/classic/src/selection/CellModel.js",
  6903. "requires": [
  6904. 528,
  6905. 564
  6906. ],
  6907. "uses": [],
  6908. "idx": 687
  6909. },
  6910. {
  6911. "path": "../classic/classic/src/selection/RowModel.js",
  6912. "requires": [
  6913. 528,
  6914. 564
  6915. ],
  6916. "uses": [],
  6917. "idx": 688
  6918. },
  6919. {
  6920. "path": "../classic/classic/src/selection/CheckboxModel.js",
  6921. "requires": [
  6922. 593,
  6923. 688
  6924. ],
  6925. "uses": [
  6926. 422,
  6927. 564,
  6928. 566
  6929. ],
  6930. "idx": 689
  6931. },
  6932. {
  6933. "path": "../classic/classic/src/selection/TreeModel.js",
  6934. "requires": [
  6935. 688
  6936. ],
  6937. "uses": [],
  6938. "idx": 690
  6939. },
  6940. {
  6941. "path": "../classic/classic/src/slider/Thumb.js",
  6942. "requires": [
  6943. 94,
  6944. 476
  6945. ],
  6946. "uses": [
  6947. 73
  6948. ],
  6949. "idx": 691
  6950. },
  6951. {
  6952. "path": "../classic/classic/src/slider/Tip.js",
  6953. "requires": [
  6954. 550
  6955. ],
  6956. "uses": [],
  6957. "idx": 692
  6958. },
  6959. {
  6960. "path": "../classic/classic/src/slider/Multi.js",
  6961. "requires": [
  6962. 94,
  6963. 95,
  6964. 502,
  6965. 691,
  6966. 692
  6967. ],
  6968. "uses": [
  6969. 253
  6970. ],
  6971. "idx": 693
  6972. },
  6973. {
  6974. "path": "../classic/classic/src/slider/Single.js",
  6975. "requires": [
  6976. 693
  6977. ],
  6978. "uses": [],
  6979. "idx": 694
  6980. },
  6981. {
  6982. "path": "../classic/classic/src/slider/Widget.js",
  6983. "requires": [
  6984. 89,
  6985. 693
  6986. ],
  6987. "uses": [
  6988. 73,
  6989. 94
  6990. ],
  6991. "idx": 695
  6992. },
  6993. {
  6994. "path": "../classic/classic/src/state/CookieProvider.js",
  6995. "requires": [
  6996. 114
  6997. ],
  6998. "uses": [],
  6999. "idx": 696
  7000. },
  7001. {
  7002. "path": "../classic/classic/src/state/LocalStorageProvider.js",
  7003. "requires": [
  7004. 114,
  7005. 406
  7006. ],
  7007. "uses": [],
  7008. "idx": 697
  7009. },
  7010. {
  7011. "path": "../classic/classic/src/tab/Tab.js",
  7012. "requires": [
  7013. 439
  7014. ],
  7015. "uses": [],
  7016. "idx": 698
  7017. },
  7018. {
  7019. "path": "../classic/classic/src/tab/Bar.js",
  7020. "requires": [
  7021. 35,
  7022. 444,
  7023. 668,
  7024. 698
  7025. ],
  7026. "uses": [
  7027. 34
  7028. ],
  7029. "idx": 699
  7030. },
  7031. {
  7032. "path": "../classic/classic/src/tab/Panel.js",
  7033. "requires": [
  7034. 466,
  7035. 674,
  7036. 699
  7037. ],
  7038. "uses": [
  7039. 433,
  7040. 698
  7041. ],
  7042. "idx": 700
  7043. },
  7044. {
  7045. "path": "../classic/classic/src/toolbar/Breadcrumb.js",
  7046. "requires": [
  7047. 250,
  7048. 424,
  7049. 440
  7050. ],
  7051. "uses": [
  7052. 24,
  7053. 185
  7054. ],
  7055. "idx": 701
  7056. },
  7057. {
  7058. "path": "../classic/classic/src/toolbar/Fill.js",
  7059. "requires": [
  7060. 117,
  7061. 455
  7062. ],
  7063. "uses": [],
  7064. "idx": 702
  7065. },
  7066. {
  7067. "path": "../classic/classic/src/toolbar/Spacer.js",
  7068. "requires": [
  7069. 117,
  7070. 455
  7071. ],
  7072. "uses": [],
  7073. "idx": 703
  7074. },
  7075. {
  7076. "path": "../classic/classic/src/tree/Column.js",
  7077. "requires": [
  7078. 589
  7079. ],
  7080. "uses": [
  7081. 78
  7082. ],
  7083. "idx": 704
  7084. },
  7085. {
  7086. "path": "../classic/classic/src/tree/NavigationModel.js",
  7087. "requires": [
  7088. 571
  7089. ],
  7090. "uses": [
  7091. 36
  7092. ],
  7093. "idx": 705
  7094. },
  7095. {
  7096. "path": "../classic/classic/src/tree/View.js",
  7097. "requires": [
  7098. 576
  7099. ],
  7100. "uses": [
  7101. 49
  7102. ],
  7103. "idx": 706
  7104. },
  7105. {
  7106. "path": "../classic/classic/src/tree/Panel.js",
  7107. "requires": [
  7108. 250,
  7109. 568,
  7110. 690,
  7111. 704,
  7112. 705,
  7113. 706
  7114. ],
  7115. "uses": [
  7116. 185,
  7117. 422,
  7118. 566
  7119. ],
  7120. "idx": 707
  7121. },
  7122. {
  7123. "path": "../classic/classic/src/view/DragZone.js",
  7124. "requires": [
  7125. 487
  7126. ],
  7127. "uses": [
  7128. 49,
  7129. 95
  7130. ],
  7131. "idx": 708
  7132. },
  7133. {
  7134. "path": "../classic/classic/src/tree/ViewDragZone.js",
  7135. "requires": [
  7136. 708
  7137. ],
  7138. "uses": [
  7139. 95
  7140. ],
  7141. "idx": 709
  7142. },
  7143. {
  7144. "path": "../classic/classic/src/tree/ViewDropZone.js",
  7145. "requires": [
  7146. 582
  7147. ],
  7148. "uses": [],
  7149. "idx": 710
  7150. },
  7151. {
  7152. "path": "../classic/classic/src/tree/plugin/TreeViewDragDrop.js",
  7153. "requires": [
  7154. 84
  7155. ],
  7156. "uses": [
  7157. 709,
  7158. 710
  7159. ],
  7160. "idx": 711
  7161. },
  7162. {
  7163. "path": "../classic/classic/src/view/MultiSelectorSearch.js",
  7164. "requires": [
  7165. 466
  7166. ],
  7167. "uses": [
  7168. 51,
  7169. 185,
  7170. 463,
  7171. 503,
  7172. 506,
  7173. 567,
  7174. 577
  7175. ],
  7176. "idx": 712
  7177. },
  7178. {
  7179. "path": "../classic/classic/src/view/MultiSelector.js",
  7180. "requires": [
  7181. 463,
  7182. 567,
  7183. 577,
  7184. 712
  7185. ],
  7186. "uses": [],
  7187. "idx": 713
  7188. },
  7189. {
  7190. "path": "../classic/classic/src/window/Toast.js",
  7191. "requires": [
  7192. 499
  7193. ],
  7194. "uses": [
  7195. 1
  7196. ],
  7197. "idx": 714
  7198. }
  7199. ],
  7200. "classes": {
  7201. "Ext.AbstractManager": {
  7202. "idx": 6,
  7203. "alias": [],
  7204. "alternates": []
  7205. },
  7206. "Ext.Action": {
  7207. "idx": 416,
  7208. "alias": [],
  7209. "alternates": []
  7210. },
  7211. "Ext.Ajax": {
  7212. "idx": 18,
  7213. "alias": [],
  7214. "alternates": []
  7215. },
  7216. "Ext.AnimationQueue": {
  7217. "idx": 19,
  7218. "alias": [],
  7219. "alternates": []
  7220. },
  7221. "Ext.Component": {
  7222. "idx": 117,
  7223. "alias": [
  7224. "widget.box",
  7225. "widget.component"
  7226. ],
  7227. "alternates": [
  7228. "Ext.AbstractComponent"
  7229. ]
  7230. },
  7231. "Ext.ComponentLoader": {
  7232. "idx": 418,
  7233. "alias": [],
  7234. "alternates": []
  7235. },
  7236. "Ext.ComponentManager": {
  7237. "idx": 21,
  7238. "alias": [],
  7239. "alternates": [
  7240. "Ext.ComponentMgr"
  7241. ]
  7242. },
  7243. "Ext.ComponentQuery": {
  7244. "idx": 24,
  7245. "alias": [],
  7246. "alternates": []
  7247. },
  7248. "Ext.Deferred": {
  7249. "idx": 11,
  7250. "alias": [],
  7251. "alternates": []
  7252. },
  7253. "Ext.Editor": {
  7254. "idx": 426,
  7255. "alias": [
  7256. "widget.editor"
  7257. ],
  7258. "alternates": []
  7259. },
  7260. "Ext.ElementLoader": {
  7261. "idx": 417,
  7262. "alias": [],
  7263. "alternates": []
  7264. },
  7265. "Ext.EventManager": {
  7266. "idx": 427,
  7267. "alias": [],
  7268. "alternates": []
  7269. },
  7270. "Ext.Evented": {
  7271. "idx": 25,
  7272. "alias": [],
  7273. "alternates": [
  7274. "Ext.EventedBase"
  7275. ]
  7276. },
  7277. "Ext.GlobalEvents": {
  7278. "idx": 77,
  7279. "alias": [],
  7280. "alternates": [
  7281. "Ext.globalEvents"
  7282. ]
  7283. },
  7284. "Ext.Glyph": {
  7285. "idx": 78,
  7286. "alias": [],
  7287. "alternates": []
  7288. },
  7289. "Ext.Img": {
  7290. "idx": 429,
  7291. "alias": [
  7292. "widget.image",
  7293. "widget.imagecomponent"
  7294. ],
  7295. "alternates": []
  7296. },
  7297. "Ext.LoadMask": {
  7298. "idx": 431,
  7299. "alias": [
  7300. "widget.loadmask"
  7301. ],
  7302. "alternates": []
  7303. },
  7304. "Ext.Mixin": {
  7305. "idx": 0,
  7306. "alias": [],
  7307. "alternates": []
  7308. },
  7309. "Ext.Progress": {
  7310. "idx": 93,
  7311. "alias": [
  7312. "widget.progress",
  7313. "widget.progressbarwidget"
  7314. ],
  7315. "alternates": [
  7316. "Ext.ProgressBarWidget"
  7317. ]
  7318. },
  7319. "Ext.ProgressBar": {
  7320. "idx": 435,
  7321. "alias": [
  7322. "widget.progressbar"
  7323. ],
  7324. "alternates": []
  7325. },
  7326. "Ext.ProgressBase": {
  7327. "idx": 92,
  7328. "alias": [],
  7329. "alternates": []
  7330. },
  7331. "Ext.Promise": {
  7332. "idx": 10,
  7333. "alias": [],
  7334. "alternates": []
  7335. },
  7336. "Ext.Responsive": {
  7337. "idx": 118,
  7338. "alias": [],
  7339. "alternates": []
  7340. },
  7341. "Ext.ResponsiveWidget": {
  7342. "idx": 91,
  7343. "alias": [],
  7344. "alternates": []
  7345. },
  7346. "Ext.TaskQueue": {
  7347. "idx": 40,
  7348. "alias": [],
  7349. "alternates": []
  7350. },
  7351. "Ext.Template": {
  7352. "idx": 95,
  7353. "alias": [],
  7354. "alternates": []
  7355. },
  7356. "Ext.Widget": {
  7357. "idx": 89,
  7358. "alias": [
  7359. "widget.widget"
  7360. ],
  7361. "alternates": [
  7362. "Ext.Gadget"
  7363. ]
  7364. },
  7365. "Ext.XTemplate": {
  7366. "idx": 98,
  7367. "alias": [],
  7368. "alternates": []
  7369. },
  7370. "Ext.ZIndexManager": {
  7371. "idx": 423,
  7372. "alias": [],
  7373. "alternates": [
  7374. "Ext.WindowGroup"
  7375. ]
  7376. },
  7377. "Ext.app.Application": {
  7378. "idx": 188,
  7379. "alias": [],
  7380. "alternates": []
  7381. },
  7382. "Ext.app.BaseController": {
  7383. "idx": 128,
  7384. "alias": [],
  7385. "alternates": []
  7386. },
  7387. "Ext.app.Controller": {
  7388. "idx": 187,
  7389. "alias": [],
  7390. "alternates": []
  7391. },
  7392. "Ext.app.EventBus": {
  7393. "idx": 120,
  7394. "alias": [],
  7395. "alternates": []
  7396. },
  7397. "Ext.app.EventDomain": {
  7398. "idx": 99,
  7399. "alias": [],
  7400. "alternates": []
  7401. },
  7402. "Ext.app.Profile": {
  7403. "idx": 189,
  7404. "alias": [],
  7405. "alternates": []
  7406. },
  7407. "Ext.app.Util": {
  7408. "idx": 129,
  7409. "alias": [],
  7410. "alternates": []
  7411. },
  7412. "Ext.app.ViewController": {
  7413. "idx": 191,
  7414. "alias": [
  7415. "controller.controller"
  7416. ],
  7417. "alternates": []
  7418. },
  7419. "Ext.app.ViewModel": {
  7420. "idx": 225,
  7421. "alias": [
  7422. "viewmodel.default"
  7423. ],
  7424. "alternates": []
  7425. },
  7426. "Ext.app.bind.AbstractStub": {
  7427. "idx": 206,
  7428. "alias": [],
  7429. "alternates": []
  7430. },
  7431. "Ext.app.bind.BaseBinding": {
  7432. "idx": 204,
  7433. "alias": [],
  7434. "alternates": []
  7435. },
  7436. "Ext.app.bind.Binding": {
  7437. "idx": 205,
  7438. "alias": [],
  7439. "alternates": []
  7440. },
  7441. "Ext.app.bind.Formula": {
  7442. "idx": 211,
  7443. "alias": [],
  7444. "alternates": []
  7445. },
  7446. "Ext.app.bind.LinkStub": {
  7447. "idx": 208,
  7448. "alias": [],
  7449. "alternates": []
  7450. },
  7451. "Ext.app.bind.Multi": {
  7452. "idx": 210,
  7453. "alias": [],
  7454. "alternates": []
  7455. },
  7456. "Ext.app.bind.Parser": {
  7457. "idx": 221,
  7458. "alias": [],
  7459. "alternates": []
  7460. },
  7461. "Ext.app.bind.RootStub": {
  7462. "idx": 209,
  7463. "alias": [],
  7464. "alternates": []
  7465. },
  7466. "Ext.app.bind.Stub": {
  7467. "idx": 207,
  7468. "alias": [],
  7469. "alternates": []
  7470. },
  7471. "Ext.app.bind.Template": {
  7472. "idx": 222,
  7473. "alias": [],
  7474. "alternates": []
  7475. },
  7476. "Ext.app.bind.TemplateBinding": {
  7477. "idx": 223,
  7478. "alias": [],
  7479. "alternates": []
  7480. },
  7481. "Ext.app.domain.Component": {
  7482. "idx": 100,
  7483. "alias": [],
  7484. "alternates": []
  7485. },
  7486. "Ext.app.domain.Controller": {
  7487. "idx": 226,
  7488. "alias": [],
  7489. "alternates": []
  7490. },
  7491. "Ext.app.domain.Direct": {
  7492. "idx": 229,
  7493. "alias": [],
  7494. "alternates": []
  7495. },
  7496. "Ext.app.domain.Global": {
  7497. "idx": 121,
  7498. "alias": [],
  7499. "alternates": []
  7500. },
  7501. "Ext.app.domain.Store": {
  7502. "idx": 186,
  7503. "alias": [],
  7504. "alternates": []
  7505. },
  7506. "Ext.app.domain.View": {
  7507. "idx": 190,
  7508. "alias": [],
  7509. "alternates": []
  7510. },
  7511. "Ext.button.Button": {
  7512. "idx": 439,
  7513. "alias": [
  7514. "widget.button"
  7515. ],
  7516. "alternates": [
  7517. "Ext.Button"
  7518. ]
  7519. },
  7520. "Ext.button.Cycle": {
  7521. "idx": 441,
  7522. "alias": [
  7523. "widget.cycle"
  7524. ],
  7525. "alternates": [
  7526. "Ext.CycleButton"
  7527. ]
  7528. },
  7529. "Ext.button.Manager": {
  7530. "idx": 437,
  7531. "alias": [],
  7532. "alternates": [
  7533. "Ext.ButtonToggleManager"
  7534. ]
  7535. },
  7536. "Ext.button.Segmented": {
  7537. "idx": 443,
  7538. "alias": [
  7539. "widget.segmentedbutton"
  7540. ],
  7541. "alternates": []
  7542. },
  7543. "Ext.button.Split": {
  7544. "idx": 440,
  7545. "alias": [
  7546. "widget.splitbutton"
  7547. ],
  7548. "alternates": [
  7549. "Ext.SplitButton"
  7550. ]
  7551. },
  7552. "Ext.container.ButtonGroup": {
  7553. "idx": 468,
  7554. "alias": [
  7555. "widget.buttongroup"
  7556. ],
  7557. "alternates": [
  7558. "Ext.ButtonGroup"
  7559. ]
  7560. },
  7561. "Ext.container.Container": {
  7562. "idx": 424,
  7563. "alias": [
  7564. "widget.container"
  7565. ],
  7566. "alternates": [
  7567. "Ext.Container",
  7568. "Ext.AbstractContainer"
  7569. ]
  7570. },
  7571. "Ext.container.DockingContainer": {
  7572. "idx": 465,
  7573. "alias": [],
  7574. "alternates": []
  7575. },
  7576. "Ext.container.Monitor": {
  7577. "idx": 469,
  7578. "alias": [],
  7579. "alternates": []
  7580. },
  7581. "Ext.container.Viewport": {
  7582. "idx": 471,
  7583. "alias": [
  7584. "widget.viewport"
  7585. ],
  7586. "alternates": [
  7587. "Ext.Viewport"
  7588. ]
  7589. },
  7590. "Ext.dashboard.Column": {
  7591. "idx": 474,
  7592. "alias": [
  7593. "widget.dashboard-column"
  7594. ],
  7595. "alternates": []
  7596. },
  7597. "Ext.dashboard.Dashboard": {
  7598. "idx": 486,
  7599. "alias": [
  7600. "widget.dashboard"
  7601. ],
  7602. "alternates": []
  7603. },
  7604. "Ext.dashboard.DropZone": {
  7605. "idx": 484,
  7606. "alias": [],
  7607. "alternates": []
  7608. },
  7609. "Ext.dashboard.Panel": {
  7610. "idx": 473,
  7611. "alias": [
  7612. "widget.dashboard-panel"
  7613. ],
  7614. "alternates": []
  7615. },
  7616. "Ext.dashboard.Part": {
  7617. "idx": 485,
  7618. "alias": [
  7619. "part.part"
  7620. ],
  7621. "alternates": []
  7622. },
  7623. "Ext.data.AbstractStore": {
  7624. "idx": 143,
  7625. "alias": [],
  7626. "alternates": []
  7627. },
  7628. "Ext.data.ArrayStore": {
  7629. "idx": 184,
  7630. "alias": [
  7631. "store.array"
  7632. ],
  7633. "alternates": [
  7634. "Ext.data.SimpleStore"
  7635. ]
  7636. },
  7637. "Ext.data.Batch": {
  7638. "idx": 194,
  7639. "alias": [],
  7640. "alternates": []
  7641. },
  7642. "Ext.data.BufferedStore": {
  7643. "idx": 231,
  7644. "alias": [
  7645. "store.buffered"
  7646. ],
  7647. "alternates": []
  7648. },
  7649. "Ext.data.ChainedStore": {
  7650. "idx": 224,
  7651. "alias": [
  7652. "store.chained"
  7653. ],
  7654. "alternates": []
  7655. },
  7656. "Ext.data.ClientStore": {
  7657. "idx": 232,
  7658. "alias": [
  7659. "store.clientstorage"
  7660. ],
  7661. "alternates": []
  7662. },
  7663. "Ext.data.Connection": {
  7664. "idx": 17,
  7665. "alias": [],
  7666. "alternates": []
  7667. },
  7668. "Ext.data.DirectStore": {
  7669. "idx": 234,
  7670. "alias": [
  7671. "store.direct"
  7672. ],
  7673. "alternates": []
  7674. },
  7675. "Ext.data.Error": {
  7676. "idx": 144,
  7677. "alias": [],
  7678. "alternates": []
  7679. },
  7680. "Ext.data.ErrorCollection": {
  7681. "idx": 145,
  7682. "alias": [],
  7683. "alternates": [
  7684. "Ext.data.Errors"
  7685. ]
  7686. },
  7687. "Ext.data.Group": {
  7688. "idx": 172,
  7689. "alias": [],
  7690. "alternates": []
  7691. },
  7692. "Ext.data.JsonP": {
  7693. "idx": 235,
  7694. "alias": [],
  7695. "alternates": []
  7696. },
  7697. "Ext.data.JsonPStore": {
  7698. "idx": 237,
  7699. "alias": [
  7700. "store.jsonp"
  7701. ],
  7702. "alternates": []
  7703. },
  7704. "Ext.data.JsonStore": {
  7705. "idx": 238,
  7706. "alias": [
  7707. "store.json"
  7708. ],
  7709. "alternates": []
  7710. },
  7711. "Ext.data.LocalStore": {
  7712. "idx": 173,
  7713. "alias": [],
  7714. "alternates": []
  7715. },
  7716. "Ext.data.Model": {
  7717. "idx": 163,
  7718. "alias": [],
  7719. "alternates": [
  7720. "Ext.data.Record"
  7721. ]
  7722. },
  7723. "Ext.data.ModelManager": {
  7724. "idx": 239,
  7725. "alias": [],
  7726. "alternates": [
  7727. "Ext.ModelMgr"
  7728. ]
  7729. },
  7730. "Ext.data.NodeInterface": {
  7731. "idx": 240,
  7732. "alias": [],
  7733. "alternates": []
  7734. },
  7735. "Ext.data.NodeStore": {
  7736. "idx": 243,
  7737. "alias": [
  7738. "store.node"
  7739. ],
  7740. "alternates": []
  7741. },
  7742. "Ext.data.PageMap": {
  7743. "idx": 230,
  7744. "alias": [],
  7745. "alternates": []
  7746. },
  7747. "Ext.data.ProxyStore": {
  7748. "idx": 170,
  7749. "alias": [],
  7750. "alternates": []
  7751. },
  7752. "Ext.data.Query": {
  7753. "idx": 248,
  7754. "alias": [
  7755. "query.default"
  7756. ],
  7757. "alternates": []
  7758. },
  7759. "Ext.data.Range": {
  7760. "idx": 133,
  7761. "alias": [],
  7762. "alternates": []
  7763. },
  7764. "Ext.data.Request": {
  7765. "idx": 249,
  7766. "alias": [],
  7767. "alternates": []
  7768. },
  7769. "Ext.data.ResultSet": {
  7770. "idx": 164,
  7771. "alias": [],
  7772. "alternates": []
  7773. },
  7774. "Ext.data.Session": {
  7775. "idx": 202,
  7776. "alias": [],
  7777. "alternates": []
  7778. },
  7779. "Ext.data.SortTypes": {
  7780. "idx": 151,
  7781. "alias": [],
  7782. "alternates": []
  7783. },
  7784. "Ext.data.Store": {
  7785. "idx": 182,
  7786. "alias": [
  7787. "store.store"
  7788. ],
  7789. "alternates": []
  7790. },
  7791. "Ext.data.StoreManager": {
  7792. "idx": 185,
  7793. "alias": [],
  7794. "alternates": [
  7795. "Ext.StoreMgr",
  7796. "Ext.data.StoreMgr",
  7797. "Ext.StoreManager"
  7798. ]
  7799. },
  7800. "Ext.data.TreeModel": {
  7801. "idx": 242,
  7802. "alias": [],
  7803. "alternates": []
  7804. },
  7805. "Ext.data.TreeStore": {
  7806. "idx": 250,
  7807. "alias": [
  7808. "store.tree"
  7809. ],
  7810. "alternates": []
  7811. },
  7812. "Ext.data.Types": {
  7813. "idx": 251,
  7814. "alias": [],
  7815. "alternates": []
  7816. },
  7817. "Ext.data.Validation": {
  7818. "idx": 252,
  7819. "alias": [],
  7820. "alternates": []
  7821. },
  7822. "Ext.data.XmlStore": {
  7823. "idx": 257,
  7824. "alias": [
  7825. "store.xml"
  7826. ],
  7827. "alternates": []
  7828. },
  7829. "Ext.data.field.Array": {
  7830. "idx": 155,
  7831. "alias": [
  7832. "data.field.array"
  7833. ],
  7834. "alternates": []
  7835. },
  7836. "Ext.data.field.Boolean": {
  7837. "idx": 156,
  7838. "alias": [
  7839. "data.field.bool",
  7840. "data.field.boolean"
  7841. ],
  7842. "alternates": []
  7843. },
  7844. "Ext.data.field.Date": {
  7845. "idx": 157,
  7846. "alias": [
  7847. "data.field.date"
  7848. ],
  7849. "alternates": []
  7850. },
  7851. "Ext.data.field.Field": {
  7852. "idx": 154,
  7853. "alias": [
  7854. "data.field.auto"
  7855. ],
  7856. "alternates": [
  7857. "Ext.data.Field"
  7858. ]
  7859. },
  7860. "Ext.data.field.Integer": {
  7861. "idx": 158,
  7862. "alias": [
  7863. "data.field.int",
  7864. "data.field.integer"
  7865. ],
  7866. "alternates": []
  7867. },
  7868. "Ext.data.field.Number": {
  7869. "idx": 159,
  7870. "alias": [
  7871. "data.field.float",
  7872. "data.field.number"
  7873. ],
  7874. "alternates": []
  7875. },
  7876. "Ext.data.field.String": {
  7877. "idx": 160,
  7878. "alias": [
  7879. "data.field.string"
  7880. ],
  7881. "alternates": []
  7882. },
  7883. "Ext.data.flash.BinaryXhr": {
  7884. "idx": 14,
  7885. "alias": [],
  7886. "alternates": []
  7887. },
  7888. "Ext.data.identifier.Generator": {
  7889. "idx": 161,
  7890. "alias": [
  7891. "data.identifier.default"
  7892. ],
  7893. "alternates": []
  7894. },
  7895. "Ext.data.identifier.Negative": {
  7896. "idx": 258,
  7897. "alias": [
  7898. "data.identifier.negative"
  7899. ],
  7900. "alternates": []
  7901. },
  7902. "Ext.data.identifier.Sequential": {
  7903. "idx": 162,
  7904. "alias": [
  7905. "data.identifier.sequential"
  7906. ],
  7907. "alternates": []
  7908. },
  7909. "Ext.data.identifier.Uuid": {
  7910. "idx": 259,
  7911. "alias": [
  7912. "data.identifier.uuid"
  7913. ],
  7914. "alternates": []
  7915. },
  7916. "Ext.data.matrix.Matrix": {
  7917. "idx": 197,
  7918. "alias": [],
  7919. "alternates": []
  7920. },
  7921. "Ext.data.matrix.Side": {
  7922. "idx": 196,
  7923. "alias": [],
  7924. "alternates": []
  7925. },
  7926. "Ext.data.matrix.Slice": {
  7927. "idx": 195,
  7928. "alias": [],
  7929. "alternates": []
  7930. },
  7931. "Ext.data.operation.Create": {
  7932. "idx": 147,
  7933. "alias": [
  7934. "data.operation.create"
  7935. ],
  7936. "alternates": []
  7937. },
  7938. "Ext.data.operation.Destroy": {
  7939. "idx": 148,
  7940. "alias": [
  7941. "data.operation.destroy"
  7942. ],
  7943. "alternates": []
  7944. },
  7945. "Ext.data.operation.Operation": {
  7946. "idx": 146,
  7947. "alias": [],
  7948. "alternates": [
  7949. "Ext.data.Operation"
  7950. ]
  7951. },
  7952. "Ext.data.operation.Read": {
  7953. "idx": 149,
  7954. "alias": [
  7955. "data.operation.read"
  7956. ],
  7957. "alternates": []
  7958. },
  7959. "Ext.data.operation.Update": {
  7960. "idx": 150,
  7961. "alias": [
  7962. "data.operation.update"
  7963. ],
  7964. "alternates": []
  7965. },
  7966. "Ext.data.proxy.Ajax": {
  7967. "idx": 175,
  7968. "alias": [
  7969. "proxy.ajax"
  7970. ],
  7971. "alternates": [
  7972. "Ext.data.HttpProxy",
  7973. "Ext.data.AjaxProxy"
  7974. ]
  7975. },
  7976. "Ext.data.proxy.Client": {
  7977. "idx": 168,
  7978. "alias": [],
  7979. "alternates": [
  7980. "Ext.data.ClientProxy"
  7981. ]
  7982. },
  7983. "Ext.data.proxy.Direct": {
  7984. "idx": 233,
  7985. "alias": [
  7986. "proxy.direct"
  7987. ],
  7988. "alternates": [
  7989. "Ext.data.DirectProxy"
  7990. ]
  7991. },
  7992. "Ext.data.proxy.JsonP": {
  7993. "idx": 236,
  7994. "alias": [
  7995. "proxy.jsonp",
  7996. "proxy.scripttag"
  7997. ],
  7998. "alternates": [
  7999. "Ext.data.ScriptTagProxy"
  8000. ]
  8001. },
  8002. "Ext.data.proxy.LocalStorage": {
  8003. "idx": 261,
  8004. "alias": [
  8005. "proxy.localstorage"
  8006. ],
  8007. "alternates": [
  8008. "Ext.data.LocalStorageProxy"
  8009. ]
  8010. },
  8011. "Ext.data.proxy.Memory": {
  8012. "idx": 169,
  8013. "alias": [
  8014. "proxy.memory"
  8015. ],
  8016. "alternates": [
  8017. "Ext.data.MemoryProxy"
  8018. ]
  8019. },
  8020. "Ext.data.proxy.Proxy": {
  8021. "idx": 167,
  8022. "alias": [
  8023. "proxy.proxy"
  8024. ],
  8025. "alternates": [
  8026. "Ext.data.DataProxy",
  8027. "Ext.data.Proxy"
  8028. ]
  8029. },
  8030. "Ext.data.proxy.Rest": {
  8031. "idx": 262,
  8032. "alias": [
  8033. "proxy.rest"
  8034. ],
  8035. "alternates": [
  8036. "Ext.data.RestProxy"
  8037. ]
  8038. },
  8039. "Ext.data.proxy.Server": {
  8040. "idx": 174,
  8041. "alias": [
  8042. "proxy.server"
  8043. ],
  8044. "alternates": [
  8045. "Ext.data.ServerProxy"
  8046. ]
  8047. },
  8048. "Ext.data.proxy.SessionStorage": {
  8049. "idx": 263,
  8050. "alias": [
  8051. "proxy.sessionstorage"
  8052. ],
  8053. "alternates": [
  8054. "Ext.data.SessionStorageProxy"
  8055. ]
  8056. },
  8057. "Ext.data.proxy.WebStorage": {
  8058. "idx": 260,
  8059. "alias": [],
  8060. "alternates": [
  8061. "Ext.data.WebStorageProxy"
  8062. ]
  8063. },
  8064. "Ext.data.query.Compiler": {
  8065. "idx": 244,
  8066. "alias": [],
  8067. "alternates": []
  8068. },
  8069. "Ext.data.query.Converter": {
  8070. "idx": 245,
  8071. "alias": [],
  8072. "alternates": []
  8073. },
  8074. "Ext.data.query.Parser": {
  8075. "idx": 247,
  8076. "alias": [],
  8077. "alternates": []
  8078. },
  8079. "Ext.data.query.Stringifier": {
  8080. "idx": 246,
  8081. "alias": [],
  8082. "alternates": []
  8083. },
  8084. "Ext.data.reader.Array": {
  8085. "idx": 183,
  8086. "alias": [
  8087. "reader.array"
  8088. ],
  8089. "alternates": [
  8090. "Ext.data.ArrayReader"
  8091. ]
  8092. },
  8093. "Ext.data.reader.Json": {
  8094. "idx": 176,
  8095. "alias": [
  8096. "reader.json"
  8097. ],
  8098. "alternates": [
  8099. "Ext.data.JsonReader"
  8100. ]
  8101. },
  8102. "Ext.data.reader.Reader": {
  8103. "idx": 165,
  8104. "alias": [
  8105. "reader.base"
  8106. ],
  8107. "alternates": [
  8108. "Ext.data.Reader",
  8109. "Ext.data.DataReader"
  8110. ]
  8111. },
  8112. "Ext.data.reader.Xml": {
  8113. "idx": 255,
  8114. "alias": [
  8115. "reader.xml"
  8116. ],
  8117. "alternates": [
  8118. "Ext.data.XmlReader"
  8119. ]
  8120. },
  8121. "Ext.data.request.Ajax": {
  8122. "idx": 15,
  8123. "alias": [
  8124. "request.ajax"
  8125. ],
  8126. "alternates": []
  8127. },
  8128. "Ext.data.request.Base": {
  8129. "idx": 13,
  8130. "alias": [],
  8131. "alternates": []
  8132. },
  8133. "Ext.data.request.Form": {
  8134. "idx": 16,
  8135. "alias": [
  8136. "request.form"
  8137. ],
  8138. "alternates": []
  8139. },
  8140. "Ext.data.schema.Association": {
  8141. "idx": 136,
  8142. "alias": [],
  8143. "alternates": []
  8144. },
  8145. "Ext.data.schema.ManyToMany": {
  8146. "idx": 139,
  8147. "alias": [],
  8148. "alternates": []
  8149. },
  8150. "Ext.data.schema.ManyToOne": {
  8151. "idx": 138,
  8152. "alias": [],
  8153. "alternates": []
  8154. },
  8155. "Ext.data.schema.Namer": {
  8156. "idx": 141,
  8157. "alias": [
  8158. "namer.default"
  8159. ],
  8160. "alternates": []
  8161. },
  8162. "Ext.data.schema.OneToOne": {
  8163. "idx": 137,
  8164. "alias": [],
  8165. "alternates": []
  8166. },
  8167. "Ext.data.schema.Role": {
  8168. "idx": 135,
  8169. "alias": [],
  8170. "alternates": []
  8171. },
  8172. "Ext.data.schema.Schema": {
  8173. "idx": 142,
  8174. "alias": [
  8175. "schema.default"
  8176. ],
  8177. "alternates": []
  8178. },
  8179. "Ext.data.session.BatchVisitor": {
  8180. "idx": 200,
  8181. "alias": [],
  8182. "alternates": []
  8183. },
  8184. "Ext.data.session.ChangesVisitor": {
  8185. "idx": 198,
  8186. "alias": [],
  8187. "alternates": []
  8188. },
  8189. "Ext.data.session.ChildChangesVisitor": {
  8190. "idx": 199,
  8191. "alias": [],
  8192. "alternates": []
  8193. },
  8194. "Ext.data.summary.Average": {
  8195. "idx": 269,
  8196. "alias": [
  8197. "data.summary.average"
  8198. ],
  8199. "alternates": []
  8200. },
  8201. "Ext.data.summary.Base": {
  8202. "idx": 153,
  8203. "alias": [
  8204. "data.summary.base"
  8205. ],
  8206. "alternates": []
  8207. },
  8208. "Ext.data.summary.Count": {
  8209. "idx": 270,
  8210. "alias": [
  8211. "data.summary.count"
  8212. ],
  8213. "alternates": []
  8214. },
  8215. "Ext.data.summary.Max": {
  8216. "idx": 271,
  8217. "alias": [
  8218. "data.summary.max"
  8219. ],
  8220. "alternates": []
  8221. },
  8222. "Ext.data.summary.Min": {
  8223. "idx": 272,
  8224. "alias": [
  8225. "data.summary.min"
  8226. ],
  8227. "alternates": []
  8228. },
  8229. "Ext.data.summary.None": {
  8230. "idx": 273,
  8231. "alias": [
  8232. "data.summary.none"
  8233. ],
  8234. "alternates": []
  8235. },
  8236. "Ext.data.summary.StdDev": {
  8237. "idx": 275,
  8238. "alias": [
  8239. "data.summary.stddev"
  8240. ],
  8241. "alternates": []
  8242. },
  8243. "Ext.data.summary.StdDevP": {
  8244. "idx": 277,
  8245. "alias": [
  8246. "data.summary.stddevp"
  8247. ],
  8248. "alternates": []
  8249. },
  8250. "Ext.data.summary.Sum": {
  8251. "idx": 268,
  8252. "alias": [
  8253. "data.summary.sum"
  8254. ],
  8255. "alternates": []
  8256. },
  8257. "Ext.data.summary.Variance": {
  8258. "idx": 274,
  8259. "alias": [
  8260. "data.summary.variance"
  8261. ],
  8262. "alternates": []
  8263. },
  8264. "Ext.data.summary.VarianceP": {
  8265. "idx": 276,
  8266. "alias": [
  8267. "data.summary.variancep"
  8268. ],
  8269. "alternates": []
  8270. },
  8271. "Ext.data.validator.AbstractDate": {
  8272. "idx": 278,
  8273. "alias": [],
  8274. "alternates": []
  8275. },
  8276. "Ext.data.validator.Bound": {
  8277. "idx": 279,
  8278. "alias": [
  8279. "data.validator.bound"
  8280. ],
  8281. "alternates": []
  8282. },
  8283. "Ext.data.validator.CIDRv4": {
  8284. "idx": 281,
  8285. "alias": [
  8286. "data.validator.cidrv4"
  8287. ],
  8288. "alternates": []
  8289. },
  8290. "Ext.data.validator.CIDRv6": {
  8291. "idx": 282,
  8292. "alias": [
  8293. "data.validator.cidrv6"
  8294. ],
  8295. "alternates": []
  8296. },
  8297. "Ext.data.validator.Currency": {
  8298. "idx": 284,
  8299. "alias": [
  8300. "data.validator.currency"
  8301. ],
  8302. "alternates": []
  8303. },
  8304. "Ext.data.validator.CurrencyUS": {
  8305. "idx": 285,
  8306. "alias": [
  8307. "data.validator.currency-us"
  8308. ],
  8309. "alternates": []
  8310. },
  8311. "Ext.data.validator.Date": {
  8312. "idx": 286,
  8313. "alias": [
  8314. "data.validator.date"
  8315. ],
  8316. "alternates": []
  8317. },
  8318. "Ext.data.validator.DateTime": {
  8319. "idx": 287,
  8320. "alias": [
  8321. "data.validator.datetime"
  8322. ],
  8323. "alternates": []
  8324. },
  8325. "Ext.data.validator.Email": {
  8326. "idx": 288,
  8327. "alias": [
  8328. "data.validator.email"
  8329. ],
  8330. "alternates": []
  8331. },
  8332. "Ext.data.validator.Exclusion": {
  8333. "idx": 290,
  8334. "alias": [
  8335. "data.validator.exclusion"
  8336. ],
  8337. "alternates": []
  8338. },
  8339. "Ext.data.validator.Format": {
  8340. "idx": 280,
  8341. "alias": [
  8342. "data.validator.format"
  8343. ],
  8344. "alternates": []
  8345. },
  8346. "Ext.data.validator.IPAddress": {
  8347. "idx": 291,
  8348. "alias": [
  8349. "data.validator.ipaddress"
  8350. ],
  8351. "alternates": []
  8352. },
  8353. "Ext.data.validator.Inclusion": {
  8354. "idx": 292,
  8355. "alias": [
  8356. "data.validator.inclusion"
  8357. ],
  8358. "alternates": []
  8359. },
  8360. "Ext.data.validator.Length": {
  8361. "idx": 293,
  8362. "alias": [
  8363. "data.validator.length"
  8364. ],
  8365. "alternates": []
  8366. },
  8367. "Ext.data.validator.List": {
  8368. "idx": 289,
  8369. "alias": [
  8370. "data.validator.list"
  8371. ],
  8372. "alternates": []
  8373. },
  8374. "Ext.data.validator.NotNull": {
  8375. "idx": 295,
  8376. "alias": [
  8377. "data.validator.notnull"
  8378. ],
  8379. "alternates": []
  8380. },
  8381. "Ext.data.validator.Number": {
  8382. "idx": 283,
  8383. "alias": [
  8384. "data.validator.number"
  8385. ],
  8386. "alternates": []
  8387. },
  8388. "Ext.data.validator.Phone": {
  8389. "idx": 296,
  8390. "alias": [
  8391. "data.validator.phone"
  8392. ],
  8393. "alternates": []
  8394. },
  8395. "Ext.data.validator.Presence": {
  8396. "idx": 294,
  8397. "alias": [
  8398. "data.validator.presence"
  8399. ],
  8400. "alternates": []
  8401. },
  8402. "Ext.data.validator.Range": {
  8403. "idx": 297,
  8404. "alias": [
  8405. "data.validator.range"
  8406. ],
  8407. "alternates": []
  8408. },
  8409. "Ext.data.validator.Time": {
  8410. "idx": 298,
  8411. "alias": [
  8412. "data.validator.time"
  8413. ],
  8414. "alternates": []
  8415. },
  8416. "Ext.data.validator.Url": {
  8417. "idx": 299,
  8418. "alias": [
  8419. "data.validator.url"
  8420. ],
  8421. "alternates": []
  8422. },
  8423. "Ext.data.validator.Validator": {
  8424. "idx": 152,
  8425. "alias": [
  8426. "data.validator.base"
  8427. ],
  8428. "alternates": []
  8429. },
  8430. "Ext.data.virtual.Group": {
  8431. "idx": 300,
  8432. "alias": [],
  8433. "alternates": []
  8434. },
  8435. "Ext.data.virtual.Page": {
  8436. "idx": 301,
  8437. "alias": [],
  8438. "alternates": []
  8439. },
  8440. "Ext.data.virtual.PageMap": {
  8441. "idx": 302,
  8442. "alias": [],
  8443. "alternates": []
  8444. },
  8445. "Ext.data.virtual.Range": {
  8446. "idx": 303,
  8447. "alias": [],
  8448. "alternates": []
  8449. },
  8450. "Ext.data.virtual.Store": {
  8451. "idx": 304,
  8452. "alias": [
  8453. "store.virtual"
  8454. ],
  8455. "alternates": []
  8456. },
  8457. "Ext.data.writer.Json": {
  8458. "idx": 177,
  8459. "alias": [
  8460. "writer.json"
  8461. ],
  8462. "alternates": [
  8463. "Ext.data.JsonWriter"
  8464. ]
  8465. },
  8466. "Ext.data.writer.Writer": {
  8467. "idx": 166,
  8468. "alias": [
  8469. "writer.base"
  8470. ],
  8471. "alternates": [
  8472. "Ext.data.DataWriter",
  8473. "Ext.data.Writer"
  8474. ]
  8475. },
  8476. "Ext.data.writer.Xml": {
  8477. "idx": 256,
  8478. "alias": [
  8479. "writer.xml"
  8480. ],
  8481. "alternates": [
  8482. "Ext.data.XmlWriter"
  8483. ]
  8484. },
  8485. "Ext.dd.DD": {
  8486. "idx": 457,
  8487. "alias": [],
  8488. "alternates": []
  8489. },
  8490. "Ext.dd.DDProxy": {
  8491. "idx": 458,
  8492. "alias": [],
  8493. "alternates": []
  8494. },
  8495. "Ext.dd.DDTarget": {
  8496. "idx": 481,
  8497. "alias": [],
  8498. "alternates": []
  8499. },
  8500. "Ext.dd.DragDrop": {
  8501. "idx": 456,
  8502. "alias": [],
  8503. "alternates": []
  8504. },
  8505. "Ext.dd.DragDropManager": {
  8506. "idx": 450,
  8507. "alias": [],
  8508. "alternates": [
  8509. "Ext.dd.DragDropMgr",
  8510. "Ext.dd.DDM"
  8511. ]
  8512. },
  8513. "Ext.dd.DragSource": {
  8514. "idx": 460,
  8515. "alias": [],
  8516. "alternates": []
  8517. },
  8518. "Ext.dd.DragTracker": {
  8519. "idx": 476,
  8520. "alias": [],
  8521. "alternates": []
  8522. },
  8523. "Ext.dd.DragZone": {
  8524. "idx": 487,
  8525. "alias": [],
  8526. "alternates": []
  8527. },
  8528. "Ext.dd.DropTarget": {
  8529. "idx": 483,
  8530. "alias": [],
  8531. "alternates": []
  8532. },
  8533. "Ext.dd.DropZone": {
  8534. "idx": 489,
  8535. "alias": [],
  8536. "alternates": []
  8537. },
  8538. "Ext.dd.Registry": {
  8539. "idx": 488,
  8540. "alias": [],
  8541. "alternates": []
  8542. },
  8543. "Ext.dd.ScrollManager": {
  8544. "idx": 482,
  8545. "alias": [],
  8546. "alternates": []
  8547. },
  8548. "Ext.dd.StatusProxy": {
  8549. "idx": 459,
  8550. "alias": [],
  8551. "alternates": []
  8552. },
  8553. "Ext.direct.Event": {
  8554. "idx": 305,
  8555. "alias": [
  8556. "direct.event"
  8557. ],
  8558. "alternates": []
  8559. },
  8560. "Ext.direct.ExceptionEvent": {
  8561. "idx": 307,
  8562. "alias": [
  8563. "direct.exception"
  8564. ],
  8565. "alternates": []
  8566. },
  8567. "Ext.direct.JsonProvider": {
  8568. "idx": 308,
  8569. "alias": [
  8570. "direct.jsonprovider"
  8571. ],
  8572. "alternates": []
  8573. },
  8574. "Ext.direct.Manager": {
  8575. "idx": 227,
  8576. "alias": [],
  8577. "alternates": []
  8578. },
  8579. "Ext.direct.PollingProvider": {
  8580. "idx": 309,
  8581. "alias": [
  8582. "direct.pollingprovider"
  8583. ],
  8584. "alternates": []
  8585. },
  8586. "Ext.direct.Provider": {
  8587. "idx": 228,
  8588. "alias": [
  8589. "direct.provider"
  8590. ],
  8591. "alternates": []
  8592. },
  8593. "Ext.direct.RemotingEvent": {
  8594. "idx": 306,
  8595. "alias": [
  8596. "direct.rpc"
  8597. ],
  8598. "alternates": []
  8599. },
  8600. "Ext.direct.RemotingMethod": {
  8601. "idx": 310,
  8602. "alias": [],
  8603. "alternates": []
  8604. },
  8605. "Ext.direct.RemotingProvider": {
  8606. "idx": 312,
  8607. "alias": [
  8608. "direct.remotingprovider"
  8609. ],
  8610. "alternates": []
  8611. },
  8612. "Ext.direct.Transaction": {
  8613. "idx": 311,
  8614. "alias": [
  8615. "direct.transaction"
  8616. ],
  8617. "alternates": []
  8618. },
  8619. "Ext.dom.ButtonElement": {
  8620. "idx": 436,
  8621. "alias": [],
  8622. "alternates": []
  8623. },
  8624. "Ext.dom.CompositeElement": {
  8625. "idx": 102,
  8626. "alias": [],
  8627. "alternates": [
  8628. "Ext.CompositeElement"
  8629. ]
  8630. },
  8631. "Ext.dom.CompositeElementLite": {
  8632. "idx": 76,
  8633. "alias": [],
  8634. "alternates": [
  8635. "Ext.CompositeElementLite"
  8636. ]
  8637. },
  8638. "Ext.dom.Element": {
  8639. "idx": 49,
  8640. "alias": [],
  8641. "alternates": [
  8642. "Ext.Element"
  8643. ]
  8644. },
  8645. "Ext.dom.ElementEvent": {
  8646. "idx": 31,
  8647. "alias": [],
  8648. "alternates": []
  8649. },
  8650. "Ext.dom.Fly": {
  8651. "idx": 75,
  8652. "alias": [],
  8653. "alternates": [
  8654. "Ext.dom.Element.Fly"
  8655. ]
  8656. },
  8657. "Ext.dom.GarbageCollector": {
  8658. "idx": 313,
  8659. "alias": [],
  8660. "alternates": []
  8661. },
  8662. "Ext.dom.Helper": {
  8663. "idx": 253,
  8664. "alias": [],
  8665. "alternates": [
  8666. "Ext.DomHelper",
  8667. "Ext.core.DomHelper"
  8668. ]
  8669. },
  8670. "Ext.dom.Layer": {
  8671. "idx": 490,
  8672. "alias": [],
  8673. "alternates": [
  8674. "Ext.Layer"
  8675. ]
  8676. },
  8677. "Ext.dom.Query": {
  8678. "idx": 254,
  8679. "alias": [],
  8680. "alternates": [
  8681. "Ext.core.DomQuery",
  8682. "Ext.DomQuery"
  8683. ]
  8684. },
  8685. "Ext.dom.Shadow": {
  8686. "idx": 29,
  8687. "alias": [],
  8688. "alternates": [
  8689. "Ext.Shadow"
  8690. ]
  8691. },
  8692. "Ext.dom.Shim": {
  8693. "idx": 30,
  8694. "alias": [],
  8695. "alternates": []
  8696. },
  8697. "Ext.dom.TouchAction": {
  8698. "idx": 314,
  8699. "alias": [],
  8700. "alternates": []
  8701. },
  8702. "Ext.dom.Underlay": {
  8703. "idx": 28,
  8704. "alias": [],
  8705. "alternates": []
  8706. },
  8707. "Ext.dom.UnderlayPool": {
  8708. "idx": 27,
  8709. "alias": [],
  8710. "alternates": []
  8711. },
  8712. "Ext.drag.Constraint": {
  8713. "idx": 315,
  8714. "alias": [
  8715. "drag.constraint.base"
  8716. ],
  8717. "alternates": []
  8718. },
  8719. "Ext.drag.Info": {
  8720. "idx": 316,
  8721. "alias": [],
  8722. "alternates": []
  8723. },
  8724. "Ext.drag.Item": {
  8725. "idx": 317,
  8726. "alias": [],
  8727. "alternates": []
  8728. },
  8729. "Ext.drag.Manager": {
  8730. "idx": 318,
  8731. "alias": [],
  8732. "alternates": []
  8733. },
  8734. "Ext.drag.Source": {
  8735. "idx": 319,
  8736. "alias": [],
  8737. "alternates": []
  8738. },
  8739. "Ext.drag.Target": {
  8740. "idx": 320,
  8741. "alias": [],
  8742. "alternates": []
  8743. },
  8744. "Ext.drag.proxy.None": {
  8745. "idx": 321,
  8746. "alias": [
  8747. "drag.proxy.none"
  8748. ],
  8749. "alternates": []
  8750. },
  8751. "Ext.drag.proxy.Original": {
  8752. "idx": 322,
  8753. "alias": [
  8754. "drag.proxy.original"
  8755. ],
  8756. "alternates": []
  8757. },
  8758. "Ext.drag.proxy.Placeholder": {
  8759. "idx": 323,
  8760. "alias": [
  8761. "drag.proxy.placeholder"
  8762. ],
  8763. "alternates": []
  8764. },
  8765. "Ext.event.Event": {
  8766. "idx": 36,
  8767. "alias": [],
  8768. "alternates": [
  8769. "Ext.EventObjectImpl"
  8770. ]
  8771. },
  8772. "Ext.event.gesture.DoubleTap": {
  8773. "idx": 326,
  8774. "alias": [],
  8775. "alternates": []
  8776. },
  8777. "Ext.event.gesture.Drag": {
  8778. "idx": 327,
  8779. "alias": [],
  8780. "alternates": []
  8781. },
  8782. "Ext.event.gesture.EdgeSwipe": {
  8783. "idx": 329,
  8784. "alias": [],
  8785. "alternates": []
  8786. },
  8787. "Ext.event.gesture.LongPress": {
  8788. "idx": 330,
  8789. "alias": [],
  8790. "alternates": []
  8791. },
  8792. "Ext.event.gesture.MultiTouch": {
  8793. "idx": 331,
  8794. "alias": [],
  8795. "alternates": []
  8796. },
  8797. "Ext.event.gesture.Pinch": {
  8798. "idx": 332,
  8799. "alias": [],
  8800. "alternates": []
  8801. },
  8802. "Ext.event.gesture.Recognizer": {
  8803. "idx": 324,
  8804. "alias": [],
  8805. "alternates": []
  8806. },
  8807. "Ext.event.gesture.Rotate": {
  8808. "idx": 333,
  8809. "alias": [],
  8810. "alternates": []
  8811. },
  8812. "Ext.event.gesture.SingleTouch": {
  8813. "idx": 325,
  8814. "alias": [],
  8815. "alternates": []
  8816. },
  8817. "Ext.event.gesture.Swipe": {
  8818. "idx": 328,
  8819. "alias": [],
  8820. "alternates": []
  8821. },
  8822. "Ext.event.gesture.Tap": {
  8823. "idx": 334,
  8824. "alias": [],
  8825. "alternates": []
  8826. },
  8827. "Ext.event.publisher.Dom": {
  8828. "idx": 37,
  8829. "alias": [],
  8830. "alternates": []
  8831. },
  8832. "Ext.event.publisher.ElementPaint": {
  8833. "idx": 48,
  8834. "alias": [],
  8835. "alternates": []
  8836. },
  8837. "Ext.event.publisher.ElementSize": {
  8838. "idx": 44,
  8839. "alias": [],
  8840. "alternates": []
  8841. },
  8842. "Ext.event.publisher.Focus": {
  8843. "idx": 335,
  8844. "alias": [],
  8845. "alternates": []
  8846. },
  8847. "Ext.event.publisher.Gesture": {
  8848. "idx": 38,
  8849. "alias": [],
  8850. "alternates": []
  8851. },
  8852. "Ext.event.publisher.MouseEnterLeave": {
  8853. "idx": 492,
  8854. "alias": [],
  8855. "alternates": []
  8856. },
  8857. "Ext.event.publisher.Publisher": {
  8858. "idx": 32,
  8859. "alias": [],
  8860. "alternates": []
  8861. },
  8862. "Ext.field.InputMask": {
  8863. "idx": 336,
  8864. "alias": [],
  8865. "alternates": []
  8866. },
  8867. "Ext.flash.Component": {
  8868. "idx": 493,
  8869. "alias": [
  8870. "widget.flash"
  8871. ],
  8872. "alternates": [
  8873. "Ext.FlashComponent"
  8874. ]
  8875. },
  8876. "Ext.form.Basic": {
  8877. "idx": 509,
  8878. "alias": [],
  8879. "alternates": [
  8880. "Ext.form.BasicForm"
  8881. ]
  8882. },
  8883. "Ext.form.CheckboxGroup": {
  8884. "idx": 516,
  8885. "alias": [
  8886. "widget.checkboxgroup"
  8887. ],
  8888. "alternates": []
  8889. },
  8890. "Ext.form.CheckboxManager": {
  8891. "idx": 514,
  8892. "alias": [],
  8893. "alternates": []
  8894. },
  8895. "Ext.form.FieldAncestor": {
  8896. "idx": 511,
  8897. "alias": [],
  8898. "alternates": []
  8899. },
  8900. "Ext.form.FieldContainer": {
  8901. "idx": 512,
  8902. "alias": [
  8903. "widget.fieldcontainer"
  8904. ],
  8905. "alternates": []
  8906. },
  8907. "Ext.form.FieldSet": {
  8908. "idx": 517,
  8909. "alias": [
  8910. "widget.fieldset"
  8911. ],
  8912. "alternates": []
  8913. },
  8914. "Ext.form.Label": {
  8915. "idx": 518,
  8916. "alias": [
  8917. "widget.label"
  8918. ],
  8919. "alternates": []
  8920. },
  8921. "Ext.form.Labelable": {
  8922. "idx": 500,
  8923. "alias": [],
  8924. "alternates": []
  8925. },
  8926. "Ext.form.Panel": {
  8927. "idx": 519,
  8928. "alias": [
  8929. "widget.form"
  8930. ],
  8931. "alternates": [
  8932. "Ext.FormPanel",
  8933. "Ext.form.FormPanel"
  8934. ]
  8935. },
  8936. "Ext.form.RadioGroup": {
  8937. "idx": 522,
  8938. "alias": [
  8939. "widget.radiogroup"
  8940. ],
  8941. "alternates": []
  8942. },
  8943. "Ext.form.RadioManager": {
  8944. "idx": 520,
  8945. "alias": [],
  8946. "alternates": []
  8947. },
  8948. "Ext.form.action.Action": {
  8949. "idx": 494,
  8950. "alias": [],
  8951. "alternates": [
  8952. "Ext.form.Action"
  8953. ]
  8954. },
  8955. "Ext.form.action.DirectAction": {
  8956. "idx": 523,
  8957. "alias": [],
  8958. "alternates": []
  8959. },
  8960. "Ext.form.action.DirectLoad": {
  8961. "idx": 524,
  8962. "alias": [
  8963. "formaction.directload"
  8964. ],
  8965. "alternates": [
  8966. "Ext.form.Action.DirectLoad"
  8967. ]
  8968. },
  8969. "Ext.form.action.DirectSubmit": {
  8970. "idx": 525,
  8971. "alias": [
  8972. "formaction.directsubmit"
  8973. ],
  8974. "alternates": [
  8975. "Ext.form.Action.DirectSubmit"
  8976. ]
  8977. },
  8978. "Ext.form.action.Load": {
  8979. "idx": 495,
  8980. "alias": [
  8981. "formaction.load"
  8982. ],
  8983. "alternates": [
  8984. "Ext.form.Action.Load"
  8985. ]
  8986. },
  8987. "Ext.form.action.StandardSubmit": {
  8988. "idx": 497,
  8989. "alias": [
  8990. "formaction.standardsubmit"
  8991. ],
  8992. "alternates": []
  8993. },
  8994. "Ext.form.action.Submit": {
  8995. "idx": 496,
  8996. "alias": [
  8997. "formaction.submit"
  8998. ],
  8999. "alternates": [
  9000. "Ext.form.Action.Submit"
  9001. ]
  9002. },
  9003. "Ext.form.field.Base": {
  9004. "idx": 502,
  9005. "alias": [
  9006. "widget.field"
  9007. ],
  9008. "alternates": [
  9009. "Ext.form.Field",
  9010. "Ext.form.BaseField"
  9011. ]
  9012. },
  9013. "Ext.form.field.Checkbox": {
  9014. "idx": 515,
  9015. "alias": [
  9016. "widget.checkbox",
  9017. "widget.checkboxfield"
  9018. ],
  9019. "alternates": [
  9020. "Ext.form.Checkbox"
  9021. ]
  9022. },
  9023. "Ext.form.field.ComboBox": {
  9024. "idx": 541,
  9025. "alias": [
  9026. "widget.combo",
  9027. "widget.combobox"
  9028. ],
  9029. "alternates": [
  9030. "Ext.form.ComboBox"
  9031. ]
  9032. },
  9033. "Ext.form.field.Date": {
  9034. "idx": 544,
  9035. "alias": [
  9036. "widget.datefield"
  9037. ],
  9038. "alternates": [
  9039. "Ext.form.DateField",
  9040. "Ext.form.Date"
  9041. ]
  9042. },
  9043. "Ext.form.field.Display": {
  9044. "idx": 545,
  9045. "alias": [
  9046. "widget.displayfield"
  9047. ],
  9048. "alternates": [
  9049. "Ext.form.DisplayField",
  9050. "Ext.form.Display"
  9051. ]
  9052. },
  9053. "Ext.form.field.Field": {
  9054. "idx": 501,
  9055. "alias": [],
  9056. "alternates": []
  9057. },
  9058. "Ext.form.field.File": {
  9059. "idx": 548,
  9060. "alias": [
  9061. "widget.filefield",
  9062. "widget.fileuploadfield"
  9063. ],
  9064. "alternates": [
  9065. "Ext.form.FileUploadField",
  9066. "Ext.ux.form.FileUploadField",
  9067. "Ext.form.File"
  9068. ]
  9069. },
  9070. "Ext.form.field.FileButton": {
  9071. "idx": 546,
  9072. "alias": [
  9073. "widget.filebutton"
  9074. ],
  9075. "alternates": []
  9076. },
  9077. "Ext.form.field.Hidden": {
  9078. "idx": 549,
  9079. "alias": [
  9080. "widget.hidden",
  9081. "widget.hiddenfield"
  9082. ],
  9083. "alternates": [
  9084. "Ext.form.Hidden"
  9085. ]
  9086. },
  9087. "Ext.form.field.HtmlEditor": {
  9088. "idx": 558,
  9089. "alias": [
  9090. "widget.htmleditor"
  9091. ],
  9092. "alternates": [
  9093. "Ext.form.HtmlEditor"
  9094. ]
  9095. },
  9096. "Ext.form.field.Number": {
  9097. "idx": 538,
  9098. "alias": [
  9099. "widget.numberfield"
  9100. ],
  9101. "alternates": [
  9102. "Ext.form.NumberField",
  9103. "Ext.form.Number"
  9104. ]
  9105. },
  9106. "Ext.form.field.Picker": {
  9107. "idx": 526,
  9108. "alias": [
  9109. "widget.pickerfield"
  9110. ],
  9111. "alternates": [
  9112. "Ext.form.Picker"
  9113. ]
  9114. },
  9115. "Ext.form.field.Radio": {
  9116. "idx": 521,
  9117. "alias": [
  9118. "widget.radio",
  9119. "widget.radiofield"
  9120. ],
  9121. "alternates": [
  9122. "Ext.form.Radio"
  9123. ]
  9124. },
  9125. "Ext.form.field.Spinner": {
  9126. "idx": 537,
  9127. "alias": [
  9128. "widget.spinnerfield"
  9129. ],
  9130. "alternates": [
  9131. "Ext.form.Spinner"
  9132. ]
  9133. },
  9134. "Ext.form.field.Tag": {
  9135. "idx": 560,
  9136. "alias": [
  9137. "widget.tagfield"
  9138. ],
  9139. "alternates": []
  9140. },
  9141. "Ext.form.field.Text": {
  9142. "idx": 506,
  9143. "alias": [
  9144. "widget.textfield"
  9145. ],
  9146. "alternates": [
  9147. "Ext.form.TextField",
  9148. "Ext.form.Text"
  9149. ]
  9150. },
  9151. "Ext.form.field.TextArea": {
  9152. "idx": 507,
  9153. "alias": [
  9154. "widget.textarea",
  9155. "widget.textareafield"
  9156. ],
  9157. "alternates": [
  9158. "Ext.form.TextArea"
  9159. ]
  9160. },
  9161. "Ext.form.field.Time": {
  9162. "idx": 562,
  9163. "alias": [
  9164. "widget.timefield"
  9165. ],
  9166. "alternates": [
  9167. "Ext.form.TimeField",
  9168. "Ext.form.Time"
  9169. ]
  9170. },
  9171. "Ext.form.field.Trigger": {
  9172. "idx": 563,
  9173. "alias": [
  9174. "widget.trigger",
  9175. "widget.triggerfield"
  9176. ],
  9177. "alternates": [
  9178. "Ext.form.TriggerField",
  9179. "Ext.form.TwinTriggerField",
  9180. "Ext.form.Trigger"
  9181. ]
  9182. },
  9183. "Ext.form.field.VTypes": {
  9184. "idx": 504,
  9185. "alias": [],
  9186. "alternates": [
  9187. "Ext.form.VTypes"
  9188. ]
  9189. },
  9190. "Ext.form.trigger.Component": {
  9191. "idx": 547,
  9192. "alias": [
  9193. "trigger.component"
  9194. ],
  9195. "alternates": []
  9196. },
  9197. "Ext.form.trigger.Spinner": {
  9198. "idx": 536,
  9199. "alias": [
  9200. "trigger.spinner"
  9201. ],
  9202. "alternates": []
  9203. },
  9204. "Ext.form.trigger.Trigger": {
  9205. "idx": 505,
  9206. "alias": [
  9207. "trigger.trigger"
  9208. ],
  9209. "alternates": []
  9210. },
  9211. "Ext.fx.Anim": {
  9212. "idx": 73,
  9213. "alias": [],
  9214. "alternates": []
  9215. },
  9216. "Ext.fx.Animation": {
  9217. "idx": 346,
  9218. "alias": [],
  9219. "alternates": []
  9220. },
  9221. "Ext.fx.Animator": {
  9222. "idx": 68,
  9223. "alias": [],
  9224. "alternates": []
  9225. },
  9226. "Ext.fx.CubicBezier": {
  9227. "idx": 69,
  9228. "alias": [],
  9229. "alternates": []
  9230. },
  9231. "Ext.fx.DrawPath": {
  9232. "idx": 71,
  9233. "alias": [],
  9234. "alternates": []
  9235. },
  9236. "Ext.fx.Easing": {
  9237. "idx": 70,
  9238. "alias": [],
  9239. "alternates": []
  9240. },
  9241. "Ext.fx.Manager": {
  9242. "idx": 67,
  9243. "alias": [],
  9244. "alternates": []
  9245. },
  9246. "Ext.fx.PropertyHandler": {
  9247. "idx": 72,
  9248. "alias": [],
  9249. "alternates": []
  9250. },
  9251. "Ext.fx.Queue": {
  9252. "idx": 66,
  9253. "alias": [],
  9254. "alternates": []
  9255. },
  9256. "Ext.fx.Runner": {
  9257. "idx": 349,
  9258. "alias": [],
  9259. "alternates": []
  9260. },
  9261. "Ext.fx.State": {
  9262. "idx": 337,
  9263. "alias": [],
  9264. "alternates": []
  9265. },
  9266. "Ext.fx.animation.Abstract": {
  9267. "idx": 338,
  9268. "alias": [],
  9269. "alternates": []
  9270. },
  9271. "Ext.fx.animation.Cube": {
  9272. "idx": 350,
  9273. "alias": [
  9274. "animation.cube"
  9275. ],
  9276. "alternates": []
  9277. },
  9278. "Ext.fx.animation.Fade": {
  9279. "idx": 341,
  9280. "alias": [
  9281. "animation.fade",
  9282. "animation.fadeIn"
  9283. ],
  9284. "alternates": [
  9285. "Ext.fx.animation.FadeIn"
  9286. ]
  9287. },
  9288. "Ext.fx.animation.FadeOut": {
  9289. "idx": 342,
  9290. "alias": [
  9291. "animation.fadeOut"
  9292. ],
  9293. "alternates": []
  9294. },
  9295. "Ext.fx.animation.Flip": {
  9296. "idx": 343,
  9297. "alias": [
  9298. "animation.flip"
  9299. ],
  9300. "alternates": []
  9301. },
  9302. "Ext.fx.animation.Pop": {
  9303. "idx": 344,
  9304. "alias": [
  9305. "animation.pop",
  9306. "animation.popIn"
  9307. ],
  9308. "alternates": [
  9309. "Ext.fx.animation.PopIn"
  9310. ]
  9311. },
  9312. "Ext.fx.animation.PopOut": {
  9313. "idx": 345,
  9314. "alias": [
  9315. "animation.popOut"
  9316. ],
  9317. "alternates": []
  9318. },
  9319. "Ext.fx.animation.Slide": {
  9320. "idx": 339,
  9321. "alias": [
  9322. "animation.slide",
  9323. "animation.slideIn"
  9324. ],
  9325. "alternates": [
  9326. "Ext.fx.animation.SlideIn"
  9327. ]
  9328. },
  9329. "Ext.fx.animation.SlideOut": {
  9330. "idx": 340,
  9331. "alias": [
  9332. "animation.slideOut"
  9333. ],
  9334. "alternates": []
  9335. },
  9336. "Ext.fx.animation.Wipe": {
  9337. "idx": 351,
  9338. "alias": [],
  9339. "alternates": [
  9340. "Ext.fx.animation.WipeIn"
  9341. ]
  9342. },
  9343. "Ext.fx.animation.WipeOut": {
  9344. "idx": 352,
  9345. "alias": [],
  9346. "alternates": []
  9347. },
  9348. "Ext.fx.easing.Abstract": {
  9349. "idx": 105,
  9350. "alias": [],
  9351. "alternates": []
  9352. },
  9353. "Ext.fx.easing.Bounce": {
  9354. "idx": 353,
  9355. "alias": [],
  9356. "alternates": []
  9357. },
  9358. "Ext.fx.easing.BoundMomentum": {
  9359. "idx": 355,
  9360. "alias": [],
  9361. "alternates": []
  9362. },
  9363. "Ext.fx.easing.EaseIn": {
  9364. "idx": 356,
  9365. "alias": [
  9366. "easing.ease-in"
  9367. ],
  9368. "alternates": []
  9369. },
  9370. "Ext.fx.easing.EaseOut": {
  9371. "idx": 357,
  9372. "alias": [
  9373. "easing.ease-out"
  9374. ],
  9375. "alternates": []
  9376. },
  9377. "Ext.fx.easing.Easing": {
  9378. "idx": 358,
  9379. "alias": [],
  9380. "alternates": []
  9381. },
  9382. "Ext.fx.easing.Linear": {
  9383. "idx": 106,
  9384. "alias": [
  9385. "easing.linear"
  9386. ],
  9387. "alternates": []
  9388. },
  9389. "Ext.fx.easing.Momentum": {
  9390. "idx": 354,
  9391. "alias": [],
  9392. "alternates": []
  9393. },
  9394. "Ext.fx.runner.Css": {
  9395. "idx": 347,
  9396. "alias": [],
  9397. "alternates": []
  9398. },
  9399. "Ext.fx.runner.CssAnimation": {
  9400. "idx": 359,
  9401. "alias": [],
  9402. "alternates": []
  9403. },
  9404. "Ext.fx.runner.CssTransition": {
  9405. "idx": 348,
  9406. "alias": [],
  9407. "alternates": [
  9408. "Ext.Animator"
  9409. ]
  9410. },
  9411. "Ext.fx.target.Component": {
  9412. "idx": 65,
  9413. "alias": [],
  9414. "alternates": []
  9415. },
  9416. "Ext.fx.target.CompositeElement": {
  9417. "idx": 61,
  9418. "alias": [],
  9419. "alternates": []
  9420. },
  9421. "Ext.fx.target.CompositeElementCSS": {
  9422. "idx": 62,
  9423. "alias": [],
  9424. "alternates": []
  9425. },
  9426. "Ext.fx.target.CompositeSprite": {
  9427. "idx": 64,
  9428. "alias": [],
  9429. "alternates": []
  9430. },
  9431. "Ext.fx.target.Element": {
  9432. "idx": 59,
  9433. "alias": [],
  9434. "alternates": []
  9435. },
  9436. "Ext.fx.target.ElementCSS": {
  9437. "idx": 60,
  9438. "alias": [],
  9439. "alternates": []
  9440. },
  9441. "Ext.fx.target.Sprite": {
  9442. "idx": 63,
  9443. "alias": [],
  9444. "alternates": []
  9445. },
  9446. "Ext.fx.target.Target": {
  9447. "idx": 58,
  9448. "alias": [],
  9449. "alternates": []
  9450. },
  9451. "Ext.grid.AdvancedGroupStore": {
  9452. "idx": 360,
  9453. "alias": [],
  9454. "alternates": []
  9455. },
  9456. "Ext.grid.CellContext": {
  9457. "idx": 564,
  9458. "alias": [],
  9459. "alternates": []
  9460. },
  9461. "Ext.grid.CellEditor": {
  9462. "idx": 565,
  9463. "alias": [
  9464. "widget.celleditor"
  9465. ],
  9466. "alternates": []
  9467. },
  9468. "Ext.grid.ColumnComponentLayout": {
  9469. "idx": 566,
  9470. "alias": [
  9471. "layout.columncomponent"
  9472. ],
  9473. "alternates": []
  9474. },
  9475. "Ext.grid.ColumnLayout": {
  9476. "idx": 569,
  9477. "alias": [
  9478. "layout.gridcolumn"
  9479. ],
  9480. "alternates": []
  9481. },
  9482. "Ext.grid.ColumnManager": {
  9483. "idx": 570,
  9484. "alias": [],
  9485. "alternates": [
  9486. "Ext.grid.ColumnModel"
  9487. ]
  9488. },
  9489. "Ext.grid.NavigationModel": {
  9490. "idx": 571,
  9491. "alias": [
  9492. "view.navigation.grid"
  9493. ],
  9494. "alternates": []
  9495. },
  9496. "Ext.grid.Panel": {
  9497. "idx": 577,
  9498. "alias": [
  9499. "widget.grid",
  9500. "widget.gridpanel"
  9501. ],
  9502. "alternates": [
  9503. "Ext.list.ListView",
  9504. "Ext.ListView",
  9505. "Ext.grid.GridPanel"
  9506. ]
  9507. },
  9508. "Ext.grid.RowContext": {
  9509. "idx": 578,
  9510. "alias": [],
  9511. "alternates": []
  9512. },
  9513. "Ext.grid.RowEditor": {
  9514. "idx": 580,
  9515. "alias": [
  9516. "widget.roweditor"
  9517. ],
  9518. "alternates": []
  9519. },
  9520. "Ext.grid.RowEditorButtons": {
  9521. "idx": 579,
  9522. "alias": [
  9523. "widget.roweditorbuttons"
  9524. ],
  9525. "alternates": []
  9526. },
  9527. "Ext.grid.Scroller": {
  9528. "idx": 581,
  9529. "alias": [],
  9530. "alternates": []
  9531. },
  9532. "Ext.grid.ViewDropZone": {
  9533. "idx": 583,
  9534. "alias": [],
  9535. "alternates": []
  9536. },
  9537. "Ext.grid.column.Action": {
  9538. "idx": 591,
  9539. "alias": [
  9540. "widget.actioncolumn"
  9541. ],
  9542. "alternates": [
  9543. "Ext.grid.ActionColumn"
  9544. ]
  9545. },
  9546. "Ext.grid.column.ActionProxy": {
  9547. "idx": 590,
  9548. "alias": [],
  9549. "alternates": []
  9550. },
  9551. "Ext.grid.column.Boolean": {
  9552. "idx": 592,
  9553. "alias": [
  9554. "widget.booleancolumn"
  9555. ],
  9556. "alternates": [
  9557. "Ext.grid.BooleanColumn"
  9558. ]
  9559. },
  9560. "Ext.grid.column.Check": {
  9561. "idx": 593,
  9562. "alias": [
  9563. "widget.checkcolumn"
  9564. ],
  9565. "alternates": [
  9566. "Ext.ux.CheckColumn",
  9567. "Ext.grid.column.CheckColumn"
  9568. ]
  9569. },
  9570. "Ext.grid.column.Column": {
  9571. "idx": 589,
  9572. "alias": [
  9573. "widget.gridcolumn"
  9574. ],
  9575. "alternates": [
  9576. "Ext.grid.Column"
  9577. ]
  9578. },
  9579. "Ext.grid.column.Date": {
  9580. "idx": 594,
  9581. "alias": [
  9582. "widget.datecolumn"
  9583. ],
  9584. "alternates": [
  9585. "Ext.grid.DateColumn"
  9586. ]
  9587. },
  9588. "Ext.grid.column.Groups": {
  9589. "idx": 595,
  9590. "alias": [
  9591. "widget.groupscolumn"
  9592. ],
  9593. "alternates": []
  9594. },
  9595. "Ext.grid.column.Number": {
  9596. "idx": 596,
  9597. "alias": [
  9598. "widget.numbercolumn"
  9599. ],
  9600. "alternates": [
  9601. "Ext.grid.NumberColumn"
  9602. ]
  9603. },
  9604. "Ext.grid.column.RowNumberer": {
  9605. "idx": 597,
  9606. "alias": [
  9607. "widget.rownumberer"
  9608. ],
  9609. "alternates": [
  9610. "Ext.grid.RowNumberer"
  9611. ]
  9612. },
  9613. "Ext.grid.column.Template": {
  9614. "idx": 598,
  9615. "alias": [
  9616. "widget.templatecolumn"
  9617. ],
  9618. "alternates": [
  9619. "Ext.grid.TemplateColumn"
  9620. ]
  9621. },
  9622. "Ext.grid.column.Widget": {
  9623. "idx": 599,
  9624. "alias": [
  9625. "widget.widgetcolumn"
  9626. ],
  9627. "alternates": []
  9628. },
  9629. "Ext.grid.feature.AbstractSummary": {
  9630. "idx": 601,
  9631. "alias": [
  9632. "feature.abstractsummary"
  9633. ],
  9634. "alternates": []
  9635. },
  9636. "Ext.grid.feature.AdvancedGroupStore": {
  9637. "idx": 602,
  9638. "alias": [],
  9639. "alternates": []
  9640. },
  9641. "Ext.grid.feature.AdvancedGrouping": {
  9642. "idx": 603,
  9643. "alias": [
  9644. "feature.advancedgrouping"
  9645. ],
  9646. "alternates": []
  9647. },
  9648. "Ext.grid.feature.AdvancedGroupingSummary": {
  9649. "idx": 604,
  9650. "alias": [
  9651. "feature.advancedgroupingsummary"
  9652. ],
  9653. "alternates": []
  9654. },
  9655. "Ext.grid.feature.Feature": {
  9656. "idx": 600,
  9657. "alias": [
  9658. "feature.feature"
  9659. ],
  9660. "alternates": []
  9661. },
  9662. "Ext.grid.feature.GroupStore": {
  9663. "idx": 605,
  9664. "alias": [],
  9665. "alternates": []
  9666. },
  9667. "Ext.grid.feature.Grouping": {
  9668. "idx": 606,
  9669. "alias": [
  9670. "feature.grouping"
  9671. ],
  9672. "alternates": []
  9673. },
  9674. "Ext.grid.feature.GroupingSummary": {
  9675. "idx": 607,
  9676. "alias": [
  9677. "feature.groupingsummary"
  9678. ],
  9679. "alternates": []
  9680. },
  9681. "Ext.grid.feature.RowBody": {
  9682. "idx": 608,
  9683. "alias": [
  9684. "feature.rowbody"
  9685. ],
  9686. "alternates": []
  9687. },
  9688. "Ext.grid.feature.Summary": {
  9689. "idx": 609,
  9690. "alias": [
  9691. "feature.summary"
  9692. ],
  9693. "alternates": []
  9694. },
  9695. "Ext.grid.filters.Filters": {
  9696. "idx": 622,
  9697. "alias": [
  9698. "plugin.gridfilters"
  9699. ],
  9700. "alternates": []
  9701. },
  9702. "Ext.grid.filters.filter.Base": {
  9703. "idx": 614,
  9704. "alias": [],
  9705. "alternates": []
  9706. },
  9707. "Ext.grid.filters.filter.Boolean": {
  9708. "idx": 616,
  9709. "alias": [
  9710. "grid.filter.boolean"
  9711. ],
  9712. "alternates": []
  9713. },
  9714. "Ext.grid.filters.filter.Date": {
  9715. "idx": 618,
  9716. "alias": [
  9717. "grid.filter.date"
  9718. ],
  9719. "alternates": []
  9720. },
  9721. "Ext.grid.filters.filter.List": {
  9722. "idx": 619,
  9723. "alias": [
  9724. "grid.filter.list"
  9725. ],
  9726. "alternates": []
  9727. },
  9728. "Ext.grid.filters.filter.Number": {
  9729. "idx": 620,
  9730. "alias": [
  9731. "grid.filter.number",
  9732. "grid.filter.numeric"
  9733. ],
  9734. "alternates": []
  9735. },
  9736. "Ext.grid.filters.filter.SingleFilter": {
  9737. "idx": 615,
  9738. "alias": [],
  9739. "alternates": []
  9740. },
  9741. "Ext.grid.filters.filter.String": {
  9742. "idx": 621,
  9743. "alias": [
  9744. "grid.filter.string"
  9745. ],
  9746. "alternates": []
  9747. },
  9748. "Ext.grid.filters.filter.TriFilter": {
  9749. "idx": 617,
  9750. "alias": [],
  9751. "alternates": []
  9752. },
  9753. "Ext.grid.header.Container": {
  9754. "idx": 588,
  9755. "alias": [
  9756. "widget.headercontainer"
  9757. ],
  9758. "alternates": []
  9759. },
  9760. "Ext.grid.header.DragZone": {
  9761. "idx": 585,
  9762. "alias": [],
  9763. "alternates": []
  9764. },
  9765. "Ext.grid.header.DropZone": {
  9766. "idx": 586,
  9767. "alias": [],
  9768. "alternates": []
  9769. },
  9770. "Ext.grid.locking.HeaderContainer": {
  9771. "idx": 623,
  9772. "alias": [],
  9773. "alternates": []
  9774. },
  9775. "Ext.grid.locking.Lockable": {
  9776. "idx": 626,
  9777. "alias": [],
  9778. "alternates": [
  9779. "Ext.grid.Lockable"
  9780. ]
  9781. },
  9782. "Ext.grid.locking.RowSynchronizer": {
  9783. "idx": 573,
  9784. "alias": [],
  9785. "alternates": []
  9786. },
  9787. "Ext.grid.locking.View": {
  9788. "idx": 624,
  9789. "alias": [],
  9790. "alternates": [
  9791. "Ext.grid.LockingView"
  9792. ]
  9793. },
  9794. "Ext.grid.plugin.BaseFilterBar": {
  9795. "idx": 361,
  9796. "alias": [],
  9797. "alternates": []
  9798. },
  9799. "Ext.grid.plugin.BaseGroupingPanel": {
  9800. "idx": 362,
  9801. "alias": [],
  9802. "alternates": []
  9803. },
  9804. "Ext.grid.plugin.BaseSummaries": {
  9805. "idx": 363,
  9806. "alias": [],
  9807. "alternates": []
  9808. },
  9809. "Ext.grid.plugin.BufferedRenderer": {
  9810. "idx": 627,
  9811. "alias": [
  9812. "plugin.bufferedrenderer"
  9813. ],
  9814. "alternates": []
  9815. },
  9816. "Ext.grid.plugin.CellEditing": {
  9817. "idx": 629,
  9818. "alias": [
  9819. "plugin.cellediting"
  9820. ],
  9821. "alternates": []
  9822. },
  9823. "Ext.grid.plugin.Clipboard": {
  9824. "idx": 630,
  9825. "alias": [
  9826. "plugin.clipboard"
  9827. ],
  9828. "alternates": []
  9829. },
  9830. "Ext.grid.plugin.DragDrop": {
  9831. "idx": 631,
  9832. "alias": [
  9833. "plugin.gridviewdragdrop"
  9834. ],
  9835. "alternates": []
  9836. },
  9837. "Ext.grid.plugin.Editing": {
  9838. "idx": 628,
  9839. "alias": [
  9840. "editing.editing"
  9841. ],
  9842. "alternates": []
  9843. },
  9844. "Ext.grid.plugin.GroupingPanel": {
  9845. "idx": 636,
  9846. "alias": [
  9847. "plugin.groupingpanel"
  9848. ],
  9849. "alternates": []
  9850. },
  9851. "Ext.grid.plugin.HeaderReorderer": {
  9852. "idx": 587,
  9853. "alias": [
  9854. "plugin.gridheaderreorderer"
  9855. ],
  9856. "alternates": []
  9857. },
  9858. "Ext.grid.plugin.HeaderResizer": {
  9859. "idx": 584,
  9860. "alias": [
  9861. "plugin.gridheaderresizer"
  9862. ],
  9863. "alternates": []
  9864. },
  9865. "Ext.grid.plugin.RowEditing": {
  9866. "idx": 637,
  9867. "alias": [
  9868. "plugin.rowediting"
  9869. ],
  9870. "alternates": []
  9871. },
  9872. "Ext.grid.plugin.RowExpander": {
  9873. "idx": 638,
  9874. "alias": [
  9875. "plugin.rowexpander"
  9876. ],
  9877. "alternates": []
  9878. },
  9879. "Ext.grid.plugin.RowWidget": {
  9880. "idx": 639,
  9881. "alias": [
  9882. "plugin.rowwidget"
  9883. ],
  9884. "alternates": []
  9885. },
  9886. "Ext.grid.plugin.Summaries": {
  9887. "idx": 640,
  9888. "alias": [
  9889. "plugin.gridsummaries"
  9890. ],
  9891. "alternates": []
  9892. },
  9893. "Ext.grid.plugin.filterbar.FilterBar": {
  9894. "idx": 651,
  9895. "alias": [
  9896. "plugin.gridfilterbar"
  9897. ],
  9898. "alternates": []
  9899. },
  9900. "Ext.grid.plugin.filterbar.Operator": {
  9901. "idx": 641,
  9902. "alias": [
  9903. "plugin.operator"
  9904. ],
  9905. "alternates": []
  9906. },
  9907. "Ext.grid.plugin.filterbar.filters.Base": {
  9908. "idx": 642,
  9909. "alias": [],
  9910. "alternates": []
  9911. },
  9912. "Ext.grid.plugin.filterbar.filters.Boolean": {
  9913. "idx": 647,
  9914. "alias": [
  9915. "grid.filterbar.boolean"
  9916. ],
  9917. "alternates": []
  9918. },
  9919. "Ext.grid.plugin.filterbar.filters.Date": {
  9920. "idx": 645,
  9921. "alias": [
  9922. "grid.filterbar.date"
  9923. ],
  9924. "alternates": []
  9925. },
  9926. "Ext.grid.plugin.filterbar.filters.InList": {
  9927. "idx": 650,
  9928. "alias": [
  9929. "grid.filterbar.inlist"
  9930. ],
  9931. "alternates": []
  9932. },
  9933. "Ext.grid.plugin.filterbar.filters.List": {
  9934. "idx": 649,
  9935. "alias": [
  9936. "grid.filterbar.list"
  9937. ],
  9938. "alternates": []
  9939. },
  9940. "Ext.grid.plugin.filterbar.filters.None": {
  9941. "idx": 648,
  9942. "alias": [
  9943. "grid.filterbar.none"
  9944. ],
  9945. "alternates": []
  9946. },
  9947. "Ext.grid.plugin.filterbar.filters.Number": {
  9948. "idx": 646,
  9949. "alias": [
  9950. "grid.filterbar.number"
  9951. ],
  9952. "alternates": []
  9953. },
  9954. "Ext.grid.plugin.filterbar.filters.SingleFilter": {
  9955. "idx": 643,
  9956. "alias": [],
  9957. "alternates": []
  9958. },
  9959. "Ext.grid.plugin.filterbar.filters.String": {
  9960. "idx": 644,
  9961. "alias": [
  9962. "grid.filterbar.string"
  9963. ],
  9964. "alternates": []
  9965. },
  9966. "Ext.grid.plugin.grouping.Column": {
  9967. "idx": 632,
  9968. "alias": [
  9969. "widget.groupingpanelcolumn"
  9970. ],
  9971. "alternates": []
  9972. },
  9973. "Ext.grid.plugin.grouping.DragZone": {
  9974. "idx": 633,
  9975. "alias": [],
  9976. "alternates": []
  9977. },
  9978. "Ext.grid.plugin.grouping.DropZone": {
  9979. "idx": 634,
  9980. "alias": [],
  9981. "alternates": []
  9982. },
  9983. "Ext.grid.plugin.grouping.Panel": {
  9984. "idx": 635,
  9985. "alias": [
  9986. "widget.groupingpanel"
  9987. ],
  9988. "alternates": []
  9989. },
  9990. "Ext.grid.property.Grid": {
  9991. "idx": 652,
  9992. "alias": [
  9993. "widget.propertygrid"
  9994. ],
  9995. "alternates": [
  9996. "Ext.grid.PropertyGrid"
  9997. ]
  9998. },
  9999. "Ext.grid.property.HeaderContainer": {
  10000. "idx": 653,
  10001. "alias": [],
  10002. "alternates": [
  10003. "Ext.grid.PropertyColumnModel"
  10004. ]
  10005. },
  10006. "Ext.grid.property.Property": {
  10007. "idx": 654,
  10008. "alias": [],
  10009. "alternates": [
  10010. "Ext.PropGridProperty"
  10011. ]
  10012. },
  10013. "Ext.grid.property.Reader": {
  10014. "idx": 655,
  10015. "alias": [],
  10016. "alternates": []
  10017. },
  10018. "Ext.grid.property.Store": {
  10019. "idx": 656,
  10020. "alias": [],
  10021. "alternates": [
  10022. "Ext.grid.PropertyStore"
  10023. ]
  10024. },
  10025. "Ext.grid.selection.Cells": {
  10026. "idx": 658,
  10027. "alias": [],
  10028. "alternates": []
  10029. },
  10030. "Ext.grid.selection.Columns": {
  10031. "idx": 659,
  10032. "alias": [],
  10033. "alternates": []
  10034. },
  10035. "Ext.grid.selection.Replicator": {
  10036. "idx": 660,
  10037. "alias": [
  10038. "plugin.selectionreplicator"
  10039. ],
  10040. "alternates": []
  10041. },
  10042. "Ext.grid.selection.Rows": {
  10043. "idx": 661,
  10044. "alias": [],
  10045. "alternates": []
  10046. },
  10047. "Ext.grid.selection.Selection": {
  10048. "idx": 657,
  10049. "alias": [],
  10050. "alternates": []
  10051. },
  10052. "Ext.grid.selection.SelectionExtender": {
  10053. "idx": 662,
  10054. "alias": [],
  10055. "alternates": []
  10056. },
  10057. "Ext.grid.selection.SpreadsheetModel": {
  10058. "idx": 663,
  10059. "alias": [
  10060. "selection.spreadsheet"
  10061. ],
  10062. "alternates": []
  10063. },
  10064. "Ext.layout.Context": {
  10065. "idx": 666,
  10066. "alias": [],
  10067. "alternates": []
  10068. },
  10069. "Ext.layout.ContextItem": {
  10070. "idx": 665,
  10071. "alias": [],
  10072. "alternates": []
  10073. },
  10074. "Ext.layout.Layout": {
  10075. "idx": 420,
  10076. "alias": [],
  10077. "alternates": []
  10078. },
  10079. "Ext.layout.SizeModel": {
  10080. "idx": 419,
  10081. "alias": [],
  10082. "alternates": []
  10083. },
  10084. "Ext.layout.component.Auto": {
  10085. "idx": 433,
  10086. "alias": [
  10087. "layout.autocomponent"
  10088. ],
  10089. "alternates": []
  10090. },
  10091. "Ext.layout.component.Body": {
  10092. "idx": 668,
  10093. "alias": [
  10094. "layout.body"
  10095. ],
  10096. "alternates": []
  10097. },
  10098. "Ext.layout.component.BoundList": {
  10099. "idx": 533,
  10100. "alias": [
  10101. "layout.boundlist"
  10102. ],
  10103. "alternates": []
  10104. },
  10105. "Ext.layout.component.Component": {
  10106. "idx": 432,
  10107. "alias": [],
  10108. "alternates": []
  10109. },
  10110. "Ext.layout.component.Dock": {
  10111. "idx": 463,
  10112. "alias": [
  10113. "layout.dock"
  10114. ],
  10115. "alternates": [
  10116. "Ext.layout.component.AbstractDock"
  10117. ]
  10118. },
  10119. "Ext.layout.component.FieldSet": {
  10120. "idx": 669,
  10121. "alias": [
  10122. "layout.fieldset"
  10123. ],
  10124. "alternates": []
  10125. },
  10126. "Ext.layout.component.ProgressBar": {
  10127. "idx": 434,
  10128. "alias": [
  10129. "layout.progressbar"
  10130. ],
  10131. "alternates": []
  10132. },
  10133. "Ext.layout.component.field.FieldContainer": {
  10134. "idx": 510,
  10135. "alias": [
  10136. "layout.fieldcontainer"
  10137. ],
  10138. "alternates": []
  10139. },
  10140. "Ext.layout.component.field.HtmlEditor": {
  10141. "idx": 555,
  10142. "alias": [
  10143. "layout.htmleditor"
  10144. ],
  10145. "alternates": []
  10146. },
  10147. "Ext.layout.component.field.Text": {
  10148. "idx": 503,
  10149. "alias": [
  10150. "layout.textfield"
  10151. ],
  10152. "alternates": []
  10153. },
  10154. "Ext.layout.container.Absolute": {
  10155. "idx": 670,
  10156. "alias": [
  10157. "layout.absolute"
  10158. ],
  10159. "alternates": [
  10160. "Ext.layout.AbsoluteLayout"
  10161. ]
  10162. },
  10163. "Ext.layout.container.Accordion": {
  10164. "idx": 671,
  10165. "alias": [
  10166. "layout.accordion"
  10167. ],
  10168. "alternates": [
  10169. "Ext.layout.AccordionLayout"
  10170. ]
  10171. },
  10172. "Ext.layout.container.Anchor": {
  10173. "idx": 472,
  10174. "alias": [
  10175. "layout.anchor"
  10176. ],
  10177. "alternates": [
  10178. "Ext.layout.AnchorLayout"
  10179. ]
  10180. },
  10181. "Ext.layout.container.Auto": {
  10182. "idx": 422,
  10183. "alias": [
  10184. "layout.auto",
  10185. "layout.autocontainer"
  10186. ],
  10187. "alternates": []
  10188. },
  10189. "Ext.layout.container.Border": {
  10190. "idx": 673,
  10191. "alias": [
  10192. "layout.border"
  10193. ],
  10194. "alternates": [
  10195. "Ext.layout.BorderLayout"
  10196. ]
  10197. },
  10198. "Ext.layout.container.Box": {
  10199. "idx": 452,
  10200. "alias": [
  10201. "layout.box"
  10202. ],
  10203. "alternates": [
  10204. "Ext.layout.BoxLayout"
  10205. ]
  10206. },
  10207. "Ext.layout.container.Card": {
  10208. "idx": 674,
  10209. "alias": [
  10210. "layout.card"
  10211. ],
  10212. "alternates": [
  10213. "Ext.layout.CardLayout"
  10214. ]
  10215. },
  10216. "Ext.layout.container.Center": {
  10217. "idx": 675,
  10218. "alias": [
  10219. "layout.center",
  10220. "layout.ux.center"
  10221. ],
  10222. "alternates": [
  10223. "Ext.ux.layout.Center"
  10224. ]
  10225. },
  10226. "Ext.layout.container.CheckboxGroup": {
  10227. "idx": 513,
  10228. "alias": [
  10229. "layout.checkboxgroup"
  10230. ],
  10231. "alternates": []
  10232. },
  10233. "Ext.layout.container.Column": {
  10234. "idx": 475,
  10235. "alias": [
  10236. "layout.column"
  10237. ],
  10238. "alternates": [
  10239. "Ext.layout.ColumnLayout"
  10240. ]
  10241. },
  10242. "Ext.layout.container.ColumnSplitter": {
  10243. "idx": 479,
  10244. "alias": [
  10245. "widget.columnsplitter"
  10246. ],
  10247. "alternates": []
  10248. },
  10249. "Ext.layout.container.ColumnSplitterTracker": {
  10250. "idx": 478,
  10251. "alias": [],
  10252. "alternates": []
  10253. },
  10254. "Ext.layout.container.Container": {
  10255. "idx": 421,
  10256. "alias": [
  10257. "layout.container"
  10258. ],
  10259. "alternates": [
  10260. "Ext.layout.ContainerLayout"
  10261. ]
  10262. },
  10263. "Ext.layout.container.Dashboard": {
  10264. "idx": 480,
  10265. "alias": [
  10266. "layout.dashboard"
  10267. ],
  10268. "alternates": []
  10269. },
  10270. "Ext.layout.container.Editor": {
  10271. "idx": 425,
  10272. "alias": [
  10273. "layout.editor"
  10274. ],
  10275. "alternates": []
  10276. },
  10277. "Ext.layout.container.Fit": {
  10278. "idx": 567,
  10279. "alias": [
  10280. "layout.fit"
  10281. ],
  10282. "alternates": [
  10283. "Ext.layout.FitLayout",
  10284. "Ext.layout.Fit"
  10285. ]
  10286. },
  10287. "Ext.layout.container.Form": {
  10288. "idx": 676,
  10289. "alias": [
  10290. "layout.form"
  10291. ],
  10292. "alternates": [
  10293. "Ext.layout.FormLayout"
  10294. ]
  10295. },
  10296. "Ext.layout.container.HBox": {
  10297. "idx": 453,
  10298. "alias": [
  10299. "layout.hbox"
  10300. ],
  10301. "alternates": [
  10302. "Ext.layout.HBoxLayout"
  10303. ]
  10304. },
  10305. "Ext.layout.container.SegmentedButton": {
  10306. "idx": 442,
  10307. "alias": [
  10308. "layout.segmentedbutton"
  10309. ],
  10310. "alternates": []
  10311. },
  10312. "Ext.layout.container.Table": {
  10313. "idx": 467,
  10314. "alias": [
  10315. "layout.table"
  10316. ],
  10317. "alternates": [
  10318. "Ext.layout.TableLayout"
  10319. ]
  10320. },
  10321. "Ext.layout.container.VBox": {
  10322. "idx": 454,
  10323. "alias": [
  10324. "layout.vbox"
  10325. ],
  10326. "alternates": [
  10327. "Ext.layout.VBoxLayout"
  10328. ]
  10329. },
  10330. "Ext.layout.container.border.Region": {
  10331. "idx": 119,
  10332. "alias": [],
  10333. "alternates": []
  10334. },
  10335. "Ext.layout.container.boxOverflow.Menu": {
  10336. "idx": 557,
  10337. "alias": [
  10338. "box.overflow.Menu",
  10339. "box.overflow.menu"
  10340. ],
  10341. "alternates": [
  10342. "Ext.layout.boxOverflow.Menu"
  10343. ]
  10344. },
  10345. "Ext.layout.container.boxOverflow.None": {
  10346. "idx": 448,
  10347. "alias": [
  10348. "box.overflow.None",
  10349. "box.overflow.none"
  10350. ],
  10351. "alternates": [
  10352. "Ext.layout.boxOverflow.None"
  10353. ]
  10354. },
  10355. "Ext.layout.container.boxOverflow.Scroller": {
  10356. "idx": 449,
  10357. "alias": [
  10358. "box.overflow.Scroller",
  10359. "box.overflow.scroller"
  10360. ],
  10361. "alternates": [
  10362. "Ext.layout.boxOverflow.Scroller"
  10363. ]
  10364. },
  10365. "Ext.list.AbstractTreeItem": {
  10366. "idx": 364,
  10367. "alias": [],
  10368. "alternates": []
  10369. },
  10370. "Ext.list.RootTreeItem": {
  10371. "idx": 365,
  10372. "alias": [],
  10373. "alternates": []
  10374. },
  10375. "Ext.list.Tree": {
  10376. "idx": 368,
  10377. "alias": [
  10378. "widget.treelist"
  10379. ],
  10380. "alternates": []
  10381. },
  10382. "Ext.list.TreeItem": {
  10383. "idx": 367,
  10384. "alias": [
  10385. "widget.treelistitem"
  10386. ],
  10387. "alternates": []
  10388. },
  10389. "Ext.menu.Bar": {
  10390. "idx": 677,
  10391. "alias": [
  10392. "widget.menubar"
  10393. ],
  10394. "alternates": []
  10395. },
  10396. "Ext.menu.CheckItem": {
  10397. "idx": 611,
  10398. "alias": [
  10399. "widget.menucheckitem"
  10400. ],
  10401. "alternates": []
  10402. },
  10403. "Ext.menu.ColorPicker": {
  10404. "idx": 678,
  10405. "alias": [
  10406. "widget.colormenu"
  10407. ],
  10408. "alternates": []
  10409. },
  10410. "Ext.menu.DatePicker": {
  10411. "idx": 679,
  10412. "alias": [
  10413. "widget.datemenu"
  10414. ],
  10415. "alternates": []
  10416. },
  10417. "Ext.menu.Item": {
  10418. "idx": 610,
  10419. "alias": [
  10420. "widget.menuitem"
  10421. ],
  10422. "alternates": [
  10423. "Ext.menu.TextItem"
  10424. ]
  10425. },
  10426. "Ext.menu.Manager": {
  10427. "idx": 438,
  10428. "alias": [],
  10429. "alternates": [
  10430. "Ext.menu.MenuMgr"
  10431. ]
  10432. },
  10433. "Ext.menu.Menu": {
  10434. "idx": 613,
  10435. "alias": [
  10436. "widget.menu"
  10437. ],
  10438. "alternates": []
  10439. },
  10440. "Ext.menu.Separator": {
  10441. "idx": 612,
  10442. "alias": [
  10443. "widget.menuseparator"
  10444. ],
  10445. "alternates": []
  10446. },
  10447. "Ext.mixin.Accessible": {
  10448. "idx": 88,
  10449. "alias": [],
  10450. "alternates": []
  10451. },
  10452. "Ext.mixin.Bindable": {
  10453. "idx": 82,
  10454. "alias": [],
  10455. "alternates": []
  10456. },
  10457. "Ext.mixin.Bufferable": {
  10458. "idx": 20,
  10459. "alias": [],
  10460. "alternates": []
  10461. },
  10462. "Ext.mixin.ComponentDelegation": {
  10463. "idx": 83,
  10464. "alias": [],
  10465. "alternates": []
  10466. },
  10467. "Ext.mixin.ConfigProxy": {
  10468. "idx": 369,
  10469. "alias": [],
  10470. "alternates": []
  10471. },
  10472. "Ext.mixin.ConfigState": {
  10473. "idx": 370,
  10474. "alias": [],
  10475. "alternates": []
  10476. },
  10477. "Ext.mixin.Container": {
  10478. "idx": 371,
  10479. "alias": [],
  10480. "alternates": []
  10481. },
  10482. "Ext.mixin.Dirty": {
  10483. "idx": 201,
  10484. "alias": [],
  10485. "alternates": []
  10486. },
  10487. "Ext.mixin.Factoryable": {
  10488. "idx": 12,
  10489. "alias": [],
  10490. "alternates": []
  10491. },
  10492. "Ext.mixin.Focusable": {
  10493. "idx": 87,
  10494. "alias": [],
  10495. "alternates": []
  10496. },
  10497. "Ext.mixin.FocusableContainer": {
  10498. "idx": 374,
  10499. "alias": [],
  10500. "alternates": []
  10501. },
  10502. "Ext.mixin.Hookable": {
  10503. "idx": 375,
  10504. "alias": [],
  10505. "alternates": []
  10506. },
  10507. "Ext.mixin.Identifiable": {
  10508. "idx": 3,
  10509. "alias": [],
  10510. "alternates": []
  10511. },
  10512. "Ext.mixin.Inheritable": {
  10513. "idx": 81,
  10514. "alias": [],
  10515. "alternates": []
  10516. },
  10517. "Ext.mixin.ItemRippler": {
  10518. "idx": 366,
  10519. "alias": [],
  10520. "alternates": []
  10521. },
  10522. "Ext.mixin.Keyboard": {
  10523. "idx": 86,
  10524. "alias": [],
  10525. "alternates": []
  10526. },
  10527. "Ext.mixin.Mashup": {
  10528. "idx": 376,
  10529. "alias": [],
  10530. "alternates": []
  10531. },
  10532. "Ext.mixin.Observable": {
  10533. "idx": 4,
  10534. "alias": [],
  10535. "alternates": []
  10536. },
  10537. "Ext.mixin.Pluggable": {
  10538. "idx": 85,
  10539. "alias": [],
  10540. "alternates": []
  10541. },
  10542. "Ext.mixin.Queryable": {
  10543. "idx": 241,
  10544. "alias": [],
  10545. "alternates": []
  10546. },
  10547. "Ext.mixin.Responsive": {
  10548. "idx": 90,
  10549. "alias": [],
  10550. "alternates": []
  10551. },
  10552. "Ext.mixin.Selectable": {
  10553. "idx": 377,
  10554. "alias": [],
  10555. "alternates": []
  10556. },
  10557. "Ext.mixin.StoreWatcher": {
  10558. "idx": 378,
  10559. "alias": [],
  10560. "alternates": []
  10561. },
  10562. "Ext.mixin.StyleCacher": {
  10563. "idx": 379,
  10564. "alias": [],
  10565. "alternates": []
  10566. },
  10567. "Ext.mixin.Templatable": {
  10568. "idx": 39,
  10569. "alias": [],
  10570. "alternates": []
  10571. },
  10572. "Ext.mixin.Traversable": {
  10573. "idx": 380,
  10574. "alias": [],
  10575. "alternates": []
  10576. },
  10577. "Ext.panel.Bar": {
  10578. "idx": 444,
  10579. "alias": [],
  10580. "alternates": []
  10581. },
  10582. "Ext.panel.DD": {
  10583. "idx": 462,
  10584. "alias": [],
  10585. "alternates": []
  10586. },
  10587. "Ext.panel.Header": {
  10588. "idx": 447,
  10589. "alias": [
  10590. "widget.header"
  10591. ],
  10592. "alternates": []
  10593. },
  10594. "Ext.panel.Panel": {
  10595. "idx": 466,
  10596. "alias": [
  10597. "widget.panel"
  10598. ],
  10599. "alternates": [
  10600. "Ext.Panel"
  10601. ]
  10602. },
  10603. "Ext.panel.Pinnable": {
  10604. "idx": 680,
  10605. "alias": [],
  10606. "alternates": []
  10607. },
  10608. "Ext.panel.Proxy": {
  10609. "idx": 461,
  10610. "alias": [],
  10611. "alternates": [
  10612. "Ext.dd.PanelProxy"
  10613. ]
  10614. },
  10615. "Ext.panel.Table": {
  10616. "idx": 568,
  10617. "alias": [
  10618. "widget.tablepanel"
  10619. ],
  10620. "alternates": []
  10621. },
  10622. "Ext.panel.Title": {
  10623. "idx": 445,
  10624. "alias": [
  10625. "widget.title"
  10626. ],
  10627. "alternates": []
  10628. },
  10629. "Ext.panel.Tool": {
  10630. "idx": 446,
  10631. "alias": [
  10632. "widget.tool"
  10633. ],
  10634. "alternates": []
  10635. },
  10636. "Ext.parse.Parser": {
  10637. "idx": 220,
  10638. "alias": [],
  10639. "alternates": []
  10640. },
  10641. "Ext.parse.Symbol": {
  10642. "idx": 214,
  10643. "alias": [],
  10644. "alternates": []
  10645. },
  10646. "Ext.parse.Tokenizer": {
  10647. "idx": 213,
  10648. "alias": [],
  10649. "alternates": []
  10650. },
  10651. "Ext.parse.symbol.Constant": {
  10652. "idx": 215,
  10653. "alias": [],
  10654. "alternates": []
  10655. },
  10656. "Ext.parse.symbol.Infix": {
  10657. "idx": 216,
  10658. "alias": [],
  10659. "alternates": []
  10660. },
  10661. "Ext.parse.symbol.InfixRight": {
  10662. "idx": 217,
  10663. "alias": [],
  10664. "alternates": []
  10665. },
  10666. "Ext.parse.symbol.Paren": {
  10667. "idx": 218,
  10668. "alias": [],
  10669. "alternates": []
  10670. },
  10671. "Ext.parse.symbol.Prefix": {
  10672. "idx": 219,
  10673. "alias": [],
  10674. "alternates": []
  10675. },
  10676. "Ext.perf.Accumulator": {
  10677. "idx": 381,
  10678. "alias": [],
  10679. "alternates": []
  10680. },
  10681. "Ext.perf.Monitor": {
  10682. "idx": 382,
  10683. "alias": [],
  10684. "alternates": [
  10685. "Ext.Perf"
  10686. ]
  10687. },
  10688. "Ext.picker.Color": {
  10689. "idx": 554,
  10690. "alias": [
  10691. "widget.colorpicker"
  10692. ],
  10693. "alternates": [
  10694. "Ext.ColorPalette"
  10695. ]
  10696. },
  10697. "Ext.picker.Date": {
  10698. "idx": 543,
  10699. "alias": [
  10700. "widget.datepicker"
  10701. ],
  10702. "alternates": [
  10703. "Ext.DatePicker"
  10704. ]
  10705. },
  10706. "Ext.picker.Month": {
  10707. "idx": 542,
  10708. "alias": [
  10709. "widget.monthpicker"
  10710. ],
  10711. "alternates": [
  10712. "Ext.MonthPicker"
  10713. ]
  10714. },
  10715. "Ext.picker.Time": {
  10716. "idx": 561,
  10717. "alias": [
  10718. "widget.timepicker"
  10719. ],
  10720. "alternates": []
  10721. },
  10722. "Ext.plugin.Abstract": {
  10723. "idx": 84,
  10724. "alias": [],
  10725. "alternates": [
  10726. "Ext.AbstractPlugin"
  10727. ]
  10728. },
  10729. "Ext.plugin.AbstractClipboard": {
  10730. "idx": 383,
  10731. "alias": [],
  10732. "alternates": []
  10733. },
  10734. "Ext.plugin.LazyItems": {
  10735. "idx": 681,
  10736. "alias": [
  10737. "plugin.lazyitems"
  10738. ],
  10739. "alternates": []
  10740. },
  10741. "Ext.plugin.Manager": {
  10742. "idx": 103,
  10743. "alias": [],
  10744. "alternates": [
  10745. "Ext.PluginManager",
  10746. "Ext.PluginMgr"
  10747. ]
  10748. },
  10749. "Ext.plugin.MouseEnter": {
  10750. "idx": 384,
  10751. "alias": [
  10752. "plugin.mouseenter"
  10753. ],
  10754. "alternates": []
  10755. },
  10756. "Ext.plugin.Responsive": {
  10757. "idx": 682,
  10758. "alias": [
  10759. "plugin.responsive"
  10760. ],
  10761. "alternates": []
  10762. },
  10763. "Ext.plugin.Viewport": {
  10764. "idx": 470,
  10765. "alias": [
  10766. "plugin.viewport"
  10767. ],
  10768. "alternates": []
  10769. },
  10770. "Ext.promise.Consequence": {
  10771. "idx": 7,
  10772. "alias": [],
  10773. "alternates": []
  10774. },
  10775. "Ext.promise.Deferred": {
  10776. "idx": 8,
  10777. "alias": [],
  10778. "alternates": []
  10779. },
  10780. "Ext.promise.Promise": {
  10781. "idx": 9,
  10782. "alias": [],
  10783. "alternates": []
  10784. },
  10785. "Ext.resizer.BorderSplitter": {
  10786. "idx": 672,
  10787. "alias": [
  10788. "widget.bordersplitter"
  10789. ],
  10790. "alternates": []
  10791. },
  10792. "Ext.resizer.BorderSplitterTracker": {
  10793. "idx": 683,
  10794. "alias": [],
  10795. "alternates": []
  10796. },
  10797. "Ext.resizer.Handle": {
  10798. "idx": 684,
  10799. "alias": [],
  10800. "alternates": []
  10801. },
  10802. "Ext.resizer.ResizeTracker": {
  10803. "idx": 685,
  10804. "alias": [],
  10805. "alternates": []
  10806. },
  10807. "Ext.resizer.Resizer": {
  10808. "idx": 686,
  10809. "alias": [],
  10810. "alternates": [
  10811. "Ext.Resizable"
  10812. ]
  10813. },
  10814. "Ext.resizer.Splitter": {
  10815. "idx": 451,
  10816. "alias": [
  10817. "widget.splitter"
  10818. ],
  10819. "alternates": []
  10820. },
  10821. "Ext.resizer.SplitterTracker": {
  10822. "idx": 477,
  10823. "alias": [],
  10824. "alternates": []
  10825. },
  10826. "Ext.route.Action": {
  10827. "idx": 123,
  10828. "alias": [],
  10829. "alternates": []
  10830. },
  10831. "Ext.route.Handler": {
  10832. "idx": 122,
  10833. "alias": [],
  10834. "alternates": []
  10835. },
  10836. "Ext.route.Mixin": {
  10837. "idx": 127,
  10838. "alias": [],
  10839. "alternates": []
  10840. },
  10841. "Ext.route.Route": {
  10842. "idx": 124,
  10843. "alias": [],
  10844. "alternates": []
  10845. },
  10846. "Ext.route.Router": {
  10847. "idx": 126,
  10848. "alias": [],
  10849. "alternates": []
  10850. },
  10851. "Ext.scroll.LockingScroller": {
  10852. "idx": 625,
  10853. "alias": [
  10854. "scroller.locking"
  10855. ],
  10856. "alternates": []
  10857. },
  10858. "Ext.scroll.Scroller": {
  10859. "idx": 110,
  10860. "alias": [
  10861. "scroller.scroller"
  10862. ],
  10863. "alternates": [
  10864. "Ext.scroll.NativeScroller"
  10865. ]
  10866. },
  10867. "Ext.scroll.TableScroller": {
  10868. "idx": 575,
  10869. "alias": [
  10870. "scroller.table"
  10871. ],
  10872. "alternates": []
  10873. },
  10874. "Ext.selection.CellModel": {
  10875. "idx": 687,
  10876. "alias": [
  10877. "selection.cellmodel"
  10878. ],
  10879. "alternates": []
  10880. },
  10881. "Ext.selection.CheckboxModel": {
  10882. "idx": 689,
  10883. "alias": [
  10884. "selection.checkboxmodel"
  10885. ],
  10886. "alternates": []
  10887. },
  10888. "Ext.selection.DataViewModel": {
  10889. "idx": 528,
  10890. "alias": [
  10891. "selection.dataviewmodel"
  10892. ],
  10893. "alternates": []
  10894. },
  10895. "Ext.selection.Model": {
  10896. "idx": 527,
  10897. "alias": [
  10898. "selection.abstract"
  10899. ],
  10900. "alternates": [
  10901. "Ext.AbstractSelectionModel"
  10902. ]
  10903. },
  10904. "Ext.selection.RowModel": {
  10905. "idx": 688,
  10906. "alias": [
  10907. "selection.rowmodel"
  10908. ],
  10909. "alternates": []
  10910. },
  10911. "Ext.selection.TreeModel": {
  10912. "idx": 690,
  10913. "alias": [
  10914. "selection.treemodel"
  10915. ],
  10916. "alternates": []
  10917. },
  10918. "Ext.slider.Multi": {
  10919. "idx": 693,
  10920. "alias": [
  10921. "widget.multislider"
  10922. ],
  10923. "alternates": [
  10924. "Ext.slider.MultiSlider"
  10925. ]
  10926. },
  10927. "Ext.slider.Single": {
  10928. "idx": 694,
  10929. "alias": [
  10930. "widget.slider",
  10931. "widget.sliderfield"
  10932. ],
  10933. "alternates": [
  10934. "Ext.Slider",
  10935. "Ext.form.SliderField",
  10936. "Ext.slider.SingleSlider",
  10937. "Ext.slider.Slider"
  10938. ]
  10939. },
  10940. "Ext.slider.Thumb": {
  10941. "idx": 691,
  10942. "alias": [],
  10943. "alternates": []
  10944. },
  10945. "Ext.slider.Tip": {
  10946. "idx": 692,
  10947. "alias": [
  10948. "widget.slidertip"
  10949. ],
  10950. "alternates": []
  10951. },
  10952. "Ext.slider.Widget": {
  10953. "idx": 695,
  10954. "alias": [
  10955. "widget.sliderwidget"
  10956. ],
  10957. "alternates": []
  10958. },
  10959. "Ext.sparkline.Bar": {
  10960. "idx": 393,
  10961. "alias": [
  10962. "widget.sparklinebar"
  10963. ],
  10964. "alternates": []
  10965. },
  10966. "Ext.sparkline.BarBase": {
  10967. "idx": 391,
  10968. "alias": [],
  10969. "alternates": []
  10970. },
  10971. "Ext.sparkline.Base": {
  10972. "idx": 390,
  10973. "alias": [
  10974. "widget.sparkline"
  10975. ],
  10976. "alternates": []
  10977. },
  10978. "Ext.sparkline.Box": {
  10979. "idx": 394,
  10980. "alias": [
  10981. "widget.sparklinebox"
  10982. ],
  10983. "alternates": []
  10984. },
  10985. "Ext.sparkline.Bullet": {
  10986. "idx": 395,
  10987. "alias": [
  10988. "widget.sparklinebullet"
  10989. ],
  10990. "alternates": []
  10991. },
  10992. "Ext.sparkline.CanvasBase": {
  10993. "idx": 386,
  10994. "alias": [],
  10995. "alternates": []
  10996. },
  10997. "Ext.sparkline.CanvasCanvas": {
  10998. "idx": 387,
  10999. "alias": [],
  11000. "alternates": []
  11001. },
  11002. "Ext.sparkline.Discrete": {
  11003. "idx": 396,
  11004. "alias": [
  11005. "widget.sparklinediscrete"
  11006. ],
  11007. "alternates": []
  11008. },
  11009. "Ext.sparkline.Line": {
  11010. "idx": 397,
  11011. "alias": [
  11012. "widget.sparklineline"
  11013. ],
  11014. "alternates": []
  11015. },
  11016. "Ext.sparkline.Pie": {
  11017. "idx": 398,
  11018. "alias": [
  11019. "widget.sparklinepie"
  11020. ],
  11021. "alternates": []
  11022. },
  11023. "Ext.sparkline.RangeMap": {
  11024. "idx": 392,
  11025. "alias": [],
  11026. "alternates": []
  11027. },
  11028. "Ext.sparkline.Shape": {
  11029. "idx": 385,
  11030. "alias": [],
  11031. "alternates": []
  11032. },
  11033. "Ext.sparkline.TriState": {
  11034. "idx": 399,
  11035. "alias": [
  11036. "widget.sparklinetristate"
  11037. ],
  11038. "alternates": []
  11039. },
  11040. "Ext.sparkline.VmlCanvas": {
  11041. "idx": 388,
  11042. "alias": [],
  11043. "alternates": []
  11044. },
  11045. "Ext.state.CookieProvider": {
  11046. "idx": 696,
  11047. "alias": [],
  11048. "alternates": []
  11049. },
  11050. "Ext.state.LocalStorageProvider": {
  11051. "idx": 697,
  11052. "alias": [
  11053. "state.localstorage"
  11054. ],
  11055. "alternates": []
  11056. },
  11057. "Ext.state.Manager": {
  11058. "idx": 115,
  11059. "alias": [],
  11060. "alternates": []
  11061. },
  11062. "Ext.state.Provider": {
  11063. "idx": 114,
  11064. "alias": [],
  11065. "alternates": []
  11066. },
  11067. "Ext.state.Stateful": {
  11068. "idx": 116,
  11069. "alias": [],
  11070. "alternates": []
  11071. },
  11072. "Ext.tab.Bar": {
  11073. "idx": 699,
  11074. "alias": [
  11075. "widget.tabbar"
  11076. ],
  11077. "alternates": []
  11078. },
  11079. "Ext.tab.Panel": {
  11080. "idx": 700,
  11081. "alias": [
  11082. "widget.tabpanel"
  11083. ],
  11084. "alternates": [
  11085. "Ext.TabPanel"
  11086. ]
  11087. },
  11088. "Ext.tab.Tab": {
  11089. "idx": 698,
  11090. "alias": [
  11091. "widget.tab"
  11092. ],
  11093. "alternates": []
  11094. },
  11095. "Ext.tip.QuickTip": {
  11096. "idx": 552,
  11097. "alias": [
  11098. "widget.quicktip"
  11099. ],
  11100. "alternates": [
  11101. "Ext.QuickTip"
  11102. ]
  11103. },
  11104. "Ext.tip.QuickTipManager": {
  11105. "idx": 553,
  11106. "alias": [],
  11107. "alternates": [
  11108. "Ext.QuickTips"
  11109. ]
  11110. },
  11111. "Ext.tip.Tip": {
  11112. "idx": 550,
  11113. "alias": [
  11114. "widget.tip"
  11115. ],
  11116. "alternates": [
  11117. "Ext.Tip"
  11118. ]
  11119. },
  11120. "Ext.tip.ToolTip": {
  11121. "idx": 551,
  11122. "alias": [
  11123. "widget.tooltip"
  11124. ],
  11125. "alternates": [
  11126. "Ext.ToolTip"
  11127. ]
  11128. },
  11129. "Ext.toolbar.Breadcrumb": {
  11130. "idx": 701,
  11131. "alias": [
  11132. "widget.breadcrumb"
  11133. ],
  11134. "alternates": []
  11135. },
  11136. "Ext.toolbar.Fill": {
  11137. "idx": 702,
  11138. "alias": [
  11139. "widget.tbfill"
  11140. ],
  11141. "alternates": [
  11142. "Ext.Toolbar.Fill"
  11143. ]
  11144. },
  11145. "Ext.toolbar.Item": {
  11146. "idx": 534,
  11147. "alias": [
  11148. "widget.tbitem"
  11149. ],
  11150. "alternates": [
  11151. "Ext.Toolbar.Item"
  11152. ]
  11153. },
  11154. "Ext.toolbar.Paging": {
  11155. "idx": 539,
  11156. "alias": [
  11157. "widget.pagingtoolbar"
  11158. ],
  11159. "alternates": [
  11160. "Ext.PagingToolbar"
  11161. ]
  11162. },
  11163. "Ext.toolbar.Separator": {
  11164. "idx": 556,
  11165. "alias": [
  11166. "widget.tbseparator"
  11167. ],
  11168. "alternates": [
  11169. "Ext.Toolbar.Separator"
  11170. ]
  11171. },
  11172. "Ext.toolbar.Spacer": {
  11173. "idx": 703,
  11174. "alias": [
  11175. "widget.tbspacer"
  11176. ],
  11177. "alternates": [
  11178. "Ext.Toolbar.Spacer"
  11179. ]
  11180. },
  11181. "Ext.toolbar.TextItem": {
  11182. "idx": 535,
  11183. "alias": [
  11184. "widget.tbtext"
  11185. ],
  11186. "alternates": [
  11187. "Ext.Toolbar.TextItem"
  11188. ]
  11189. },
  11190. "Ext.toolbar.Toolbar": {
  11191. "idx": 455,
  11192. "alias": [
  11193. "widget.toolbar"
  11194. ],
  11195. "alternates": [
  11196. "Ext.Toolbar"
  11197. ]
  11198. },
  11199. "Ext.tree.Column": {
  11200. "idx": 704,
  11201. "alias": [
  11202. "widget.treecolumn"
  11203. ],
  11204. "alternates": []
  11205. },
  11206. "Ext.tree.NavigationModel": {
  11207. "idx": 705,
  11208. "alias": [
  11209. "view.navigation.tree"
  11210. ],
  11211. "alternates": []
  11212. },
  11213. "Ext.tree.Panel": {
  11214. "idx": 707,
  11215. "alias": [
  11216. "widget.treepanel"
  11217. ],
  11218. "alternates": [
  11219. "Ext.tree.TreePanel",
  11220. "Ext.TreePanel"
  11221. ]
  11222. },
  11223. "Ext.tree.View": {
  11224. "idx": 706,
  11225. "alias": [
  11226. "widget.treeview"
  11227. ],
  11228. "alternates": []
  11229. },
  11230. "Ext.tree.ViewDragZone": {
  11231. "idx": 709,
  11232. "alias": [],
  11233. "alternates": []
  11234. },
  11235. "Ext.tree.ViewDropZone": {
  11236. "idx": 710,
  11237. "alias": [],
  11238. "alternates": []
  11239. },
  11240. "Ext.tree.plugin.TreeViewDragDrop": {
  11241. "idx": 711,
  11242. "alias": [
  11243. "plugin.treeviewdragdrop"
  11244. ],
  11245. "alternates": []
  11246. },
  11247. "Ext.util.AbstractMixedCollection": {
  11248. "idx": 53,
  11249. "alias": [],
  11250. "alternates": []
  11251. },
  11252. "Ext.util.Animate": {
  11253. "idx": 74,
  11254. "alias": [],
  11255. "alternates": []
  11256. },
  11257. "Ext.util.Bag": {
  11258. "idx": 192,
  11259. "alias": [],
  11260. "alternates": []
  11261. },
  11262. "Ext.util.Base64": {
  11263. "idx": 400,
  11264. "alias": [],
  11265. "alternates": []
  11266. },
  11267. "Ext.util.BasicFilter": {
  11268. "idx": 50,
  11269. "alias": [],
  11270. "alternates": []
  11271. },
  11272. "Ext.util.CSS": {
  11273. "idx": 104,
  11274. "alias": [],
  11275. "alternates": []
  11276. },
  11277. "Ext.util.CSV": {
  11278. "idx": 402,
  11279. "alias": [],
  11280. "alternates": []
  11281. },
  11282. "Ext.util.ClickRepeater": {
  11283. "idx": 403,
  11284. "alias": [],
  11285. "alternates": [
  11286. "Ext.util.TapRepeater"
  11287. ]
  11288. },
  11289. "Ext.util.Collection": {
  11290. "idx": 132,
  11291. "alias": [],
  11292. "alternates": []
  11293. },
  11294. "Ext.util.CollectionKey": {
  11295. "idx": 130,
  11296. "alias": [],
  11297. "alternates": []
  11298. },
  11299. "Ext.util.Color": {
  11300. "idx": 389,
  11301. "alias": [],
  11302. "alternates": [
  11303. "Ext.draw.Color"
  11304. ]
  11305. },
  11306. "Ext.util.ComponentDragger": {
  11307. "idx": 498,
  11308. "alias": [],
  11309. "alternates": []
  11310. },
  11311. "Ext.util.Cookies": {
  11312. "idx": 404,
  11313. "alias": [],
  11314. "alternates": []
  11315. },
  11316. "Ext.util.DelimitedValue": {
  11317. "idx": 401,
  11318. "alias": [],
  11319. "alternates": []
  11320. },
  11321. "Ext.util.ElementContainer": {
  11322. "idx": 112,
  11323. "alias": [],
  11324. "alternates": []
  11325. },
  11326. "Ext.util.Event": {
  11327. "idx": 2,
  11328. "alias": [],
  11329. "alternates": []
  11330. },
  11331. "Ext.util.Filter": {
  11332. "idx": 51,
  11333. "alias": [],
  11334. "alternates": []
  11335. },
  11336. "Ext.util.FilterCollection": {
  11337. "idx": 179,
  11338. "alias": [],
  11339. "alternates": []
  11340. },
  11341. "Ext.util.Floating": {
  11342. "idx": 111,
  11343. "alias": [],
  11344. "alternates": []
  11345. },
  11346. "Ext.util.Fly": {
  11347. "idx": 212,
  11348. "alias": [],
  11349. "alternates": []
  11350. },
  11351. "Ext.util.Format": {
  11352. "idx": 94,
  11353. "alias": [],
  11354. "alternates": []
  11355. },
  11356. "Ext.util.Group": {
  11357. "idx": 171,
  11358. "alias": [],
  11359. "alternates": []
  11360. },
  11361. "Ext.util.GroupCollection": {
  11362. "idx": 181,
  11363. "alias": [],
  11364. "alternates": []
  11365. },
  11366. "Ext.util.Grouper": {
  11367. "idx": 131,
  11368. "alias": [],
  11369. "alternates": []
  11370. },
  11371. "Ext.util.GrouperCollection": {
  11372. "idx": 180,
  11373. "alias": [],
  11374. "alternates": []
  11375. },
  11376. "Ext.util.HashMap": {
  11377. "idx": 5,
  11378. "alias": [],
  11379. "alternates": []
  11380. },
  11381. "Ext.util.History": {
  11382. "idx": 125,
  11383. "alias": [],
  11384. "alternates": [
  11385. "Ext.History"
  11386. ]
  11387. },
  11388. "Ext.util.Inflector": {
  11389. "idx": 140,
  11390. "alias": [],
  11391. "alternates": []
  11392. },
  11393. "Ext.util.ItemCollection": {
  11394. "idx": 405,
  11395. "alias": [],
  11396. "alternates": [
  11397. "Ext.ItemCollection"
  11398. ]
  11399. },
  11400. "Ext.util.KeyMap": {
  11401. "idx": 372,
  11402. "alias": [],
  11403. "alternates": [
  11404. "Ext.KeyMap"
  11405. ]
  11406. },
  11407. "Ext.util.KeyNav": {
  11408. "idx": 373,
  11409. "alias": [],
  11410. "alternates": [
  11411. "Ext.KeyNav"
  11412. ]
  11413. },
  11414. "Ext.util.LocalStorage": {
  11415. "idx": 406,
  11416. "alias": [],
  11417. "alternates": []
  11418. },
  11419. "Ext.util.LruCache": {
  11420. "idx": 23,
  11421. "alias": [],
  11422. "alternates": []
  11423. },
  11424. "Ext.util.Memento": {
  11425. "idx": 464,
  11426. "alias": [],
  11427. "alternates": []
  11428. },
  11429. "Ext.util.MixedCollection": {
  11430. "idx": 56,
  11431. "alias": [],
  11432. "alternates": []
  11433. },
  11434. "Ext.util.ObjectTemplate": {
  11435. "idx": 134,
  11436. "alias": [],
  11437. "alternates": []
  11438. },
  11439. "Ext.util.Observable": {
  11440. "idx": 52,
  11441. "alias": [],
  11442. "alternates": []
  11443. },
  11444. "Ext.util.Offset": {
  11445. "idx": 33,
  11446. "alias": [],
  11447. "alternates": []
  11448. },
  11449. "Ext.util.PaintMonitor": {
  11450. "idx": 47,
  11451. "alias": [],
  11452. "alternates": []
  11453. },
  11454. "Ext.util.Point": {
  11455. "idx": 35,
  11456. "alias": [],
  11457. "alternates": []
  11458. },
  11459. "Ext.util.Positionable": {
  11460. "idx": 26,
  11461. "alias": [],
  11462. "alternates": []
  11463. },
  11464. "Ext.util.ProtoElement": {
  11465. "idx": 101,
  11466. "alias": [],
  11467. "alternates": []
  11468. },
  11469. "Ext.util.Queue": {
  11470. "idx": 664,
  11471. "alias": [],
  11472. "alternates": []
  11473. },
  11474. "Ext.util.Region": {
  11475. "idx": 34,
  11476. "alias": [],
  11477. "alternates": []
  11478. },
  11479. "Ext.util.Renderable": {
  11480. "idx": 113,
  11481. "alias": [],
  11482. "alternates": []
  11483. },
  11484. "Ext.util.Schedulable": {
  11485. "idx": 203,
  11486. "alias": [],
  11487. "alternates": []
  11488. },
  11489. "Ext.util.Scheduler": {
  11490. "idx": 193,
  11491. "alias": [],
  11492. "alternates": []
  11493. },
  11494. "Ext.util.SizeMonitor": {
  11495. "idx": 43,
  11496. "alias": [],
  11497. "alternates": []
  11498. },
  11499. "Ext.util.Sortable": {
  11500. "idx": 55,
  11501. "alias": [],
  11502. "alternates": []
  11503. },
  11504. "Ext.util.Sorter": {
  11505. "idx": 54,
  11506. "alias": [],
  11507. "alternates": []
  11508. },
  11509. "Ext.util.SorterCollection": {
  11510. "idx": 178,
  11511. "alias": [],
  11512. "alternates": []
  11513. },
  11514. "Ext.util.Spans": {
  11515. "idx": 407,
  11516. "alias": [],
  11517. "alternates": []
  11518. },
  11519. "Ext.util.StoreHolder": {
  11520. "idx": 430,
  11521. "alias": [],
  11522. "alternates": []
  11523. },
  11524. "Ext.util.TaskManager": {
  11525. "idx": 409,
  11526. "alias": [],
  11527. "alternates": [
  11528. "Ext.TaskManager"
  11529. ]
  11530. },
  11531. "Ext.util.TaskRunner": {
  11532. "idx": 57,
  11533. "alias": [],
  11534. "alternates": []
  11535. },
  11536. "Ext.util.TextMetrics": {
  11537. "idx": 410,
  11538. "alias": [],
  11539. "alternates": []
  11540. },
  11541. "Ext.util.TsvDecoder": {
  11542. "idx": 408,
  11543. "alias": [],
  11544. "alternates": [
  11545. "Ext.util.TSV"
  11546. ]
  11547. },
  11548. "Ext.util.XTemplateCompiler": {
  11549. "idx": 97,
  11550. "alias": [],
  11551. "alternates": []
  11552. },
  11553. "Ext.util.XTemplateParser": {
  11554. "idx": 96,
  11555. "alias": [],
  11556. "alternates": []
  11557. },
  11558. "Ext.util.paintmonitor.Abstract": {
  11559. "idx": 45,
  11560. "alias": [],
  11561. "alternates": []
  11562. },
  11563. "Ext.util.paintmonitor.CssAnimation": {
  11564. "idx": 46,
  11565. "alias": [],
  11566. "alternates": []
  11567. },
  11568. "Ext.util.paintmonitor.OverflowChange": {
  11569. "idx": 411,
  11570. "alias": [],
  11571. "alternates": []
  11572. },
  11573. "Ext.util.sizemonitor.Abstract": {
  11574. "idx": 41,
  11575. "alias": [],
  11576. "alternates": []
  11577. },
  11578. "Ext.util.sizemonitor.OverflowChange": {
  11579. "idx": 412,
  11580. "alias": [],
  11581. "alternates": []
  11582. },
  11583. "Ext.util.sizemonitor.Scroll": {
  11584. "idx": 42,
  11585. "alias": [],
  11586. "alternates": []
  11587. },
  11588. "Ext.util.translatable.Abstract": {
  11589. "idx": 107,
  11590. "alias": [],
  11591. "alternates": []
  11592. },
  11593. "Ext.util.translatable.CssPosition": {
  11594. "idx": 413,
  11595. "alias": [
  11596. "translatable.cssposition"
  11597. ],
  11598. "alternates": []
  11599. },
  11600. "Ext.util.translatable.CssTransform": {
  11601. "idx": 414,
  11602. "alias": [
  11603. "translatable.csstransform"
  11604. ],
  11605. "alternates": []
  11606. },
  11607. "Ext.util.translatable.Dom": {
  11608. "idx": 108,
  11609. "alias": [
  11610. "translatable.dom"
  11611. ],
  11612. "alternates": []
  11613. },
  11614. "Ext.util.translatable.ScrollParent": {
  11615. "idx": 415,
  11616. "alias": [
  11617. "translatable.scrollparent"
  11618. ],
  11619. "alternates": []
  11620. },
  11621. "Ext.util.translatable.ScrollPosition": {
  11622. "idx": 109,
  11623. "alias": [
  11624. "translatable.scrollposition"
  11625. ],
  11626. "alternates": []
  11627. },
  11628. "Ext.view.AbstractView": {
  11629. "idx": 530,
  11630. "alias": [],
  11631. "alternates": []
  11632. },
  11633. "Ext.view.BoundList": {
  11634. "idx": 540,
  11635. "alias": [
  11636. "widget.boundlist"
  11637. ],
  11638. "alternates": [
  11639. "Ext.BoundList"
  11640. ]
  11641. },
  11642. "Ext.view.BoundListKeyNav": {
  11643. "idx": 532,
  11644. "alias": [
  11645. "view.navigation.boundlist"
  11646. ],
  11647. "alternates": []
  11648. },
  11649. "Ext.view.DragZone": {
  11650. "idx": 708,
  11651. "alias": [],
  11652. "alternates": []
  11653. },
  11654. "Ext.view.DropZone": {
  11655. "idx": 582,
  11656. "alias": [],
  11657. "alternates": []
  11658. },
  11659. "Ext.view.MultiSelector": {
  11660. "idx": 713,
  11661. "alias": [
  11662. "widget.multiselector"
  11663. ],
  11664. "alternates": []
  11665. },
  11666. "Ext.view.MultiSelectorSearch": {
  11667. "idx": 712,
  11668. "alias": [
  11669. "widget.multiselector-search"
  11670. ],
  11671. "alternates": []
  11672. },
  11673. "Ext.view.NavigationModel": {
  11674. "idx": 529,
  11675. "alias": [
  11676. "view.navigation.default"
  11677. ],
  11678. "alternates": []
  11679. },
  11680. "Ext.view.NodeCache": {
  11681. "idx": 574,
  11682. "alias": [],
  11683. "alternates": []
  11684. },
  11685. "Ext.view.Table": {
  11686. "idx": 576,
  11687. "alias": [
  11688. "widget.gridview",
  11689. "widget.tableview"
  11690. ],
  11691. "alternates": [
  11692. "Ext.grid.View"
  11693. ]
  11694. },
  11695. "Ext.view.TableLayout": {
  11696. "idx": 572,
  11697. "alias": [
  11698. "layout.tableview"
  11699. ],
  11700. "alternates": []
  11701. },
  11702. "Ext.view.TagKeyNav": {
  11703. "idx": 559,
  11704. "alias": [
  11705. "view.navigation.tagfield"
  11706. ],
  11707. "alternates": []
  11708. },
  11709. "Ext.view.View": {
  11710. "idx": 531,
  11711. "alias": [
  11712. "widget.dataview"
  11713. ],
  11714. "alternates": [
  11715. "Ext.DataView"
  11716. ]
  11717. },
  11718. "Ext.window.MessageBox": {
  11719. "idx": 508,
  11720. "alias": [
  11721. "widget.messagebox"
  11722. ],
  11723. "alternates": []
  11724. },
  11725. "Ext.window.Toast": {
  11726. "idx": 714,
  11727. "alias": [
  11728. "widget.toast"
  11729. ],
  11730. "alternates": []
  11731. },
  11732. "Ext.window.Window": {
  11733. "idx": 499,
  11734. "alias": [
  11735. "widget.window"
  11736. ],
  11737. "alternates": [
  11738. "Ext.Window"
  11739. ]
  11740. }
  11741. },
  11742. "packages": {
  11743. "classic": {
  11744. "css": true,
  11745. "included": true,
  11746. "language": {
  11747. "js": {
  11748. "input": {
  11749. "version": "ES5"
  11750. }
  11751. }
  11752. },
  11753. "namespace": "Ext",
  11754. "properties": {
  11755. "skip.sass": 1,
  11756. "skip.pkg": 1,
  11757. "skip.slice": 1
  11758. },
  11759. "required": true,
  11760. "requires": [
  11761. "ext",
  11762. "core",
  11763. "classic"
  11764. ],
  11765. "version": "7.4.0.42"
  11766. },
  11767. "cmd": {
  11768. "version": "7.4.0.39"
  11769. },
  11770. "core": {
  11771. "css": true,
  11772. "included": true,
  11773. "properties": {
  11774. "skip.slice": 1,
  11775. "skip.style": 1,
  11776. "skip.pkg": 1,
  11777. "package.tags.classdefs": "class"
  11778. },
  11779. "required": true,
  11780. "requires": [
  11781. "ext"
  11782. ],
  11783. "version": "7.4.0.42"
  11784. },
  11785. "ext": {
  11786. "css": true,
  11787. "included": true,
  11788. "language": {
  11789. "js": {
  11790. "input": {
  11791. "version": "ES5"
  11792. }
  11793. }
  11794. },
  11795. "license": "commercial",
  11796. "namespace": "Ext",
  11797. "properties": {
  11798. "skip.sass": 1,
  11799. "skip.slice": 1
  11800. },
  11801. "required": true,
  11802. "requires": [],
  11803. "version": "7.4.0.42"
  11804. }
  11805. },
  11806. "bootRelative": true
  11807. });
  11808. // @tag core
  11809. // @define Ext.Boot
  11810. var Ext = Ext || {};
  11811. //<editor-fold desc="Boot">
  11812. /**
  11813. * @class Ext.Boot
  11814. * @singleton
  11815. * @private
  11816. */
  11817. Ext.Boot = Ext.Boot || (function(emptyFn) {
  11818. var doc = document,
  11819. _emptyArray = [],
  11820. _config = {
  11821. /**
  11822. * @cfg {Boolean} [disableCaching=true]
  11823. * If `true` current timestamp is added to script URL's to prevent caching.
  11824. * In debug builds, adding a "cache" or "disableCacheBuster" query parameter
  11825. * to the page's URL will set this to `false`.
  11826. */
  11827. disableCaching: (/[?&](?:cache|disableCacheBuster)\b/i.test(location.search) || !(/http[s]?\:/i.test(location.href)) || /(^|[ ;])ext-cache=1/.test(doc.cookie)) ? false : true,
  11828. /**
  11829. * @cfg {String} [disableCachingParam="_dc"]
  11830. * The query parameter name for the cache buster's timestamp.
  11831. */
  11832. disableCachingParam: '_dc',
  11833. /**
  11834. * @cfg {Boolean} loadDelay
  11835. * Millisecond delay between asynchronous script injection (prevents stack
  11836. * overflow on some user agents) 'false' disables delay but potentially
  11837. * increases stack load.
  11838. */
  11839. loadDelay: false,
  11840. /**
  11841. * @cfg {Boolean} preserveScripts
  11842. * `false` to remove asynchronously loaded scripts, `true` to retain script
  11843. * element for browser debugger compatibility and improved load performance.
  11844. */
  11845. preserveScripts: true,
  11846. /**
  11847. * @cfg {String} [charset=UTF-8]
  11848. * Optional charset to specify encoding of dynamic content.
  11849. */
  11850. charset: 'UTF-8'
  11851. },
  11852. _assetConfig = {},
  11853. cssRe = /\.css(?:\?|$)/i,
  11854. resolverEl = doc.createElement('a'),
  11855. isBrowser = typeof window !== 'undefined',
  11856. _environment = {
  11857. browser: isBrowser,
  11858. node: !isBrowser && (typeof require === 'function'),
  11859. phantom: (window && (window._phantom || window.callPhantom)) || /PhantomJS/.test(window.navigator.userAgent)
  11860. },
  11861. _tags = (Ext.platformTags = {}),
  11862. // All calls to _debug are commented out to speed up old browsers a bit;
  11863. // yes that makes a difference because the cost of concatenating strings
  11864. // and passing them into _debug() adds up pretty quickly.
  11865. _debug = function(message) {},
  11866. //console.log(message);
  11867. _apply = function(object, config, defaults) {
  11868. if (defaults) {
  11869. _apply(object, defaults);
  11870. }
  11871. if (object && config && typeof config === 'object') {
  11872. for (var i in config) {
  11873. object[i] = config[i];
  11874. }
  11875. }
  11876. return object;
  11877. },
  11878. _merge = function() {
  11879. var lowerCase = false,
  11880. obj = Array.prototype.shift.call(arguments),
  11881. index, i, len, value;
  11882. if (typeof arguments[arguments.length - 1] === 'boolean') {
  11883. lowerCase = Array.prototype.pop.call(arguments);
  11884. }
  11885. len = arguments.length;
  11886. for (index = 0; index < len; index++) {
  11887. value = arguments[index];
  11888. if (typeof value === 'object') {
  11889. for (i in value) {
  11890. obj[lowerCase ? i.toLowerCase() : i] = value[i];
  11891. }
  11892. }
  11893. }
  11894. return obj;
  11895. },
  11896. _getKeys = (typeof Object.keys == 'function') ? function(object) {
  11897. if (!object) {
  11898. return [];
  11899. }
  11900. return Object.keys(object);
  11901. } : function(object) {
  11902. var keys = [],
  11903. property;
  11904. for (property in object) {
  11905. if (object.hasOwnProperty(property)) {
  11906. keys.push(property);
  11907. }
  11908. }
  11909. return keys;
  11910. },
  11911. /*
  11912. * The Boot loader class manages Request objects that contain one or
  11913. * more individual urls that need to be loaded. Requests can be performed
  11914. * synchronously or asynchronously, but will always evaluate urls in the
  11915. * order specified on the request object.
  11916. */
  11917. Boot = {
  11918. loading: 0,
  11919. loaded: 0,
  11920. apply: _apply,
  11921. env: _environment,
  11922. config: _config,
  11923. /**
  11924. * @cfg {Object} assetConfig
  11925. * A map (url->assetConfig) that contains information about assets loaded by the Microlaoder.
  11926. */
  11927. assetConfig: _assetConfig,
  11928. // Keyed by absolute URL this object holds "true" if that URL is already loaded
  11929. // or an array of callbacks to call once it loads.
  11930. scripts: {},
  11931. /*
  11932. Entry objects
  11933. 'http://foo.com/bar/baz/Thing.js': {
  11934. done: true,
  11935. el: scriptEl || linkEl,
  11936. preserve: true,
  11937. requests: [ request1, ... ]
  11938. }
  11939. */
  11940. /**
  11941. * contains the current script name being loaded
  11942. * (loadSync or sequential load only)
  11943. */
  11944. currentFile: null,
  11945. suspendedQueue: [],
  11946. currentRequest: null,
  11947. // when loadSync is called, need to cause subsequent load requests to also be loadSync,
  11948. // eg, when Ext.require(...) is called
  11949. syncMode: false,
  11950. /*
  11951. * simple helper method for debugging
  11952. */
  11953. debug: _debug,
  11954. /**
  11955. * enables / disables loading scripts via script / link elements rather
  11956. * than using ajax / eval
  11957. */
  11958. useElements: true,
  11959. listeners: [],
  11960. Request: Request,
  11961. Entry: Entry,
  11962. allowMultipleBrowsers: false,
  11963. browserNames: {
  11964. ie: 'IE',
  11965. firefox: 'Firefox',
  11966. safari: 'Safari',
  11967. chrome: 'Chrome',
  11968. opera: 'Opera',
  11969. dolfin: 'Dolfin',
  11970. edge: 'Edge',
  11971. webosbrowser: 'webOSBrowser',
  11972. chromeMobile: 'ChromeMobile',
  11973. chromeiOS: 'ChromeiOS',
  11974. silk: 'Silk',
  11975. other: 'Other'
  11976. },
  11977. osNames: {
  11978. ios: 'iOS',
  11979. android: 'Android',
  11980. windowsPhone: 'WindowsPhone',
  11981. webos: 'webOS',
  11982. blackberry: 'BlackBerry',
  11983. rimTablet: 'RIMTablet',
  11984. mac: 'MacOS',
  11985. win: 'Windows',
  11986. tizen: 'Tizen',
  11987. linux: 'Linux',
  11988. bada: 'Bada',
  11989. chromeOS: 'ChromeOS',
  11990. other: 'Other'
  11991. },
  11992. browserPrefixes: {
  11993. ie: 'MSIE ',
  11994. edge: 'Edge/',
  11995. firefox: 'Firefox/',
  11996. chrome: 'Chrome/',
  11997. safari: 'Version/',
  11998. opera: 'OPR/',
  11999. dolfin: 'Dolfin/',
  12000. webosbrowser: 'wOSBrowser/',
  12001. chromeMobile: 'CrMo/',
  12002. chromeiOS: 'CriOS/',
  12003. silk: 'Silk/'
  12004. },
  12005. // When a UA reports multiple browsers this list is used to prioritize the 'real' browser
  12006. // lower index number will win
  12007. browserPriority: [
  12008. 'edge',
  12009. 'opera',
  12010. 'dolfin',
  12011. 'webosbrowser',
  12012. 'silk',
  12013. 'chromeiOS',
  12014. 'chromeMobile',
  12015. 'ie',
  12016. 'firefox',
  12017. 'safari',
  12018. 'chrome'
  12019. ],
  12020. osPrefixes: {
  12021. tizen: '(Tizen )',
  12022. ios: 'i(?:Pad|Phone|Pod)(?:.*)CPU(?: iPhone)? OS ',
  12023. android: '(Android |HTC_|Silk/)',
  12024. // Some HTC devices ship with an OSX userAgent by default,
  12025. // so we need to add a direct check for HTC_
  12026. windowsPhone: 'Windows Phone ',
  12027. blackberry: '(?:BlackBerry|BB)(?:.*)Version/',
  12028. rimTablet: 'RIM Tablet OS ',
  12029. webos: '(?:webOS|hpwOS)/',
  12030. bada: 'Bada/',
  12031. chromeOS: 'CrOS '
  12032. },
  12033. fallbackOSPrefixes: {
  12034. windows: 'win',
  12035. mac: 'mac',
  12036. linux: 'linux'
  12037. },
  12038. devicePrefixes: {
  12039. iPhone: 'iPhone',
  12040. iPod: 'iPod',
  12041. iPad: 'iPad'
  12042. },
  12043. maxIEVersion: 12,
  12044. /**
  12045. * The default function that detects various platforms and sets tags
  12046. * in the platform map accordingly. Examples are iOS, android, tablet, etc.
  12047. * @param tags the set of tags to populate
  12048. */
  12049. detectPlatformTags: function() {
  12050. var me = this,
  12051. ua = navigator.userAgent,
  12052. isMobile = /Mobile(\/|\s)/.test(ua),
  12053. element = document.createElement('div'),
  12054. isEventSupported = function(name, tag) {
  12055. if (tag === undefined) {
  12056. tag = window;
  12057. }
  12058. var eventName = 'on' + name.toLowerCase(),
  12059. isSupported = (eventName in element);
  12060. if (!isSupported) {
  12061. if (element.setAttribute && element.removeAttribute) {
  12062. element.setAttribute(eventName, '');
  12063. isSupported = typeof element[eventName] === 'function';
  12064. if (typeof element[eventName] !== 'undefined') {
  12065. element[eventName] = undefined;
  12066. }
  12067. element.removeAttribute(eventName);
  12068. }
  12069. }
  12070. return isSupported;
  12071. },
  12072. // Browser Detection
  12073. getBrowsers = function() {
  12074. var browsers = {},
  12075. maxIEVersion, prefix, value, key, index, len, match, version, matched;
  12076. // MS Edge browser (and possibly others) can report multiple browsers in the UserAgent
  12077. // "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
  12078. // we use this to prioritize the actual browser in this situation
  12079. len = me.browserPriority.length;
  12080. for (index = 0; index < len; index++) {
  12081. key = me.browserPriority[index];
  12082. if (!matched) {
  12083. value = me.browserPrefixes[key];
  12084. match = ua.match(new RegExp('(' + value + ')([\\w\\._]+)'));
  12085. version = match && match.length > 1 ? parseInt(match[2]) : 0;
  12086. if (version) {
  12087. matched = true;
  12088. }
  12089. } else {
  12090. version = 0;
  12091. }
  12092. browsers[key] = version;
  12093. }
  12094. //Deal with IE document mode
  12095. if (browsers.ie) {
  12096. var mode = document.documentMode;
  12097. if (mode >= 8) {
  12098. browsers.ie = mode;
  12099. }
  12100. }
  12101. // Fancy IE greater than and less then quick tags
  12102. version = browsers.ie || false;
  12103. maxIEVersion = Math.max(version, me.maxIEVersion);
  12104. for (index = 8; index <= maxIEVersion; ++index) {
  12105. prefix = 'ie' + index;
  12106. browsers[prefix + 'm'] = version ? version <= index : 0;
  12107. browsers[prefix] = version ? version === index : 0;
  12108. browsers[prefix + 'p'] = version ? version >= index : 0;
  12109. }
  12110. return browsers;
  12111. },
  12112. //OS Detection
  12113. getOperatingSystems = function() {
  12114. var systems = {},
  12115. value, key, keys, index, len, match, matched, version, activeCount;
  12116. keys = _getKeys(me.osPrefixes);
  12117. len = keys.length;
  12118. for (index = 0 , activeCount = 0; index < len; index++) {
  12119. key = keys[index];
  12120. value = me.osPrefixes[key];
  12121. match = ua.match(new RegExp('(' + value + ')([^\\s;]+)'));
  12122. matched = match ? match[1] : null;
  12123. // This is here because some HTC android devices show an OSX Snow Leopard userAgent by default.
  12124. // And the Kindle Fire doesn't have any indicator of Android as the OS in its User Agent
  12125. if (matched && (matched === 'HTC_' || matched === 'Silk/')) {
  12126. version = 2.3;
  12127. } else {
  12128. version = match && match.length > 1 ? parseFloat(match[match.length - 1]) : 0;
  12129. }
  12130. if (version) {
  12131. activeCount++;
  12132. }
  12133. systems[key] = version;
  12134. }
  12135. keys = _getKeys(me.fallbackOSPrefixes);
  12136. // If no OS could be found we resort to the fallbacks, otherwise we just
  12137. // falsify the fallbacks
  12138. len = keys.length;
  12139. for (index = 0; index < len; index++) {
  12140. key = keys[index];
  12141. // No OS was detected from osPrefixes
  12142. if (activeCount === 0) {
  12143. value = me.fallbackOSPrefixes[key];
  12144. match = ua.toLowerCase().match(new RegExp(value));
  12145. systems[key] = match ? true : 0;
  12146. } else {
  12147. systems[key] = 0;
  12148. }
  12149. }
  12150. return systems;
  12151. },
  12152. // Device Detection
  12153. getDevices = function() {
  12154. var devices = {},
  12155. value, key, keys, index, len, match;
  12156. keys = _getKeys(me.devicePrefixes);
  12157. len = keys.length;
  12158. for (index = 0; index < len; index++) {
  12159. key = keys[index];
  12160. value = me.devicePrefixes[key];
  12161. match = ua.match(new RegExp(value));
  12162. devices[key] = match ? true : 0;
  12163. }
  12164. return devices;
  12165. },
  12166. browsers = getBrowsers(),
  12167. systems = getOperatingSystems(),
  12168. devices = getDevices(),
  12169. platformParams = Boot.loadPlatformsParam();
  12170. // We apply platformParams from the query here first to allow for forced user valued
  12171. // to be used in calculation of generated tags
  12172. _merge(_tags, browsers, systems, devices, platformParams, true);
  12173. _tags.phone = !!((_tags.iphone || _tags.ipod) || (!_tags.silk && (_tags.android && (_tags.android < 3 || isMobile))) || (_tags.blackberry && isMobile) || (_tags.windowsphone));
  12174. _tags.tablet = !!(!_tags.phone && (_tags.ipad || _tags.android || _tags.silk || _tags.rimtablet || (_tags.ie10 && /; Touch/.test(ua))));
  12175. _tags.touch = // if the browser has touch events we can be reasonably sure the device has
  12176. // a touch screen
  12177. isEventSupported('touchend') || // browsers that use pointer event have maxTouchPoints > 0 if the
  12178. // device supports touch input
  12179. // http://www.w3.org/TR/pointerevents/#widl-Navigator-maxTouchPoints
  12180. navigator.maxTouchPoints || // IE10 uses a vendor-prefixed maxTouchPoints property
  12181. navigator.msMaxTouchPoints;
  12182. _tags.desktop = !_tags.phone && !_tags.tablet;
  12183. _tags.cordova = _tags.phonegap = !!(window.PhoneGap || window.Cordova || window.cordova);
  12184. _tags.webview = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)(?!.*FBAN)/i.test(ua);
  12185. _tags.androidstock = (_tags.android <= 4.3) && (_tags.safari || _tags.silk);
  12186. // Re-apply any query params here to allow for user override of generated tags (desktop, touch, tablet, etc)
  12187. _merge(_tags, platformParams, true);
  12188. },
  12189. /**
  12190. * Extracts user supplied platform tags from the "platformTags" query parameter
  12191. * of the form:
  12192. *
  12193. * ?platformTags=name:state,name:state,...
  12194. *
  12195. * (each tag defaults to true when state is unspecified)
  12196. *
  12197. * Example:
  12198. *
  12199. * ?platformTags=isTablet,isPhone:false,isDesktop:0,iOS:1,Safari:true, ...
  12200. *
  12201. * @returns {Object} the platform tags supplied by the query string
  12202. */
  12203. loadPlatformsParam: function() {
  12204. // Check if the ?platform parameter is set in the URL
  12205. var paramsString = window.location.search.substr(1),
  12206. paramsArray = paramsString.split("&"),
  12207. params = {},
  12208. i,
  12209. platforms = {},
  12210. tmpArray, tmplen, platform, name, enabled;
  12211. for (i = 0; i < paramsArray.length; i++) {
  12212. tmpArray = paramsArray[i].split("=");
  12213. params[tmpArray[0]] = tmpArray[1];
  12214. }
  12215. if (params.platformTags) {
  12216. tmpArray = params.platformTags.split(",");
  12217. for (tmplen = tmpArray.length , i = 0; i < tmplen; i++) {
  12218. platform = tmpArray[i].split(":");
  12219. name = platform[0];
  12220. enabled = true;
  12221. if (platform.length > 1) {
  12222. enabled = platform[1];
  12223. if (enabled === 'false' || enabled === '0') {
  12224. enabled = false;
  12225. }
  12226. }
  12227. platforms[name] = enabled;
  12228. }
  12229. }
  12230. return platforms;
  12231. },
  12232. filterPlatform: function(platform, excludes) {
  12233. platform = _emptyArray.concat(platform || _emptyArray);
  12234. excludes = _emptyArray.concat(excludes || _emptyArray);
  12235. var plen = platform.length,
  12236. elen = excludes.length,
  12237. include = (!plen && elen),
  12238. // default true if only excludes specified
  12239. i, tag;
  12240. for (i = 0; i < plen && !include; i++) {
  12241. tag = platform[i];
  12242. include = !!_tags[tag];
  12243. }
  12244. for (i = 0; i < elen && include; i++) {
  12245. tag = excludes[i];
  12246. include = !_tags[tag];
  12247. }
  12248. return include;
  12249. },
  12250. init: function() {
  12251. var scriptEls = doc.getElementsByTagName('script'),
  12252. script = scriptEls[0],
  12253. len = scriptEls.length,
  12254. re = /\/ext(\-[a-z\-]+)?\.js$/,
  12255. entry, src, state, baseUrl, key, n, origin;
  12256. // No check for script definedness because there always should be at least one
  12257. Boot.hasReadyState = ("readyState" in script);
  12258. Boot.hasAsync = ("async" in script);
  12259. Boot.hasDefer = ("defer" in script);
  12260. Boot.hasOnLoad = ("onload" in script);
  12261. // Feature detecting IE
  12262. Boot.isIE8 = Boot.hasReadyState && !Boot.hasAsync && Boot.hasDefer && !Boot.hasOnLoad;
  12263. Boot.isIE9 = Boot.hasReadyState && !Boot.hasAsync && Boot.hasDefer && Boot.hasOnLoad;
  12264. Boot.isIE10p = Boot.hasReadyState && Boot.hasAsync && Boot.hasDefer && Boot.hasOnLoad;
  12265. if (Boot.isIE8) {
  12266. Boot.isIE10 = false;
  12267. Boot.isIE10m = true;
  12268. } else {
  12269. Boot.isIE10 = navigator.appVersion.indexOf('MSIE 10') !== -1;
  12270. Boot.isIE10m = Boot.isIE10 || Boot.isIE9 || Boot.isIE8;
  12271. }
  12272. // IE11 does not support conditional compilation so we detect it by exclusion
  12273. Boot.isIE11 = Boot.isIE10p && !Boot.isIE10;
  12274. // Since we are loading after other scripts, and we needed to gather them
  12275. // anyway, we track them in _scripts so we don't have to ask for them all
  12276. // repeatedly.
  12277. for (n = 0; n < len; n++) {
  12278. src = (script = scriptEls[n]).src;
  12279. if (!src) {
  12280. continue;
  12281. }
  12282. state = script.readyState || null;
  12283. // If we find a script file called "ext-*.js", then the base path is that file's base path.
  12284. if (!baseUrl && re.test(src)) {
  12285. baseUrl = src;
  12286. }
  12287. if (!Boot.scripts[key = Boot.canonicalUrl(src)]) {
  12288. // _debug("creating entry " + key + " in Boot.init");
  12289. entry = new Entry({
  12290. key: key,
  12291. url: src,
  12292. done: state === null || // non-IE
  12293. state === 'loaded' || state === 'complete',
  12294. // IE only
  12295. el: script,
  12296. prop: 'src'
  12297. });
  12298. }
  12299. }
  12300. if (!baseUrl) {
  12301. script = scriptEls[scriptEls.length - 1];
  12302. baseUrl = script.src;
  12303. }
  12304. Boot.baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/') + 1);
  12305. origin = window.location.origin || window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
  12306. Boot.origin = origin;
  12307. Boot.detectPlatformTags();
  12308. Ext.filterPlatform = Boot.filterPlatform;
  12309. },
  12310. /**
  12311. * This method returns a canonical URL for the given URL.
  12312. *
  12313. * For example, the following all produce the same canonical URL (which is the
  12314. * last one):
  12315. *
  12316. * http://foo.com/bar/baz/zoo/derp/../../goo/Thing.js?_dc=12345
  12317. * http://foo.com/bar/baz/zoo/derp/../../goo/Thing.js
  12318. * http://foo.com/bar/baz/zoo/derp/../jazz/../../goo/Thing.js
  12319. * http://foo.com/bar/baz/zoo/../goo/Thing.js
  12320. * http://foo.com/bar/baz/goo/Thing.js
  12321. *
  12322. * @private
  12323. */
  12324. canonicalUrl: function(url) {
  12325. // *WARNING WARNING WARNING*
  12326. // This method yields the most correct result we can get but it is EXPENSIVE!
  12327. // In ALL browsers! When called multiple times in a sequence, as if when
  12328. // we resolve dependencies for entries, it will cause garbage collection events
  12329. // and overall painful slowness. This is why we try to avoid it as much as we can.
  12330. //
  12331. // @TODO - see if we need this fallback logic
  12332. // http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue
  12333. resolverEl.href = url;
  12334. var ret = resolverEl.href,
  12335. dc = _config.disableCachingParam,
  12336. pos = dc ? ret.indexOf(dc + '=') : -1,
  12337. c, end;
  12338. // If we have a _dc query parameter we need to remove it from the canonical
  12339. // URL.
  12340. if (pos > 0 && ((c = ret.charAt(pos - 1)) === '?' || c === '&')) {
  12341. end = ret.indexOf('&', pos);
  12342. end = (end < 0) ? '' : ret.substring(end);
  12343. if (end && c === '?') {
  12344. ++pos;
  12345. // keep the '?'
  12346. end = end.substring(1);
  12347. }
  12348. // remove the '&'
  12349. ret = ret.substring(0, pos - 1) + end;
  12350. }
  12351. return ret;
  12352. },
  12353. /**
  12354. * Get the config value corresponding to the specified name. If no name is given, will return the config object
  12355. * @param {String} name The config property name
  12356. * @return {Object}
  12357. */
  12358. getConfig: function(name) {
  12359. return name ? Boot.config[name] : Boot.config;
  12360. },
  12361. /**
  12362. * Set the configuration.
  12363. * @param {Object} config The config object to override the default values.
  12364. * @return {Ext.Boot} this
  12365. */
  12366. setConfig: function(name, value) {
  12367. if (typeof name === 'string') {
  12368. Boot.config[name] = value;
  12369. } else {
  12370. for (var s in name) {
  12371. Boot.setConfig(s, name[s]);
  12372. }
  12373. }
  12374. return Boot;
  12375. },
  12376. getHead: function() {
  12377. return Boot.docHead || (Boot.docHead = doc.head || doc.getElementsByTagName('head')[0]);
  12378. },
  12379. create: function(url, key, cfg) {
  12380. var config = cfg || {};
  12381. config.url = url;
  12382. config.key = key;
  12383. return Boot.scripts[key] = new Entry(config);
  12384. },
  12385. getEntry: function(url, cfg, canonicalPath) {
  12386. var key, entry;
  12387. // Canonicalizing URLs via anchor element href yields the most correct result
  12388. // but is *extremely* resource heavy so we need to avoid it whenever possible
  12389. key = canonicalPath ? url : Boot.canonicalUrl(url);
  12390. entry = Boot.scripts[key];
  12391. if (!entry) {
  12392. entry = Boot.create(url, key, cfg);
  12393. if (canonicalPath) {
  12394. entry.canonicalPath = true;
  12395. }
  12396. }
  12397. return entry;
  12398. },
  12399. registerContent: function(url, type, content) {
  12400. var cfg = {
  12401. content: content,
  12402. loaded: true,
  12403. css: type === 'css'
  12404. };
  12405. return Boot.getEntry(url, cfg);
  12406. },
  12407. processRequest: function(request, sync) {
  12408. request.loadEntries(sync);
  12409. },
  12410. load: function(request) {
  12411. // _debug("Boot.load called");
  12412. var request = new Request(request);
  12413. if (request.sync || Boot.syncMode) {
  12414. return Boot.loadSync(request);
  12415. }
  12416. // If there is a request in progress, we must
  12417. // queue this new request to be fired when the current request completes.
  12418. if (Boot.currentRequest) {
  12419. // _debug("current active request, suspending this request");
  12420. // trigger assignment of entries now to ensure that overlapping
  12421. // entries with currently running requests will synchronize state
  12422. // with this pending one as they complete
  12423. request.getEntries();
  12424. Boot.suspendedQueue.push(request);
  12425. } else {
  12426. Boot.currentRequest = request;
  12427. Boot.processRequest(request, false);
  12428. }
  12429. return Boot;
  12430. },
  12431. loadSync: function(request) {
  12432. // _debug("Boot.loadSync called");
  12433. var request = new Request(request);
  12434. Boot.syncMode++;
  12435. Boot.processRequest(request, true);
  12436. Boot.syncMode--;
  12437. return Boot;
  12438. },
  12439. loadBasePrefix: function(request) {
  12440. request = new Request(request);
  12441. request.prependBaseUrl = true;
  12442. return Boot.load(request);
  12443. },
  12444. loadSyncBasePrefix: function(request) {
  12445. request = new Request(request);
  12446. request.prependBaseUrl = true;
  12447. return Boot.loadSync(request);
  12448. },
  12449. requestComplete: function(request) {
  12450. var next;
  12451. if (Boot.currentRequest === request) {
  12452. Boot.currentRequest = null;
  12453. while (Boot.suspendedQueue.length > 0) {
  12454. next = Boot.suspendedQueue.shift();
  12455. if (!next.done) {
  12456. // _debug("resuming suspended request");
  12457. Boot.load(next);
  12458. break;
  12459. }
  12460. }
  12461. }
  12462. if (!Boot.currentRequest && Boot.suspendedQueue.length == 0) {
  12463. Boot.fireListeners();
  12464. }
  12465. },
  12466. isLoading: function() {
  12467. return !Boot.currentRequest && Boot.suspendedQueue.length == 0;
  12468. },
  12469. fireListeners: function() {
  12470. var listener;
  12471. while (Boot.isLoading() && (listener = Boot.listeners.shift())) {
  12472. listener();
  12473. }
  12474. },
  12475. onBootReady: function(listener) {
  12476. if (!Boot.isLoading()) {
  12477. listener();
  12478. } else {
  12479. Boot.listeners.push(listener);
  12480. }
  12481. },
  12482. /**
  12483. * this is a helper function used by Ext.Loader to flush out
  12484. * 'uses' arrays for classes in some Ext versions
  12485. */
  12486. getPathsFromIndexes: function(indexMap, loadOrder) {
  12487. // In older versions indexMap was an object instead of a sparse array
  12488. if (!('length' in indexMap)) {
  12489. var indexArray = [],
  12490. index;
  12491. for (index in indexMap) {
  12492. if (!isNaN(+index)) {
  12493. indexArray[+index] = indexMap[index];
  12494. }
  12495. }
  12496. indexMap = indexArray;
  12497. }
  12498. return Request.prototype.getPathsFromIndexes(indexMap, loadOrder);
  12499. },
  12500. createLoadOrderMap: function(loadOrder) {
  12501. return Request.prototype.createLoadOrderMap(loadOrder);
  12502. },
  12503. fetch: function(url, complete, scope, async) {
  12504. async = (async === undefined) ? !!complete : async;
  12505. var xhr = new XMLHttpRequest(),
  12506. result, status, content,
  12507. exception = false,
  12508. readyStateChange = function() {
  12509. if (xhr && xhr.readyState == 4) {
  12510. status = (xhr.status === 1223) ? 204 : (xhr.status === 0 && ((self.location || {}).protocol === 'file:' || (self.location || {}).protocol === 'ionp:')) ? 200 : xhr.status;
  12511. content = xhr.responseText;
  12512. result = {
  12513. content: content,
  12514. status: status,
  12515. exception: exception
  12516. };
  12517. if (complete) {
  12518. complete.call(scope, result);
  12519. }
  12520. xhr.onreadystatechange = emptyFn;
  12521. xhr = null;
  12522. }
  12523. };
  12524. if (async) {
  12525. xhr.onreadystatechange = readyStateChange;
  12526. }
  12527. try {
  12528. // _debug("fetching " + url + " " + (async ? "async" : "sync"));
  12529. xhr.open('GET', url, async);
  12530. xhr.send(null);
  12531. } catch (err) {
  12532. exception = err;
  12533. readyStateChange();
  12534. return result;
  12535. }
  12536. if (!async) {
  12537. readyStateChange();
  12538. }
  12539. return result;
  12540. },
  12541. notifyAll: function(entry) {
  12542. entry.notifyRequests();
  12543. }
  12544. };
  12545. function Request(cfg) {
  12546. //The request class encapsulates a series of Entry objects
  12547. //and provides notification around the completion of all Entries
  12548. //in this request.
  12549. if (cfg.$isRequest) {
  12550. return cfg;
  12551. }
  12552. var cfg = cfg.url ? cfg : {
  12553. url: cfg
  12554. },
  12555. url = cfg.url,
  12556. urls = url.charAt ? [
  12557. url
  12558. ] : url,
  12559. charset = cfg.charset || Boot.config.charset;
  12560. _apply(this, cfg);
  12561. delete this.url;
  12562. this.urls = urls;
  12563. this.charset = charset;
  12564. }
  12565. Request.prototype = {
  12566. $isRequest: true,
  12567. createLoadOrderMap: function(loadOrder) {
  12568. var len = loadOrder.length,
  12569. loadOrderMap = {},
  12570. i, element;
  12571. for (i = 0; i < len; i++) {
  12572. element = loadOrder[i];
  12573. loadOrderMap[element.path] = element;
  12574. }
  12575. return loadOrderMap;
  12576. },
  12577. getLoadIndexes: function(item, indexMap, loadOrder, includeUses, skipLoaded) {
  12578. var resolved = [],
  12579. queue = [
  12580. item
  12581. ],
  12582. itemIndex = item.idx,
  12583. queue, entry, dependencies, depIndex, i, len;
  12584. if (indexMap[itemIndex]) {
  12585. // prevent cycles
  12586. return resolved;
  12587. }
  12588. // Both indexMap and resolved are sparse arrays keyed by indexes.
  12589. // This gives us a naturally sorted sequence of indexes later on
  12590. // when we need to convert them to paths.
  12591. // indexMap is the map of all indexes we have visited at least once
  12592. // per the current expandUrls() invocation, and resolved is the map
  12593. // of all dependencies for the current item that are not included
  12594. // in indexMap.
  12595. indexMap[itemIndex] = resolved[itemIndex] = true;
  12596. while (item = queue.shift()) {
  12597. // Canonicalizing URLs is expensive, we try to avoid it
  12598. if (item.canonicalPath) {
  12599. entry = Boot.getEntry(item.path, null, true);
  12600. } else {
  12601. entry = Boot.getEntry(this.prepareUrl(item.path));
  12602. }
  12603. if (!(skipLoaded && entry.done)) {
  12604. if (includeUses && item.uses && item.uses.length) {
  12605. dependencies = item.requires.concat(item.uses);
  12606. } else {
  12607. dependencies = item.requires;
  12608. }
  12609. for (i = 0 , len = dependencies.length; i < len; i++) {
  12610. depIndex = dependencies[i];
  12611. if (!indexMap[depIndex]) {
  12612. indexMap[depIndex] = resolved[depIndex] = true;
  12613. queue.push(loadOrder[depIndex]);
  12614. }
  12615. }
  12616. }
  12617. }
  12618. return resolved;
  12619. },
  12620. getPathsFromIndexes: function(indexes, loadOrder) {
  12621. var paths = [],
  12622. index, len;
  12623. // indexes is a sparse array with values being true for defined indexes
  12624. for (index = 0 , len = indexes.length; index < len; index++) {
  12625. if (indexes[index]) {
  12626. paths.push(loadOrder[index].path);
  12627. }
  12628. }
  12629. return paths;
  12630. },
  12631. expandUrl: function(url, loadOrder, loadOrderMap, indexMap, includeUses, skipLoaded) {
  12632. var item, resolved;
  12633. if (loadOrder) {
  12634. item = loadOrderMap[url];
  12635. if (item) {
  12636. resolved = this.getLoadIndexes(item, indexMap, loadOrder, includeUses, skipLoaded);
  12637. if (resolved.length) {
  12638. return this.getPathsFromIndexes(resolved, loadOrder);
  12639. }
  12640. }
  12641. }
  12642. return [
  12643. url
  12644. ];
  12645. },
  12646. expandUrls: function(urls, includeUses) {
  12647. var me = this,
  12648. loadOrder = me.loadOrder,
  12649. expanded = [],
  12650. expandMap = {},
  12651. indexMap = [],
  12652. loadOrderMap, tmpExpanded, i, len, t, tlen, tUrl;
  12653. if (typeof urls === "string") {
  12654. urls = [
  12655. urls
  12656. ];
  12657. }
  12658. if (loadOrder) {
  12659. loadOrderMap = me.loadOrderMap;
  12660. if (!loadOrderMap) {
  12661. loadOrderMap = me.loadOrderMap = me.createLoadOrderMap(loadOrder);
  12662. }
  12663. }
  12664. for (i = 0 , len = urls.length; i < len; i++) {
  12665. // We don't want to skip loaded entries (last argument === false).
  12666. // There are some overrides that get loaded before their respective classes,
  12667. // and when the class dependencies are processed we don't want to skip over
  12668. // the overrides' dependencies just because they were loaded first.
  12669. tmpExpanded = this.expandUrl(urls[i], loadOrder, loadOrderMap, indexMap, includeUses, false);
  12670. for (t = 0 , tlen = tmpExpanded.length; t < tlen; t++) {
  12671. tUrl = tmpExpanded[t];
  12672. if (!expandMap[tUrl]) {
  12673. expandMap[tUrl] = true;
  12674. expanded.push(tUrl);
  12675. }
  12676. }
  12677. }
  12678. if (expanded.length === 0) {
  12679. expanded = urls;
  12680. }
  12681. return expanded;
  12682. },
  12683. expandLoadOrder: function() {
  12684. var me = this,
  12685. urls = me.urls,
  12686. expanded;
  12687. if (!me.expanded) {
  12688. expanded = this.expandUrls(urls, true);
  12689. me.expanded = true;
  12690. } else {
  12691. expanded = urls;
  12692. }
  12693. me.urls = expanded;
  12694. // if we added some urls to the request to honor the indicated
  12695. // load order, the request needs to be sequential
  12696. if (urls.length != expanded.length) {
  12697. me.sequential = true;
  12698. }
  12699. return me;
  12700. },
  12701. getUrls: function() {
  12702. this.expandLoadOrder();
  12703. return this.urls;
  12704. },
  12705. prepareUrl: function(url) {
  12706. if (this.prependBaseUrl) {
  12707. return Boot.baseUrl + url;
  12708. }
  12709. return url;
  12710. },
  12711. getEntries: function() {
  12712. var me = this,
  12713. entries = me.entries,
  12714. loadOrderMap, item, i, entry, urls, url;
  12715. if (!entries) {
  12716. entries = [];
  12717. urls = me.getUrls();
  12718. // If we have loadOrder array then the map will be expanded by now
  12719. if (me.loadOrder) {
  12720. loadOrderMap = me.loadOrderMap;
  12721. }
  12722. for (i = 0; i < urls.length; i++) {
  12723. url = me.prepareUrl(urls[i]);
  12724. if (loadOrderMap) {
  12725. item = loadOrderMap[url];
  12726. }
  12727. entry = Boot.getEntry(url, {
  12728. buster: me.buster,
  12729. charset: me.charset
  12730. }, item && item.canonicalPath);
  12731. entry.requests.push(me);
  12732. entries.push(entry);
  12733. }
  12734. me.entries = entries;
  12735. }
  12736. return entries;
  12737. },
  12738. loadEntries: function(sync) {
  12739. var me = this,
  12740. entries = me.getEntries(),
  12741. len = entries.length,
  12742. start = me.loadStart || 0,
  12743. continueLoad, entries, entry, i;
  12744. if (sync !== undefined) {
  12745. me.sync = sync;
  12746. }
  12747. me.loaded = me.loaded || 0;
  12748. me.loading = me.loading || len;
  12749. for (i = start; i < len; i++) {
  12750. entry = entries[i];
  12751. if (!entry.loaded) {
  12752. continueLoad = entries[i].load(me.sync);
  12753. } else {
  12754. continueLoad = true;
  12755. }
  12756. if (!continueLoad) {
  12757. me.loadStart = i;
  12758. entry.onDone(function() {
  12759. me.loadEntries(sync);
  12760. });
  12761. break;
  12762. }
  12763. }
  12764. me.processLoadedEntries();
  12765. },
  12766. processLoadedEntries: function() {
  12767. var me = this,
  12768. entries = me.getEntries(),
  12769. len = entries.length,
  12770. start = me.startIndex || 0,
  12771. i, entry;
  12772. if (!me.done) {
  12773. for (i = start; i < len; i++) {
  12774. entry = entries[i];
  12775. if (!entry.loaded) {
  12776. me.startIndex = i;
  12777. return;
  12778. }
  12779. if (!entry.evaluated) {
  12780. entry.evaluate();
  12781. }
  12782. if (entry.error) {
  12783. me.error = true;
  12784. }
  12785. }
  12786. me.notify();
  12787. }
  12788. },
  12789. notify: function() {
  12790. var me = this;
  12791. if (!me.done) {
  12792. var error = me.error,
  12793. fn = me[error ? 'failure' : 'success'],
  12794. delay = ('delay' in me) ? me.delay : (error ? 1 : Boot.config.chainDelay),
  12795. scope = me.scope || me;
  12796. me.done = true;
  12797. if (fn) {
  12798. if (delay === 0 || delay > 0) {
  12799. // Free the stack (and defer the next script)
  12800. setTimeout(function() {
  12801. fn.call(scope, me);
  12802. }, delay);
  12803. } else {
  12804. fn.call(scope, me);
  12805. }
  12806. }
  12807. me.fireListeners();
  12808. Boot.requestComplete(me);
  12809. }
  12810. },
  12811. onDone: function(listener) {
  12812. var me = this,
  12813. listeners = me.listeners || (me.listeners = []);
  12814. if (me.done) {
  12815. listener(me);
  12816. } else {
  12817. listeners.push(listener);
  12818. }
  12819. },
  12820. fireListeners: function() {
  12821. var listeners = this.listeners,
  12822. listener;
  12823. if (listeners) {
  12824. // _debug("firing request listeners");
  12825. while ((listener = listeners.shift())) {
  12826. listener(this);
  12827. }
  12828. }
  12829. }
  12830. };
  12831. function Entry(cfg) {
  12832. //The Entry class is a token to manage the load and evaluation
  12833. //state of a particular url. It is used to notify all Requests
  12834. //interested in this url that the content is available.
  12835. if (cfg.$isEntry) {
  12836. return cfg;
  12837. }
  12838. // _debug("creating entry for " + cfg.url);
  12839. var charset = cfg.charset || Boot.config.charset,
  12840. manifest = Ext.manifest,
  12841. loader = manifest && manifest.loader,
  12842. cache = (cfg.cache !== undefined) ? cfg.cache : (loader && loader.cache),
  12843. buster, busterParam;
  12844. if (Boot.config.disableCaching) {
  12845. if (cache === undefined) {
  12846. cache = !Boot.config.disableCaching;
  12847. }
  12848. if (cache === false) {
  12849. buster = +new Date();
  12850. } else if (cache !== true) {
  12851. buster = cache;
  12852. }
  12853. if (buster) {
  12854. busterParam = (loader && loader.cacheParam) || Boot.config.disableCachingParam;
  12855. buster = busterParam + "=" + buster;
  12856. }
  12857. }
  12858. _apply(this, cfg);
  12859. this.charset = charset;
  12860. this.buster = buster;
  12861. this.requests = [];
  12862. }
  12863. Entry.prototype = {
  12864. $isEntry: true,
  12865. done: false,
  12866. evaluated: false,
  12867. loaded: false,
  12868. isCrossDomain: function() {
  12869. var me = this;
  12870. if (me.crossDomain === undefined) {
  12871. // _debug("checking " + me.getLoadUrl() + " for prefix " + Boot.origin);
  12872. me.crossDomain = (me.getLoadUrl().indexOf(Boot.origin) !== 0);
  12873. }
  12874. return me.crossDomain;
  12875. },
  12876. isCss: function() {
  12877. var me = this;
  12878. if (me.css === undefined) {
  12879. if (me.url) {
  12880. var assetConfig = Boot.assetConfig[me.url];
  12881. me.css = assetConfig ? assetConfig.type === "css" : cssRe.test(me.url);
  12882. } else {
  12883. me.css = false;
  12884. }
  12885. }
  12886. return this.css;
  12887. },
  12888. getElement: function(tag) {
  12889. var me = this,
  12890. el = me.el;
  12891. if (!el) {
  12892. // _debug("creating element for " + me.url);
  12893. if (me.isCss()) {
  12894. tag = tag || "link";
  12895. el = doc.createElement(tag);
  12896. if (tag == "link") {
  12897. el.rel = 'stylesheet';
  12898. me.prop = 'href';
  12899. } else {
  12900. me.prop = "textContent";
  12901. }
  12902. el.type = "text/css";
  12903. } else {
  12904. tag = tag || "script";
  12905. el = doc.createElement(tag);
  12906. el.type = 'text/javascript';
  12907. me.prop = 'src';
  12908. if (me.charset) {
  12909. el.charset = me.charset;
  12910. }
  12911. if (Boot.hasAsync) {
  12912. el.async = false;
  12913. }
  12914. }
  12915. me.el = el;
  12916. }
  12917. return el;
  12918. },
  12919. getLoadUrl: function() {
  12920. var me = this,
  12921. url;
  12922. url = me.canonicalPath ? me.url : Boot.canonicalUrl(me.url);
  12923. if (!me.loadUrl) {
  12924. me.loadUrl = !!me.buster ? (url + (url.indexOf('?') === -1 ? '?' : '&') + me.buster) : url;
  12925. }
  12926. return me.loadUrl;
  12927. },
  12928. fetch: function(req) {
  12929. var url = this.getLoadUrl(),
  12930. async = !!req.async,
  12931. complete = req.complete;
  12932. Boot.fetch(url, complete, this, async);
  12933. },
  12934. onContentLoaded: function(response) {
  12935. var me = this,
  12936. status = response.status,
  12937. content = response.content,
  12938. exception = response.exception,
  12939. url = this.getLoadUrl();
  12940. me.loaded = true;
  12941. if ((exception || status === 0) && !_environment.phantom) {
  12942. me.error = ("Failed loading synchronously via XHR: '" + url + "'. It's likely that the file is either being loaded from a " + "different domain or from the local file system where cross " + "origin requests are not allowed for security reasons. Try " + "asynchronous loading instead.") || true;
  12943. me.evaluated = true;
  12944. } else if ((status >= 200 && status < 300) || status === 304 || _environment.phantom || (status === 0 && content.length > 0)) {
  12945. me.content = content;
  12946. } else {
  12947. me.error = ("Failed loading synchronously via XHR: '" + url + "'. Please verify that the file exists. XHR status code: " + status) || true;
  12948. me.evaluated = true;
  12949. }
  12950. },
  12951. createLoadElement: function(callback) {
  12952. var me = this,
  12953. el = me.getElement();
  12954. me.preserve = true;
  12955. el.onerror = function() {
  12956. me.error = true;
  12957. if (callback) {
  12958. callback();
  12959. callback = null;
  12960. }
  12961. };
  12962. if (Boot.isIE10m) {
  12963. el.onreadystatechange = function() {
  12964. if (this.readyState === 'loaded' || this.readyState === 'complete') {
  12965. if (callback) {
  12966. callback();
  12967. callback = this.onreadystatechange = this.onerror = null;
  12968. }
  12969. }
  12970. };
  12971. } else {
  12972. el.onload = function() {
  12973. callback();
  12974. callback = this.onload = this.onerror = null;
  12975. };
  12976. }
  12977. // IE starts loading here
  12978. el[me.prop] = me.getLoadUrl();
  12979. },
  12980. onLoadElementReady: function() {
  12981. Boot.getHead().appendChild(this.getElement());
  12982. this.evaluated = true;
  12983. },
  12984. inject: function(content, asset) {
  12985. // _debug("injecting content for " + this.url);
  12986. var me = this,
  12987. head = Boot.getHead(),
  12988. url = me.url,
  12989. key = me.key,
  12990. base, el, ieMode, basePath;
  12991. if (me.isCss()) {
  12992. me.preserve = true;
  12993. basePath = key.substring(0, key.lastIndexOf("/") + 1);
  12994. base = doc.createElement('base');
  12995. base.href = basePath;
  12996. if (head.firstChild) {
  12997. head.insertBefore(base, head.firstChild);
  12998. } else {
  12999. head.appendChild(base);
  13000. }
  13001. // reset the href attribute to cuase IE to pick up the change
  13002. base.href = base.href;
  13003. if (url) {
  13004. content += "\n/*# sourceURL=" + key + " */";
  13005. }
  13006. // create element after setting base
  13007. el = me.getElement("style");
  13008. ieMode = ('styleSheet' in el);
  13009. head.appendChild(base);
  13010. if (ieMode) {
  13011. head.appendChild(el);
  13012. el.styleSheet.cssText = content;
  13013. } else {
  13014. el.textContent = content;
  13015. head.appendChild(el);
  13016. }
  13017. head.removeChild(base);
  13018. } else {
  13019. // Debugger friendly, file names are still shown even though they're
  13020. // eval'ed code. Breakpoints work on both Firebug and Chrome's Web
  13021. // Inspector.
  13022. if (url) {
  13023. content += "\n//# sourceURL=" + key;
  13024. }
  13025. Ext.globalEval(content);
  13026. }
  13027. return me;
  13028. },
  13029. loadCrossDomain: function() {
  13030. var me = this,
  13031. complete = function() {
  13032. me.el.onerror = me.el.onload = emptyFn;
  13033. me.el = null;
  13034. me.loaded = me.evaluated = me.done = true;
  13035. me.notifyRequests();
  13036. };
  13037. me.createLoadElement(function() {
  13038. complete();
  13039. });
  13040. me.evaluateLoadElement();
  13041. // at this point, we need sequential evaluation,
  13042. // which means we can't advance the load until
  13043. // this entry has fully completed
  13044. return false;
  13045. },
  13046. loadElement: function() {
  13047. var me = this,
  13048. complete = function() {
  13049. me.el.onerror = me.el.onload = emptyFn;
  13050. me.el = null;
  13051. me.loaded = me.evaluated = me.done = true;
  13052. me.notifyRequests();
  13053. };
  13054. me.createLoadElement(function() {
  13055. complete();
  13056. });
  13057. me.evaluateLoadElement();
  13058. return true;
  13059. },
  13060. loadSync: function() {
  13061. var me = this;
  13062. me.fetch({
  13063. async: false,
  13064. complete: function(response) {
  13065. me.onContentLoaded(response);
  13066. }
  13067. });
  13068. me.evaluate();
  13069. me.notifyRequests();
  13070. },
  13071. load: function(sync) {
  13072. var me = this;
  13073. if (!me.loaded) {
  13074. if (me.loading) {
  13075. // if we're calling back through load and we're loading but haven't
  13076. // yet loaded, then we should be in a sequential, cross domain
  13077. // load scenario which means we can't continue the load on the
  13078. // request until this entry has fully evaluated, which will mean
  13079. // loaded = evaluated = done = true in one step. For css files, this
  13080. // will happen immediately upon <link> element creation / insertion,
  13081. // but <script> elements will set this upon load notification
  13082. return false;
  13083. }
  13084. me.loading = true;
  13085. // for async modes, we have some options
  13086. if (!sync) {
  13087. // if cross domain, just inject the script tag and let the onload
  13088. // events drive the progression.
  13089. // IE10 also needs sequential loading because of a bug that makes it
  13090. // fire readystate event prematurely:
  13091. // https://connect.microsoft.com/IE/feedback/details/729164/ie10-dynamic-script-element-fires-loaded-readystate-prematurely
  13092. if (Boot.isIE10 || me.isCrossDomain()) {
  13093. return me.loadCrossDomain();
  13094. }
  13095. // for IE, use the readyStateChange allows us to load scripts in parallel
  13096. // but serialize the evaluation by appending the script node to the
  13097. // document
  13098. else if (!me.isCss() && Boot.hasReadyState) {
  13099. me.createLoadElement(function() {
  13100. me.loaded = true;
  13101. me.notifyRequests();
  13102. });
  13103. } else if (Boot.useElements && // older webkit, phantomjs included, won't fire load for link elements
  13104. !(me.isCss() && _environment.phantom)) {
  13105. return me.loadElement();
  13106. } else // for other browsers, just ajax the content down in parallel, and use
  13107. // globalEval to serialize evaluation
  13108. {
  13109. me.fetch({
  13110. async: !sync,
  13111. complete: function(response) {
  13112. me.onContentLoaded(response);
  13113. me.notifyRequests();
  13114. }
  13115. });
  13116. }
  13117. } else // for sync mode in js, global eval FTW. IE won't honor the comment
  13118. // paths in the debugger, so eventually we need a sync mode for IE that
  13119. // uses the readyStateChange mechanism
  13120. {
  13121. me.loadSync();
  13122. }
  13123. }
  13124. // signal that the load process can continue
  13125. return true;
  13126. },
  13127. evaluateContent: function() {
  13128. this.inject(this.content);
  13129. this.content = null;
  13130. },
  13131. evaluateLoadElement: function() {
  13132. Boot.getHead().appendChild(this.getElement());
  13133. },
  13134. evaluate: function() {
  13135. var me = this;
  13136. if (!me.evaluated) {
  13137. if (me.evaluating) {
  13138. return;
  13139. }
  13140. me.evaluating = true;
  13141. if (me.content !== undefined) {
  13142. me.evaluateContent();
  13143. } else if (!me.error) {
  13144. me.evaluateLoadElement();
  13145. }
  13146. me.evaluated = me.done = true;
  13147. me.cleanup();
  13148. }
  13149. },
  13150. cleanup: function() {
  13151. var me = this,
  13152. el = me.el,
  13153. prop;
  13154. if (!el) {
  13155. return;
  13156. }
  13157. if (!me.preserve) {
  13158. me.el = null;
  13159. el.parentNode.removeChild(el);
  13160. // Remove, since its useless now
  13161. for (prop in el) {
  13162. try {
  13163. if (prop !== me.prop) {
  13164. // If we set the src property to null IE
  13165. // will try and request a script at './null'
  13166. el[prop] = null;
  13167. }
  13168. delete el[prop];
  13169. } // and prepare for GC
  13170. catch (cleanEx) {}
  13171. }
  13172. }
  13173. //ignore
  13174. // Setting to null can cause exceptions if IE ever needs to call these
  13175. // again (like onreadystatechange). This emptyFn has nothing locked in
  13176. // closure scope so it is about as safe as null for memory leaks.
  13177. el.onload = el.onerror = el.onreadystatechange = emptyFn;
  13178. },
  13179. notifyRequests: function() {
  13180. var requests = this.requests,
  13181. len = requests.length,
  13182. i, request;
  13183. for (i = 0; i < len; i++) {
  13184. request = requests[i];
  13185. request.processLoadedEntries();
  13186. }
  13187. if (this.done) {
  13188. this.fireListeners();
  13189. }
  13190. },
  13191. onDone: function(listener) {
  13192. var me = this,
  13193. listeners = me.listeners || (me.listeners = []);
  13194. if (me.done) {
  13195. listener(me);
  13196. } else {
  13197. listeners.push(listener);
  13198. }
  13199. },
  13200. fireListeners: function() {
  13201. var listeners = this.listeners,
  13202. listener;
  13203. if (listeners && listeners.length > 0) {
  13204. // _debug("firing event listeners for url " + this.url);
  13205. while ((listener = listeners.shift())) {
  13206. listener(this);
  13207. }
  13208. }
  13209. }
  13210. };
  13211. /**
  13212. * Turns on or off the "cache buster" applied to dynamically loaded scripts. Normally
  13213. * dynamically loaded scripts have an extra query parameter appended to avoid stale
  13214. * cached scripts. This method can be used to disable this mechanism, and is primarily
  13215. * useful for testing. This is done using a cookie.
  13216. * @param {Boolean} disable True to disable the cache buster.
  13217. * @param {String} [path="/"] An optional path to scope the cookie.
  13218. */
  13219. Ext.disableCacheBuster = function(disable, path) {
  13220. var date = new Date();
  13221. date.setTime(date.getTime() + (disable ? 10 * 365 : -1) * 24 * 60 * 60 * 1000);
  13222. date = date.toGMTString();
  13223. doc.cookie = 'ext-cache=1; expires=' + date + '; path=' + (path || '/');
  13224. };
  13225. Boot.init();
  13226. return Boot;
  13227. }(// NOTE: We run the eval at global scope to protect the body of the function and allow
  13228. // compressors to still process it.
  13229. function() {}));
  13230. //(eval("/*@cc_on!@*/!1"));
  13231. /**
  13232. * This method evaluates the given code free of any local variable. This
  13233. * will be at global scope, in others it will be in a function.
  13234. * @param {String} code The code to evaluate.
  13235. * @private
  13236. * @method
  13237. * @member Ext
  13238. */
  13239. Ext.globalEval = Ext.globalEval || (this.execScript ? function(code) {
  13240. execScript(code);
  13241. } : function($$code) {
  13242. eval.call(window, $$code);
  13243. });
  13244. /*
  13245. * Only IE8 & IE/Quirks lack Function.prototype.bind so we polyfill that here.
  13246. */
  13247. if (!Function.prototype.bind) {
  13248. (function() {
  13249. var slice = Array.prototype.slice,
  13250. // To reduce overhead on call of the bound fn we have two flavors based on
  13251. // whether we have args to prepend or not:
  13252. bind = function(me) {
  13253. var args = slice.call(arguments, 1),
  13254. method = this;
  13255. if (args.length) {
  13256. return function() {
  13257. var t = arguments;
  13258. // avoid the slice/concat if the caller does not supply args
  13259. return method.apply(me, t.length ? args.concat(slice.call(t)) : args);
  13260. };
  13261. }
  13262. // this is the majority use case - just fn.bind(this) and no args
  13263. args = null;
  13264. return function() {
  13265. return method.apply(me, arguments);
  13266. };
  13267. };
  13268. Function.prototype.bind = bind;
  13269. bind.$extjs = true;
  13270. }());
  13271. }
  13272. // to detect this polyfill if one want to improve it
  13273. //</editor-fold>
  13274. Ext.setResourcePath = function(poolName, path) {
  13275. var manifest = Ext.manifest || (Ext.manifest = {}),
  13276. paths = manifest.resources || (manifest.resources = {});
  13277. if (manifest) {
  13278. if (typeof poolName !== 'string') {
  13279. Ext.apply(paths, poolName);
  13280. } else {
  13281. paths[poolName] = path;
  13282. }
  13283. manifest.resources = paths;
  13284. }
  13285. };
  13286. Ext.getResourcePath = function(path, poolName, packageName) {
  13287. if (typeof path !== 'string') {
  13288. poolName = path.pool;
  13289. packageName = path.packageName;
  13290. path = path.path;
  13291. }
  13292. var manifest = Ext.manifest,
  13293. paths = manifest && manifest.resources,
  13294. poolPath = paths[poolName],
  13295. output = [];
  13296. if (poolPath == null) {
  13297. poolPath = paths.path;
  13298. if (poolPath == null) {
  13299. poolPath = 'resources';
  13300. }
  13301. }
  13302. if (poolPath) {
  13303. output.push(poolPath);
  13304. }
  13305. if (packageName) {
  13306. output.push(packageName);
  13307. }
  13308. output.push(path);
  13309. return output.join('/');
  13310. };
  13311. // @tag core
  13312. /**
  13313. * @class Ext
  13314. *
  13315. * The Ext namespace (global object) encapsulates all classes, singletons, and
  13316. * utility methods provided by Sencha's libraries.
  13317. *
  13318. * Most user interface Components are at a lower level of nesting in the namespace,
  13319. * but many common utility functions are provided as direct properties of the Ext namespace.
  13320. *
  13321. * Also many frequently used methods from other classes are provided as shortcuts
  13322. * within the Ext namespace. For example {@link Ext#getCmp Ext.getCmp} aliases
  13323. * {@link Ext.ComponentManager#get Ext.ComponentManager.get}.
  13324. *
  13325. * Many applications are initiated with {@link Ext#application Ext.application} which is
  13326. * called once the DOM is ready. This ensures all scripts have been loaded, preventing
  13327. * dependency issues. For example:
  13328. *
  13329. * Ext.application({
  13330. * name: 'MyApp',
  13331. *
  13332. * launch: function () {
  13333. * Ext.Msg.alert(this.getName(), 'Ready to go!');
  13334. * }
  13335. * });
  13336. *
  13337. * <b><a href="http://www.sencha.com/products/sencha-cmd/">Sencha Cmd</a></b> is a free tool
  13338. * for helping you generate and build Ext JS (and Sencha Touch) applications. See
  13339. * `{@link Ext.app.Application Application}` for more information about creating an app.
  13340. *
  13341. * A lower-level technique that does not use the `Ext.app.Application` architecture is
  13342. * {@link Ext#onReady Ext.onReady}.
  13343. *
  13344. * You can also discuss concepts and issues with others on the
  13345. * <a href="http://www.sencha.com/forum/">Sencha Forums</a>.
  13346. *
  13347. * @singleton
  13348. */
  13349. var Ext = Ext || {};
  13350. // @define Ext
  13351. /* eslint indent: "off" */
  13352. (function() {
  13353. var global = this,
  13354. objectPrototype = Object.prototype,
  13355. toString = objectPrototype.toString,
  13356. enumerables = [
  13357. // 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable',
  13358. 'valueOf',
  13359. 'toLocaleString',
  13360. 'toString',
  13361. 'constructor'
  13362. ],
  13363. emptyFn = Ext.fireIdle = function() {},
  13364. // see GlobalEvents for true fireIdle
  13365. privateFn = function() {},
  13366. identityFn = function(o) {
  13367. return o;
  13368. },
  13369. // eslint-disable-line
  13370. // This is the "$previous" method of a hook function on an instance. When called, it
  13371. // calls through the class prototype by the name of the called method.
  13372. callOverrideParent = function() {
  13373. var method = callOverrideParent.caller.caller;
  13374. // skip callParent (our caller)
  13375. return method.$owner.prototype[method.$name].apply(this, arguments);
  13376. },
  13377. manifest = Ext.manifest || {},
  13378. iterableRe = /\[object\s*(?:Array|Arguments|\w*Collection|\w*List|HTML\s+document\.all\s+class)\]/,
  13379. MSDateRe = /^\\?\/Date\(([-+])?(\d+)(?:[+-]\d{4})?\)\\?\/$/,
  13380. /* eslint-disable-next-line no-unused-vars */
  13381. elevateArgs, elevateFn, elevateRet, elevateScope, i;
  13382. Ext.global = global;
  13383. Ext.$nextIid = 0;
  13384. /**
  13385. * Returns the current timestamp.
  13386. * @return {Number} Milliseconds since UNIX epoch.
  13387. * @method now
  13388. * @member Ext
  13389. */
  13390. Ext.now = Date.now || (Date.now = function() {
  13391. return +new Date();
  13392. });
  13393. /**
  13394. * Returns the current high-resolution timestamp.
  13395. * @return {Number} Milliseconds ellapsed since arbitrary epoch.
  13396. * @method ticks
  13397. * @member Ext
  13398. * @since 6.0.1
  13399. */
  13400. Ext.ticks = (global.performance && global.performance.now) ? function() {
  13401. return performance.now();
  13402. } : Ext.now;
  13403. Ext._startTime = Ext.ticks();
  13404. // Mark these special fn's for easy identification:
  13405. emptyFn.$nullFn = identityFn.$nullFn = emptyFn.$emptyFn = identityFn.$identityFn = privateFn.$nullFn = true;
  13406. privateFn.$privacy = 'framework';
  13407. // We also want to prevent these functions from being cleaned up on destroy
  13408. emptyFn.$noClearOnDestroy = identityFn.$noClearOnDestroy = true;
  13409. privateFn.$noClearOnDestroy = true;
  13410. // These are emptyFn's in core and are redefined only in Ext JS (we use this syntax
  13411. // so Cmd does not detect them):
  13412. /* eslint-disable-next-line dot-notation */
  13413. Ext['suspendLayouts'] = Ext['resumeLayouts'] = emptyFn;
  13414. for (i in {
  13415. toString: 1
  13416. }) {
  13417. enumerables = null;
  13418. }
  13419. /**
  13420. * An array containing extra enumerables for old browsers
  13421. * @property {String[]}
  13422. */
  13423. Ext.enumerables = enumerables;
  13424. /**
  13425. * Copies all the properties of `config` to the specified `object`. There are two levels
  13426. * of defaulting supported:
  13427. *
  13428. * Ext.apply(obj, { a: 1 }, { a: 2 });
  13429. * //obj.a === 1
  13430. *
  13431. * Ext.apply(obj, { }, { a: 2 });
  13432. * //obj.a === 2
  13433. *
  13434. * Note that if recursive merging and cloning without referencing the original objects
  13435. * or arrays is needed, use {@link Ext.Object#merge} instead.
  13436. *
  13437. * @param {Object} object The receiver of the properties.
  13438. * @param {Object} config The primary source of the properties.
  13439. * @param {Object} [defaults] An object that will also be applied for default values.
  13440. * @return {Object} returns `object`.
  13441. */
  13442. Ext.apply = function(object, config, defaults) {
  13443. var i, j, k;
  13444. if (object) {
  13445. if (defaults) {
  13446. Ext.apply(object, defaults);
  13447. }
  13448. if (config && typeof config === 'object') {
  13449. for (i in config) {
  13450. object[i] = config[i];
  13451. }
  13452. if (enumerables) {
  13453. for (j = enumerables.length; j--; ) {
  13454. k = enumerables[j];
  13455. if (config.hasOwnProperty(k)) {
  13456. object[k] = config[k];
  13457. }
  13458. }
  13459. }
  13460. }
  13461. }
  13462. return object;
  13463. };
  13464. // Used by Ext.override
  13465. function addInstanceOverrides(target, owner, overrides) {
  13466. var name, value;
  13467. for (name in overrides) {
  13468. if (overrides.hasOwnProperty(name)) {
  13469. value = overrides[name];
  13470. if (typeof value === 'function') {
  13471. if (owner.$className) {
  13472. value.name = owner.$className + '#' + name;
  13473. }
  13474. value.$name = name;
  13475. value.$owner = owner;
  13476. value.$previous = target.hasOwnProperty(name) ? target[name] : // already hooked, so call previous hook
  13477. callOverrideParent;
  13478. }
  13479. // calls by name on prototype
  13480. target[name] = value;
  13481. }
  13482. }
  13483. }
  13484. Ext.buildSettings = Ext.apply({
  13485. baseCSSPrefix: 'x-'
  13486. }, Ext.buildSettings || {});
  13487. Ext.apply(Ext, {
  13488. /**
  13489. * @private
  13490. */
  13491. idSeed: 0,
  13492. /**
  13493. * @private
  13494. */
  13495. idPrefix: 'ext-',
  13496. /**
  13497. * @private
  13498. */
  13499. isRobot: false,
  13500. /**
  13501. * @property {Boolean} isSecure
  13502. * True if the page is running over SSL
  13503. * @readonly
  13504. */
  13505. isSecure: /^https/i.test(window.location.protocol),
  13506. /**
  13507. * `true` to automatically uncache orphaned Ext.Elements periodically. If set to
  13508. * `false`, the application will be required to clean up orphaned Ext.Elements and
  13509. * it's listeners as to not cause memory leakage.
  13510. */
  13511. enableGarbageCollector: false,
  13512. /**
  13513. * True to automatically purge event listeners during garbageCollection.
  13514. */
  13515. enableListenerCollection: true,
  13516. /**
  13517. * @property {String} [name='Ext']
  13518. * The name of the property in the global namespace (The `window` in browser
  13519. * environments) which refers to the current instance of Ext.
  13520. * This is usually `"Ext"`, but if a sandboxed build of ExtJS is being used, this will be
  13521. * an alternative name.
  13522. * If code is being generated for use by `eval` or to create a `new Function`, and the
  13523. * global instance of Ext must be referenced, this is the name that should be built
  13524. * into the code.
  13525. */
  13526. name: Ext.sandboxName || 'Ext',
  13527. /**
  13528. * @property {Function}
  13529. * A reusable empty function for use as `privates` members.
  13530. *
  13531. * Ext.define('MyClass', {
  13532. * nothing: Ext.emptyFn,
  13533. *
  13534. * privates: {
  13535. * privateNothing: Ext.privateFn
  13536. * }
  13537. * });
  13538. *
  13539. */
  13540. privateFn: privateFn,
  13541. /**
  13542. * @property {Function}
  13543. * A reusable empty function.
  13544. */
  13545. emptyFn: emptyFn,
  13546. /**
  13547. * @property {Function}
  13548. * A reusable identity function that simply returns its first argument.
  13549. */
  13550. identityFn: identityFn,
  13551. /**
  13552. * This indicate the start timestamp of current cycle.
  13553. * It is only reliable during dom-event-initiated cycles and
  13554. * {@link Ext.draw.Animator} initiated cycles.
  13555. */
  13556. frameStartTime: Ext.now(),
  13557. /**
  13558. * This object is initialized prior to loading the framework
  13559. * and contains settings and other information describing the application.
  13560. *
  13561. * For applications built using Sencha Cmd, this is produced from the `"app.json"`
  13562. * file with information extracted from all of the required packages' `"package.json"`
  13563. * files. This can be set to a string when your application is using the
  13564. * (microloader)[#/guide/microloader]. In this case, the string of "foo" will be
  13565. * requested as `"foo.json"` and the object in that JSON file will parsed and set
  13566. * as this object.
  13567. *
  13568. * @cfg {String/Ext.Manifest} manifest
  13569. * @since 5.0.0
  13570. */
  13571. manifest: manifest,
  13572. /**
  13573. * @cfg {Object} [debugConfig]
  13574. * This object is used to enable or disable debugging for classes or namespaces. The
  13575. * default instance looks like this:
  13576. *
  13577. * Ext.debugConfig = {
  13578. * hooks: {
  13579. * '*': true
  13580. * }
  13581. * };
  13582. *
  13583. * Typically applications will set this in their `"app.json"` like so:
  13584. *
  13585. * {
  13586. * "debug": {
  13587. * "hooks": {
  13588. * // Default for all namespaces:
  13589. * '*': true,
  13590. *
  13591. * // Except for Ext namespace which is disabled
  13592. * 'Ext': false,
  13593. *
  13594. * // Except for Ext.layout namespace which is enabled
  13595. * 'Ext.layout': true
  13596. * }
  13597. * }
  13598. * }
  13599. *
  13600. * Alternatively, because this property is consumed very early in the load process of
  13601. * the framework, this can be set in a `script` tag that is defined prior to loading
  13602. * the framework itself.
  13603. *
  13604. * For example, to enable debugging for the `Ext.layout` namespace only:
  13605. *
  13606. * var Ext = Ext || {};
  13607. * Ext.debugConfig = {
  13608. * hooks: {
  13609. * //...
  13610. * }
  13611. * };
  13612. *
  13613. * For any class declared, the longest matching namespace specified determines if its
  13614. * `debugHooks` will be enabled. The default setting is specified by the '*' property.
  13615. *
  13616. * **NOTE:** This option only applies to debug builds. All debugging is disabled in
  13617. * production builds.
  13618. */
  13619. debugConfig: Ext.debugConfig || manifest.debug || {
  13620. hooks: {
  13621. '*': true
  13622. }
  13623. },
  13624. /**
  13625. * @property {Boolean} [enableAria=true] This property is provided for backward
  13626. * compatibility with previous versions of Ext JS. Accessibility is always enabled
  13627. * in Ext JS 6.0+.
  13628. *
  13629. * This property is deprecated. To disable WAI-ARIA compatibility warnings,
  13630. * override `Ext.ariaWarn` function in your application startup code:
  13631. *
  13632. * Ext.application({
  13633. * launch: function() {
  13634. * Ext.ariaWarn = Ext.emptyFn;
  13635. * }
  13636. * });
  13637. *
  13638. * For stricter compatibility with WAI-ARIA requirements, replace `Ext.ariaWarn`
  13639. * with a function that will raise an error instead:
  13640. *
  13641. * Ext.application({
  13642. * launch: function() {
  13643. * Ext.ariaWarn = function(target, msg) {
  13644. * Ext.raise({
  13645. * msg: msg,
  13646. * component: target
  13647. * });
  13648. * };
  13649. * }
  13650. * });
  13651. *
  13652. * @since 6.0.0
  13653. * @deprecated 6.0.2 This property is no longer necessary, so no replacement is required.
  13654. */
  13655. enableAria: true,
  13656. startsWithHashRe: /^#/,
  13657. /**
  13658. * @property {RegExp}
  13659. * @private
  13660. * Regular expression used for validating identifiers.
  13661. */
  13662. validIdRe: /^[a-z_][a-z0-9\-_]*$/i,
  13663. /**
  13664. * @property {String} BLANK_IMAGE_URL
  13665. * URL to a 1x1 transparent gif image used by Ext to create inline icons with
  13666. * CSS background images.
  13667. */
  13668. /* eslint-disable-next-line max-len */
  13669. BLANK_IMAGE_URL: 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',
  13670. /**
  13671. * Converts an id (`'foo'`) into an id selector (`'#foo'`). This method is used
  13672. * internally by the framework whenever an id needs to be converted into a selector
  13673. * and is provided as a hook for those that need to escape IDs selectors since,
  13674. * as of Ext 5.0, the framework no longer escapes IDs by default.
  13675. * @private
  13676. * @param {String} id
  13677. * @return {String}
  13678. */
  13679. makeIdSelector: function(id) {
  13680. if (!Ext.validIdRe.test(id)) {
  13681. Ext.raise('Invalid id selector: "' + id + '"');
  13682. }
  13683. return '#' + id;
  13684. },
  13685. /**
  13686. * Generates unique ids. If the object/element is passes and it already has an `id`, it is
  13687. * unchanged.
  13688. * @param {Object} [o] The object to generate an id for.
  13689. * @param {String} [prefix=ext-gen] (optional) The `id` prefix.
  13690. * @return {String} The generated `id`.
  13691. */
  13692. id: function(o, prefix) {
  13693. if (o && o.id) {
  13694. return o.id;
  13695. }
  13696. /* eslint-disable-next-line vars-on-top */
  13697. var id = (prefix || Ext.idPrefix) + (++Ext.idSeed);
  13698. if (o) {
  13699. o.id = id;
  13700. }
  13701. return id;
  13702. },
  13703. /**
  13704. * A reusable function which returns the value of `getId()` called upon a single passed
  13705. * parameter. Useful when creating a {@link Ext.util.MixedCollection} of objects keyed
  13706. * by an identifier returned from a `getId` method.
  13707. */
  13708. returnId: function(o) {
  13709. return o.getId();
  13710. },
  13711. /**
  13712. * A reusable function which returns `true`.
  13713. */
  13714. returnTrue: function() {
  13715. return true;
  13716. },
  13717. /**
  13718. * A zero length string which will pass a truth test. Useful for passing to methods
  13719. * which use a truth test to reject <i>falsy</i> values where a string value must be
  13720. * cleared.
  13721. */
  13722. emptyString: new String(),
  13723. /**
  13724. * An immutable empty array if Object.freeze is supported by the browser
  13725. * @since 6.5.0
  13726. * @private
  13727. */
  13728. emptyArray: Object.freeze ? Object.freeze([]) : [],
  13729. /**
  13730. * @property {String} [baseCSSPrefix='x-']
  13731. * The base prefix to use for all `Ext` components. To configure this property, you should
  13732. * use the Ext.buildSettings object before the framework is loaded:
  13733. *
  13734. * Ext.buildSettings = {
  13735. * baseCSSPrefix : 'abc-'
  13736. * };
  13737. *
  13738. * or you can change it before any components are rendered:
  13739. *
  13740. * Ext.baseCSSPrefix = Ext.buildSettings.baseCSSPrefix = 'abc-';
  13741. *
  13742. * This will change what CSS classes components will use and you should
  13743. * then recompile the SASS changing the `$prefix` SASS variable to match.
  13744. */
  13745. baseCSSPrefix: Ext.buildSettings.baseCSSPrefix,
  13746. /**
  13747. * @property {Object} $eventNameMap
  13748. * A map of event names which contained the lower-cased versions of any mixed
  13749. * case event names.
  13750. * @private
  13751. */
  13752. $eventNameMap: {},
  13753. // Vendor-specific events do not work if lower-cased. This regex specifies event
  13754. // prefixes for names that should NOT be lower-cased by Ext.canonicalEventName()
  13755. $vendorEventRe: /^(DOMMouse|Moz.+|MS.+|webkit.+)/,
  13756. // TODO: inlinable function - SDKTOOLS-686
  13757. /**
  13758. * @private
  13759. */
  13760. canonicalEventName: function(name) {
  13761. return Ext.$eventNameMap[name] || (Ext.$eventNameMap[name] = (Ext.$vendorEventRe.test(name) ? name : name.toLowerCase()));
  13762. },
  13763. /**
  13764. * Copies all the properties of config to object if they don't already exist.
  13765. * @param {Object} object The receiver of the properties
  13766. * @param {Object} config The source of the properties
  13767. * @return {Object} returns obj
  13768. */
  13769. applyIf: function(object, config) {
  13770. var property;
  13771. if (object && config && typeof config === 'object') {
  13772. for (property in config) {
  13773. if (object[property] === undefined) {
  13774. object[property] = config[property];
  13775. }
  13776. }
  13777. }
  13778. return object;
  13779. },
  13780. /**
  13781. * Destroys all of the given objects. If arrays are passed, the elements of these
  13782. * are destroyed recursively.
  13783. *
  13784. * What it means to "destroy" an object depends on the type of object.
  13785. *
  13786. * * `Array`: Each element of the array is destroyed recursively.
  13787. * * `Object`: Any object with a `destroy` method will have that method called.
  13788. *
  13789. * @param {Mixed...} args Any number of objects or arrays.
  13790. */
  13791. destroy: function() {
  13792. var ln = arguments.length,
  13793. i, arg;
  13794. for (i = 0; i < ln; i++) {
  13795. arg = arguments[i];
  13796. if (arg) {
  13797. if (Ext.isArray(arg)) {
  13798. this.destroy.apply(this, arg);
  13799. } else if (Ext.isFunction(arg.destroy) && !arg.destroyed) {
  13800. arg.destroy();
  13801. }
  13802. }
  13803. }
  13804. return null;
  13805. },
  13806. /**
  13807. * Destroys the specified named members of the given object using `Ext.destroy`. These
  13808. * properties will be set to `null`.
  13809. * @param {Object} object The object who's properties you wish to destroy.
  13810. * @param {String...} args One or more names of the properties to destroy and remove from
  13811. * the object.
  13812. */
  13813. destroyMembers: function(object) {
  13814. /* eslint-disable-next-line vars-on-top */
  13815. for (var ref, name,
  13816. i = 1,
  13817. a = arguments,
  13818. len = a.length; i < len; i++) {
  13819. ref = object[name = a[i]];
  13820. // Avoid adding the property if it does not already exist
  13821. if (ref != null) {
  13822. object[name] = Ext.destroy(ref);
  13823. }
  13824. }
  13825. },
  13826. /**
  13827. * Overrides members of the specified `target` with the given values.
  13828. *
  13829. * If the `target` is a class declared using {@link Ext#define Ext.define}, the
  13830. * `override` method of that class is called (see {@link Ext.Base#override}) given
  13831. * the `overrides`.
  13832. *
  13833. * If the `target` is a function, it is assumed to be a constructor and the contents
  13834. * of `overrides` are applied to its `prototype` using {@link Ext#apply Ext.apply}.
  13835. *
  13836. * If the `target` is an instance of a class declared using {@link Ext#define Ext.define},
  13837. * the `overrides` are applied to only that instance. In this case, methods are
  13838. * specially processed to allow them to use {@link Ext.Base#method!callParent}.
  13839. *
  13840. * var panel = new Ext.Panel({ ... });
  13841. *
  13842. * Ext.override(panel, {
  13843. * initComponent: function () {
  13844. * // extra processing...
  13845. *
  13846. * this.callParent();
  13847. * }
  13848. * });
  13849. *
  13850. * If the `target` is none of these, the `overrides` are applied to the `target`
  13851. * using {@link Ext#apply Ext.apply}.
  13852. *
  13853. * Please refer to {@link Ext#define Ext.define} and {@link Ext.Base#override} for
  13854. * further details.
  13855. *
  13856. * @param {Object} target The target to override.
  13857. * @param {Object} overrides The properties to add or replace on `target`.
  13858. * @method override
  13859. */
  13860. override: function(target, overrides) {
  13861. if (target.$isClass) {
  13862. target.override(overrides);
  13863. } else if (typeof target === 'function') {
  13864. Ext.apply(target.prototype, overrides);
  13865. } else {
  13866. /* eslint-disable-next-line vars-on-top */
  13867. var owner = target.self,
  13868. privates;
  13869. if (owner && owner.$isClass) {
  13870. // if (instance of Ext.define'd class)
  13871. privates = overrides.privates;
  13872. if (privates) {
  13873. overrides = Ext.apply({}, overrides);
  13874. delete overrides.privates;
  13875. addInstanceOverrides(target, owner, privates);
  13876. }
  13877. addInstanceOverrides(target, owner, overrides);
  13878. } else {
  13879. Ext.apply(target, overrides);
  13880. }
  13881. }
  13882. return target;
  13883. },
  13884. /**
  13885. * Returns the given value itself if it's not empty, as described in {@link Ext#isEmpty};
  13886. * returns the default value (second argument) otherwise.
  13887. *
  13888. * @param {Object} value The value to test.
  13889. * @param {Object} defaultValue The value to return if the original value is empty.
  13890. * @param {Boolean} [allowBlank=false] `true` to allow zero length strings to qualify
  13891. * as non-empty.
  13892. * @return {Object} value, if non-empty, else defaultValue.
  13893. */
  13894. valueFrom: function(value, defaultValue, allowBlank) {
  13895. return Ext.isEmpty(value, allowBlank) ? defaultValue : value;
  13896. },
  13897. /**
  13898. * Returns true if the passed value is empty, false otherwise. The value is deemed to be
  13899. * empty if it is either:
  13900. *
  13901. * - `null`
  13902. * - `undefined`
  13903. * - a zero-length array
  13904. * - a zero-length string (Unless the `allowEmptyString` parameter is set to `true`)
  13905. *
  13906. * @param {Object} value The value to test.
  13907. * @param {Boolean} [allowEmptyString=false] `true` to allow empty strings.
  13908. * @return {Boolean}
  13909. */
  13910. isEmpty: function(value, allowEmptyString) {
  13911. return (value == null) || (!allowEmptyString ? value === '' : false) || (Ext.isArray(value) && value.length === 0);
  13912. },
  13913. /**
  13914. * Returns `true` if the passed value is a JavaScript Array, `false` otherwise.
  13915. *
  13916. * @param {Object} target The target to test.
  13917. * @return {Boolean}
  13918. * @method
  13919. */
  13920. isArray: ('isArray' in Array) ? Array.isArray : function(value) {
  13921. return toString.call(value) === '[object Array]';
  13922. },
  13923. /**
  13924. * Returns `true` if the passed value is a JavaScript Date object, `false` otherwise.
  13925. * @param {Object} obj The object to test.
  13926. * @return {Boolean}
  13927. */
  13928. isDate: function(obj) {
  13929. return toString.call(obj) === '[object Date]';
  13930. },
  13931. /**
  13932. * Returns 'true' if the passed value is a String that matches the MS Date JSON
  13933. * encoding format.
  13934. * @param {String} value The string to test.
  13935. * @return {Boolean}
  13936. */
  13937. isMSDate: function(value) {
  13938. if (!Ext.isString(value)) {
  13939. return false;
  13940. }
  13941. return MSDateRe.test(value);
  13942. },
  13943. /**
  13944. * Returns `true` if the passed value is a JavaScript Object, `false` otherwise.
  13945. * @param {Object} value The value to test.
  13946. * @return {Boolean}
  13947. * @method
  13948. */
  13949. isObject: (toString.call(null) === '[object Object]') ? function(value) {
  13950. // check ownerDocument here as well to exclude DOM nodes
  13951. return value != null && toString.call(value) === '[object Object]' && value.ownerDocument === undefined;
  13952. } : function(value) {
  13953. return toString.call(value) === '[object Object]';
  13954. },
  13955. /**
  13956. * @private
  13957. */
  13958. isSimpleObject: function(value) {
  13959. return value instanceof Object && value.constructor === Object;
  13960. },
  13961. /**
  13962. * Returns `true` if the passed value is a JavaScript 'primitive', a string, number
  13963. * or boolean.
  13964. * @param {Object} value The value to test.
  13965. * @return {Boolean}
  13966. */
  13967. isPrimitive: function(value) {
  13968. var type = typeof value;
  13969. return type === 'string' || type === 'number' || type === 'boolean';
  13970. },
  13971. /**
  13972. * Returns `true` if the passed value is a JavaScript Function, `false` otherwise.
  13973. * @param {Object} value The value to test.
  13974. * @return {Boolean}
  13975. * @method
  13976. */
  13977. isFunction: // Safari 3.x and 4.x returns 'function' for typeof <NodeList>, hence we need to fall back
  13978. // to using Object.prototype.toString (slower)
  13979. (typeof document !== 'undefined' && typeof document.getElementsByTagName('body') === 'function') ? function(value) {
  13980. return !!value && toString.call(value) === '[object Function]';
  13981. } : function(value) {
  13982. return !!value && typeof value === 'function';
  13983. },
  13984. /**
  13985. * Returns `true` if the passed value is a number. Returns `false` for non-finite numbers.
  13986. * @param {Object} value The value to test.
  13987. * @return {Boolean}
  13988. */
  13989. isNumber: function(value) {
  13990. return typeof value === 'number' && isFinite(value);
  13991. },
  13992. /**
  13993. * Validates that a value is numeric.
  13994. * @param {Object} value Examples: 1, '1', '2.34'
  13995. * @return {Boolean} True if numeric, false otherwise
  13996. */
  13997. isNumeric: function(value) {
  13998. return !isNaN(parseFloat(value)) && isFinite(value);
  13999. },
  14000. /**
  14001. * Returns `true `if the passed value is a string.
  14002. * @param {Object} value The value to test.
  14003. * @return {Boolean}
  14004. */
  14005. isString: function(value) {
  14006. return typeof value === 'string';
  14007. },
  14008. /**
  14009. * Returns `true` if the passed value is a boolean.
  14010. *
  14011. * @param {Object} value The value to test.
  14012. * @return {Boolean}
  14013. */
  14014. isBoolean: function(value) {
  14015. return typeof value === 'boolean';
  14016. },
  14017. /**
  14018. * Returns `true` if the passed value is an HTMLElement
  14019. * @param {Object} value The value to test.
  14020. * @return {Boolean}
  14021. */
  14022. isElement: function(value) {
  14023. return value ? value.nodeType === 1 : false;
  14024. },
  14025. /**
  14026. * Returns `true` if the passed value is a TextNode
  14027. * @param {Object} value The value to test.
  14028. * @return {Boolean}
  14029. */
  14030. isTextNode: function(value) {
  14031. return value ? value.nodeName === "#text" : false;
  14032. },
  14033. /**
  14034. * Returns `true` if the passed value is defined.
  14035. * @param {Object} value The value to test.
  14036. * @return {Boolean}
  14037. */
  14038. isDefined: function(value) {
  14039. return typeof value !== 'undefined';
  14040. },
  14041. /**
  14042. * Returns `true` if the passed value is iterable, that is, if elements of it are
  14043. * addressable using array notation with numeric indices, `false` otherwise.
  14044. *
  14045. * Arrays and function `arguments` objects are iterable. Also HTML collections such as
  14046. * `NodeList` and `HTMLCollection' are iterable.
  14047. *
  14048. * @param {Object} value The value to test
  14049. * @return {Boolean}
  14050. */
  14051. isIterable: function(value) {
  14052. // To be iterable, the object must have a numeric length property and must not be
  14053. // a string or function.
  14054. if (!value || typeof value.length !== 'number' || typeof value === 'string' || Ext.isFunction(value)) {
  14055. return false;
  14056. }
  14057. // Certain "standard" collections in IE (such as document.images) do not offer
  14058. // the correct Javascript Object interface; specifically, they lack the
  14059. // propertyIsEnumerable method.
  14060. // And the item property while it does exist is not typeof "function"
  14061. if (!value.propertyIsEnumerable) {
  14062. return !!value.item;
  14063. }
  14064. // If it is a regular, interrogatable JS object (not an IE ActiveX object), then...
  14065. // If it has its own property called "length", but not enumerable, it's iterable
  14066. if (value.hasOwnProperty('length') && !value.propertyIsEnumerable('length')) {
  14067. return true;
  14068. }
  14069. // Test against whitelist which includes known iterable collection types
  14070. return iterableRe.test(toString.call(value));
  14071. },
  14072. /**
  14073. * This method returns `true` if debug is enabled for the specified class. This is
  14074. * done by checking the `Ext.debugConfig.hooks` config for the closest match to the
  14075. * given `className`.
  14076. * @param {String} className The name of the class.
  14077. * @return {Boolean} `true` if debug is enabled for the specified class.
  14078. * @method
  14079. */
  14080. isDebugEnabled: function(className, defaultEnabled) {
  14081. var debugConfig = Ext.debugConfig.hooks;
  14082. if (debugConfig.hasOwnProperty(className)) {
  14083. return debugConfig[className];
  14084. }
  14085. /* eslint-disable-next-line vars-on-top */
  14086. var enabled = debugConfig['*'],
  14087. prefixLength = 0;
  14088. if (defaultEnabled !== undefined) {
  14089. enabled = defaultEnabled;
  14090. }
  14091. if (!className) {
  14092. return enabled;
  14093. }
  14094. /* eslint-disable-next-line vars-on-top */
  14095. for (var prefix in debugConfig) {
  14096. var value = debugConfig[prefix];
  14097. // eslint-disable-line vars-on-top
  14098. // if prefix=='Ext' match 'Ext.foo.Bar' but not 'Ext4.foo.Bar'
  14099. if (className.charAt(prefix.length) === '.') {
  14100. if (className.substring(0, prefix.length) === prefix) {
  14101. if (prefixLength < prefix.length) {
  14102. prefixLength = prefix.length;
  14103. enabled = value;
  14104. }
  14105. }
  14106. }
  14107. }
  14108. return enabled;
  14109. } || emptyFn,
  14110. /**
  14111. * Clone simple variables including array, {}-like objects, DOM nodes and Date without
  14112. * keeping the old reference. A reference for the object itself is returned if it's not
  14113. * a direct descendant of Object. For model cloning, see
  14114. * {@link Ext.data.Model#copy Model.copy}.
  14115. *
  14116. * @param {Object} item The variable to clone
  14117. * @param {Boolean} [cloneDom=true] `true` to clone DOM nodes.
  14118. * @return {Object} clone
  14119. */
  14120. clone: function(item, cloneDom) {
  14121. if (item == null) {
  14122. return item;
  14123. }
  14124. // DOM nodes
  14125. // TODO proxy this to Ext.Element.clone to handle automatic id attribute changing
  14126. // recursively
  14127. if (cloneDom !== false && item.nodeType && item.cloneNode) {
  14128. return item.cloneNode(true);
  14129. }
  14130. /* eslint-disable-next-line vars-on-top */
  14131. var type = toString.call(item),
  14132. i, j, k, clone, key;
  14133. // Date
  14134. if (type === '[object Date]') {
  14135. return new Date(item.getTime());
  14136. }
  14137. // Array
  14138. if (type === '[object Array]') {
  14139. i = item.length;
  14140. clone = [];
  14141. while (i--) {
  14142. clone[i] = Ext.clone(item[i], cloneDom);
  14143. }
  14144. }
  14145. // Object
  14146. else if (type === '[object Object]' && item.constructor === Object) {
  14147. clone = {};
  14148. for (key in item) {
  14149. clone[key] = Ext.clone(item[key], cloneDom);
  14150. }
  14151. if (enumerables) {
  14152. for (j = enumerables.length; j--; ) {
  14153. k = enumerables[j];
  14154. if (item.hasOwnProperty(k)) {
  14155. clone[k] = item[k];
  14156. }
  14157. }
  14158. }
  14159. }
  14160. return clone || item;
  14161. },
  14162. /**
  14163. * @private
  14164. * Generate a unique reference of Ext in the global scope, useful for sandboxing
  14165. */
  14166. getUniqueGlobalNamespace: function() {
  14167. var uniqueGlobalNamespace = this.uniqueGlobalNamespace,
  14168. i;
  14169. if (uniqueGlobalNamespace === undefined) {
  14170. i = 0;
  14171. do {
  14172. uniqueGlobalNamespace = 'ExtBox' + (++i);
  14173. } while (global[uniqueGlobalNamespace] !== undefined);
  14174. global[uniqueGlobalNamespace] = Ext;
  14175. this.uniqueGlobalNamespace = uniqueGlobalNamespace;
  14176. }
  14177. return uniqueGlobalNamespace;
  14178. },
  14179. /**
  14180. * @private
  14181. */
  14182. functionFactoryCache: {},
  14183. cacheableFunctionFactory: function() {
  14184. var me = this,
  14185. args = Array.prototype.slice.call(arguments),
  14186. cache = me.functionFactoryCache,
  14187. idx, fn, ln;
  14188. if (Ext.isSandboxed) {
  14189. ln = args.length;
  14190. if (ln > 0) {
  14191. ln--;
  14192. args[ln] = 'var Ext=window.' + Ext.name + ';' + args[ln];
  14193. }
  14194. }
  14195. idx = args.join('');
  14196. fn = cache[idx];
  14197. if (!fn) {
  14198. fn = Function.prototype.constructor.apply(Function.prototype, args);
  14199. cache[idx] = fn;
  14200. }
  14201. return fn;
  14202. },
  14203. functionFactory: function() {
  14204. var args = Array.prototype.slice.call(arguments),
  14205. ln;
  14206. if (Ext.isSandboxed) {
  14207. ln = args.length;
  14208. if (ln > 0) {
  14209. ln--;
  14210. args[ln] = 'var Ext=window.' + Ext.name + ';' + args[ln];
  14211. }
  14212. }
  14213. return Function.prototype.constructor.apply(Function.prototype, args);
  14214. },
  14215. /**
  14216. * @private
  14217. */
  14218. Logger: {
  14219. log: function(message, priority) {
  14220. if (message && global.console) {
  14221. if (!priority || !(priority in global.console)) {
  14222. priority = 'log';
  14223. }
  14224. message = '[' + priority.toUpperCase() + '] ' + message;
  14225. global.console[priority](message);
  14226. }
  14227. },
  14228. verbose: function(message) {
  14229. this.log(message, 'verbose');
  14230. },
  14231. info: function(message) {
  14232. this.log(message, 'info');
  14233. },
  14234. warn: function(message) {
  14235. this.log(message, 'warn');
  14236. },
  14237. error: function(message) {
  14238. throw new Error(message);
  14239. },
  14240. deprecate: function(message) {
  14241. this.log(message, 'warn');
  14242. }
  14243. } || {
  14244. verbose: emptyFn,
  14245. log: emptyFn,
  14246. info: emptyFn,
  14247. warn: emptyFn,
  14248. error: function(message) {
  14249. throw new Error(message);
  14250. },
  14251. deprecate: emptyFn
  14252. },
  14253. ariaWarn: function(target, msg) {
  14254. // The checks still can be disabled by setting Ext.enableAria to false;
  14255. // this is for backwards compatibility. Also make sure we're not running
  14256. // under the slicer, warnings are pointless in that case.
  14257. if (Ext.enableAria && !Ext.slicer) {
  14258. if (!Ext.ariaWarn.first) {
  14259. Ext.ariaWarn.first = true;
  14260. Ext.log.warn("WAI-ARIA compatibility warnings can be suppressed " + "by adding the following to application startup code:");
  14261. Ext.log.warn(" Ext.ariaWarn = Ext.emptyFn;");
  14262. }
  14263. Ext.log.warn({
  14264. msg: msg,
  14265. dump: target
  14266. });
  14267. }
  14268. },
  14269. /**
  14270. * @private
  14271. */
  14272. getElementById: function(id) {
  14273. return document.getElementById(id);
  14274. },
  14275. /**
  14276. * @member Ext
  14277. * @private
  14278. */
  14279. splitAndUnescape: (function() {
  14280. var cache = {};
  14281. return function(origin, delimiter) {
  14282. if (!origin) {
  14283. return [];
  14284. } else if (!delimiter) {
  14285. return [
  14286. origin
  14287. ];
  14288. }
  14289. /* eslint-disable-next-line vars-on-top, max-len */
  14290. var replaceRe = cache[delimiter] || (cache[delimiter] = new RegExp('\\\\' + delimiter, 'g')),
  14291. result = [],
  14292. parts, part;
  14293. parts = origin.split(delimiter);
  14294. while ((part = parts.shift()) !== undefined) {
  14295. // If any of the parts ends with the delimiter that means
  14296. // the delimiter was escaped and the split was invalid. Roll back.
  14297. while (part.charAt(part.length - 1) === '\\' && parts.length > 0) {
  14298. part = part + delimiter + parts.shift();
  14299. }
  14300. // Now that we have split the parts, unescape the delimiter char
  14301. part = part.replace(replaceRe, delimiter);
  14302. result.push(part);
  14303. }
  14304. return result;
  14305. };
  14306. })(),
  14307. /**
  14308. * This is the target of the user-supplied `Ext.elevateFunction`. It wraps the
  14309. * call to a function and concludes by calling {@link Ext#fireIdle}.
  14310. * @since 6.5.1
  14311. * @private
  14312. */
  14313. doElevate: function() {
  14314. var fn = elevateFn,
  14315. args = elevateArgs,
  14316. scope = elevateScope;
  14317. // We really should never re-enter here, but we'll latch these vars just
  14318. // in case.
  14319. elevateFn = elevateArgs = elevateScope = null;
  14320. elevateRet = args ? fn.apply(scope, args) : fn.call(scope);
  14321. // Be sure to fire the idle event while elevated or its handlers will
  14322. // be running in an unprivileged context.
  14323. Ext.fireIdle();
  14324. },
  14325. /**
  14326. * Runs the given `fn` directly or using the user-provided `Ext.elevateFunction`
  14327. * (if present). After calling the `fn` the global `idle` event is fired using
  14328. * the {@link Ext#fireIdle} method.
  14329. *
  14330. * @param {Function} fn
  14331. * @param {Object} [scope]
  14332. * @param {Array} [args]
  14333. * @param {Object} [timer]
  14334. * @return {Mixed}
  14335. * @since 6.5.1
  14336. * @private
  14337. */
  14338. elevate: function(fn, scope, args, timer) // eslint-disable-line comma-style
  14339. {
  14340. var ret;
  14341. if (args && !args.length) {
  14342. args = null;
  14343. }
  14344. Ext._suppressIdle = false;
  14345. if (timer) {
  14346. timer.tick();
  14347. }
  14348. if (Ext.elevateFunction) {
  14349. elevateFn = fn;
  14350. elevateScope = scope;
  14351. elevateArgs = args;
  14352. // We reuse the same fn here to avoid GC pressure.
  14353. Ext.elevateFunction(Ext.doElevate);
  14354. ret = elevateRet;
  14355. elevateRet = null;
  14356. } else {
  14357. ret = args ? fn.apply(scope, args) : fn.call(scope);
  14358. Ext.fireIdle();
  14359. }
  14360. if (timer) {
  14361. timer.tock();
  14362. }
  14363. return ret;
  14364. },
  14365. Timer: {
  14366. all: {},
  14367. track: false,
  14368. captureStack: true,
  14369. created: function(kind, id, info) {
  14370. if (!Ext.Timer.track) {
  14371. return null;
  14372. }
  14373. /* eslint-disable-next-line vars-on-top */
  14374. var timer = Ext.apply({
  14375. kind: kind,
  14376. id: id,
  14377. done: false,
  14378. firing: false,
  14379. creator: Ext.Timer.captureStack ? new Error().stack : null,
  14380. tick: Ext.Timer.tick,
  14381. tock: Ext.Timer.tock
  14382. }, info);
  14383. /* eslint-disable-next-line vars-on-top, one-var */
  14384. var timers = Ext.Timer.all[kind] || (Ext.Timer.all[kind] = {});
  14385. timers[timer.id] = timer;
  14386. if (Ext.Timer.hook) {
  14387. Ext.Timer.hook(timer);
  14388. }
  14389. return timer;
  14390. },
  14391. get: function(id, kind) {
  14392. kind = kind || 'timeout';
  14393. /* eslint-disable-next-line vars-on-top */
  14394. var timers = Ext.Timer.all[kind];
  14395. return timers && timers[id] || null;
  14396. },
  14397. cancel: function(kind, id) {
  14398. var timers = Ext.Timer.all[kind],
  14399. timer = timers && timers[id];
  14400. if (timer) {
  14401. timer.cancelled = true;
  14402. timers[id] = null;
  14403. delete timers[id];
  14404. }
  14405. },
  14406. tick: function() {
  14407. if (Ext.Timer.firing) {
  14408. // One reason for Ext.Timer.firing to get stuck is exception thrown
  14409. // in timer handler. In that case the timer is never tock()ed
  14410. // and will be left hanging. Just clean it up.
  14411. Ext.log.error('Previous timer state not cleaned up properly: ' + Ext.Timer.firing.creator);
  14412. }
  14413. if (this.kind !== 'interval') {
  14414. this.done = true;
  14415. Ext.Timer.all[this.kind][this.id] = null;
  14416. delete Ext.Timer.all[this.kind][this.id];
  14417. }
  14418. this.firing = true;
  14419. Ext.Timer.firing = this;
  14420. },
  14421. tock: function() {
  14422. this.firing = false;
  14423. if (Ext.Timer.firing === this) {
  14424. Ext.Timer.firing = null;
  14425. }
  14426. }
  14427. },
  14428. /**
  14429. * @private
  14430. */
  14431. getExpando: function(target, id) {
  14432. var expandos = target.$expandos;
  14433. return expandos && expandos[id] || null;
  14434. },
  14435. /**
  14436. * @private
  14437. */
  14438. setExpando: function(target, id, value) {
  14439. var expandos = target.$expandos;
  14440. if (value !== undefined) {
  14441. (expandos || (target.$expandos = {}))[id] = value;
  14442. } else if (expandos) {
  14443. delete expandos[id];
  14444. }
  14445. return value;
  14446. }
  14447. });
  14448. Ext.returnTrue.$nullFn = Ext.returnId.$nullFn = true;
  14449. }());
  14450. // @override Ext
  14451. // This file is order extremely early (typically right after Ext.js) due to the
  14452. // above Cmd directive. This ensures that the "modern" and "classic" platform tags
  14453. // are properly set up as soon as possible.
  14454. Ext.platformTags.modern = !(Ext.platformTags.classic = Ext.isClassic = true);
  14455. /* eslint-disable max-len */
  14456. /**
  14457. * A helper class for the native JavaScript Error object that adds a few useful capabilities for handling
  14458. * errors in an application. When you use Ext.Error to {@link #raise} an error from within any class that
  14459. * uses the Class System, the Error class can automatically add the source class and method from which
  14460. * the error was raised. It also includes logic to automatically log the error to the console, if available,
  14461. * with additional metadata about the error. In all cases, the error will always be thrown at the end so that
  14462. * execution will halt.
  14463. *
  14464. * Ext.Error also offers a global error {@link #handle handling} method that can be overridden in order to
  14465. * handle application-wide errors in a single spot. You can optionally {@link #ignore} errors altogether,
  14466. * although in a real application it's usually a better idea to override the handling function and perform
  14467. * logging or some other method of reporting the errors in a way that is meaningful to the application.
  14468. *
  14469. * At its simplest you can simply raise an error as a simple string from within any code:
  14470. *
  14471. * Example usage:
  14472. *
  14473. * Ext.raise('Something bad happened!');
  14474. *
  14475. * If raised from plain JavaScript code, the error will be logged to the console (if available) and the message
  14476. * displayed. In most cases however you'll be raising errors from within a class, and it may often be useful to add
  14477. * additional metadata about the error being raised. The {@link #raise} method can also take a config object.
  14478. * In this form the `msg` attribute becomes the error description, and any other data added to the config gets
  14479. * added to the error object and, if the console is available, logged to the console for inspection.
  14480. *
  14481. * Example usage:
  14482. *
  14483. * Ext.define('Ext.Foo', {
  14484. * doSomething: function(option){
  14485. * if (someCondition === false) {
  14486. * Ext.raise({
  14487. * msg: 'You cannot do that!',
  14488. * option: option, // whatever was passed into the method
  14489. * 'error code': 100 // other arbitrary info
  14490. * });
  14491. * }
  14492. * }
  14493. * });
  14494. *
  14495. * If a console is available (that supports the `console.dir` function) you'll see console output like:
  14496. *
  14497. * An error was raised with the following data:
  14498. * option: Object { foo: "bar"}
  14499. * foo: "bar"
  14500. * error code: 100
  14501. * msg: "You cannot do that!"
  14502. * sourceClass: "Ext.Foo"
  14503. * sourceMethod: "doSomething"
  14504. *
  14505. * uncaught exception: You cannot do that!
  14506. *
  14507. * As you can see, the error will report exactly where it was raised and will include as much information as the
  14508. * raising code can usefully provide.
  14509. *
  14510. * If you want to handle all application errors globally you can simply override the static {@link #handle} method
  14511. * and provide whatever handling logic you need. If the method returns true then the error is considered handled
  14512. * and will not be thrown to the browser. If anything but true is returned then the error will be thrown normally.
  14513. *
  14514. * Example usage:
  14515. *
  14516. * Ext.Error.handle = function(err) {
  14517. * if (err.someProperty == 'NotReallyAnError') {
  14518. * // maybe log something to the application here if applicable
  14519. * return true;
  14520. * }
  14521. * // any non-true return value (including none) will cause the error to be thrown
  14522. * }
  14523. *
  14524. * @class Ext.Error
  14525. */
  14526. /* eslint-enable max-len */
  14527. /* eslint-disable indent */
  14528. (function() {
  14529. // @define Ext.lang.Error
  14530. // @define Ext.Error
  14531. // @require Ext
  14532. function toString() {
  14533. var me = this,
  14534. cls = me.sourceClass,
  14535. method = me.sourceMethod,
  14536. msg = me.msg;
  14537. if (method) {
  14538. if (msg) {
  14539. method += '(): ';
  14540. method += msg;
  14541. } else {
  14542. method += '()';
  14543. }
  14544. }
  14545. if (cls) {
  14546. method = method ? (cls + '.' + method) : cls;
  14547. }
  14548. return method || msg || '';
  14549. }
  14550. Ext.Error = function(config) {
  14551. var error = new Error();
  14552. if (Ext.isString(config)) {
  14553. config = {
  14554. msg: config
  14555. };
  14556. }
  14557. Ext.apply(error, config);
  14558. error.message = error.message || error.msg;
  14559. // 'message' is standard ('msg' is non-standard)
  14560. // note: the above does not work in old WebKit (me.message is readonly) (Safari 4)
  14561. error.toString = toString;
  14562. return error;
  14563. };
  14564. Ext.apply(Ext.Error, {
  14565. /**
  14566. * @property {Boolean} ignore
  14567. * Static flag that can be used to globally disable error reporting to the browser if set
  14568. * to true (defaults to false). Note that if you ignore Ext errors it's likely that some
  14569. * other code may fail and throw a native JavaScript error thereafter, so use with caution.
  14570. * In most cases it will probably be preferable to supply a custom error
  14571. * {@link #handle handling} function instead.
  14572. *
  14573. * Example usage:
  14574. *
  14575. * Ext.Error.ignore = true;
  14576. *
  14577. * @static
  14578. */
  14579. ignore: false,
  14580. /**
  14581. * This method is called internally by {@link Ext#raise}. Application code should
  14582. * call {@link Ext#raise} instead of calling this method directly.
  14583. *
  14584. * @static
  14585. * @deprecated 6.0.0 Use {@link Ext#raise} instead.
  14586. */
  14587. raise: function(err) {
  14588. var me = this,
  14589. method = me.raise.caller,
  14590. msg, name;
  14591. err = err || {};
  14592. if (Ext.isString(err)) {
  14593. err = {
  14594. msg: err
  14595. };
  14596. }
  14597. if (method === Ext.raise) {
  14598. method = method.caller;
  14599. }
  14600. if (method) {
  14601. if (!err.sourceMethod && (name = method.$name)) {
  14602. err.sourceMethod = name;
  14603. }
  14604. if (!err.sourceClass && (name = method.$owner) && (name = name.$className)) {
  14605. err.sourceClass = name;
  14606. }
  14607. }
  14608. if (me.handle(err) !== true) {
  14609. msg = toString.call(err);
  14610. Ext.log({
  14611. msg: msg,
  14612. level: 'error',
  14613. dump: err,
  14614. stack: true
  14615. });
  14616. throw new Ext.Error(err);
  14617. }
  14618. },
  14619. /**
  14620. * Globally handle any Ext errors that may be raised, optionally providing custom logic
  14621. * to handle different errors individually. Return true from the function to bypass
  14622. * throwing the error to the browser, otherwise the error will be thrown and execution
  14623. * will halt.
  14624. *
  14625. * Example usage:
  14626. *
  14627. * Ext.Error.handle = function(err) {
  14628. * if (err.someProperty == 'NotReallyAnError') {
  14629. * // maybe log something to the application here if applicable
  14630. * return true;
  14631. * }
  14632. * // any non-true return value (including none) will cause the error to be thrown
  14633. * }
  14634. *
  14635. * @param {Object} err The error being raised. It will contain any attributes that were
  14636. * originally raised with it, plus properties about the method and class from which
  14637. * the error originated (if raised from a class that uses the Class System).
  14638. * @static
  14639. */
  14640. handle: function() {
  14641. return this.ignore;
  14642. }
  14643. });
  14644. })();
  14645. /**
  14646. * Create a function that will throw an error if called (in debug mode) with a message that
  14647. * indicates the method has been removed.
  14648. * @param {String} suggestion Optional text to include in the message (a workaround perhaps).
  14649. * @return {Function} The generated function.
  14650. * @private
  14651. */
  14652. Ext.deprecated = function(suggestion) {
  14653. if (!suggestion) {
  14654. suggestion = '';
  14655. }
  14656. function fail() {
  14657. Ext.raise('The method "' + fail.$owner.$className + '.' + fail.$name + '" has been removed. ' + suggestion);
  14658. }
  14659. return fail;
  14660. return Ext.emptyFn;
  14661. };
  14662. // eslint-disable-line no-unreachable
  14663. /**
  14664. * Raise an error that can include additional data and supports automatic console logging
  14665. * if available. You can pass a string error message or an object with the `msg` attribute
  14666. * which will be used as the error message. The object can contain any other name-value
  14667. * attributes (or objects) to be logged along with the error.
  14668. *
  14669. * Note that after displaying the error message a JavaScript error will ultimately be
  14670. * thrown so that execution will halt.
  14671. *
  14672. * Example usage:
  14673. *
  14674. * Ext.raise('A simple string error message');
  14675. *
  14676. * // or...
  14677. *
  14678. * Ext.define('Ext.Foo', {
  14679. * doSomething: function(option){
  14680. * if (someCondition === false) {
  14681. * Ext.raise({
  14682. * msg: 'You cannot do that!',
  14683. * option: option, // whatever was passed into the method
  14684. * code: 100 // other arbitrary info
  14685. * });
  14686. * }
  14687. * }
  14688. * });
  14689. *
  14690. * @param {String/Object} err The error message string, or an object containing the
  14691. * attribute "msg" that will be used as the error message. Any other data included in the
  14692. * object will also be logged to the browser console, if available.
  14693. * @method raise
  14694. * @member Ext
  14695. */
  14696. Ext.raise = function() {
  14697. Ext.Error.raise.apply(Ext.Error, arguments);
  14698. };
  14699. /*
  14700. * This mechanism is used to notify the user of the first error encountered on the page. In
  14701. * most cases errors go unobserved especially on IE. This mechanism pushes this information
  14702. * to the status bar so that users don't miss it.
  14703. */
  14704. (function(skipNotify) {
  14705. if (skipNotify || typeof window === 'undefined') {
  14706. return;
  14707. }
  14708. // build system or some such environment...
  14709. // eslint-disable-next-line vars-on-top
  14710. var last = 0,
  14711. // This method is called to notify the user of the current error status.
  14712. notify = function() {
  14713. var cnt = Ext.log && Ext.log.counters,
  14714. n = cnt && (cnt.error + cnt.warn + cnt.info + cnt.log),
  14715. msg;
  14716. // Put log counters to the status bar (for most browsers):
  14717. if (n && last !== n) {
  14718. msg = [];
  14719. if (cnt.error) {
  14720. msg.push('Errors: ' + cnt.error);
  14721. }
  14722. if (cnt.warn) {
  14723. msg.push('Warnings: ' + cnt.warn);
  14724. }
  14725. if (cnt.info) {
  14726. msg.push('Info: ' + cnt.info);
  14727. }
  14728. if (cnt.log) {
  14729. msg.push('Log: ' + cnt.log);
  14730. }
  14731. window.status = '*** ' + msg.join(' -- ');
  14732. last = n;
  14733. }
  14734. };
  14735. // Allow unit tests to skip this when checking for dangling timers
  14736. notify.$skipTimerCheck = true;
  14737. // window.onerror sounds ideal but it prevents the built-in error dialog from doing
  14738. // its (better) thing. We deliberately use setInterval() here instead of going with
  14739. // Ext.interval() to keep it basic and simple.
  14740. setInterval(notify, 1000);
  14741. }(!!window.__UNIT_TESTING__));
  14742. /**
  14743. * @class Ext.Array
  14744. * @singleton
  14745. *
  14746. * A set of useful static methods to deal with arrays; provide missing methods for
  14747. * older browsers.
  14748. */
  14749. Ext.Array = (function() {
  14750. /* eslint-disable indent */
  14751. // @define Ext.lang.Array
  14752. // @define Ext.Array
  14753. // @require Ext
  14754. // @require Ext.lang.Error
  14755. var arrayPrototype = Array.prototype,
  14756. slice = arrayPrototype.slice,
  14757. supportsSplice = (function() {
  14758. var array = [],
  14759. lengthBefore,
  14760. j = 20;
  14761. if (!array.splice) {
  14762. return false;
  14763. }
  14764. // This detects a bug in IE8 splice method:
  14765. // see http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/
  14766. // 6e946d03-e09f-4b22-a4dd-cd5e276bf05a/
  14767. while (j--) {
  14768. array.push("A");
  14769. }
  14770. array.splice(15, 0, "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F");
  14771. lengthBefore = array.length;
  14772. // 41
  14773. array.splice(13, 0, "XXX");
  14774. // add one element
  14775. if (lengthBefore + 1 !== array.length) {
  14776. return false;
  14777. }
  14778. // end IE8 bug
  14779. return true;
  14780. }()),
  14781. supportsIndexOf = 'indexOf' in arrayPrototype,
  14782. supportsSliceOnNodeList = true;
  14783. // Sort an array using the comparator, but if the comparator returns zero, use the objects'
  14784. // original indices to tiebreak This results in a stable sort.
  14785. function stableSort(array, userComparator) {
  14786. var len = array.length,
  14787. indices = new Array(len),
  14788. i;
  14789. // generate 0-n index map from original array
  14790. for (i = 0; i < len; i++) {
  14791. indices[i] = i;
  14792. }
  14793. // Sort indices array using a comparator which compares the original values at the two
  14794. // indices, and uses those indices as a tiebreaker
  14795. indices.sort(function(index1, index2) {
  14796. return userComparator(array[index1], array[index2]) || (index1 - index2);
  14797. });
  14798. // Reconsitute a sorted array using the array that the indices have been sorted into
  14799. for (i = 0; i < len; i++) {
  14800. indices[i] = array[indices[i]];
  14801. }
  14802. // Rebuild the original array
  14803. for (i = 0; i < len; i++) {
  14804. array[i] = indices[i];
  14805. }
  14806. return array;
  14807. }
  14808. try {
  14809. // IE 6 - 8 will throw an error when using Array.prototype.slice on NodeList
  14810. if (typeof document !== 'undefined') {
  14811. slice.call(document.getElementsByTagName('body'));
  14812. }
  14813. } catch (e) {
  14814. supportsSliceOnNodeList = false;
  14815. }
  14816. /* eslint-disable-next-line vars-on-top */
  14817. var fixArrayIndex = function(array, index) {
  14818. return (index < 0) ? Math.max(0, array.length + index) : Math.min(array.length, index);
  14819. },
  14820. /*
  14821. Does the same work as splice, but with a slightly more convenient signature. The splice
  14822. method has bugs in IE8, so this is the implementation we use on that platform.
  14823. The rippling of items in the array can be tricky. Consider two use cases:
  14824. index=2
  14825. removeCount=2
  14826. /=====\
  14827. +---+---+---+---+---+---+---+---+
  14828. | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
  14829. +---+---+---+---+---+---+---+---+
  14830. / \/ \/ \/ \
  14831. / /\ /\ /\ \
  14832. / / \/ \/ \ +--------------------------+
  14833. / / /\ /\ +--------------------------+ \
  14834. / / / \/ +--------------------------+ \ \
  14835. / / / /+--------------------------+ \ \ \
  14836. / / / / \ \ \ \
  14837. v v v v v v v v
  14838. +---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+---+
  14839. | 0 | 1 | 4 | 5 | 6 | 7 | | 0 | 1 | a | b | c | 4 | 5 | 6 | 7 |
  14840. +---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+---+
  14841. A B \=========/
  14842. insert=[a,b,c]
  14843. In case A, it is obvious that copying of [4,5,6,7] must be left-to-right so
  14844. that we don't end up with [0,1,6,7,6,7]. In case B, we have the opposite; we
  14845. must go right-to-left or else we would end up with [0,1,a,b,c,4,4,4,4].
  14846. */
  14847. replaceSim = function(array, index, removeCount, insert) {
  14848. var add = insert ? insert.length : 0,
  14849. length = array.length,
  14850. pos = fixArrayIndex(array, index);
  14851. // we try to use Array.push when we can for efficiency...
  14852. if (pos === length) {
  14853. if (add) {
  14854. array.push.apply(array, insert);
  14855. }
  14856. } else {
  14857. /* eslint-disable-next-line vars-on-top */
  14858. var remove = Math.min(removeCount, length - pos),
  14859. tailOldPos = pos + remove,
  14860. tailNewPos = tailOldPos + add - remove,
  14861. tailCount = length - tailOldPos,
  14862. lengthAfterRemove = length - remove,
  14863. i;
  14864. if (tailNewPos < tailOldPos) {
  14865. // case A
  14866. for (i = 0; i < tailCount; ++i) {
  14867. array[tailNewPos + i] = array[tailOldPos + i];
  14868. }
  14869. } else if (tailNewPos > tailOldPos) {
  14870. // case B
  14871. for (i = tailCount; i--; ) {
  14872. array[tailNewPos + i] = array[tailOldPos + i];
  14873. }
  14874. }
  14875. // else, add == remove (nothing to do)
  14876. if (add && pos === lengthAfterRemove) {
  14877. array.length = lengthAfterRemove;
  14878. // truncate array
  14879. array.push.apply(array, insert);
  14880. } else {
  14881. array.length = lengthAfterRemove + add;
  14882. // reserves space
  14883. for (i = 0; i < add; ++i) {
  14884. array[pos + i] = insert[i];
  14885. }
  14886. }
  14887. }
  14888. return array;
  14889. },
  14890. replaceNative = function(array, index, removeCount, insert) {
  14891. if (insert && insert.length) {
  14892. // Inserting at index zero with no removing: use unshift
  14893. if (index === 0 && !removeCount) {
  14894. array.unshift.apply(array, insert);
  14895. }
  14896. // Inserting/replacing in middle of array
  14897. else if (index < array.length) {
  14898. array.splice.apply(array, [
  14899. index,
  14900. removeCount
  14901. ].concat(insert));
  14902. } else // Appending to array
  14903. {
  14904. array.push.apply(array, insert);
  14905. }
  14906. } else {
  14907. array.splice(index, removeCount);
  14908. }
  14909. return array;
  14910. },
  14911. eraseSim = function(array, index, removeCount) {
  14912. return replaceSim(array, index, removeCount);
  14913. },
  14914. eraseNative = function(array, index, removeCount) {
  14915. array.splice(index, removeCount);
  14916. return array;
  14917. },
  14918. spliceSim = function(array, index, removeCount) {
  14919. var len = arguments.length,
  14920. pos = fixArrayIndex(array, index),
  14921. removed;
  14922. if (len < 3) {
  14923. removeCount = array.length - pos;
  14924. }
  14925. removed = array.slice(index, fixArrayIndex(array, pos + removeCount));
  14926. if (len < 4) {
  14927. replaceSim(array, pos, removeCount);
  14928. } else {
  14929. replaceSim(array, pos, removeCount, slice.call(arguments, 3));
  14930. }
  14931. return removed;
  14932. },
  14933. spliceNative = function(array) {
  14934. return array.splice.apply(array, slice.call(arguments, 1));
  14935. },
  14936. erase = supportsSplice ? eraseNative : eraseSim,
  14937. replace = supportsSplice ? replaceNative : replaceSim,
  14938. splice = supportsSplice ? spliceNative : spliceSim,
  14939. // NOTE: from here on, use erase, replace or splice (not native methods)...
  14940. ExtArray = {
  14941. /**
  14942. * This method returns the index that a given item would be inserted into the
  14943. * given (sorted) `array`. Note that the given `item` may or may not be in the
  14944. * array. This method will return the index of where the item *should* be.
  14945. *
  14946. * For example:
  14947. *
  14948. * var array = [ 'A', 'D', 'G', 'K', 'O', 'R', 'X' ];
  14949. * var index = Ext.Array.binarySearch(array, 'E');
  14950. *
  14951. * console.log('index: ' + index);
  14952. * // logs "index: 2"
  14953. *
  14954. * array.splice(index, 0, 'E');
  14955. *
  14956. * console.log('array : ' + array.join(''));
  14957. * // logs "array: ADEGKORX"
  14958. *
  14959. * @param {Object[]} array The array to search.
  14960. * @param {Object} item The item that you want to insert into the `array`.
  14961. * @param {Number} [begin=0] The first index in the `array` to consider.
  14962. * @param {Number} [end=array.length] The index that marks the end of the range
  14963. * to consider. The item at this index is *not* considered.
  14964. * @param {Function} [compareFn] The comparison function that matches the sort
  14965. * order of the `array`. The default `compareFn` compares items using less-than
  14966. * and greater-than operators.
  14967. * @return {Number} The index for the given item in the given array based on
  14968. * the current sorters.
  14969. */
  14970. binarySearch: function(array, item, begin, end, compareFn) {
  14971. var length = array.length,
  14972. middle, comparison;
  14973. if (begin instanceof Function) {
  14974. compareFn = begin;
  14975. begin = 0;
  14976. end = length;
  14977. } else if (end instanceof Function) {
  14978. compareFn = end;
  14979. end = length;
  14980. } else {
  14981. if (begin === undefined) {
  14982. begin = 0;
  14983. }
  14984. if (end === undefined) {
  14985. end = length;
  14986. }
  14987. compareFn = compareFn || ExtArray.lexicalCompare;
  14988. }
  14989. --end;
  14990. while (begin <= end) {
  14991. middle = (begin + end) >> 1;
  14992. comparison = compareFn(item, array[middle]);
  14993. if (comparison >= 0) {
  14994. begin = middle + 1;
  14995. } else if (comparison < 0) {
  14996. end = middle - 1;
  14997. }
  14998. }
  14999. return begin;
  15000. },
  15001. defaultCompare: function(lhs, rhs) {
  15002. return (lhs < rhs) ? -1 : ((lhs > rhs) ? 1 : 0);
  15003. },
  15004. // Default comparator to use when no comparator is specified for the sort method.
  15005. // Javascript sort does LEXICAL comparison.
  15006. lexicalCompare: function(lhs, rhs) {
  15007. lhs = String(lhs);
  15008. rhs = String(rhs);
  15009. return (lhs < rhs) ? -1 : ((lhs > rhs) ? 1 : 0);
  15010. },
  15011. /**
  15012. * Iterates an array or an iterable value and invoke the given callback function for each
  15013. * item.
  15014. *
  15015. * var countries = ['Vietnam', 'Singapore', 'United States', 'Russia'];
  15016. *
  15017. * Ext.Array.each(countries, function(name, index, countriesItSelf) {
  15018. * console.log(name);
  15019. * });
  15020. *
  15021. * var sum = function() {
  15022. * var sum = 0;
  15023. *
  15024. * Ext.Array.each(arguments, function(value) {
  15025. * sum += value;
  15026. * });
  15027. *
  15028. * return sum;
  15029. * };
  15030. *
  15031. * sum(1, 2, 3); // returns 6
  15032. *
  15033. * The iteration can be stopped by returning `false` from the callback function.
  15034. * Returning `undefined` (i.e `return;`) will only exit the callback function and
  15035. * proceed with the next iteration of the loop.
  15036. *
  15037. * Ext.Array.each(countries, function(name, index, countriesItSelf) {
  15038. * if (name === 'Singapore') {
  15039. * return false; // break here
  15040. * }
  15041. * });
  15042. *
  15043. * {@link Ext#each Ext.each} is alias for {@link Ext.Array#each Ext.Array.each}
  15044. *
  15045. * @param {Array/NodeList/Object} array The value to be iterated. If this
  15046. * argument is not iterable, the callback function is called once.
  15047. * @param {Function} fn The callback function. If it returns `false`, the iteration
  15048. * stops and this method returns the current `index`. Returning `undefined` (i.e
  15049. * `return;`) will only exit the callback function and proceed with the next iteration
  15050. * in the loop.
  15051. * @param {Object} fn.item The item at the current `index` in the passed `array`
  15052. * @param {Number} fn.index The current `index` within the `array`
  15053. * @param {Array} fn.allItems The `array` itself which was passed as the first argument
  15054. * @param {Boolean} fn.return Return `false` to stop iteration.
  15055. * @param {Object} [scope] The scope (`this` reference) in which the specified function is
  15056. * executed.
  15057. * @param {Boolean} [reverse=false] Reverse the iteration order (loop from the end to the
  15058. * beginning).
  15059. * @return {Boolean/Number} If all array entries were iterated, this will be `true. If
  15060. * iteration was halted early because the passed fuction returned `false`, this will
  15061. * be the index at which iteration was halted.
  15062. */
  15063. each: function(array, fn, scope, reverse) {
  15064. var i, ln;
  15065. array = ExtArray.from(array);
  15066. ln = array.length;
  15067. if (reverse !== true) {
  15068. for (i = 0; i < ln; i++) {
  15069. if (fn.call(scope || array[i], array[i], i, array) === false) {
  15070. return i;
  15071. }
  15072. }
  15073. } else {
  15074. for (i = ln - 1; i > -1; i--) {
  15075. if (fn.call(scope || array[i], array[i], i, array) === false) {
  15076. return i;
  15077. }
  15078. }
  15079. }
  15080. return true;
  15081. },
  15082. /*
  15083. * Calculates the the insertion index of a passed object into the passed Array according
  15084. * to the passed comparator function. Note that the passed Array *MUST* already be ordered.
  15085. * @param {Object} item The item to calculate the insertion index for.
  15086. * @param {Array} The array into which the item is to be inserted.
  15087. * @param {Function} comparatorFn The comparison function. Must return -1 or 0 or 1.
  15088. * @param {Object} comparatorFn.lhs The left object to compare.
  15089. * @param {Object} comparatorFn.rhs The right object to compare.
  15090. * @param {Number} index The possible correct index to try first before a binary
  15091. * search is instigated.
  15092. */
  15093. findInsertionIndex: function(item, items, comparatorFn, index) {
  15094. var len = items.length,
  15095. beforeCheck, afterCheck;
  15096. comparatorFn = comparatorFn || ExtArray.lexicalCompare;
  15097. if (0 <= index && index < len) {
  15098. beforeCheck = index > 0 ? comparatorFn(item, items[index - 1]) : 0;
  15099. afterCheck = (index < len) ? comparatorFn(item, items[index]) : 0;
  15100. if (0 <= beforeCheck && afterCheck < 1) {
  15101. return index;
  15102. }
  15103. }
  15104. return ExtArray.binarySearch(items, item, comparatorFn);
  15105. },
  15106. /**
  15107. * @method
  15108. * Iterates an array and invoke the given callback function for each item. Note that this
  15109. * will simply delegate to the native `Array.prototype.forEach` method if supported. It
  15110. * doesn't support stopping the iteration by returning `false` in the callback function
  15111. * like {@link Ext.Array#each}. However, performance could be much better in modern
  15112. * browsers comparing with {@link Ext.Array#each}
  15113. *
  15114. * @param {Array} array The array to iterate.
  15115. * @param {Function} fn The callback function.
  15116. * @param {Object} fn.item The item at the current `index` in the passed `array`.
  15117. * @param {Number} fn.index The current `index` within the `array`.
  15118. * @param {Array} fn.allItems The `array` itself which was passed as the first argument.
  15119. * @param {Object} scope (Optional) The execution scope (`this`) in which the
  15120. * specified function is executed.
  15121. */
  15122. forEach: ('forEach' in arrayPrototype) ? function(array, fn, scope) {
  15123. array.forEach(fn, scope);
  15124. } : function(array, fn, scope) {
  15125. var i, ln;
  15126. for (i = 0 , ln = array.length; i < ln; i++) {
  15127. fn.call(scope, array[i], i, array);
  15128. }
  15129. },
  15130. /**
  15131. * @method
  15132. * Get the index of the provided `item` in the given `array`, a supplement for the
  15133. * missing arrayPrototype.indexOf in Internet Explorer.
  15134. *
  15135. * @param {Array} array The array to check.
  15136. * @param {Object} item The item to find.
  15137. * @param {Number} from (Optional) The index at which to begin the search.
  15138. * @return {Number} The index of item in the array (or -1 if it is not found).
  15139. */
  15140. indexOf: supportsIndexOf ? function(array, item, from) {
  15141. // May be called with no array which causes an error.
  15142. return array ? arrayPrototype.indexOf.call(array, item, from) : -1;
  15143. } : function(array, item, from) {
  15144. var i,
  15145. length = array ? array.length : 0;
  15146. for (i = (from < 0) ? Math.max(0, length + from) : from || 0; i < length; i++) {
  15147. if (array[i] === item) {
  15148. return i;
  15149. }
  15150. }
  15151. return -1;
  15152. },
  15153. /**
  15154. * @method
  15155. * Checks whether or not the given `array` contains the specified `item`.
  15156. *
  15157. * @param {Array} array The array to check.
  15158. * @param {Object} item The item to find.
  15159. * @return {Boolean} `true` if the array contains the item, `false` otherwise.
  15160. */
  15161. contains: supportsIndexOf ? function(array, item) {
  15162. return arrayPrototype.indexOf.call(array, item) !== -1;
  15163. } : function(array, item) {
  15164. var i, ln;
  15165. for (i = 0 , ln = array.length; i < ln; i++) {
  15166. if (array[i] === item) {
  15167. return true;
  15168. }
  15169. }
  15170. return false;
  15171. },
  15172. /**
  15173. * Converts any iterable (numeric indices and a length property) into a true array.
  15174. *
  15175. * function test() {
  15176. * var args = Ext.Array.toArray(arguments),
  15177. * fromSecondToLastArgs = Ext.Array.toArray(arguments, 1);
  15178. *
  15179. * alert(args.join(' '));
  15180. * alert(fromSecondToLastArgs.join(' '));
  15181. * }
  15182. *
  15183. * test('just', 'testing', 'here'); // alerts 'just testing here';
  15184. * // alerts 'testing here';
  15185. *
  15186. * // will convert the NodeList into an array
  15187. * Ext.Array.toArray(document.getElementsByTagName('div'));
  15188. * Ext.Array.toArray('splitted'); // returns ['s', 'p', 'l', 'i', 't', 't', 'e', 'd']
  15189. * Ext.Array.toArray('splitted', 0, 3); // returns ['s', 'p', 'l']
  15190. *
  15191. * {@link Ext#toArray Ext.toArray} is alias for {@link Ext.Array#toArray Ext.Array.toArray}
  15192. *
  15193. * @param {Object} iterable the iterable object to be turned into a true Array.
  15194. * @param {Number} [start=0] a zero-based index that specifies the start of extraction.
  15195. * @param {Number} [end=-1] a 1-based index that specifies the end of extraction.
  15196. * @return {Array}
  15197. */
  15198. toArray: function(iterable, start, end) {
  15199. var array = [],
  15200. i;
  15201. if (!iterable || !iterable.length) {
  15202. return array;
  15203. }
  15204. if (typeof iterable === 'string') {
  15205. iterable = iterable.split('');
  15206. }
  15207. if (supportsSliceOnNodeList) {
  15208. return slice.call(iterable, start || 0, end || iterable.length);
  15209. }
  15210. start = start || 0;
  15211. end = end ? ((end < 0) ? iterable.length + end : end) : iterable.length;
  15212. for (i = start; i < end; i++) {
  15213. array.push(iterable[i]);
  15214. }
  15215. return array;
  15216. },
  15217. /**
  15218. * Plucks the value of a property from each item in the Array. Example:
  15219. *
  15220. * // [el1.className, el2.className, ..., elN.className]
  15221. * Ext.Array.pluck(Ext.query("p"), "className");
  15222. *
  15223. * @param {Array/NodeList} array The Array of items to pluck the value from.
  15224. * @param {String} propertyName The property name to pluck from each element.
  15225. * @return {Array} The value from each item in the Array.
  15226. */
  15227. pluck: function(array, propertyName) {
  15228. var ret = [],
  15229. i, ln, item;
  15230. for (i = 0 , ln = array.length; i < ln; i++) {
  15231. item = array[i];
  15232. ret.push(item[propertyName]);
  15233. }
  15234. return ret;
  15235. },
  15236. /**
  15237. * @method
  15238. * Creates a new array with the results of calling a provided function on every element
  15239. * in this array.
  15240. *
  15241. * @param {Array} array
  15242. * @param {Function} fn Callback function for each item.
  15243. * @param {Mixed} fn.item Current item.
  15244. * @param {Number} fn.index Index of the item.
  15245. * @param {Array} fn.array The whole array that's being iterated.
  15246. * @param {Object} [scope] Callback function scope
  15247. * @return {Array} results
  15248. */
  15249. map: ('map' in arrayPrototype) ? function(array, fn, scope) {
  15250. Ext.Assert.isFunction(fn, 'Ext.Array.map must have a callback function passed as second argument.');
  15251. return array.map(fn, scope);
  15252. } : function(array, fn, scope) {
  15253. Ext.Assert.isFunction(fn, 'Ext.Array.map must have a callback function passed as second argument.');
  15254. /* eslint-disable-next-line vars-on-top */
  15255. var len = array.length,
  15256. results = new Array(len),
  15257. i;
  15258. for (i = 0; i < len; i++) {
  15259. results[i] = fn.call(scope, array[i], i, array);
  15260. }
  15261. return results;
  15262. },
  15263. /**
  15264. * @method
  15265. * Executes the specified function for each array element until the function returns
  15266. * a falsy value. If such an item is found, the function will return `false` immediately.
  15267. * Otherwise, it will return `true`.
  15268. *
  15269. * @param {Array} array
  15270. * @param {Function} fn Callback function for each item.
  15271. * @param {Mixed} fn.item Current item.
  15272. * @param {Number} fn.index Index of the item.
  15273. * @param {Array} fn.array The whole array that's being iterated.
  15274. * @param {Object} scope Callback function scope.
  15275. * @return {Boolean} `true` if no false value is returned by the callback function.
  15276. */
  15277. every: ('every' in arrayPrototype) ? function(array, fn, scope) {
  15278. Ext.Assert.isFunction(fn, 'Ext.Array.every must have a callback function passed as second argument.');
  15279. return array.every(fn, scope);
  15280. } : function(array, fn, scope) {
  15281. var i, ln;
  15282. Ext.Assert.isFunction(fn, 'Ext.Array.every must have a callback function passed as second argument.');
  15283. for (i = 0 , ln = array.length; i < ln; ++i) {
  15284. if (!fn.call(scope, array[i], i, array)) {
  15285. return false;
  15286. }
  15287. }
  15288. return true;
  15289. },
  15290. /**
  15291. * @method
  15292. * Executes the specified function for each array element until the function returns
  15293. * a truthy value. If such an item is found, the function will return `true` immediately.
  15294. * Otherwise, it will return `false`.
  15295. *
  15296. * @param {Array} array
  15297. * @param {Function} fn Callback function for each item.
  15298. * @param {Mixed} fn.item Current item.
  15299. * @param {Number} fn.index Index of the item.
  15300. * @param {Array} fn.array The whole array that's being iterated.
  15301. * @param {Object} scope Callback function scope.
  15302. * @return {Boolean} `true` if the callback function returns a truthy value.
  15303. */
  15304. some: ('some' in arrayPrototype) ? function(array, fn, scope) {
  15305. Ext.Assert.isFunction(fn, 'Ext.Array.some must have a callback function passed as second argument.');
  15306. return array.some(fn, scope);
  15307. } : function(array, fn, scope) {
  15308. var i, ln;
  15309. Ext.Assert.isFunction(fn, 'Ext.Array.some must have a callback function passed as second argument.');
  15310. for (i = 0 , ln = array.length; i < ln; ++i) {
  15311. if (fn.call(scope, array[i], i, array)) {
  15312. return true;
  15313. }
  15314. }
  15315. return false;
  15316. },
  15317. /**
  15318. * Shallow compares the contents of 2 arrays using strict equality.
  15319. * @param {Array} array1
  15320. * @param {Array} array2
  15321. * @return {Boolean} `true` if the arrays are equal.
  15322. */
  15323. equals: function(array1, array2) {
  15324. var len1 = array1.length,
  15325. len2 = array2.length,
  15326. i;
  15327. // Short circuit if the same array is passed twice
  15328. if (array1 === array2) {
  15329. return true;
  15330. }
  15331. if (len1 !== len2) {
  15332. return false;
  15333. }
  15334. for (i = 0; i < len1; ++i) {
  15335. if (array1[i] !== array2[i]) {
  15336. return false;
  15337. }
  15338. }
  15339. return true;
  15340. },
  15341. /**
  15342. * Filter through an array and remove empty item as defined in
  15343. * {@link Ext#isEmpty Ext.isEmpty}.
  15344. *
  15345. * See {@link Ext.Array#filter}
  15346. *
  15347. * @param {Array} array
  15348. * @return {Array} results
  15349. */
  15350. clean: function(array) {
  15351. var results = [],
  15352. i, ln, item;
  15353. for (i = 0 , ln = array.length; i < ln; i++) {
  15354. item = array[i];
  15355. if (!Ext.isEmpty(item)) {
  15356. results.push(item);
  15357. }
  15358. }
  15359. return results;
  15360. },
  15361. /**
  15362. * Returns a new array with unique items.
  15363. *
  15364. * @param {Array} array
  15365. * @return {Array} results
  15366. */
  15367. unique: function(array) {
  15368. var clone = [],
  15369. i, ln, item;
  15370. for (i = 0 , ln = array.length; i < ln; i++) {
  15371. item = array[i];
  15372. if (ExtArray.indexOf(clone, item) === -1) {
  15373. clone.push(item);
  15374. }
  15375. }
  15376. return clone;
  15377. },
  15378. /**
  15379. * @method
  15380. * Creates a new array with all of the elements of this array for which
  15381. * the provided filtering function returns a truthy value.
  15382. *
  15383. * @param {Array} array
  15384. * @param {Function} fn Callback function for each item.
  15385. * @param {Mixed} fn.item Current item.
  15386. * @param {Number} fn.index Index of the item.
  15387. * @param {Array} fn.array The whole array that's being iterated.
  15388. * @param {Object} scope Callback function scope.
  15389. * @return {Array} results
  15390. */
  15391. filter: ('filter' in arrayPrototype) ? function(array, fn, scope) {
  15392. Ext.Assert.isFunction(fn, 'Ext.Array.filter must have a filter function passed as second argument.');
  15393. return array.filter(fn, scope);
  15394. } : function(array, fn, scope) {
  15395. var results = [],
  15396. i, ln;
  15397. Ext.Assert.isFunction(fn, 'Ext.Array.filter must have a filter function passed as second argument.');
  15398. for (i = 0 , ln = array.length; i < ln; i++) {
  15399. if (fn.call(scope, array[i], i, array)) {
  15400. results.push(array[i]);
  15401. }
  15402. }
  15403. return results;
  15404. },
  15405. /**
  15406. * Returns the first item in the array which elicits a truthy return value from the
  15407. * passed selection function.
  15408. * @param {Array} array The array to search
  15409. * @param {Function} fn The selection function to execute for each item.
  15410. * @param {Mixed} fn.item The array item.
  15411. * @param {Number} fn.index The index of the array item.
  15412. * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the
  15413. * function is executed. Defaults to the array
  15414. * @return {Object} The first item in the array which returned true from the selection
  15415. * function, or null if none was found.
  15416. */
  15417. findBy: function(array, fn, scope) {
  15418. var i, len;
  15419. for (i = 0 , len = array.length; i < len; i++) {
  15420. if (fn.call(scope || array, array[i], i)) {
  15421. return array[i];
  15422. }
  15423. }
  15424. return null;
  15425. },
  15426. /**
  15427. * Converts a value to an array if it's not already an array; returns:
  15428. *
  15429. * - An empty array if given value is `undefined` or `null`
  15430. * - Itself if given value is already an array
  15431. * - An array copy if given value is {@link Ext#isIterable iterable} (arguments, NodeList
  15432. * and alike)
  15433. * - An array with one item which is the given value, otherwise
  15434. *
  15435. * @param {Object} value The value to convert to an array if it's not already is an array.
  15436. * @param {Boolean} [newReference] `true` to clone the given array and return a new
  15437. * reference if necessary.
  15438. * @return {Array} array
  15439. */
  15440. from: function(value, newReference) {
  15441. var type;
  15442. if (value === undefined || value === null) {
  15443. return [];
  15444. }
  15445. if (Ext.isArray(value)) {
  15446. return (newReference) ? slice.call(value) : value;
  15447. }
  15448. type = typeof value;
  15449. // Both strings and functions will have a length property. In phantomJS, NodeList
  15450. // instances report typeof=='function' but don't have an apply method...
  15451. if (value && value.length !== undefined && type !== 'string' && (type !== 'function' || !value.apply)) {
  15452. return ExtArray.toArray(value);
  15453. }
  15454. return [
  15455. value
  15456. ];
  15457. },
  15458. /**
  15459. * Removes the specified item from the array if it exists.
  15460. *
  15461. * @param {Array} array The array.
  15462. * @param {Object} item The item to remove.
  15463. * @return {Array} The passed array.
  15464. */
  15465. remove: function(array, item) {
  15466. var index = ExtArray.indexOf(array, item);
  15467. if (index !== -1) {
  15468. erase(array, index, 1);
  15469. }
  15470. return array;
  15471. },
  15472. /**
  15473. * Removes item/s at the specified index.
  15474. *
  15475. * @param {Array} array The array.
  15476. * @param {Number} index The index of the item to be removed.
  15477. * @param {Number} [count=1] The number of items to be removed.
  15478. * @return {Array} The passed array.
  15479. */
  15480. removeAt: function(array, index, count) {
  15481. var len = array.length;
  15482. if (index >= 0 && index < len) {
  15483. count = count || 1;
  15484. count = Math.min(count, len - index);
  15485. erase(array, index, count);
  15486. }
  15487. return array;
  15488. },
  15489. /**
  15490. * Push an item into the array only if the array doesn't contain it yet.
  15491. *
  15492. * @param {Array} array The array.
  15493. * @param {Object} item The item to include.
  15494. */
  15495. include: function(array, item) {
  15496. if (!ExtArray.contains(array, item)) {
  15497. array.push(item);
  15498. }
  15499. },
  15500. /**
  15501. * Clone a flat array without referencing the previous one. Note that this is different
  15502. * from `Ext.clone` since it doesn't handle recursive cloning. It's simply a convenient,
  15503. * easy-to-remember method for `Array.prototype.slice.call(array)`.
  15504. *
  15505. * @param {Array} array The array.
  15506. * @return {Array} The clone array.
  15507. */
  15508. clone: function(array) {
  15509. return slice.call(array);
  15510. },
  15511. /**
  15512. * Merge multiple arrays into one with unique items.
  15513. *
  15514. * {@link Ext.Array#union} is alias for {@link Ext.Array#merge}
  15515. *
  15516. * @param {Array} array1
  15517. * @param {Array} array2
  15518. * @param {Array} etc
  15519. * @return {Array} merged
  15520. */
  15521. merge: function() {
  15522. var args = slice.call(arguments),
  15523. array = [],
  15524. i, ln;
  15525. for (i = 0 , ln = args.length; i < ln; i++) {
  15526. array = array.concat(args[i]);
  15527. }
  15528. return ExtArray.unique(array);
  15529. },
  15530. /**
  15531. * Merge multiple arrays into one with unique items that exist in all of the arrays.
  15532. *
  15533. * @param {Array} array1
  15534. * @param {Array} array2
  15535. * @param {Array} etc
  15536. * @return {Array} intersect
  15537. */
  15538. intersect: function() {
  15539. var intersection = [],
  15540. arrays = slice.call(arguments),
  15541. arraysLength, array, arrayLength, minArray, minArrayIndex, minArrayCandidate, minArrayLength, element, elementCandidate, elementCount, i, j, k;
  15542. if (!arrays.length) {
  15543. return intersection;
  15544. }
  15545. // Find the smallest array
  15546. arraysLength = arrays.length;
  15547. for (i = minArrayIndex = 0; i < arraysLength; i++) {
  15548. minArrayCandidate = arrays[i];
  15549. if (!minArray || minArrayCandidate.length < minArray.length) {
  15550. minArray = minArrayCandidate;
  15551. minArrayIndex = i;
  15552. }
  15553. }
  15554. minArray = ExtArray.unique(minArray);
  15555. erase(arrays, minArrayIndex, 1);
  15556. // Use the smallest unique'd array as the anchor loop. If the other array(s) do contain
  15557. // an item in the small array, we're likely to find it before reaching the end
  15558. // of the inner loop and can terminate the search early.
  15559. minArrayLength = minArray.length;
  15560. arraysLength = arrays.length;
  15561. for (i = 0; i < minArrayLength; i++) {
  15562. element = minArray[i];
  15563. elementCount = 0;
  15564. for (j = 0; j < arraysLength; j++) {
  15565. array = arrays[j];
  15566. arrayLength = array.length;
  15567. for (k = 0; k < arrayLength; k++) {
  15568. elementCandidate = array[k];
  15569. if (element === elementCandidate) {
  15570. elementCount++;
  15571. break;
  15572. }
  15573. }
  15574. }
  15575. if (elementCount === arraysLength) {
  15576. intersection.push(element);
  15577. }
  15578. }
  15579. return intersection;
  15580. },
  15581. /**
  15582. * Perform a set difference A-B by subtracting all items in array B from array A.
  15583. *
  15584. * @param {Array} arrayA
  15585. * @param {Array} arrayB
  15586. * @return {Array} difference
  15587. */
  15588. difference: function(arrayA, arrayB) {
  15589. var clone = slice.call(arrayA),
  15590. ln = clone.length,
  15591. i, j, lnB;
  15592. for (i = 0 , lnB = arrayB.length; i < lnB; i++) {
  15593. for (j = 0; j < ln; j++) {
  15594. if (clone[j] === arrayB[i]) {
  15595. erase(clone, j, 1);
  15596. j--;
  15597. ln--;
  15598. }
  15599. }
  15600. }
  15601. return clone;
  15602. },
  15603. /**
  15604. * This method applies the `reduceFn` function against an accumulator and each
  15605. * value of the `array` (from left-to-right) to reduce it to a single value.
  15606. *
  15607. * If no `initialValue` is specified, the first element of the array is used as
  15608. * the initial value. For example:
  15609. *
  15610. * function reducer (previous, value, index) {
  15611. * console.log('[' + index + ']: (' + previous + ',' + value + '}');
  15612. * return previous * 10 + value;
  15613. * }
  15614. *
  15615. * v = Ext.Array.reduce([2, 3, 4], reducer);
  15616. * console.log('v = ' + v);
  15617. *
  15618. * > [1]: (2, 3)
  15619. * > [2]: (23, 4)
  15620. * > v = 234
  15621. *
  15622. * v = Ext.Array.reduce([2, 3, 4], reducer, 1);
  15623. * console.log('v = ' + v);
  15624. *
  15625. * > [0]: (1, 2)
  15626. * > [1]: (12, 3)
  15627. * > [2]: (123, 4)
  15628. * > v = 1234
  15629. *
  15630. * @param {Array} array The array to process.
  15631. * @param {Function} reduceFn The reducing callback function.
  15632. * @param {Mixed} reduceFn.previous The previous value.
  15633. * @param {Mixed} reduceFn.value The current value.
  15634. * @param {Number} reduceFn.index The index in the array of the current `value`.
  15635. * @param {Array} reduceFn.array The array to being processed.
  15636. * @param {Mixed} [initialValue] The starting value.
  15637. * @return {Mixed} The reduced value.
  15638. * @method reduce
  15639. * @since 6.0.0
  15640. */
  15641. reduce: Array.prototype.reduce ? function(array, reduceFn, initialValue) {
  15642. if (arguments.length === 3) {
  15643. return Array.prototype.reduce.call(array, reduceFn, initialValue);
  15644. }
  15645. return Array.prototype.reduce.call(array, reduceFn);
  15646. } : function(array, reduceFn, initialValue) {
  15647. array = Object(array);
  15648. if (!Ext.isFunction(reduceFn)) {
  15649. Ext.raise('Invalid parameter: expected a function.');
  15650. }
  15651. /* eslint-disable-next-line vars-on-top */
  15652. var index = 0,
  15653. length = array.length >>> 0,
  15654. reduced = initialValue;
  15655. if (arguments.length < 3) {
  15656. while (true) {
  15657. // eslint-disable-line no-constant-condition
  15658. if (index in array) {
  15659. reduced = array[index++];
  15660. break;
  15661. }
  15662. if (++index >= length) {
  15663. throw new TypeError('Reduce of empty array with no initial value');
  15664. }
  15665. }
  15666. }
  15667. for (; index < length; ++index) {
  15668. if (index in array) {
  15669. reduced = reduceFn(reduced, array[index], index, array);
  15670. }
  15671. }
  15672. return reduced;
  15673. },
  15674. /**
  15675. * Returns a shallow copy of a part of an array. This is equivalent to the native
  15676. * call `Array.prototype.slice.call(array, begin, end)`. This is often used when "array"
  15677. * is "arguments" since the arguments object does not supply a slice method but can
  15678. * be the context object to `Array.prototype.slice`.
  15679. *
  15680. * @param {Array} array The array (or arguments object).
  15681. * @param {Number} begin The index at which to begin. Negative values are offsets from
  15682. * the end of the array.
  15683. * @param {Number} end The index at which to end. The copied items do not include
  15684. * end. Negative values are offsets from the end of the array. If end is omitted,
  15685. * all items up to the end of the array are copied.
  15686. * @return {Array} The copied piece of the array.
  15687. * @method slice
  15688. */
  15689. // Note: IE8 will return [] on slice.call(x, undefined).
  15690. slice: ([
  15691. 1,
  15692. 2
  15693. ].slice(1, undefined).length ? function(array, begin, end) {
  15694. return slice.call(array, begin, end);
  15695. } : function(array, begin, end) {
  15696. // see http://jsperf.com/slice-fix
  15697. if (typeof begin === 'undefined') {
  15698. return slice.call(array);
  15699. }
  15700. if (typeof end === 'undefined') {
  15701. return slice.call(array, begin);
  15702. }
  15703. return slice.call(array, begin, end);
  15704. }),
  15705. /**
  15706. * Sorts the elements of an Array in a stable manner (equivalently keyed values do not move
  15707. * relative to each other). By default, this method sorts the elements alphabetically and
  15708. * ascending.
  15709. * **Note:** This method modifies the passed array, in the same manner as the
  15710. * native javascript Array.sort.
  15711. *
  15712. * @param {Array} array The array to sort.
  15713. * @param {Function} [sortFn] The comparison function.
  15714. * @param {Mixed} sortFn.a The first item to compare.
  15715. * @param {Mixed} sortFn.b The second item to compare.
  15716. * @param {Number} sortFn.return `-1` if a < b, `1` if a > b, otherwise `0`.
  15717. * @return {Array} The sorted array.
  15718. */
  15719. sort: function(array, sortFn) {
  15720. return stableSort(array, sortFn || ExtArray.lexicalCompare);
  15721. },
  15722. /**
  15723. * Recursively flattens into 1-d Array. Injects Arrays inline.
  15724. *
  15725. * @param {Array} array The array to flatten
  15726. * @return {Array} The 1-d array.
  15727. */
  15728. flatten: function(array) {
  15729. var worker = [];
  15730. function rFlatten(a) {
  15731. var i, ln, v;
  15732. for (i = 0 , ln = a.length; i < ln; i++) {
  15733. v = a[i];
  15734. if (Ext.isArray(v)) {
  15735. rFlatten(v);
  15736. } else {
  15737. worker.push(v);
  15738. }
  15739. }
  15740. return worker;
  15741. }
  15742. return rFlatten(array);
  15743. },
  15744. /**
  15745. * Returns the minimum value in the Array.
  15746. *
  15747. * @param {Array/NodeList} array The Array from which to select the minimum value.
  15748. * @param {Function} comparisonFn (optional) a function to perform the comparison which
  15749. * determines minimization.
  15750. * If omitted the "<" operator will be used.
  15751. * __Note:__ gt = 1; eq = 0; lt = -1
  15752. * @param {Mixed} comparisonFn.min Current minimum value.
  15753. * @param {Mixed} comparisonFn.item The value to compare with the current minimum.
  15754. * @return {Object} minValue The minimum value.
  15755. */
  15756. min: function(array, comparisonFn) {
  15757. var min = array[0],
  15758. i, ln, item;
  15759. for (i = 0 , ln = array.length; i < ln; i++) {
  15760. item = array[i];
  15761. if (comparisonFn) {
  15762. if (comparisonFn(min, item) === 1) {
  15763. min = item;
  15764. }
  15765. } else {
  15766. if (item < min) {
  15767. min = item;
  15768. }
  15769. }
  15770. }
  15771. return min;
  15772. },
  15773. /**
  15774. * Returns the maximum value in the Array.
  15775. *
  15776. * @param {Array/NodeList} array The Array from which to select the maximum value.
  15777. * @param {Function} comparisonFn (optional) a function to perform the comparison which
  15778. * determines maximization.
  15779. * If omitted the ">" operator will be used.
  15780. * __Note:__ gt = 1; eq = 0; lt = -1
  15781. * @param {Mixed} comparisonFn.max Current maximum value.
  15782. * @param {Mixed} comparisonFn.item The value to compare with the current maximum.
  15783. * @return {Object} maxValue The maximum value.
  15784. */
  15785. max: function(array, comparisonFn) {
  15786. var max = array[0],
  15787. i, ln, item;
  15788. for (i = 0 , ln = array.length; i < ln; i++) {
  15789. item = array[i];
  15790. if (comparisonFn) {
  15791. if (comparisonFn(max, item) === -1) {
  15792. max = item;
  15793. }
  15794. } else {
  15795. if (item > max) {
  15796. max = item;
  15797. }
  15798. }
  15799. }
  15800. return max;
  15801. },
  15802. /**
  15803. * Calculates the mean of all items in the array.
  15804. *
  15805. * @param {Array} array The Array to calculate the mean value of.
  15806. * @return {Number} The mean.
  15807. */
  15808. mean: function(array) {
  15809. return array.length > 0 ? ExtArray.sum(array) / array.length : undefined;
  15810. },
  15811. /**
  15812. * Calculates the sum of all items in the given array.
  15813. *
  15814. * @param {Array} array The Array to calculate the sum value of.
  15815. * @return {Number} The sum.
  15816. */
  15817. sum: function(array) {
  15818. var sum = 0,
  15819. i, ln, item;
  15820. for (i = 0 , ln = array.length; i < ln; i++) {
  15821. item = array[i];
  15822. sum += item;
  15823. }
  15824. return sum;
  15825. },
  15826. /**
  15827. * Creates a map (object) keyed by the elements of the given array. The values in
  15828. * the map are the index+1 of the array element. For example:
  15829. *
  15830. * var map = Ext.Array.toMap(['a','b','c']);
  15831. *
  15832. * // map = { a: 1, b: 2, c: 3 };
  15833. *
  15834. * Or a key property can be specified:
  15835. *
  15836. * var map = Ext.Array.toMap([
  15837. * { name: 'a' },
  15838. * { name: 'b' },
  15839. * { name: 'c' }
  15840. * ], 'name');
  15841. *
  15842. * // map = { a: 1, b: 2, c: 3 };
  15843. *
  15844. * Lastly, a key extractor can be provided:
  15845. *
  15846. * var map = Ext.Array.toMap([
  15847. * { name: 'a' },
  15848. * { name: 'b' },
  15849. * { name: 'c' }
  15850. * ], function(obj) { return obj.name.toUpperCase(); });
  15851. *
  15852. * // map = { A: 1, B: 2, C: 3 };
  15853. *
  15854. * @param {String/String[]} strings The strings from which to create the map.
  15855. * @param {String/Function} [getKey] Name of the object property to use
  15856. * as a key or a function to extract the key.
  15857. * @param {Object} [scope] Value of `this` inside callback specified for `getKey`.
  15858. * @return {Object} The resulting map.
  15859. */
  15860. toMap: function(strings, getKey, scope) {
  15861. var map, i;
  15862. if (!strings) {
  15863. return null;
  15864. }
  15865. map = {};
  15866. i = strings.length;
  15867. if (typeof strings === 'string') {
  15868. map[strings] = 1;
  15869. } else if (!getKey) {
  15870. while (i--) {
  15871. map[strings[i]] = i + 1;
  15872. }
  15873. } else if (typeof getKey === 'string') {
  15874. while (i--) {
  15875. map[strings[i][getKey]] = i + 1;
  15876. }
  15877. } else {
  15878. while (i--) {
  15879. map[getKey.call(scope, strings[i])] = i + 1;
  15880. }
  15881. }
  15882. return map;
  15883. },
  15884. /**
  15885. * Creates a map (object) keyed by a property of elements of the given array. The values in
  15886. * the map are the array element. For example:
  15887. *
  15888. * var map = Ext.Array.toValueMap(['a','b','c']);
  15889. *
  15890. * // map = { a: 'a', b: 'b', c: 'c' };
  15891. *
  15892. * Or a key property can be specified:
  15893. *
  15894. * var map = Ext.Array.toValueMap([
  15895. * { name: 'a' },
  15896. * { name: 'b' },
  15897. * { name: 'c' }
  15898. * ], 'name');
  15899. *
  15900. * // map = { a: {name: 'a'}, b: {name: 'b'}, c: {name: 'c'} };
  15901. *
  15902. * Lastly, a key extractor can be provided:
  15903. *
  15904. * var map = Ext.Array.toValueMap([
  15905. * { name: 'a' },
  15906. * { name: 'b' },
  15907. * { name: 'c' }
  15908. * ], function(obj) { return obj.name.toUpperCase(); });
  15909. *
  15910. * // map = { A: {name: 'a'}, B: {name: 'b'}, C: {name: 'c'} };
  15911. *
  15912. * @param {Array} array The Array to create the map from.
  15913. * @param {String/Function} [getKey] Name of the object property to use
  15914. * as a key or a function to extract the key.
  15915. * @param {Object} [scope] Value of this inside callback. This parameter is only
  15916. * passed when `getKey` is a function. If `getKey` is not a function, the 3rd
  15917. * argument is `arrayify`.
  15918. * @param {Number} [arrayify] Pass `1` to create arrays for all map entries
  15919. * or `2` to create arrays for map entries that have 2 or more items with the
  15920. * same key. This only applies when `getKey` is specified. By default the map will
  15921. * hold the last entry with a given key.
  15922. * @return {Object} The resulting map.
  15923. */
  15924. toValueMap: function(array, getKey, scope, arrayify) {
  15925. var map = {},
  15926. i = array.length,
  15927. autoArray, alwaysArray, entry, fn, key, value;
  15928. if (!getKey) {
  15929. while (i--) {
  15930. value = array[i];
  15931. map[value] = value;
  15932. }
  15933. } else {
  15934. if (!(fn = (typeof getKey !== 'string'))) {
  15935. arrayify = scope;
  15936. }
  15937. alwaysArray = arrayify === 1;
  15938. autoArray = arrayify === 2;
  15939. while (i--) {
  15940. value = array[i];
  15941. key = fn ? getKey.call(scope, value) : value[getKey];
  15942. if (alwaysArray) {
  15943. if (key in map) {
  15944. map[key].push(value);
  15945. } else {
  15946. map[key] = [
  15947. value
  15948. ];
  15949. }
  15950. } else if (autoArray && (key in map)) {
  15951. if ((entry = map[key]) instanceof Array) {
  15952. entry.push(value);
  15953. } else {
  15954. map[key] = [
  15955. entry,
  15956. value
  15957. ];
  15958. }
  15959. } else {
  15960. map[key] = value;
  15961. }
  15962. }
  15963. }
  15964. return map;
  15965. },
  15966. _replaceSim: replaceSim,
  15967. // for unit testing
  15968. _spliceSim: spliceSim,
  15969. /**
  15970. * Removes items from an array. This is functionally equivalent to the splice method
  15971. * of Array, but works around bugs in IE8's splice method and does not copy the
  15972. * removed elements in order to return them (because very often they are ignored).
  15973. *
  15974. * @param {Array} array The Array on which to replace.
  15975. * @param {Number} index The index in the array at which to operate.
  15976. * @param {Number} removeCount The number of items to remove at index.
  15977. * @return {Array} The array passed.
  15978. * @method
  15979. */
  15980. erase: erase,
  15981. /**
  15982. * Inserts items in to an array.
  15983. *
  15984. * @param {Array} array The Array in which to insert.
  15985. * @param {Number} index The index in the array at which to operate.
  15986. * @param {Array} items The array of items to insert at index.
  15987. * @return {Array} The array passed.
  15988. */
  15989. insert: function(array, index, items) {
  15990. return replace(array, index, 0, items);
  15991. },
  15992. move: function(array, fromIdx, toIdx) {
  15993. if (toIdx === fromIdx) {
  15994. return;
  15995. }
  15996. /* eslint-disable-next-line vars-on-top */
  15997. var item = array[fromIdx],
  15998. incr = toIdx > fromIdx ? 1 : -1,
  15999. i;
  16000. for (i = fromIdx; i !== toIdx; i += incr) {
  16001. array[i] = array[i + incr];
  16002. }
  16003. array[toIdx] = item;
  16004. },
  16005. /**
  16006. * Replaces items in an array. This is functionally equivalent to the splice method
  16007. * of Array, but works around bugs in IE8's splice method and is often more convenient
  16008. * to call because it accepts an array of items to insert rather than use a variadic
  16009. * argument list.
  16010. *
  16011. * @param {Array} array The Array on which to replace.
  16012. * @param {Number} index The index in the array at which to operate.
  16013. * @param {Number} removeCount The number of items to remove at index (can be 0).
  16014. * @param {Array} insert (optional) An array of items to insert at index.
  16015. * @return {Array} The array passed.
  16016. * @method
  16017. */
  16018. replace: replace,
  16019. /**
  16020. * Replaces items in an array. This is equivalent to the splice method of Array, but
  16021. * works around bugs in IE8's splice method. The signature is exactly the same as the
  16022. * splice method except that the array is the first argument. All arguments following
  16023. * removeCount are inserted in the array at index.
  16024. *
  16025. * @param {Array} array The Array on which to replace.
  16026. * @param {Number} index The index in the array at which to operate.
  16027. * @param {Number} removeCount The number of items to remove at index (can be 0).
  16028. * @param {Object...} elements The elements to add to the array. If you don't specify
  16029. * any elements, splice simply removes elements from the array.
  16030. * @return {Array} An array containing the removed items.
  16031. * @method
  16032. */
  16033. splice: splice,
  16034. /**
  16035. * Pushes new items onto the end of an Array.
  16036. *
  16037. * Passed parameters may be single items, or arrays of items. If an Array is found in the
  16038. * argument list, all its elements are pushed into the end of the target Array.
  16039. *
  16040. * @param {Array} target The Array onto which to push new items
  16041. * @param {Object...} elements The elements to add to the array. Each parameter may
  16042. * be an Array, in which case all the elements of that Array will be pushed into the end
  16043. * of the destination Array.
  16044. * @return {Array} An array containing all the new items push onto the end.
  16045. */
  16046. push: function(target) {
  16047. var args = arguments,
  16048. len = args.length,
  16049. i, newItem;
  16050. if (target === undefined) {
  16051. target = [];
  16052. } else if (!Ext.isArray(target)) {
  16053. target = [
  16054. target
  16055. ];
  16056. }
  16057. for (i = 1; i < len; i++) {
  16058. newItem = args[i];
  16059. Array.prototype.push[Ext.isIterable(newItem) ? 'apply' : 'call'](target, newItem);
  16060. }
  16061. return target;
  16062. },
  16063. /**
  16064. * A function used to sort an array by numeric value. By default, javascript array values
  16065. * are coerced to strings when sorting, which can be problematic when using numeric values.
  16066. * To ensure that the values are sorted numerically, this method can be passed to the sort
  16067. * method:
  16068. *
  16069. * Ext.Array.sort(myArray, Ext.Array.numericSortFn);
  16070. */
  16071. numericSortFn: function(a, b) {
  16072. return a - b;
  16073. }
  16074. };
  16075. /**
  16076. * @method each
  16077. * @member Ext
  16078. * @inheritdoc Ext.Array#each
  16079. */
  16080. Ext.each = ExtArray.each;
  16081. /**
  16082. * @method union
  16083. * @member Ext.Array
  16084. * @inheritdoc Ext.Array#merge
  16085. */
  16086. ExtArray.union = ExtArray.merge;
  16087. /**
  16088. * Old alias to {@link Ext.Array#min}
  16089. * @deprecated 4.0.0 Use {@link Ext.Array#min} instead
  16090. * @method min
  16091. * @member Ext
  16092. * @inheritdoc Ext.Array#min
  16093. */
  16094. Ext.min = ExtArray.min;
  16095. /**
  16096. * Old alias to {@link Ext.Array#max}
  16097. * @deprecated 4.0.0 Use {@link Ext.Array#max} instead
  16098. * @method max
  16099. * @member Ext
  16100. * @inheritdoc Ext.Array#max
  16101. */
  16102. Ext.max = ExtArray.max;
  16103. /**
  16104. * Old alias to {@link Ext.Array#sum}
  16105. * @deprecated 4.0.0 Use {@link Ext.Array#sum} instead
  16106. * @method sum
  16107. * @member Ext
  16108. * @inheritdoc Ext.Array#sum
  16109. */
  16110. Ext.sum = ExtArray.sum;
  16111. /**
  16112. * Old alias to {@link Ext.Array#mean}
  16113. * @deprecated 4.0.0 Use {@link Ext.Array#mean} instead
  16114. * @method mean
  16115. * @member Ext
  16116. * @inheritdoc Ext.Array#mean
  16117. */
  16118. Ext.mean = ExtArray.mean;
  16119. /**
  16120. * Old alias to {@link Ext.Array#flatten}
  16121. * @deprecated 4.0.0 Use {@link Ext.Array#flatten} instead
  16122. * @method flatten
  16123. * @member Ext
  16124. * @inheritdoc Ext.Array#flatten
  16125. */
  16126. Ext.flatten = ExtArray.flatten;
  16127. /**
  16128. * Old alias to {@link Ext.Array#clean}
  16129. * @deprecated 4.0.0 Use {@link Ext.Array#clean} instead
  16130. * @method clean
  16131. * @member Ext
  16132. * @inheritdoc Ext.Array#clean
  16133. */
  16134. Ext.clean = ExtArray.clean;
  16135. /**
  16136. * Old alias to {@link Ext.Array#unique}
  16137. * @deprecated 4.0.0 Use {@link Ext.Array#unique} instead
  16138. * @method unique
  16139. * @member Ext
  16140. * @inheritdoc Ext.Array#unique
  16141. */
  16142. Ext.unique = ExtArray.unique;
  16143. /**
  16144. * Old alias to {@link Ext.Array#pluck Ext.Array.pluck}
  16145. * @deprecated 4.0.0 Use {@link Ext.Array#pluck Ext.Array.pluck} instead
  16146. * @method pluck
  16147. * @member Ext
  16148. * @inheritdoc Ext.Array#pluck
  16149. */
  16150. Ext.pluck = ExtArray.pluck;
  16151. /**
  16152. * @method toArray
  16153. * @member Ext
  16154. * @inheritdoc Ext.Array#toArray
  16155. */
  16156. Ext.toArray = function() {
  16157. return ExtArray.toArray.apply(ExtArray, arguments);
  16158. };
  16159. return ExtArray;
  16160. }());
  16161. // @define Ext.lang.Assert
  16162. // @define Ext.Assert
  16163. // @require Ext.lang.Error
  16164. /**
  16165. * @class Ext.Assert
  16166. * This class provides help value testing methods useful for diagnostics. These are often
  16167. * used in `debugHooks`:
  16168. *
  16169. * Ext.define('Foo.bar.Class', {
  16170. *
  16171. * debugHooks: {
  16172. * method: function (a) {
  16173. * Ext.Assert.truthy(a, 'Expected "a" to be truthy');
  16174. * },
  16175. *
  16176. * foo: function (object) {
  16177. * Ext.Assert.isFunctionProp(object, 'doSomething');
  16178. * }
  16179. * }
  16180. * });
  16181. *
  16182. * **NOTE:** This class is entirely removed in production builds so all uses of it should
  16183. * be either in `debug` conditional comments or `debugHooks`.
  16184. *
  16185. * The following type detection methods from the `Ext` object are wrapped as assertions
  16186. * by this class:
  16187. *
  16188. * * `isEmpty`
  16189. * * `isArray`
  16190. * * `isDate`
  16191. * * `isObject`
  16192. * * `isSimpleObject`
  16193. * * `isPrimitive`
  16194. * * `isFunction`
  16195. * * `isNumber`
  16196. * * `isNumeric`
  16197. * * `isString`
  16198. * * `isBoolean`
  16199. * * `isElement`
  16200. * * `isTextNode`
  16201. * * `isDefined`
  16202. * * `isIterable`
  16203. *
  16204. * These appear both their exact name and with a "Prop" suffix for checking a property on
  16205. * an object. For example, these are almost identical:
  16206. *
  16207. * Ext.Assert.isFunction(object.foo);
  16208. *
  16209. * Ext.Assert.isFunctionProp(object, 'foo');
  16210. *
  16211. * The difference is the default error message generated is better in the second use case
  16212. * than the first.
  16213. *
  16214. * The above list are also expanded for "Not" flavors (and "Not...Prop"):
  16215. *
  16216. * * `isNotEmpty`
  16217. * * `isNotArray`
  16218. * * `isNotDate`
  16219. * * `isNotObject`
  16220. * * `isNotSimpleObject`
  16221. * * `isNotPrimitive`
  16222. * * `isNotFunction`
  16223. * * `isNotNumber`
  16224. * * `isNotNumeric`
  16225. * * `isNotString`
  16226. * * `isNotBoolean`
  16227. * * `isNotElement`
  16228. * * `isNotTextNode`
  16229. * * `isNotDefined`
  16230. * * `isNotIterable`
  16231. */
  16232. Ext.Assert = {
  16233. /**
  16234. * Checks that the first argument is falsey and throws an `Error` if it is not.
  16235. */
  16236. falsey: function(b, msg) {
  16237. if (b) {
  16238. Ext.raise(msg || ('Expected a falsey value but was ' + b));
  16239. }
  16240. },
  16241. /**
  16242. * Checks that the first argument is falsey and throws an `Error` if it is not.
  16243. */
  16244. falseyProp: function(object, property) {
  16245. var b;
  16246. Ext.Assert.truthy(object);
  16247. b = object[property];
  16248. if (b) {
  16249. if (object.$className) {
  16250. property = object.$className + '#' + property;
  16251. }
  16252. Ext.raise('Expected a falsey value for ' + property + ' but was ' + b);
  16253. }
  16254. },
  16255. /**
  16256. * Checks that the first argument is truthy and throws an `Error` if it is not.
  16257. */
  16258. truthy: function(b, msg) {
  16259. if (!b) {
  16260. Ext.raise(msg || ('Expected a truthy value but was ' + typeof b));
  16261. }
  16262. },
  16263. /**
  16264. * Checks that the first argument is truthy and throws an `Error` if it is not.
  16265. */
  16266. truthyProp: function(object, property) {
  16267. var b;
  16268. Ext.Assert.truthy(object);
  16269. b = object[property];
  16270. if (!b) {
  16271. if (object.$className) {
  16272. property = object.$className + '#' + property;
  16273. }
  16274. Ext.raise('Expected a truthy value for ' + property + ' but was ' + typeof b);
  16275. }
  16276. }
  16277. };
  16278. /* eslint-disable indent */
  16279. (function() {
  16280. var name, kind;
  16281. function makeAssert(name, kind) {
  16282. var testFn = Ext[name],
  16283. def;
  16284. return function(value, msg) {
  16285. if (!testFn(value)) {
  16286. Ext.raise(msg || def || (def = 'Expected value to be ' + kind));
  16287. }
  16288. };
  16289. }
  16290. function makeAssertProp(name, kind) {
  16291. var testFn = Ext[name],
  16292. def;
  16293. return function(object, prop) {
  16294. Ext.Assert.truthy(object);
  16295. if (!testFn(object[prop])) {
  16296. Ext.raise(def || (def = 'Expected ' + (object.$className ? object.$className + '#' : '') + prop + ' to be ' + kind));
  16297. }
  16298. };
  16299. }
  16300. function makeNotAssert(name, kind) {
  16301. var testFn = Ext[name],
  16302. def;
  16303. return function(value, msg) {
  16304. if (testFn(value)) {
  16305. Ext.raise(msg || def || (def = 'Expected value to NOT be ' + kind));
  16306. }
  16307. };
  16308. }
  16309. function makeNotAssertProp(name, kind) {
  16310. var testFn = Ext[name],
  16311. def;
  16312. return function(object, prop) {
  16313. Ext.Assert.truthy(object);
  16314. if (testFn(object[prop])) {
  16315. Ext.raise(def || (def = 'Expected ' + (object.$className ? object.$className + '#' : '') + prop + ' to NOT be ' + kind));
  16316. }
  16317. };
  16318. }
  16319. for (name in Ext) {
  16320. if (name.substring(0, 2) === "is" && Ext.isFunction(Ext[name])) {
  16321. kind = name.substring(2);
  16322. Ext.Assert[name] = makeAssert(name, kind);
  16323. Ext.Assert[name + 'Prop'] = makeAssertProp(name, kind);
  16324. Ext.Assert['isNot' + kind] = makeNotAssert(name, kind);
  16325. Ext.Assert['isNot' + kind + 'Prop'] = makeNotAssertProp(name, kind);
  16326. }
  16327. }
  16328. }());
  16329. /**
  16330. * @class Ext.String
  16331. *
  16332. * A collection of useful static methods to deal with strings.
  16333. * @singleton
  16334. */
  16335. /* eslint-disable indent */
  16336. Ext.String = (function() {
  16337. // @define Ext.lang.String
  16338. // @define Ext.String
  16339. // @require Ext
  16340. // @require Ext.lang.Array
  16341. // eslint-disable-next-line no-control-regex
  16342. var trimRegex = /^[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+|[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+$/g,
  16343. escapeRe = /('|\\)/g,
  16344. // eslint-disable-next-line no-useless-escape
  16345. escapeRegexRe = /([-.*+?\^${}()|\[\]\/\\])/g,
  16346. basicTrimRe = /^\s+|\s+$/g,
  16347. whitespaceRe = /\s+/,
  16348. varReplace = /(^[^a-z]*|[^\w])/gi,
  16349. charToEntity, entityToChar, charToEntityRegex, entityToCharRegex,
  16350. htmlEncodeReplaceFn = function(match, capture) {
  16351. return charToEntity[capture];
  16352. },
  16353. htmlDecodeReplaceFn = function(match, capture) {
  16354. return (capture in entityToChar) ? entityToChar[capture] : String.fromCharCode(parseInt(capture.substr(2), 10));
  16355. },
  16356. boundsCheck = function(s, other) {
  16357. if (s === null || s === undefined || other === null || other === undefined) {
  16358. return false;
  16359. }
  16360. return other.length <= s.length;
  16361. },
  16362. fromCharCode = String.fromCharCode,
  16363. ExtString;
  16364. return ExtString = {
  16365. /**
  16366. * @method
  16367. * Creates a string created by using the specified sequence of code points.
  16368. * @param {Number...} codePoint Codepoints from which to build the string.
  16369. * @return {String} A string built from the sequence of code points passed.
  16370. */
  16371. fromCodePoint: String.fromCodePoint || function() {
  16372. var codePoint,
  16373. result = '',
  16374. codeUnits = [],
  16375. index = -1,
  16376. length = arguments.length;
  16377. while (++index < length) {
  16378. codePoint = Number(arguments[index]);
  16379. if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
  16380. codePoint < 0 || // not a valid Unicode code point
  16381. codePoint > 1114111 || // not a valid Unicode code point
  16382. Math.floor(codePoint) !== codePoint) // not an integer
  16383. {
  16384. Ext.raise('Invalid code point: ' + codePoint);
  16385. }
  16386. if (codePoint <= 65535) {
  16387. // BMP code point
  16388. codeUnits.push(codePoint);
  16389. } else {
  16390. // Astral code point; split in surrogate halves
  16391. // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
  16392. codePoint -= 65536;
  16393. codeUnits.push((codePoint >> 10) + 55296, (codePoint % 1024) + 56320);
  16394. }
  16395. if (index + 1 === length) {
  16396. result += fromCharCode(codeUnits);
  16397. codeUnits.length = 0;
  16398. }
  16399. }
  16400. return result;
  16401. },
  16402. /**
  16403. * Inserts a substring into a string.
  16404. * @param {String} s The original string.
  16405. * @param {String} value The substring to insert.
  16406. * @param {Number} index The index to insert the substring. Negative indexes will insert
  16407. * from the end of the string. Example:
  16408. *
  16409. * Ext.String.insert("abcdefg", "h", -1); // abcdefhg
  16410. *
  16411. * @return {String} The value with the inserted substring
  16412. */
  16413. insert: function(s, value, index) {
  16414. var len;
  16415. if (!s) {
  16416. return value;
  16417. }
  16418. if (!value) {
  16419. return s;
  16420. }
  16421. len = s.length;
  16422. if (!index && index !== 0) {
  16423. index = len;
  16424. }
  16425. if (index < 0) {
  16426. index *= -1;
  16427. if (index >= len) {
  16428. // negative overflow, insert at start
  16429. index = 0;
  16430. } else {
  16431. index = len - index;
  16432. }
  16433. }
  16434. if (index === 0) {
  16435. s = value + s;
  16436. } else if (index >= s.length) {
  16437. s += value;
  16438. } else {
  16439. s = s.substr(0, index) + value + s.substr(index);
  16440. }
  16441. return s;
  16442. },
  16443. /**
  16444. * Checks if a string starts with a substring
  16445. * @param {String} s The original string
  16446. * @param {String} start The substring to check
  16447. * @param {Boolean} [ignoreCase=false] True to ignore the case in the comparison
  16448. */
  16449. startsWith: function(s, start, ignoreCase) {
  16450. var result = boundsCheck(s, start);
  16451. if (result) {
  16452. if (ignoreCase) {
  16453. s = s.toLowerCase();
  16454. start = start.toLowerCase();
  16455. }
  16456. result = s.lastIndexOf(start, 0) === 0;
  16457. }
  16458. return result;
  16459. },
  16460. /**
  16461. * Checks if a string ends with a substring
  16462. * @param {String} s The original string
  16463. * @param {String} end The substring to check
  16464. * @param {Boolean} [ignoreCase=false] True to ignore the case in the comparison
  16465. */
  16466. endsWith: function(s, end, ignoreCase) {
  16467. var result = boundsCheck(s, end);
  16468. if (result) {
  16469. if (ignoreCase) {
  16470. s = s.toLowerCase();
  16471. end = end.toLowerCase();
  16472. }
  16473. result = s.indexOf(end, s.length - end.length) !== -1;
  16474. }
  16475. return result;
  16476. },
  16477. /**
  16478. * Converts a string of characters into a legal, parse-able JavaScript `var` name
  16479. * as long as the passed string contains at least one alphabetic character.
  16480. * Non alphanumeric characters, and *leading* non alphabetic characters will be removed.
  16481. * @param {String} s A string to be converted into a `var` name.
  16482. * @return {String} A legal JavaScript `var` name.
  16483. */
  16484. createVarName: function(s) {
  16485. return s.replace(varReplace, '');
  16486. },
  16487. /**
  16488. * Convert certain characters (&, <, >, ', and ") to their HTML character equivalents
  16489. * for literal display in web pages.
  16490. * @param {String} value The string to encode.
  16491. * @return {String} The encoded text.
  16492. * @method
  16493. */
  16494. htmlEncode: function(value) {
  16495. return (!value) ? value : String(value).replace(charToEntityRegex, htmlEncodeReplaceFn);
  16496. },
  16497. /**
  16498. * Convert certain characters (&, <, >, ', and ") from their HTML character equivalents.
  16499. * @param {String} value The string to decode.
  16500. * @return {String} The decoded text.
  16501. * @method
  16502. */
  16503. htmlDecode: function(value) {
  16504. return (!value) ? value : String(value).replace(entityToCharRegex, htmlDecodeReplaceFn);
  16505. },
  16506. /**
  16507. * Checks if a string has values needing to be html encoded.
  16508. * @private
  16509. * @param {String} s The string to test
  16510. * @return {Boolean} `true` if the string contains HTML characters
  16511. */
  16512. hasHtmlCharacters: function(s) {
  16513. return charToEntityRegex.test(s);
  16514. },
  16515. /**
  16516. * Adds a set of character entity definitions to the set used by
  16517. * {@link Ext.String#htmlEncode} and {@link Ext.String#htmlDecode}.
  16518. *
  16519. * This object should be keyed by the entity name sequence,
  16520. * with the value being the textual representation of the entity.
  16521. *
  16522. * Ext.String.addCharacterEntities({
  16523. * '&amp;Uuml;':'Ü',
  16524. * '&amp;ccedil;':'ç',
  16525. * '&amp;ntilde;':'ñ',
  16526. * '&amp;egrave;':'è'
  16527. * });
  16528. * var s = Ext.String.htmlEncode("A string with entities: èÜçñ");
  16529. *
  16530. * __Note:__ the values of the character entities defined on this object are expected
  16531. * to be single character values. As such, the actual values represented by the
  16532. * characters are sensitive to the character encoding of the JavaScript source
  16533. * file when defined in string literal form. Script tags referencing server
  16534. * resources with character entities must ensure that the 'charset' attribute
  16535. * of the script node is consistent with the actual character encoding of the
  16536. * server resource.
  16537. *
  16538. * The set of character entities may be reset back to the default state by using
  16539. * the {@link Ext.String#resetCharacterEntities} method
  16540. *
  16541. * @param {Object} newEntities The set of character entities to add to the current
  16542. * definitions.
  16543. */
  16544. addCharacterEntities: function(newEntities) {
  16545. var charKeys = [],
  16546. entityKeys = [],
  16547. key, echar;
  16548. for (key in newEntities) {
  16549. echar = newEntities[key];
  16550. entityToChar[key] = echar;
  16551. charToEntity[echar] = key;
  16552. charKeys.push(echar);
  16553. entityKeys.push(key);
  16554. }
  16555. charToEntityRegex = new RegExp('(' + charKeys.join('|') + ')', 'g');
  16556. entityToCharRegex = new RegExp('(' + entityKeys.join('|') + '|&#[0-9]{1,5};' + ')', 'g');
  16557. },
  16558. /**
  16559. * Resets the set of character entity definitions used by
  16560. * {@link Ext.String#htmlEncode} and {@link Ext.String#htmlDecode} back to the
  16561. * default state.
  16562. */
  16563. resetCharacterEntities: function() {
  16564. charToEntity = {};
  16565. entityToChar = {};
  16566. // add the default set
  16567. this.addCharacterEntities({
  16568. '&amp;': '&',
  16569. '&gt;': '>',
  16570. '&lt;': '<',
  16571. '&quot;': '"',
  16572. '&#39;': "'"
  16573. });
  16574. },
  16575. /**
  16576. * Appends content to the query string of a URL, handling logic for whether to place
  16577. * a question mark or ampersand.
  16578. * @param {String} url The URL to append to.
  16579. * @param {String} string The content to append to the URL.
  16580. * @return {String} The resulting URL
  16581. */
  16582. urlAppend: function(url, string) {
  16583. if (!Ext.isEmpty(string)) {
  16584. return url + (url.indexOf('?') === -1 ? '?' : '&') + string;
  16585. }
  16586. return url;
  16587. },
  16588. /**
  16589. * Trims whitespace from either end of a string, leaving spaces within the string intact.
  16590. * Example:
  16591. *
  16592. * var s = ' foo bar ';
  16593. * alert('-' + s + '-'); //alerts "- foo bar -"
  16594. * alert('-' + Ext.String.trim(s) + '-'); //alerts "-foo bar-"
  16595. *
  16596. * @param {String} string The string to trim.
  16597. * @return {String} The trimmed string.
  16598. */
  16599. trim: function(string) {
  16600. if (string) {
  16601. string = string.replace(trimRegex, "");
  16602. }
  16603. return string || '';
  16604. },
  16605. /**
  16606. * Capitalize the first letter of the given string.
  16607. * @param {String} string
  16608. * @return {String}
  16609. */
  16610. capitalize: function(string) {
  16611. if (string) {
  16612. string = string.charAt(0).toUpperCase() + string.substr(1);
  16613. }
  16614. return string || '';
  16615. },
  16616. /**
  16617. * Uncapitalize the first letter of a given string.
  16618. * @param {String} string
  16619. * @return {String}
  16620. */
  16621. uncapitalize: function(string) {
  16622. if (string) {
  16623. string = string.charAt(0).toLowerCase() + string.substr(1);
  16624. }
  16625. return string || '';
  16626. },
  16627. /**
  16628. * Truncate a string and add an ellipsis ('...') to the end if it exceeds
  16629. * the specified length.
  16630. * @param {String} value The string to truncate.
  16631. * @param {Number} length The maximum length to allow before truncating.
  16632. * @param {Boolean} [word=false] `true` to try to find a common word break.
  16633. * @return {String} The converted text.
  16634. */
  16635. ellipsis: function(value, length, word) {
  16636. var vs, index;
  16637. if (value && value.length > length) {
  16638. if (word) {
  16639. vs = value.substr(0, length - 2);
  16640. index = Math.max(vs.lastIndexOf(' '), vs.lastIndexOf('.'), vs.lastIndexOf('!'), vs.lastIndexOf('?'));
  16641. if (index !== -1 && index >= (length - 15)) {
  16642. return vs.substr(0, index) + "...";
  16643. }
  16644. }
  16645. return value.substr(0, length - 3) + "...";
  16646. }
  16647. return value;
  16648. },
  16649. /**
  16650. * Escapes the passed string for use in a regular expression.
  16651. * @param {String} string The string to escape.
  16652. * @return {String} The escaped string.
  16653. */
  16654. escapeRegex: function(string) {
  16655. return string.replace(escapeRegexRe, "\\$1");
  16656. },
  16657. /**
  16658. * Creates a `RegExp` given a string `value` and optional flags. For example, the
  16659. * following two regular expressions are equivalent.
  16660. *
  16661. * var regex1 = Ext.String.createRegex('hello');
  16662. *
  16663. * var regex2 = /^hello$/i;
  16664. *
  16665. * The following two regular expressions are also equivalent:
  16666. *
  16667. * var regex1 = Ext.String.createRegex('world', false, false, false);
  16668. *
  16669. * var regex2 = /world/;
  16670. *
  16671. * @param {String/RegExp} value The String to convert to a `RegExp`.
  16672. * @param {Boolean} [startsWith=true] Pass `false` to allow a match to start
  16673. * anywhere in the string. By default the `value` will match only at the start
  16674. * of the string.
  16675. * @param {Boolean} [endsWith=true] Pass `false` to allow the match to end before
  16676. * the end of the string. By default the `value` will match only at the end of the
  16677. * string.
  16678. * @param {Boolean} [ignoreCase=true] Pass `false` to make the `RegExp` case
  16679. * sensitive (removes the 'i' flag).
  16680. * @since 5.0.0
  16681. * @return {RegExp}
  16682. */
  16683. createRegex: function(value, startsWith, endsWith, ignoreCase) {
  16684. var ret = value;
  16685. if (value != null && !value.exec) {
  16686. // not a regex
  16687. ret = ExtString.escapeRegex(String(value));
  16688. if (startsWith !== false) {
  16689. ret = '^' + ret;
  16690. }
  16691. if (endsWith !== false) {
  16692. ret += '$';
  16693. }
  16694. ret = new RegExp(ret, (ignoreCase !== false) ? 'i' : '');
  16695. }
  16696. return ret;
  16697. },
  16698. /**
  16699. * Escapes the passed string for ' and \.
  16700. * @param {String} string The string to escape.
  16701. * @return {String} The escaped string.
  16702. */
  16703. escape: function(string) {
  16704. return string.replace(escapeRe, "\\$1");
  16705. },
  16706. /**
  16707. * Utility function that allows you to easily switch a string between two alternating
  16708. * values. The passed value is compared to the current string, and if they are equal,
  16709. * the other value that was passed in is returned. If they are already different,
  16710. * the first value passed in is returned. Note that this method returns the new value
  16711. * but does not change the current string.
  16712. *
  16713. * // alternate sort directions
  16714. * sort = Ext.String.toggle(sort, 'ASC', 'DESC');
  16715. *
  16716. * // instead of conditional logic:
  16717. * sort = (sort === 'ASC' ? 'DESC' : 'ASC');
  16718. *
  16719. * @param {String} string The current string.
  16720. * @param {String} value The value to compare to the current string.
  16721. * @param {String} other The new value to use if the string already equals the first value
  16722. * passed in.
  16723. * @return {String} The new value.
  16724. */
  16725. toggle: function(string, value, other) {
  16726. return string === value ? other : value;
  16727. },
  16728. /**
  16729. * Pads the left side of a string with a specified character. This is especially useful
  16730. * for normalizing number and date strings. Example usage:
  16731. *
  16732. * var s = Ext.String.leftPad('123', 5, '0');
  16733. * // s now contains the string: '00123'
  16734. *
  16735. * @param {String} string The original string.
  16736. * @param {Number} size The total length of the output string.
  16737. * @param {String} [character=' '] (optional) The character with which to pad the original
  16738. * string.
  16739. * @return {String} The padded string.
  16740. */
  16741. leftPad: function(string, size, character) {
  16742. var result = String(string);
  16743. character = character || " ";
  16744. while (result.length < size) {
  16745. result = character + result;
  16746. }
  16747. return result;
  16748. },
  16749. /**
  16750. * Returns a string with a specified number of repetitions a given string pattern.
  16751. * The pattern be separated by a different string.
  16752. *
  16753. * var s = Ext.String.repeat('---', 4); // = '------------'
  16754. * var t = Ext.String.repeat('--', 3, '/'); // = '--/--/--'
  16755. *
  16756. * @param {String} pattern The pattern to repeat.
  16757. * @param {Number} count The number of times to repeat the pattern (may be 0).
  16758. * @param {String} sep An option string to separate each pattern.
  16759. */
  16760. repeat: function(pattern, count, sep) {
  16761. var buf = [],
  16762. i;
  16763. if (count < 1) {
  16764. count = 0;
  16765. }
  16766. for (i = count; i--; ) {
  16767. buf.push(pattern);
  16768. }
  16769. return buf.join(sep || '');
  16770. },
  16771. /**
  16772. * Splits a string of space separated words into an array, trimming as needed. If the
  16773. * words are already an array, it is returned.
  16774. *
  16775. * @param {String/Array} words
  16776. */
  16777. splitWords: function(words) {
  16778. if (words && typeof words === 'string') {
  16779. return words.replace(basicTrimRe, '').split(whitespaceRe);
  16780. }
  16781. return words || [];
  16782. }
  16783. };
  16784. }());
  16785. // initialize the default encode / decode entities
  16786. Ext.String.resetCharacterEntities();
  16787. /**
  16788. * @method htmlEncode
  16789. * @member Ext
  16790. * @inheritdoc Ext.String#htmlEncode
  16791. */
  16792. Ext.htmlEncode = Ext.String.htmlEncode;
  16793. /**
  16794. * @method htmlDecode
  16795. * @member Ext
  16796. * @inheritdoc Ext.String#htmlDecode
  16797. */
  16798. Ext.htmlDecode = Ext.String.htmlDecode;
  16799. /**
  16800. * @method urlAppend
  16801. * @member Ext
  16802. * @inheritdoc Ext.String#urlAppend
  16803. */
  16804. Ext.urlAppend = Ext.String.urlAppend;
  16805. /* eslint-disable max-len */
  16806. /**
  16807. * @class Ext.Date
  16808. * This class defines some basic methods for handling dates.
  16809. *
  16810. * The date parsing and formatting syntax contains a subset of
  16811. * [PHP's `date()` function](http://www.php.net/date), and the formats that are
  16812. * supported will provide results equivalent to their PHP versions.
  16813. *
  16814. * The following is a list of all currently supported formats:
  16815. *
  16816. * Format Description Example returned values
  16817. * ------ ----------------------------------------------------------------------- -----------------------
  16818. * d Day of the month, 2 digits with leading zeros 01 to 31
  16819. * D A short textual representation of the day of the week Mon to Sun
  16820. * j Day of the month without leading zeros 1 to 31
  16821. * l A full textual representation of the day of the week Sunday to Saturday
  16822. * N ISO-8601 numeric representation of the day of the week 1 (for Monday) through 7 (for Sunday)
  16823. * S English ordinal suffix for the day of the month, 2 characters st, nd, rd or th. Works well with j
  16824. * w Numeric representation of the day of the week 0 (for Sunday) to 6 (for Saturday)
  16825. * z The day of the year (starting from 0) 0 to 364 (365 in leap years)
  16826. * W ISO-8601 week number of year, weeks starting on Monday 01 to 53
  16827. * F A full textual representation of a month, such as January or March January to December
  16828. * m Numeric representation of a month, with leading zeros 01 to 12
  16829. * M A short textual representation of a month Jan to Dec
  16830. * n Numeric representation of a month, without leading zeros 1 to 12
  16831. * t Number of days in the given month 28 to 31
  16832. * L Whether it&#39;s a leap year 1 if it is a leap year, 0 otherwise.
  16833. * o ISO-8601 year number (identical to (Y), but if the ISO week number (W) Examples: 1998 or 2004
  16834. * belongs to the previous or next year, that year is used instead)
  16835. * Y A full numeric representation of a year, 4 digits Examples: 1999 or 2003
  16836. * y A two digit representation of a year Examples: 99 or 03
  16837. * a Lowercase Ante meridiem and Post meridiem am or pm
  16838. * A Uppercase Ante meridiem and Post meridiem AM or PM
  16839. * g 12-hour format of an hour without leading zeros 1 to 12
  16840. * G 24-hour format of an hour without leading zeros 0 to 23
  16841. * h 12-hour format of an hour with leading zeros 01 to 12
  16842. * H 24-hour format of an hour with leading zeros 00 to 23
  16843. * i Minutes, with leading zeros 00 to 59
  16844. * s Seconds, with leading zeros 00 to 59
  16845. * u Decimal fraction of a second Examples:
  16846. * (minimum 1 digit, arbitrary number of digits allowed) 001 (i.e. 0.001s) or
  16847. * 100 (i.e. 0.100s) or
  16848. * 999 (i.e. 0.999s) or
  16849. * 999876543210 (i.e. 0.999876543210s)
  16850. * O Difference to Greenwich time (GMT) in hours and minutes Example: +1030
  16851. * P Difference to Greenwich time (GMT) with colon between hours and minutes Example: -08:00
  16852. * T Timezone abbreviation of the machine running the code Examples: EST, MDT, PDT ...
  16853. * Z Timezone offset in seconds (negative if west of UTC, positive if east) -43200 to 50400
  16854. * c ISO 8601 date represented as the local time with an offset to UTC appended.
  16855. * Notes: Examples:
  16856. * 1) If unspecified, the month / day defaults to the current month / day, 1991 or
  16857. * the time defaults to midnight, while the timezone defaults to the 1992-10 or
  16858. * browser's timezone. If a time is specified, it must include both hours 1993-09-20 or
  16859. * and minutes. The "T" delimiter, seconds, milliseconds and timezone 1994-08-19T16:20+01:00 or
  16860. * are optional. 1995-07-18T17:21:28-02:00 or
  16861. * 2) The decimal fraction of a second, if specified, must contain at 1996-06-17T18:22:29.98765+03:00 or
  16862. * least 1 digit (there is no limit to the maximum number 1997-05-16T19:23:30,12345-0400 or
  16863. * of digits allowed), and may be delimited by either a '.' or a ',' 1998-04-15T20:24:31.2468Z or
  16864. * Refer to the examples on the right for the various levels of 1999-03-14T20:24:32Z or
  16865. * date-time granularity which are supported, or see 2000-02-13T21:25:33
  16866. * http://www.w3.org/TR/NOTE-datetime for more info. 2001-01-12 22:26:34
  16867. * C An ISO date string as implemented by the native Date object's 1962-06-17T09:21:34.125Z
  16868. * [Date.toISOString](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
  16869. * method. This outputs the numeric part with *UTC* hour and minute
  16870. * values, and indicates this by appending the `'Z'` timezone
  16871. * identifier.
  16872. * U Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) 1193432466 or -2138434463
  16873. * MS Microsoft AJAX serialized dates \/Date(1238606590509)\/ (i.e. UTC milliseconds since epoch) or
  16874. * \/Date(1238606590509+0800)\/
  16875. * time A javascript millisecond timestamp 1350024476440
  16876. * timestamp A UNIX timestamp (same as U) 1350024866
  16877. *
  16878. * Example usage (note that you must escape format specifiers with '\\' to render them as character literals):
  16879. *
  16880. * // Sample date:
  16881. * // 'Wed Jan 10 2007 15:05:01 GMT-0600 (Central Standard Time)'
  16882. *
  16883. * var dt = new Date('1/10/2007 03:05:01 PM GMT-0600');
  16884. * console.log(Ext.Date.format(dt, 'Y-m-d')); // 2007-01-10
  16885. * console.log(Ext.Date.format(dt, 'F j, Y, g:i a')); // January 10, 2007, 3:05 pm
  16886. * console.log(Ext.Date.format(dt, 'l, \\t\\he jS \\of F Y h:i:s A')); // Wednesday, the 10th of January 2007 03:05:01 PM
  16887. *
  16888. * Here are some standard date/time patterns that you might find helpful. They
  16889. * are not part of the source of Ext.Date, but to use them you can simply copy this
  16890. * block of code into any script that is included after Ext.Date and they will also become
  16891. * globally available on the Date object. Feel free to add or remove patterns as needed in your code.
  16892. *
  16893. * Ext.Date.patterns = {
  16894. * ISO8601Long:"Y-m-d H:i:s",
  16895. * ISO8601Short:"Y-m-d",
  16896. * ShortDate: "n/j/Y",
  16897. * LongDate: "l, F d, Y",
  16898. * FullDateTime: "l, F d, Y g:i:s A",
  16899. * MonthDay: "F d",
  16900. * ShortTime: "g:i A",
  16901. * LongTime: "g:i:s A",
  16902. * SortableDateTime: "Y-m-d\\TH:i:s",
  16903. * UniversalSortableDateTime: "Y-m-d H:i:sO",
  16904. * YearMonth: "F, Y"
  16905. * };
  16906. *
  16907. * Example usage:
  16908. *
  16909. * var dt = new Date();
  16910. * console.log(Ext.Date.format(dt, Ext.Date.patterns.ShortDate));
  16911. *
  16912. * Developer-written, custom formats may be used by supplying both a formatting and a parsing function
  16913. * which perform to specialized requirements. The functions are stored in {@link #parseFunctions} and {@link #formatFunctions}.
  16914. * @singleton
  16915. */
  16916. Ext.Date = (function() {
  16917. /* eslint-disable indent */
  16918. // @define Ext.lang.Date
  16919. // @define Ext.Date
  16920. // @require Ext
  16921. // @require Ext.lang.String
  16922. var utilDate,
  16923. nativeDate = Date,
  16924. stripEscapeRe = /(\\.)/g,
  16925. hourInfoRe = /([gGhHisucUOPZ]|MS)/,
  16926. dateInfoRe = /([djzmnYycU]|MS)/,
  16927. slashRe = /\\/gi,
  16928. numberTokenRe = /\{(\d+)\}/g,
  16929. MSFormatRe = new RegExp('\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/'),
  16930. datePartsRe = /^(?:(\d{1,4})|(\w{3,}))[/\-.\\\s](?:(\d{1,2})|(\w{3,}))[/\-.\\\s](\d{1,4})$/,
  16931. pad = Ext.String.leftPad,
  16932. dayInfo = {
  16933. d: true,
  16934. j: true
  16935. },
  16936. monthInfo = {
  16937. F: true,
  16938. m: true,
  16939. M: true,
  16940. n: true
  16941. },
  16942. yearInfo = {
  16943. o: true,
  16944. Y: true,
  16945. y: true
  16946. },
  16947. // Most of the date-formatting functions below are the excellent work of Baron Schwartz.
  16948. // (see http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/)
  16949. // They generate precompiled functions from format patterns instead of parsing and
  16950. // processing each pattern every time a date is formatted.
  16951. code = [
  16952. // date calculations (note: the code below creates a dependency on Ext.Number.from())
  16953. "var me = this, dt, y, m, d, h, i, s, ms, o, O, z, zz, u, v, W, year, jan4, week1monday, daysInMonth, dayMatched,",
  16954. "def = me.defaults,",
  16955. "from = Ext.Number.from,",
  16956. "results = String(input).match(me.parseRegexes[{0}]);",
  16957. // either null, or an array of matched strings
  16958. "if(results){",
  16959. "{1}",
  16960. "if(u != null){",
  16961. // i.e. unix time is defined
  16962. "v = new Date(u * 1000);",
  16963. // give top priority to UNIX time
  16964. "}else{",
  16965. // create Date object representing midnight of the current day;
  16966. // this will provide us with our date defaults
  16967. // (note: clearTime() handles Daylight Saving Time automatically)
  16968. "dt = me.clearTime(new Date);",
  16969. "y = from(y, from(def.y, dt.getFullYear()));",
  16970. "m = from(m, from(def.m - 1, dt.getMonth()));",
  16971. "dayMatched = d !== undefined;",
  16972. "d = from(d, from(def.d, dt.getDate()));",
  16973. // Attempt to validate the day. Since it defaults to today, it may go out
  16974. // of range, for example parsing m/Y where the value is 02/2000 on the 31st of May.
  16975. // It will attempt to parse 2000/02/31, which will overflow to March and end up
  16976. // returning 03/2000. We only do this when we default the day. If an invalid day value
  16977. // was set to be parsed by the user, continue on and either let it overflow or return null
  16978. // depending on the strict value. This will be in line with the normal Date behaviour.
  16979. "if (!dayMatched) {",
  16980. "dt.setDate(1);",
  16981. "dt.setMonth(m);",
  16982. "dt.setFullYear(y);",
  16983. "daysInMonth = me.getDaysInMonth(dt);",
  16984. "if (d > daysInMonth) {",
  16985. "d = daysInMonth;",
  16986. "}",
  16987. "}",
  16988. "h = from(h, from(def.h, dt.getHours()));",
  16989. "i = from(i, from(def.i, dt.getMinutes()));",
  16990. "s = from(s, from(def.s, dt.getSeconds()));",
  16991. "ms = from(ms, from(def.ms, dt.getMilliseconds()));",
  16992. "if(z >= 0 && y >= 0){",
  16993. // both the year and zero-based day of year are defined and >= 0.
  16994. // these 2 values alone provide sufficient info to create a full date object
  16995. // create Date object representing January 1st for the given year
  16996. // handle years < 100 appropriately
  16997. "v = me.add(new Date(y < 100 ? 100 : y, 0, 1, h, i, s, ms), me.YEAR, y < 100 ? y - 100 : 0);",
  16998. // then add day of year, checking for Date "rollover" if necessary
  16999. "v = !strict? v : (strict === true && (z <= 364 || (me.isLeapYear(v) && z <= 365))? me.add(v, me.DAY, z) : null);",
  17000. "}else if(strict === true && !me.isValid(y, m + 1, d, h, i, s, ms)){",
  17001. // check for Date "rollover"
  17002. "v = null;",
  17003. // invalid date, so return null
  17004. "}else{",
  17005. "if (W) {",
  17006. // support ISO-8601
  17007. // http://en.wikipedia.org/wiki/ISO_week_date
  17008. //
  17009. // Mutually equivalent definitions for week 01 are:
  17010. // a. the week starting with the Monday which is nearest in time to 1 January
  17011. // b. the week with 4 January in it
  17012. // ... there are many others ...
  17013. //
  17014. // We'll use letter b above to determine the first week of the year.
  17015. //
  17016. // So, first get a Date object for January 4th of whatever calendar year is desired.
  17017. //
  17018. // Then, the first Monday of the year can easily be determined by (operating on this Date):
  17019. // 1. Getting the day of the week.
  17020. // 2. Subtracting that by one.
  17021. // 3. Multiplying that by 86400000 (one day in ms).
  17022. // 4. Subtracting this number of days (in ms) from the January 4 date (represented in ms).
  17023. //
  17024. // Example #1 ...
  17025. //
  17026. // January 2012
  17027. // Su Mo Tu We Th Fr Sa
  17028. // 1 2 3 4 5 6 7
  17029. // 8 9 10 11 12 13 14
  17030. // 15 16 17 18 19 20 21
  17031. // 22 23 24 25 26 27 28
  17032. // 29 30 31
  17033. //
  17034. // 1. January 4th is a Wednesday.
  17035. // 2. Its day number is 3.
  17036. // 3. Simply substract 2 days from Wednesday.
  17037. // 4. The first week of the year begins on Monday, January 2. Simple!
  17038. //
  17039. // Example #2 ...
  17040. // January 1992
  17041. // Su Mo Tu We Th Fr Sa
  17042. // 1 2 3 4
  17043. // 5 6 7 8 9 10 11
  17044. // 12 13 14 15 16 17 18
  17045. // 19 20 21 22 23 24 25
  17046. // 26 27 28 29 30 31
  17047. //
  17048. // 1. January 4th is a Saturday.
  17049. // 2. Its day number is 6.
  17050. // 3. Simply subtract 5 days from Saturday.
  17051. // 4. The first week of the year begins on Monday, December 30. Simple!
  17052. //
  17053. // v = Ext.Date.clearTime(new Date(week1monday.getTime() + ((W - 1) * 604800000 + 43200000)));
  17054. // (This is essentially doing the same thing as above but for the week rather than the day)
  17055. "year = y || (new Date()).getFullYear();",
  17056. "jan4 = new Date(year, 0, 4, 0, 0, 0);",
  17057. "d = jan4.getDay();",
  17058. // If the 1st is a Thursday, then the 4th will be a Sunday, so we need the appropriate
  17059. // day number here, which is why we use the day === checks.
  17060. "week1monday = new Date(jan4.getTime() - ((d === 0 ? 6 : d - 1) * 86400000));",
  17061. // The reason for adding 43200000 (12 hours) is to avoid any complication with daylight saving
  17062. // switch overs. For example, if the clock is rolled back, an hour will repeat, so adding 7 days
  17063. // will leave us 1 hour short (Sun <date> 23:00:00). By setting is to 12:00, subtraction
  17064. // or addition of an hour won't make any difference.
  17065. "v = Ext.Date.clearTime(new Date(week1monday.getTime() + ((W - 1) * 604800000 + 43200000)));",
  17066. "} else {",
  17067. // plain old Date object
  17068. // handle years < 100 properly
  17069. "v = me.add(new Date(y < 100 ? 100 : y, m, d, h, i, s, ms), me.YEAR, y < 100 ? y - 100 : 0);",
  17070. "}",
  17071. "}",
  17072. "}",
  17073. "}",
  17074. "if(v){",
  17075. // favor UTC offset over GMT offset
  17076. "if(zz != null){",
  17077. // reset to UTC, then add offset
  17078. "v = me.add(v, me.SECOND, -v.getTimezoneOffset() * 60 - zz);",
  17079. "}else if(o){",
  17080. // reset to GMT, then add offset
  17081. "v = me.add(v, me.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));",
  17082. "}",
  17083. "}",
  17084. "return (v != null) ? v : null;"
  17085. ].join('\n');
  17086. // Polyfill Date's toISOString instance method where not implemented.
  17087. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
  17088. // TODO: Remove this when IE8 retires.
  17089. if (!Date.prototype.toISOString) {
  17090. Date.prototype.toISOString = function() {
  17091. var me = this;
  17092. return pad(me.getUTCFullYear(), 4, '0') + '-' + pad(me.getUTCMonth() + 1, 2, '0') + '-' + pad(me.getUTCDate(), 2, '0') + 'T' + pad(me.getUTCHours(), 2, '0') + ':' + pad(me.getUTCMinutes(), 2, '0') + ':' + pad(me.getUTCSeconds(), 2, '0') + '.' + pad(me.getUTCMilliseconds(), 3, '0') + 'Z';
  17093. };
  17094. }
  17095. /**
  17096. * @method xf
  17097. * @private
  17098. * @param format
  17099. * Create private copy of Ext JS's `Ext.util.Format.format()` method
  17100. * + to remove unnecessary dependency
  17101. * + to resolve namespace conflict with MS-Ajax's implementation
  17102. */
  17103. function xf(format) {
  17104. var args = Array.prototype.slice.call(arguments, 1);
  17105. return format.replace(numberTokenRe, function(m, i) {
  17106. return args[i];
  17107. });
  17108. }
  17109. /* eslint-enable indent, max-len */
  17110. utilDate = {
  17111. /** @ignore */
  17112. now: nativeDate.now,
  17113. // always available due to polyfill in Ext.js
  17114. /**
  17115. * @private
  17116. */
  17117. toString: function(date) {
  17118. if (!date) {
  17119. date = new nativeDate();
  17120. }
  17121. return date.getFullYear() + "-" + pad(date.getMonth() + 1, 2, '0') + "-" + pad(date.getDate(), 2, '0') + "T" + pad(date.getHours(), 2, '0') + ":" + pad(date.getMinutes(), 2, '0') + ":" + pad(date.getSeconds(), 2, '0');
  17122. },
  17123. /**
  17124. * Returns the number of milliseconds between two dates.
  17125. * @param {Date} dateA The first date.
  17126. * @param {Date} [dateB=new Date()] (optional) The second date.
  17127. * @return {Number} The difference in milliseconds
  17128. */
  17129. getElapsed: function(dateA, dateB) {
  17130. return Math.abs(dateA - (dateB || utilDate.now()));
  17131. },
  17132. /**
  17133. * Global flag which determines if strict date parsing should be used.
  17134. * Strict date parsing will not roll-over invalid dates, which is the
  17135. * default behavior of JavaScript Date objects.
  17136. * (see {@link #parse} for more information)
  17137. * @type Boolean
  17138. */
  17139. useStrict: false,
  17140. /**
  17141. * @private
  17142. */
  17143. formatCodeToRegex: function(character, currentGroup) {
  17144. // Note: currentGroup - position in regex result array (see notes for
  17145. // Ext.Date.parseCodes below)
  17146. var p = utilDate.parseCodes[character];
  17147. if (p) {
  17148. p = typeof p === 'function' ? p() : p;
  17149. // reassign function result to prevent repeated execution
  17150. utilDate.parseCodes[character] = p;
  17151. }
  17152. return p ? Ext.applyIf({
  17153. c: p.c ? xf(p.c, currentGroup || "{0}") : p.c
  17154. }, p) : {
  17155. g: 0,
  17156. c: null,
  17157. s: Ext.String.escapeRegex(character)
  17158. };
  17159. },
  17160. // treat unrecognized characters as literals
  17161. /**
  17162. * An object hash in which each property is a date parsing function. The property name is the
  17163. * format string which that function parses.
  17164. *
  17165. * This object is automatically populated with date parsing functions as
  17166. * date formats are requested for Ext standard formatting strings.
  17167. *
  17168. * Custom parsing functions may be inserted into this object, keyed by a name which from then on
  17169. * may be used as a format string to {@link #parse}.
  17170. *
  17171. * Example:
  17172. *
  17173. * Ext.Date.parseFunctions['x-date-format'] = myDateParser;
  17174. *
  17175. * A parsing function should return a Date object, and is passed the following parameters:
  17176. *
  17177. * - `date`: {@link String} - The date string to parse.
  17178. * - `strict`: {@link Boolean} - `true` to validate date strings while parsing
  17179. * (i.e. prevent JavaScript Date "rollover"). __The default must be `false`.__
  17180. * Invalid date strings should return `null` when parsed.
  17181. *
  17182. * To enable Dates to also be _formatted_ according to that format, a corresponding
  17183. * formatting function must be placed into the {@link #formatFunctions} property.
  17184. * @property parseFunctions
  17185. * @type Object
  17186. */
  17187. parseFunctions: {
  17188. "MS": function(input, strict) {
  17189. // note: the timezone offset is ignored since the MS Ajax server sends
  17190. // a UTC milliseconds-since-Unix-epoch value (negative values are allowed)
  17191. var r = (input || '').match(MSFormatRe);
  17192. return r ? new nativeDate(((r[1] || '') + r[2]) * 1) : null;
  17193. },
  17194. "time": function(input, strict) {
  17195. var num = parseInt(input, 10);
  17196. if (num || num === 0) {
  17197. return new nativeDate(num);
  17198. }
  17199. return null;
  17200. },
  17201. "timestamp": function(input, strict) {
  17202. var num = parseInt(input, 10);
  17203. if (num || num === 0) {
  17204. return new nativeDate(num * 1000);
  17205. }
  17206. return null;
  17207. }
  17208. },
  17209. parseRegexes: [],
  17210. /**
  17211. * An object hash in which each property is a date formatting function. The property name is the
  17212. * format string which corresponds to the produced formatted date string.
  17213. *
  17214. * This object is automatically populated with date formatting functions as
  17215. * date formats are requested for Ext standard formatting strings.
  17216. *
  17217. * Custom formatting functions may be inserted into this object, keyed by a name which
  17218. * from then on may be used as a format string to {@link #format}.
  17219. *
  17220. * Example:
  17221. *
  17222. * Ext.Date.formatFunctions['x-date-format'] = myDateFormatter;
  17223. *
  17224. * A formatting function should return a string representation of the Date object which
  17225. * is the scope (this) of the function.
  17226. *
  17227. * To enable date strings to also be _parsed_ according to that format, a corresponding
  17228. * parsing function must be placed into the {@link #parseFunctions} property.
  17229. * @property formatFunctions
  17230. * @type Object
  17231. */
  17232. formatFunctions: {
  17233. "MS": function() {
  17234. // UTC milliseconds since Unix epoch (MS-AJAX serialized date format (MRSF))
  17235. return '\\/Date(' + this.getTime() + ')\\/';
  17236. },
  17237. "time": function() {
  17238. return this.getTime().toString();
  17239. },
  17240. "timestamp": function() {
  17241. return utilDate.format(this, 'U');
  17242. }
  17243. },
  17244. y2kYear: 50,
  17245. /**
  17246. * Date interval constant.
  17247. * @type String
  17248. */
  17249. MILLI: "ms",
  17250. /**
  17251. * Date interval constant.
  17252. * @type String
  17253. */
  17254. SECOND: "s",
  17255. /**
  17256. * Date interval constant.
  17257. * @type String
  17258. */
  17259. MINUTE: "mi",
  17260. /**
  17261. * Date interval constant.
  17262. * @type String
  17263. */
  17264. HOUR: "h",
  17265. /**
  17266. * Date interval constant.
  17267. * @type String
  17268. */
  17269. DAY: "d",
  17270. /**
  17271. * Date interval constant.
  17272. * @type String
  17273. */
  17274. MONTH: "mo",
  17275. /**
  17276. * Date interval constant.
  17277. * @type String
  17278. */
  17279. YEAR: "y",
  17280. /**
  17281. * The number of days in a week.
  17282. * @type Number
  17283. */
  17284. DAYS_IN_WEEK: 7,
  17285. /**
  17286. * The number of months in a year.
  17287. * @type Number
  17288. */
  17289. MONTHS_IN_YEAR: 12,
  17290. /**
  17291. * The maximum number of days in a month.
  17292. * @type {Number}
  17293. */
  17294. MAX_DAYS_IN_MONTH: 31,
  17295. SUNDAY: 0,
  17296. MONDAY: 1,
  17297. TUESDAY: 2,
  17298. WEDNESDAY: 3,
  17299. THURSDAY: 4,
  17300. FRIDAY: 5,
  17301. SATURDAY: 6,
  17302. /**
  17303. * An object hash containing default date values used during date parsing.
  17304. *
  17305. * The following properties are available:
  17306. *
  17307. * - `y`: {@link Number} - The default year value. Defaults to `undefined`.
  17308. * - `m`: {@link Number} - The default 1-based month value. Defaults to `undefined`.
  17309. * - `d`: {@link Number} - The default day value. Defaults to `undefined`.
  17310. * - `h`: {@link Number} - The default hour value. Defaults to `undefined`.
  17311. * - `i`: {@link Number} - The default minute value. Defaults to `undefined`.
  17312. * - `s`: {@link Number} - The default second value. Defaults to `undefined`.
  17313. * - `ms`: {@link Number} - The default millisecond value. Defaults to `undefined`.
  17314. *
  17315. * Override these properties to customize the default date values used by the {@link #parse}
  17316. * method.
  17317. *
  17318. * __Note:__ In countries which experience Daylight Saving Time (i.e. DST), the `h`, `i`, `s`
  17319. * and `ms` properties may coincide with the exact time in which DST takes effect.
  17320. * It is the responsibility of the developer to account for this.
  17321. *
  17322. * Example Usage:
  17323. *
  17324. * // set default day value to the first day of the month
  17325. * Ext.Date.defaults.d = 1;
  17326. *
  17327. * // parse a February date string containing only year and month values.
  17328. * // setting the default day value to 1 prevents weird date rollover issues
  17329. * // when attempting to parse the following date string on, for example, March 31st 2009
  17330. * Ext.Date.parse('2009-02', 'Y-m'); // returns a Date object representing February 1st 2009
  17331. *
  17332. * @property defaults
  17333. * @type Object
  17334. */
  17335. defaults: {},
  17336. /**
  17337. * @property {String[]} dayNames
  17338. * An array of textual day names.
  17339. * Override these values for international dates.
  17340. *
  17341. * Example:
  17342. *
  17343. * Ext.Date.dayNames = [
  17344. * 'SundayInYourLang',
  17345. * 'MondayInYourLang'
  17346. * // ...
  17347. * ];
  17348. * @locale
  17349. */
  17350. dayNames: [
  17351. "Sunday",
  17352. "Monday",
  17353. "Tuesday",
  17354. "Wednesday",
  17355. "Thursday",
  17356. "Friday",
  17357. "Saturday"
  17358. ],
  17359. /**
  17360. * @property {String[]} monthNames
  17361. * An array of textual month names.
  17362. * Override these values for international dates.
  17363. *
  17364. * Example:
  17365. *
  17366. * Ext.Date.monthNames = [
  17367. * 'JanInYourLang',
  17368. * 'FebInYourLang'
  17369. * // ...
  17370. * ];
  17371. * @locale
  17372. */
  17373. monthNames: [
  17374. "January",
  17375. "February",
  17376. "March",
  17377. "April",
  17378. "May",
  17379. "June",
  17380. "July",
  17381. "August",
  17382. "September",
  17383. "October",
  17384. "November",
  17385. "December"
  17386. ],
  17387. /**
  17388. * @property {Object} monthNumbers
  17389. * An object hash of zero-based JavaScript month numbers (with short month names as keys).
  17390. *
  17391. * __Note:__ keys are case-sensitive.
  17392. *
  17393. * Override these values for international dates.
  17394. *
  17395. * Example:
  17396. *
  17397. * Ext.Date.monthNumbers = {
  17398. * 'LongJanNameInYourLang': 0,
  17399. * 'ShortJanNameInYourLang':0,
  17400. * 'LongFebNameInYourLang':1,
  17401. * 'ShortFebNameInYourLang':1
  17402. * // ...
  17403. * };
  17404. * @locale
  17405. */
  17406. monthNumbers: {
  17407. January: 0,
  17408. Jan: 0,
  17409. February: 1,
  17410. Feb: 1,
  17411. March: 2,
  17412. Mar: 2,
  17413. April: 3,
  17414. Apr: 3,
  17415. May: 4,
  17416. June: 5,
  17417. Jun: 5,
  17418. July: 6,
  17419. Jul: 6,
  17420. August: 7,
  17421. Aug: 7,
  17422. September: 8,
  17423. Sep: 8,
  17424. October: 9,
  17425. Oct: 9,
  17426. November: 10,
  17427. Nov: 10,
  17428. December: 11,
  17429. Dec: 11
  17430. },
  17431. /**
  17432. * @property {String} defaultFormat
  17433. * The date format string that the {@link Ext.util.Format#dateRenderer}
  17434. * and {@link Ext.util.Format#date} functions use. See {@link Ext.Date} for details.
  17435. *
  17436. * This is the format that {@link #method!flexParse} uses to disambiguate all-numeric
  17437. * input dates.
  17438. *
  17439. * This may be overridden in a locale file.
  17440. * @locale
  17441. */
  17442. defaultFormat: 'm/d/Y',
  17443. /**
  17444. * @property {String} defaultTimeFormat
  17445. * The default time format.
  17446. *
  17447. * This may be overridden in a locale file.
  17448. * @locale
  17449. */
  17450. defaultTimeFormat: 'h:i A',
  17451. /**
  17452. * @property {Number} firstDayOfWeek
  17453. * The day on which the week starts. `0` being Sunday, through `6` being Saturday.
  17454. *
  17455. * This may be overridden in a locale file.
  17456. * @locale
  17457. */
  17458. firstDayOfWeek: 0,
  17459. /**
  17460. * @property {Number[]} weekendDays
  17461. * The days on which weekend falls. `0` being Sunday, through `6` being Saturday.
  17462. *
  17463. * This may be overridden in a locale file.
  17464. * @locale
  17465. */
  17466. weekendDays: [
  17467. 0,
  17468. 6
  17469. ],
  17470. /**
  17471. * Get the short month name for the given month number.
  17472. * Override this function for international dates.
  17473. * @param {Number} month A zero-based JavaScript month number.
  17474. * @return {String} The short month name.
  17475. * @locale
  17476. */
  17477. getShortMonthName: function(month) {
  17478. return utilDate.monthNames[month].substring(0, 3);
  17479. },
  17480. /**
  17481. * Get the short day name for the given day number.
  17482. * Override this function for international dates.
  17483. * @param {Number} day A zero-based JavaScript day number.
  17484. * @return {String} The short day name.
  17485. * @locale
  17486. */
  17487. getShortDayName: function(day) {
  17488. return utilDate.dayNames[day].substring(0, 3);
  17489. },
  17490. /**
  17491. * Get the zero-based JavaScript month number for the given short/full month name.
  17492. * Override this function for international dates.
  17493. * @param {String} name The short/full month name.
  17494. * @return {Number} The zero-based JavaScript month number.
  17495. * @locale
  17496. */
  17497. getMonthNumber: function(name) {
  17498. // handle camel casing for English month names (since the keys for
  17499. // the Ext.Date.monthNumbers hash are case sensitive)
  17500. return utilDate.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()];
  17501. },
  17502. /**
  17503. * Checks if the specified format contains hour information
  17504. * @param {String} format The format to check
  17505. * @return {Boolean} True if the format contains hour information
  17506. * @method
  17507. */
  17508. formatContainsHourInfo: function(format) {
  17509. return hourInfoRe.test(format.replace(stripEscapeRe, ''));
  17510. },
  17511. /**
  17512. * Checks if the specified format contains information about
  17513. * anything other than the time.
  17514. * @param {String} format The format to check
  17515. * @return {Boolean} True if the format contains information about
  17516. * date/day information.
  17517. * @method
  17518. */
  17519. formatContainsDateInfo: function(format) {
  17520. return dateInfoRe.test(format.replace(stripEscapeRe, ''));
  17521. },
  17522. /**
  17523. * @private
  17524. * Checks if the specified format contains only month information.
  17525. *
  17526. * @param {String} format Format to check
  17527. *
  17528. * @return {Boolean}
  17529. */
  17530. isMonthFormat: function(format) {
  17531. return !!monthInfo[format];
  17532. },
  17533. /**
  17534. * @private
  17535. * Checks if the specified format contains only year information.
  17536. *
  17537. * @param {String} format Format to check.
  17538. *
  17539. * @return {Boolean}
  17540. */
  17541. isYearFormat: function(format) {
  17542. return !!yearInfo[format];
  17543. },
  17544. /**
  17545. * Removes all escaping for a date format string. In date formats,
  17546. * using a '\' can be used to escape special characters.
  17547. * @param {String} format The format to unescape
  17548. * @return {String} The unescaped format
  17549. * @method
  17550. */
  17551. unescapeFormat: function(format) {
  17552. // Escape the format, since \ can be used to escape special
  17553. // characters in a date format. For example, in a Spanish
  17554. // locale the format may be: 'd \\de F \\de Y'
  17555. return format.replace(slashRe, '');
  17556. },
  17557. /**
  17558. * The base format-code to formatting-function hashmap used by the {@link #format} method.
  17559. * Formatting functions are strings (or functions which return strings) which
  17560. * will return the appropriate value when evaluated in the context of the Date object
  17561. * from which the {@link #format} method is called.
  17562. * Add to / override these mappings for custom date formatting.
  17563. *
  17564. * __Note:__ `Ext.Date.format()` treats characters as literals if an appropriate mapping
  17565. * cannot be found.
  17566. *
  17567. * Example:
  17568. *
  17569. * Ext.Date.formatCodes.x = "Ext.util.Format.leftPad(this.getDate(), 2, '0')";
  17570. * console.log(Ext.Date.format(new Date(), 'X'); // returns the current day of the month
  17571. * @type Object
  17572. */
  17573. formatCodes: {
  17574. /* eslint-disable max-len */
  17575. d: "Ext.String.leftPad(m.getDate(), 2, '0')",
  17576. D: "Ext.Date.getShortDayName(m.getDay())",
  17577. // get localized short day name
  17578. j: "m.getDate()",
  17579. l: "Ext.Date.dayNames[m.getDay()]",
  17580. N: "(m.getDay() ? m.getDay() : 7)",
  17581. S: "Ext.Date.getSuffix(m)",
  17582. w: "m.getDay()",
  17583. z: "Ext.Date.getDayOfYear(m)",
  17584. W: "Ext.String.leftPad(Ext.Date.getWeekOfYear(m), 2, '0')",
  17585. F: "Ext.Date.monthNames[m.getMonth()]",
  17586. m: "Ext.String.leftPad(m.getMonth() + 1, 2, '0')",
  17587. M: "Ext.Date.getShortMonthName(m.getMonth())",
  17588. // get localized short month name
  17589. n: "(m.getMonth() + 1)",
  17590. t: "Ext.Date.getDaysInMonth(m)",
  17591. L: "(Ext.Date.isLeapYear(m) ? 1 : 0)",
  17592. o: "(m.getFullYear() + (Ext.Date.getWeekOfYear(m) == 1 && m.getMonth() > 0 ? +1 : (Ext.Date.getWeekOfYear(m) >= 52 && m.getMonth() < 11 ? -1 : 0)))",
  17593. Y: "Ext.String.leftPad(m.getFullYear(), 4, '0')",
  17594. y: "('' + m.getFullYear()).substring(2, 4)",
  17595. a: "(m.getHours() < 12 ? 'am' : 'pm')",
  17596. A: "(m.getHours() < 12 ? 'AM' : 'PM')",
  17597. g: "((m.getHours() % 12) ? m.getHours() % 12 : 12)",
  17598. G: "m.getHours()",
  17599. h: "Ext.String.leftPad((m.getHours() % 12) ? m.getHours() % 12 : 12, 2, '0')",
  17600. H: "Ext.String.leftPad(m.getHours(), 2, '0')",
  17601. i: "Ext.String.leftPad(m.getMinutes(), 2, '0')",
  17602. s: "Ext.String.leftPad(m.getSeconds(), 2, '0')",
  17603. u: "Ext.String.leftPad(m.getMilliseconds(), 3, '0')",
  17604. O: "Ext.Date.getGMTOffset(m)",
  17605. P: "Ext.Date.getGMTOffset(m, true)",
  17606. T: "Ext.Date.getTimezone(m)",
  17607. Z: "(m.getTimezoneOffset() * -60)",
  17608. /* eslint-enable max-len */
  17609. c: function() {
  17610. // ISO-8601 -- GMT format
  17611. var c = "Y-m-dTH:i:sP",
  17612. code = [],
  17613. l = c.length,
  17614. i, e;
  17615. for (i = 0; i < l; ++i) {
  17616. e = c.charAt(i);
  17617. // treat T as a character literal
  17618. code.push(e === "T" ? "'T'" : utilDate.getFormatCode(e));
  17619. }
  17620. return code.join(" + ");
  17621. },
  17622. C: function() {
  17623. // ISO-1601 -- browser format. UTC numerics with the 'Z' TZ id.
  17624. return 'm.toISOString()';
  17625. },
  17626. U: "Math.round(m.getTime() / 1000)"
  17627. },
  17628. /**
  17629. * Checks if the passed Date parameters will cause a JavaScript Date "rollover".
  17630. * @param {Number} year 4-digit year.
  17631. * @param {Number} month 1-based month-of-year.
  17632. * @param {Number} day Day of month.
  17633. * @param {Number} hour (optional) Hour.
  17634. * @param {Number} minute (optional) Minute.
  17635. * @param {Number} second (optional) Second.
  17636. * @param {Number} millisecond (optional) Millisecond.
  17637. * @return {Boolean} `true` if the passed parameters do not cause a Date "rollover",
  17638. * `false` otherwise.
  17639. */
  17640. isValid: function(year, month, day, hour, minute, second, millisecond) {
  17641. var dt;
  17642. // setup defaults
  17643. hour = hour || 0;
  17644. minute = minute || 0;
  17645. second = second || 0;
  17646. millisecond = millisecond || 0;
  17647. // Special handling for year < 100
  17648. /* eslint-disable-next-line max-len */
  17649. dt = utilDate.add(new nativeDate(year < 100 ? 100 : year, month - 1, day, hour, minute, second, millisecond), utilDate.YEAR, year < 100 ? year - 100 : 0);
  17650. return year === dt.getFullYear() && month === dt.getMonth() + 1 && day === dt.getDate() && hour === dt.getHours() && minute === dt.getMinutes() && second === dt.getSeconds() && millisecond === dt.getMilliseconds();
  17651. },
  17652. /**
  17653. * Parses the passed string using the specified date format.
  17654. * Note that this function expects normal calendar dates, meaning that months are 1-based
  17655. * (i.e. 1 = January). The {@link #defaults} hash will be used for any date value (i.e. year,
  17656. * month, day, hour, minute, second or millisecond) which cannot be found in the passed string.
  17657. * If a corresponding default date value has not been specified in the {@link #defaults} hash,
  17658. * the current date's year, month, day or DST-adjusted zero-hour time value will be used
  17659. * instead. Keep in mind that the input date string must precisely match the specified format
  17660. * string in order for the parse operation to be successful (failed parse operations return a
  17661. * `null` value).
  17662. *
  17663. * Example:
  17664. *
  17665. * //dt = Fri May 25 2007 (current date)
  17666. * var dt = new Date();
  17667. *
  17668. * //dt = Thu May 25 2006 (today&#39;s month/day in 2006)
  17669. * dt = Ext.Date.parse("2006", "Y");
  17670. *
  17671. * //dt = Sun Jan 15 2006 (all date parts specified)
  17672. * dt = Ext.Date.parse("2006-01-15", "Y-m-d");
  17673. *
  17674. * //dt = Sun Jan 15 2006 15:20:01
  17675. * dt = Ext.Date.parse("2006-01-15 3:20:01 PM", "Y-m-d g:i:s A");
  17676. *
  17677. * // attempt to parse Sun Feb 29 2006 03:20:01 in strict mode
  17678. * dt = Ext.Date.parse("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null
  17679. *
  17680. * ## Heuristic Parsing
  17681. * When no `format` is specified, this method parses the date in a flexible way allowing
  17682. * for different delimiters and textual month names to infer the position of the other
  17683. * parts.
  17684. *
  17685. * Supported inferred date orders when alphabetic month names are used are:
  17686. *
  17687. * - `D,M,Y`
  17688. * - `M,D,Y`
  17689. * - `Y,M,D`
  17690. *
  17691. * If the passed in date consists of all numeric tokens then the relative magnitude of
  17692. * the first two tokens is used to make an inference about the user's intention.
  17693. * If one token is less than 13 and the other is greater than 12, then the user's
  17694. * intention is known.
  17695. *
  17696. * Failing this, the {@link #defaultFormat} is used to determine the input order for
  17697. * the current locale.
  17698. *
  17699. * Part delimiters may be any of these:
  17700. *
  17701. * - `'/'`
  17702. * - `'-'`
  17703. * - `'.'`
  17704. * - `'\'`
  17705. * - `' '` (space)
  17706. *
  17707. * For example, the inputs `"Jun 1 62"` and `"1 Jun 62"` would be understood as the
  17708. * first of June, 1962 in all English locales regardless of the locale's default date
  17709. * ordering.
  17710. *
  17711. * If `"25/1/62"` was passed in, it's obvious that the user means the twenty fifth
  17712. * of January.
  17713. *
  17714. * If, however, `"1/6/62"` was passed in, the {@link #defaultFormat} would be consulted
  17715. * to disambiguate the meaning of those first two tokens.
  17716. *
  17717. * @param {String} input The date string to parse.
  17718. * @param {String} [format] The expected date string format. If not passed, the date
  17719. * string will be parsed heuristically as described above.
  17720. * @param {Boolean} [strict=false] Pass `true` to validate date strings while parsing
  17721. * (i.e. prevents JavaScript Date "rollover"). Invalid date strings will return `null`
  17722. * when parsed.
  17723. * @return {Date} The parsed Date, or `null` if an invalid date string.
  17724. */
  17725. parse: function(input, format, strict) {
  17726. var p;
  17727. if (!format) {
  17728. return utilDate.flexParse(input);
  17729. }
  17730. p = utilDate.parseFunctions;
  17731. if (p[format] == null) {
  17732. utilDate.createParser(format);
  17733. }
  17734. return p[format].call(utilDate, input, Ext.isDefined(strict) ? strict : utilDate.useStrict);
  17735. },
  17736. // Backwards compat
  17737. parseDate: function(input, format, strict) {
  17738. return utilDate.parse(input, format, strict);
  17739. },
  17740. /**
  17741. * @private
  17742. */
  17743. getFormatCode: function(character) {
  17744. var f = utilDate.formatCodes[character];
  17745. if (f) {
  17746. f = typeof f === 'function' ? f() : f;
  17747. // reassign function result to prevent repeated execution
  17748. utilDate.formatCodes[character] = f;
  17749. }
  17750. // note: unknown characters are treated as literals
  17751. return f || ("'" + Ext.String.escape(character) + "'");
  17752. },
  17753. /**
  17754. * @private
  17755. */
  17756. createFormat: function(format) {
  17757. var code = [],
  17758. special = false,
  17759. ch = '',
  17760. i;
  17761. for (i = 0; i < format.length; ++i) {
  17762. ch = format.charAt(i);
  17763. if (!special && ch === "\\") {
  17764. special = true;
  17765. } else if (special) {
  17766. special = false;
  17767. code.push("'" + Ext.String.escape(ch) + "'");
  17768. } else {
  17769. if (ch === '\n') {
  17770. code.push("'\\n'");
  17771. } else {
  17772. code.push(utilDate.getFormatCode(ch));
  17773. }
  17774. }
  17775. }
  17776. utilDate.formatFunctions[format] = Ext.functionFactory("var m = this; return " + code.join('+'));
  17777. },
  17778. /**
  17779. * @private
  17780. */
  17781. createParser: function(format) {
  17782. var regexNum = utilDate.parseRegexes.length,
  17783. currentGroup = 1,
  17784. calc = [],
  17785. regex = [],
  17786. special = false,
  17787. ch = "",
  17788. i = 0,
  17789. len = format.length,
  17790. atEnd = [],
  17791. obj;
  17792. for (; i < len; ++i) {
  17793. ch = format.charAt(i);
  17794. if (!special && ch === "\\") {
  17795. special = true;
  17796. } else if (special) {
  17797. special = false;
  17798. regex.push(Ext.String.escape(ch));
  17799. } else {
  17800. obj = utilDate.formatCodeToRegex(ch, currentGroup);
  17801. currentGroup += obj.g;
  17802. regex.push(obj.s);
  17803. if (obj.g && obj.c) {
  17804. if (obj.calcAtEnd) {
  17805. atEnd.push(obj.c);
  17806. } else {
  17807. calc.push(obj.c);
  17808. }
  17809. }
  17810. }
  17811. }
  17812. calc = calc.concat(atEnd);
  17813. utilDate.parseRegexes[regexNum] = new RegExp("^" + regex.join('') + "$", 'i');
  17814. utilDate.parseFunctions[format] = Ext.functionFactory("input", "strict", xf(code, regexNum, calc.join('')));
  17815. },
  17816. /**
  17817. * @private
  17818. */
  17819. parseCodes: {
  17820. // Notes:
  17821. // g = {Number} calculation group (0 or 1. only group 1 contributes to
  17822. // date calculations.)
  17823. // c = {String} calculation method (required for group 1. null for group 0.
  17824. // {0} = currentGroup - position in regex result array)
  17825. // s = {String} regex pattern. all matches are stored in results[], and are
  17826. // accessible by the calculation mapped to 'c'
  17827. d: {
  17828. g: 1,
  17829. c: "d = parseInt(results[{0}], 10);\n",
  17830. s: "(3[0-1]|[1-2][0-9]|0[1-9])"
  17831. },
  17832. // day of month with leading zeroes (01 - 31)
  17833. j: {
  17834. g: 1,
  17835. c: "d = parseInt(results[{0}], 10);\n",
  17836. s: "(3[0-1]|[1-2][0-9]|[1-9])"
  17837. },
  17838. // day of month without leading zeroes (1 - 31)
  17839. D: function() {
  17840. var a = [],
  17841. i;
  17842. // get localised short day names
  17843. for (i = 0; i < 7; i++) {
  17844. a.push(utilDate.getShortDayName(i));
  17845. }
  17846. return {
  17847. g: 0,
  17848. c: null,
  17849. s: "(?:" + a.join("|") + ")"
  17850. };
  17851. },
  17852. l: function() {
  17853. return {
  17854. g: 0,
  17855. c: null,
  17856. s: "(?:" + utilDate.dayNames.join("|") + ")"
  17857. };
  17858. },
  17859. N: {
  17860. g: 0,
  17861. c: null,
  17862. s: "[1-7]"
  17863. },
  17864. // ISO-8601 day number (1 (monday) - 7 (sunday))
  17865. //<locale type="object" property="parseCodes">
  17866. S: {
  17867. g: 0,
  17868. c: null,
  17869. s: "(?:st|nd|rd|th)"
  17870. },
  17871. //</locale>
  17872. w: {
  17873. g: 0,
  17874. c: null,
  17875. s: "[0-6]"
  17876. },
  17877. // JavaScript day number (0 (sunday) - 6 (saturday))
  17878. z: {
  17879. g: 1,
  17880. c: "z = parseInt(results[{0}], 10);\n",
  17881. s: "(\\d{1,3})"
  17882. },
  17883. // day of the year (0 - 364 (365 in leap years))
  17884. W: {
  17885. g: 1,
  17886. c: "W = parseInt(results[{0}], 10);\n",
  17887. s: "(\\d{2})"
  17888. },
  17889. // ISO-8601 week number (with leading zero)
  17890. F: function() {
  17891. return {
  17892. g: 1,
  17893. c: "m = parseInt(me.getMonthNumber(results[{0}]), 10);\n",
  17894. s: "(" + utilDate.monthNames.join("|") + ")"
  17895. };
  17896. },
  17897. M: function() {
  17898. var a = [],
  17899. i;
  17900. // get localised short month names
  17901. for (i = 0; i < 12; i++) {
  17902. a.push(utilDate.getShortMonthName(i));
  17903. }
  17904. return Ext.applyIf({
  17905. s: "(" + a.join("|") + ")"
  17906. }, utilDate.formatCodeToRegex("F"));
  17907. },
  17908. m: {
  17909. g: 1,
  17910. c: "m = parseInt(results[{0}], 10) - 1;\n",
  17911. s: "(1[0-2]|0[1-9])"
  17912. },
  17913. // month number with leading zeros (01 - 12)
  17914. n: {
  17915. g: 1,
  17916. c: "m = parseInt(results[{0}], 10) - 1;\n",
  17917. s: "(1[0-2]|[1-9])"
  17918. },
  17919. // month number without leading zeros (1 - 12)
  17920. t: {
  17921. g: 0,
  17922. c: null,
  17923. s: "(?:\\d{2})"
  17924. },
  17925. // no. of days in the month (28 - 31)
  17926. L: {
  17927. g: 0,
  17928. c: null,
  17929. s: "(?:1|0)"
  17930. },
  17931. o: {
  17932. g: 1,
  17933. c: "y = parseInt(results[{0}], 10);\n",
  17934. s: "(\\d{4})"
  17935. },
  17936. // ISO-8601 year number (with leading zero)
  17937. Y: {
  17938. g: 1,
  17939. c: "y = parseInt(results[{0}], 10);\n",
  17940. s: "(\\d{4})"
  17941. },
  17942. // 4-digit year
  17943. y: {
  17944. g: 1,
  17945. c: "var ty = parseInt(results[{0}], 10);\n" + "y = ty > me.y2kYear ? 1900 + ty : 2000 + ty;\n",
  17946. // 2-digit year
  17947. s: "(\\d{2})"
  17948. },
  17949. // In the am/pm parsing routines, we allow both upper and lower case
  17950. // even though it doesn't exactly match the spec. It gives much more flexibility
  17951. // in being able to specify case insensitive regexes.
  17952. /* eslint-disable indent */
  17953. //<locale type="object" property="parseCodes">
  17954. a: {
  17955. g: 1,
  17956. c: "if (/(am)/i.test(results[{0}])) {\n" + "if (!h || h == 12) { h = 0; }\n" + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}",
  17957. s: "(am|pm|AM|PM)",
  17958. calcAtEnd: true
  17959. },
  17960. //</locale>
  17961. //<locale type="object" property="parseCodes">
  17962. A: {
  17963. g: 1,
  17964. c: "if (/(am)/i.test(results[{0}])) {\n" + "if (!h || h == 12) { h = 0; }\n" + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}",
  17965. s: "(AM|PM|am|pm)",
  17966. calcAtEnd: true
  17967. },
  17968. //</locale>
  17969. g: {
  17970. g: 1,
  17971. c: "h = parseInt(results[{0}], 10);\n",
  17972. s: "(1[0-2]|[1-9])"
  17973. },
  17974. // 12-hr format of an hour without leading zeroes (1 - 12)
  17975. G: {
  17976. g: 1,
  17977. c: "h = parseInt(results[{0}], 10);\n",
  17978. s: "(2[0-3]|1[0-9]|[0-9])"
  17979. },
  17980. // 24-hr format of an hour without leading zeroes (0 - 23)
  17981. h: {
  17982. g: 1,
  17983. c: "h = parseInt(results[{0}], 10);\n",
  17984. s: "(1[0-2]|0[1-9])"
  17985. },
  17986. // 12-hr format of an hour with leading zeroes (01 - 12)
  17987. H: {
  17988. g: 1,
  17989. c: "h = parseInt(results[{0}], 10);\n",
  17990. s: "(2[0-3]|[0-1][0-9])"
  17991. },
  17992. // 24-hr format of an hour with leading zeroes (00 - 23)
  17993. i: {
  17994. g: 1,
  17995. c: "i = parseInt(results[{0}], 10);\n",
  17996. s: "([0-5][0-9])"
  17997. },
  17998. // minutes with leading zeros (00 - 59)
  17999. s: {
  18000. g: 1,
  18001. c: "s = parseInt(results[{0}], 10);\n",
  18002. s: "([0-5][0-9])"
  18003. },
  18004. // seconds with leading zeros (00 - 59)
  18005. u: {
  18006. g: 1,
  18007. c: "ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",
  18008. s: "(\\d+)"
  18009. },
  18010. // decimal fraction of a second (minimum = 1 digit, maximum = unlimited)
  18011. /* eslint-disable max-len */
  18012. O: {
  18013. g: 1,
  18014. c: [
  18015. "o = results[{0}];",
  18016. "var sn = o.substring(0,1),",
  18017. // get + / - sign
  18018. "hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),",
  18019. // get hours (performs minutes-to-hour conversion also, just in case)
  18020. "mn = o.substring(3,5) % 60;",
  18021. // get minutes
  18022. "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + Ext.String.leftPad(hr, 2, '0') + Ext.String.leftPad(mn, 2, '0')) : null;\n"
  18023. ].// -12hrs <= GMT offset <= 14hrs
  18024. join("\n"),
  18025. s: "([+-]\\d{4})"
  18026. },
  18027. // GMT offset in hrs and mins
  18028. P: {
  18029. g: 1,
  18030. c: [
  18031. "o = results[{0}];",
  18032. "var sn = o.substring(0,1),",
  18033. // get + / - sign
  18034. "hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),",
  18035. // get hours (performs minutes-to-hour conversion also, just in case)
  18036. "mn = o.substring(4,6) % 60;",
  18037. // get minutes
  18038. "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + Ext.String.leftPad(hr, 2, '0') + Ext.String.leftPad(mn, 2, '0')) : null;\n"
  18039. ].// -12hrs <= GMT offset <= 14hrs
  18040. join("\n"),
  18041. s: "([+-]\\d{2}:\\d{2})"
  18042. },
  18043. // GMT offset in hrs and mins (with colon separator)
  18044. T: {
  18045. g: 0,
  18046. c: null,
  18047. s: "[A-Z]{1,5}"
  18048. },
  18049. // timezone abbrev. may be between 1 - 5 chars
  18050. Z: {
  18051. g: 1,
  18052. c: "zz = results[{0}] * 1;\n" + // -43200 <= UTC offset <= 50400
  18053. "zz = (-43200 <= zz && zz <= 50400)? zz : null;\n",
  18054. s: "([+-]?\\d{1,5})"
  18055. },
  18056. // leading '+' sign is optional for UTC offset
  18057. c: function() {
  18058. var calc = [],
  18059. arr = [
  18060. utilDate.formatCodeToRegex("Y", 1),
  18061. // year
  18062. utilDate.formatCodeToRegex("m", 2),
  18063. // month
  18064. utilDate.formatCodeToRegex("d", 3),
  18065. // day
  18066. utilDate.formatCodeToRegex("H", 4),
  18067. // hour
  18068. utilDate.formatCodeToRegex("i", 5),
  18069. // minute
  18070. utilDate.formatCodeToRegex("s", 6),
  18071. // second
  18072. {
  18073. c: "ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"
  18074. },
  18075. // decimal fraction of a second (minimum = 1 digit, maximum = unlimited)
  18076. {
  18077. c: [
  18078. // allow either "Z" (i.e. UTC) or "-0530" or "+08:00" (i.e. UTC offset) timezone delimiters. assumes local timezone if no timezone is specified
  18079. "if (results[8]) {",
  18080. // timezone specified
  18081. "if (results[8] == 'Z') {",
  18082. "zz = 0;",
  18083. // UTC
  18084. "}",
  18085. "else if (results[8].indexOf(':') > -1) {",
  18086. utilDate.formatCodeToRegex("P", 8).c,
  18087. // timezone offset with colon separator
  18088. "}",
  18089. "else {",
  18090. utilDate.formatCodeToRegex("O", 8).c,
  18091. // timezone offset without colon separator
  18092. "}",
  18093. "}"
  18094. ].join('\n')
  18095. }
  18096. ],
  18097. i, l;
  18098. for (i = 0 , l = arr.length; i < l; ++i) {
  18099. calc.push(arr[i].c);
  18100. }
  18101. return {
  18102. g: 1,
  18103. c: calc.join(""),
  18104. s: [
  18105. arr[0].s,
  18106. // year (required)
  18107. "(?:",
  18108. "-",
  18109. arr[1].s,
  18110. // month (optional)
  18111. "(?:",
  18112. "-",
  18113. arr[2].s,
  18114. // day (optional)
  18115. "(?:",
  18116. "(?:T| )?",
  18117. // time delimiter -- either a "T" or a single blank space
  18118. arr[3].s,
  18119. ":",
  18120. arr[4].s,
  18121. // hour AND minute, delimited by a single colon (optional). MUST be preceded by either a "T" or a single blank space
  18122. "(?::",
  18123. arr[5].s,
  18124. ")?",
  18125. // seconds (optional)
  18126. "(?:(?:\\.|,)(\\d+))?",
  18127. // decimal fraction of a second (e.g. ",12345" or ".98765") (optional)
  18128. "(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?",
  18129. // "Z" (UTC) or "-0530" (UTC offset without colon delimiter) or "+08:00" (UTC offset with colon delimiter) (optional)
  18130. ")?",
  18131. ")?",
  18132. ")?"
  18133. ].join("")
  18134. };
  18135. },
  18136. U: {
  18137. g: 1,
  18138. c: "u = parseInt(results[{0}], 10);\n",
  18139. s: "(-?\\d+)"
  18140. }
  18141. },
  18142. // leading minus sign indicates seconds before UNIX epoch
  18143. /* eslint-enable indent, max-len */
  18144. compare: function(d1, d2, includeTime) {
  18145. var s1, s2;
  18146. if (typeof d1 === 'string') {
  18147. d1 = Ext.Date.parse(d1);
  18148. }
  18149. if (typeof d2 === 'string') {
  18150. d2 = Ext.Date.parse(d2);
  18151. }
  18152. s1 = Ext.Date.format(d1, 'C');
  18153. s2 = Ext.Date.format(d2, 'C');
  18154. if (!includeTime) {
  18155. s1 = s1.substr(0, 10);
  18156. // "YYYY-MM-DD".length === 10
  18157. s2 = s2.substr(0, 10);
  18158. }
  18159. return (s1 < s2) ? -1 : ((s2 < s1) ? 1 : 0);
  18160. },
  18161. // Old Ext.Date prototype methods.
  18162. /**
  18163. * @private
  18164. */
  18165. dateFormat: function(date, format) {
  18166. return utilDate.format(date, format);
  18167. },
  18168. /**
  18169. * Compares if two dates are equal by comparing their values.
  18170. * @param {Date} date1
  18171. * @param {Date} date2
  18172. * @return {Boolean} `true` if the date values are equal
  18173. */
  18174. isEqual: function(date1, date2) {
  18175. // check we have 2 date objects
  18176. if (date1 && date2) {
  18177. return +date1 === +date2;
  18178. }
  18179. // one or both isn't a date, only equal if both are falsy
  18180. return !(date1 || date2);
  18181. },
  18182. /**
  18183. * Formats a date given the supplied format string.
  18184. * @param {Date} date The date to format
  18185. * @param {String} format The format string
  18186. * @return {String} The formatted date or an empty string if date parameter is not
  18187. * a JavaScript Date object
  18188. */
  18189. format: function(date, format) {
  18190. var formatFunctions = utilDate.formatFunctions;
  18191. if (!Ext.isDate(date)) {
  18192. return '';
  18193. }
  18194. if (formatFunctions[format] == null) {
  18195. utilDate.createFormat(format);
  18196. }
  18197. return formatFunctions[format].call(date) + '';
  18198. },
  18199. /**
  18200. * Get the timezone abbreviation of the current date (equivalent to the format specifier 'T').
  18201. *
  18202. * __Note:__ The date string returned by the JavaScript Date object's `toString()` method varies
  18203. * between browsers (e.g. FF vs IE) and system region settings (e.g. IE in Asia vs IE in
  18204. * America). For a given date string e.g. "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula
  18205. * Standard Time)", `getTimezone()` first tries to get the timezone abbreviation from between
  18206. * a pair of parentheses (which may or may not be present), failing which it proceeds to get
  18207. * the timezone abbreviation from the GMT offset portion of the date string.
  18208. *
  18209. * var dt = new Date('9/17/2011');
  18210. * console.log(Ext.Date.getTimezone(dt));
  18211. *
  18212. * @param {Date} date The date
  18213. * @return {String} The abbreviated timezone name (e.g. 'CST', 'PDT', 'EDT', 'MPST' ...).
  18214. */
  18215. getTimezone: function(date) {
  18216. /* eslint-disable max-len, no-useless-escape, newline-per-chained-call */
  18217. // the following list shows the differences between date strings from different browsers on a WinXP SP2 machine from an Asian locale:
  18218. //
  18219. // Opera : "Thu, 25 Oct 2007 22:53:45 GMT+0800" -- shortest (weirdest) date string of the lot
  18220. // Safari : "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)" -- value in parentheses always gives the correct timezone (same as FF)
  18221. // FF : "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)" -- value in parentheses always gives the correct timezone
  18222. // IE : "Thu Oct 25 22:54:35 UTC+0800 2007" -- (Asian system setting) look for 3-4 letter timezone abbrev
  18223. // IE : "Thu Oct 25 17:06:37 PDT 2007" -- (American system setting) look for 3-4 letter timezone abbrev
  18224. //
  18225. // this crazy regex attempts to guess the correct timezone abbreviation despite these differences.
  18226. // step 1: (?:\((.*)\) -- find timezone in parentheses
  18227. // step 2: ([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?) -- if nothing was found in step 1, find timezone from timezone offset portion of date string
  18228. // step 3: remove all non uppercase characters found in step 1 and 2
  18229. return date.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,5})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/, "$1$2").replace(/[^A-Z]/g, "");
  18230. },
  18231. /* eslint-enable max-len, no-useless-escape, newline-per-chained-call */
  18232. /**
  18233. * Get the offset from GMT of the current date (equivalent to the format specifier 'O').
  18234. *
  18235. * var dt = new Date('9/17/2011');
  18236. * console.log(Ext.Date.getGMTOffset(dt));
  18237. *
  18238. * @param {Date} date The date
  18239. * @param {Boolean} [colon=false] `true` to separate the hours and minutes with a colon.
  18240. * @return {String} The 4-character offset string prefixed with + or - (e.g. '-0600').
  18241. */
  18242. getGMTOffset: function(date, colon) {
  18243. var offset = date.getTimezoneOffset();
  18244. return (offset > 0 ? "-" : "+") + Ext.String.leftPad(Math.floor(Math.abs(offset) / 60), 2, "0") + (colon ? ":" : "") + Ext.String.leftPad(Math.abs(offset % 60), 2, "0");
  18245. },
  18246. /**
  18247. * Get the numeric day number of the year, adjusted for leap year.
  18248. *
  18249. * var dt = new Date('9/17/2011');
  18250. * console.log(Ext.Date.getDayOfYear(dt)); // 259
  18251. *
  18252. * @param {Date} date The date
  18253. * @return {Number} 0 to 364 (365 in leap years).
  18254. */
  18255. getDayOfYear: function(date) {
  18256. var num = 0,
  18257. d = utilDate.clone(date),
  18258. m = date.getMonth(),
  18259. i;
  18260. for (i = 0 , d.setDate(1) , d.setMonth(0); i < m; d.setMonth(++i)) {
  18261. num += utilDate.getDaysInMonth(d);
  18262. }
  18263. return num + date.getDate() - 1;
  18264. },
  18265. /**
  18266. * Get the numeric ISO-8601 week number of the year.
  18267. * (equivalent to the format specifier 'W', but without a leading zero).
  18268. *
  18269. * var dt = new Date('9/17/2011');
  18270. * console.log(Ext.Date.getWeekOfYear(dt)); // 37
  18271. *
  18272. * @param {Date} date The date.
  18273. * @return {Number} 1 to 53.
  18274. * @method
  18275. */
  18276. getWeekOfYear: (function() {
  18277. // adapted from http://www.merlyn.demon.co.uk/weekcalc.htm
  18278. var ms1d = 86400000,
  18279. // milliseconds in a day
  18280. ms7d = 7 * ms1d;
  18281. // milliseconds in a week
  18282. return function(date) {
  18283. // return a closure so constants get calculated only once
  18284. /* eslint-disable-next-line max-len */
  18285. var DC3 = nativeDate.UTC(date.getFullYear(), date.getMonth(), date.getDate() + 3) / ms1d,
  18286. // an Absolute Day Number
  18287. AWN = Math.floor(DC3 / 7),
  18288. // an Absolute Week Number
  18289. Wyr = new nativeDate(AWN * ms7d).getUTCFullYear();
  18290. return AWN - Math.floor(nativeDate.UTC(Wyr, 0, 7) / ms7d) + 1;
  18291. };
  18292. }()),
  18293. /**
  18294. * Checks if the current date falls within a leap year.
  18295. *
  18296. * var dt = new Date('1/10/2011');
  18297. * console.log(Ext.Date.isLeapYear(dt)); // false
  18298. *
  18299. * @param {Date} date The date
  18300. * @return {Boolean} `true` if the current date falls within a leap year, `false` otherwise.
  18301. */
  18302. isLeapYear: function(date) {
  18303. var year = date.getFullYear();
  18304. return !!((year & 3) === 0 && (year % 100 || (year % 400 === 0 && year)));
  18305. },
  18306. /**
  18307. * Get the first day of the current month, adjusted for leap year. The returned value
  18308. * is the numeric day index within the week (0-6) which can be used in conjunction with
  18309. * the {@link #monthNames} array to retrieve the textual day name.
  18310. *
  18311. * var dt = new Date('1/10/2007'),
  18312. * firstDay = Ext.Date.getFirstDayOfMonth(dt);
  18313. *
  18314. * console.log(Ext.Date.dayNames[firstDay]); // output: 'Monday'
  18315. *
  18316. * @param {Date} date The date
  18317. * @return {Number} The day number (0-6).
  18318. */
  18319. getFirstDayOfMonth: function(date) {
  18320. var day = (date.getDay() - (date.getDate() - 1)) % 7;
  18321. return (day < 0) ? (day + 7) : day;
  18322. },
  18323. /**
  18324. * Get the last day of the current month, adjusted for leap year. The returned value
  18325. * is the numeric day index within the week (0-6) which can be used in conjunction with
  18326. * the {@link #monthNames} array to retrieve the textual day name.
  18327. *
  18328. * var dt = new Date('1/10/2007'),
  18329. * lastDay = Ext.Date.getLastDayOfMonth(dt);
  18330. *
  18331. * console.log(Ext.Date.dayNames[lastDay]); // output: 'Wednesday'
  18332. *
  18333. * @param {Date} date The date
  18334. * @return {Number} The day number (0-6).
  18335. */
  18336. getLastDayOfMonth: function(date) {
  18337. return utilDate.getLastDateOfMonth(date).getDay();
  18338. },
  18339. /**
  18340. * Get the date of the first day of the month in which this date resides.
  18341. * @param {Date} date The date
  18342. * @return {Date}
  18343. */
  18344. getFirstDateOfMonth: function(date) {
  18345. return new nativeDate(date.getFullYear(), date.getMonth(), 1);
  18346. },
  18347. /**
  18348. * Get the date of the last day of the month in which this date resides.
  18349. * @param {Date} date The date
  18350. * @return {Date}
  18351. */
  18352. getLastDateOfMonth: function(date) {
  18353. return new nativeDate(date.getFullYear(), date.getMonth(), utilDate.getDaysInMonth(date));
  18354. },
  18355. /**
  18356. * Get the number of days in the current month, adjusted for leap year.
  18357. * @param {Date} date The date
  18358. * @return {Number} The number of days in the month.
  18359. * @method
  18360. */
  18361. getDaysInMonth: (function() {
  18362. var daysInMonth = [
  18363. 31,
  18364. 28,
  18365. 31,
  18366. 30,
  18367. 31,
  18368. 30,
  18369. 31,
  18370. 31,
  18371. 30,
  18372. 31,
  18373. 30,
  18374. 31
  18375. ];
  18376. return function(date) {
  18377. // return a closure for efficiency
  18378. var m = date.getMonth();
  18379. return m === 1 && utilDate.isLeapYear(date) ? 29 : daysInMonth[m];
  18380. };
  18381. }()),
  18382. /**
  18383. * Get the English ordinal suffix of the current day (equivalent to the format specifier 'S').
  18384. * @param {Date} date The date
  18385. * @return {String} 'st, 'nd', 'rd' or 'th'.
  18386. * @locale
  18387. */
  18388. getSuffix: function(date) {
  18389. switch (date.getDate()) {
  18390. case 1:
  18391. case 21:
  18392. case 31:
  18393. return "st";
  18394. case 2:
  18395. case 22:
  18396. return "nd";
  18397. case 3:
  18398. case 23:
  18399. return "rd";
  18400. default:
  18401. return "th";
  18402. }
  18403. },
  18404. /**
  18405. * Creates and returns a new Date instance with the exact same date value as the called
  18406. * instance. Dates are copied and passed by reference, so if a copied date variable is modified
  18407. * later, the original variable will also be changed. When the intention is to create a new
  18408. * variable that will not modify the original instance, you should create a clone.
  18409. *
  18410. * Example of correctly cloning a date:
  18411. *
  18412. * //wrong way:
  18413. * var orig = new Date('10/1/2006');
  18414. * var copy = orig;
  18415. * copy.setDate(5);
  18416. * console.log(orig); // returns 'Thu Oct 05 2006'!
  18417. *
  18418. * //correct way:
  18419. * var orig = new Date('10/1/2006'),
  18420. * copy = Ext.Date.clone(orig);
  18421. * copy.setDate(5);
  18422. * console.log(orig); // returns 'Thu Oct 01 2006'
  18423. *
  18424. * @param {Date} date The date.
  18425. * @return {Date} The new Date instance.
  18426. */
  18427. clone: function(date) {
  18428. return new nativeDate(date.getTime());
  18429. },
  18430. /**
  18431. * Checks if the current date is affected by Daylight Saving Time (DST).
  18432. * @param {Date} date The date
  18433. * @return {Boolean} `true` if the current date is affected by DST.
  18434. */
  18435. isDST: function(date) {
  18436. // adapted from http://sencha.com/forum/showthread.php?p=247172#post247172
  18437. // courtesy of @geoffrey.mcgill
  18438. /* eslint-disable-next-line max-len */
  18439. return new nativeDate(date.getFullYear(), 0, 1).getTimezoneOffset() !== date.getTimezoneOffset();
  18440. },
  18441. /**
  18442. * Attempts to clear all time information from this Date by setting the time to midnight
  18443. * of the same day, automatically adjusting for Daylight Saving Time (DST) where applicable.
  18444. *
  18445. * __Note:__ DST timezone information for the browser's host operating system is assumed to be
  18446. * up-to-date.
  18447. * @param {Date} date The date
  18448. * @param {Boolean} [clone=false] `true` to create a clone of this date, clear the time and
  18449. * return it.
  18450. * @return {Date} this or the clone.
  18451. */
  18452. clearTime: function(date, clone) {
  18453. var d, hr, c;
  18454. // handles invalid dates preventing the browser from crashing.
  18455. if (isNaN(date.getTime())) {
  18456. return date;
  18457. }
  18458. if (clone) {
  18459. return utilDate.clearTime(utilDate.clone(date));
  18460. }
  18461. // get current date before clearing time
  18462. d = date.getDate();
  18463. // clear time
  18464. date.setHours(0);
  18465. date.setMinutes(0);
  18466. date.setSeconds(0);
  18467. date.setMilliseconds(0);
  18468. // account for DST (i.e. day of month changed when setting hour = 0)
  18469. if (date.getDate() !== d) {
  18470. // note: DST adjustments are assumed to occur in multiples of 1 hour
  18471. // (this is almost always the case)
  18472. // refer to http://www.timeanddate.com/time/aboutdst.html for the (rare) exceptions
  18473. // to this rule
  18474. // increment hour until cloned date == current date
  18475. /* eslint-disable-next-line max-len, curly, nonblock-statement-body-position */
  18476. for (hr = 1 , c = utilDate.add(date, utilDate.HOUR, hr); c.getDate() !== d; hr++ , c = utilDate.add(date, utilDate.HOUR, hr)){}
  18477. date.setDate(d);
  18478. date.setHours(c.getHours());
  18479. }
  18480. return date;
  18481. },
  18482. /**
  18483. * Provides a convenient method for performing basic date arithmetic. This method
  18484. * does not modify the Date instance being called - it creates and returns
  18485. * a new Date instance containing the resulting date value.
  18486. *
  18487. * Examples:
  18488. *
  18489. * // Basic usage:
  18490. * var dt = Ext.Date.add(new Date('10/29/2006'), Ext.Date.DAY, 5);
  18491. * console.log(dt); // returns 'Fri Nov 03 2006 00:00:00'
  18492. *
  18493. * // Negative values will be subtracted:
  18494. * var dt2 = Ext.Date.add(new Date('10/1/2006'), Ext.Date.DAY, -5);
  18495. * console.log(dt2); // returns 'Tue Sep 26 2006 00:00:00'
  18496. *
  18497. * // Decimal values can be used:
  18498. * var dt3 = Ext.Date.add(new Date('10/1/2006'), Ext.Date.DAY, 1.25);
  18499. * console.log(dt3); // returns 'Mon Oct 02 2006 06:00:00'
  18500. *
  18501. * @param {Date} date The date to modify
  18502. * @param {String} interval A valid date interval enum value.
  18503. * @param {Number} value The amount to add to the current date.
  18504. * @param {Boolean} [preventDstAdjust=false] `true` to prevent adjustments when crossing
  18505. * daylight savings boundaries.
  18506. * @return {Date} The new Date instance.
  18507. */
  18508. add: function(date, interval, value, preventDstAdjust) {
  18509. var d = utilDate.clone(date),
  18510. base = 0,
  18511. day, decimalValue;
  18512. if (!interval || value === 0) {
  18513. return d;
  18514. }
  18515. decimalValue = value - parseInt(value, 10);
  18516. value = parseInt(value, 10);
  18517. if (value) {
  18518. switch (interval.toLowerCase()) {
  18519. // See EXTJSIV-7418. We use setTime() here to deal with issues related to
  18520. // the switchover that occurs when changing to daylight savings and vice
  18521. // versa. setTime() handles this correctly where setHour/Minute/Second/Millisecond
  18522. // do not. Let's assume the DST change occurs at 2am and we're incrementing using
  18523. // add for 15 minutes at time. When entering DST, we should see:
  18524. // 01:30am
  18525. // 01:45am
  18526. // 03:00am // skip 2am because the hour does not exist
  18527. // ...
  18528. // Similarly, leaving DST, we should see:
  18529. // 01:30am
  18530. // 01:45am
  18531. // 01:00am // repeat 1am because that's the change over
  18532. // 01:30am
  18533. // 01:45am
  18534. // 02:00am
  18535. // ....
  18536. //
  18537. case utilDate.MILLI:
  18538. if (preventDstAdjust) {
  18539. d.setMilliseconds(d.getMilliseconds() + value);
  18540. } else {
  18541. d.setTime(d.getTime() + value);
  18542. };
  18543. break;
  18544. case utilDate.SECOND:
  18545. if (preventDstAdjust) {
  18546. d.setSeconds(d.getSeconds() + value);
  18547. } else {
  18548. d.setTime(d.getTime() + value * 1000);
  18549. };
  18550. break;
  18551. case utilDate.MINUTE:
  18552. if (preventDstAdjust) {
  18553. d.setMinutes(d.getMinutes() + value);
  18554. } else {
  18555. d.setTime(d.getTime() + value * 60 * 1000);
  18556. };
  18557. break;
  18558. case utilDate.HOUR:
  18559. if (preventDstAdjust) {
  18560. d.setHours(d.getHours() + value);
  18561. } else {
  18562. d.setTime(d.getTime() + value * 60 * 60 * 1000);
  18563. };
  18564. break;
  18565. case utilDate.DAY:
  18566. if (preventDstAdjust === false) {
  18567. d.setTime(d.getTime() + value * 24 * 60 * 60 * 1000);
  18568. } else {
  18569. d.setDate(d.getDate() + value);
  18570. };
  18571. break;
  18572. case utilDate.MONTH:
  18573. day = date.getDate();
  18574. if (day > 28) {
  18575. /* eslint-disable-next-line max-len */
  18576. day = Math.min(day, utilDate.getLastDateOfMonth(utilDate.add(utilDate.getFirstDateOfMonth(date), utilDate.MONTH, value)).getDate());
  18577. };
  18578. d.setDate(day);
  18579. d.setMonth(date.getMonth() + value);
  18580. break;
  18581. case utilDate.YEAR:
  18582. day = date.getDate();
  18583. if (day > 28) {
  18584. /* eslint-disable-next-line max-len */
  18585. day = Math.min(day, utilDate.getLastDateOfMonth(utilDate.add(utilDate.getFirstDateOfMonth(date), utilDate.YEAR, value)).getDate());
  18586. };
  18587. d.setDate(day);
  18588. d.setFullYear(date.getFullYear() + value);
  18589. break;
  18590. }
  18591. }
  18592. if (decimalValue) {
  18593. switch (interval.toLowerCase()) {
  18594. /* eslint-disable no-multi-spaces */
  18595. case utilDate.MILLI:
  18596. base = 1;
  18597. break;
  18598. case utilDate.SECOND:
  18599. base = 1000;
  18600. break;
  18601. case utilDate.MINUTE:
  18602. base = 1000 * 60;
  18603. break;
  18604. case utilDate.HOUR:
  18605. base = 1000 * 60 * 60;
  18606. break;
  18607. case utilDate.DAY:
  18608. base = 1000 * 60 * 60 * 24;
  18609. break;
  18610. /* eslint-enable no-multi-spaces */
  18611. case utilDate.MONTH:
  18612. day = utilDate.getDaysInMonth(d);
  18613. base = 1000 * 60 * 60 * 24 * day;
  18614. break;
  18615. case utilDate.YEAR:
  18616. day = (utilDate.isLeapYear(d) ? 366 : 365);
  18617. base = 1000 * 60 * 60 * 24 * day;
  18618. break;
  18619. }
  18620. if (base) {
  18621. d.setTime(d.getTime() + base * decimalValue);
  18622. }
  18623. }
  18624. return d;
  18625. },
  18626. /**
  18627. * Provides a convenient method for performing basic date arithmetic. This method
  18628. * does not modify the Date instance being called - it creates and returns
  18629. * a new Date instance containing the resulting date value.
  18630. *
  18631. * Examples:
  18632. *
  18633. * // Basic usage:
  18634. * var dt = Ext.Date.subtract(new Date('10/29/2006'), Ext.Date.DAY, 5);
  18635. * console.log(dt); // returns 'Tue Oct 24 2006 00:00:00'
  18636. *
  18637. * // Negative values will be added:
  18638. * var dt2 = Ext.Date.subtract(new Date('10/1/2006'), Ext.Date.DAY, -5);
  18639. * console.log(dt2); // returns 'Fri Oct 6 2006 00:00:00'
  18640. *
  18641. * // Decimal values can be used:
  18642. * var dt3 = Ext.Date.subtract(new Date('10/1/2006'), Ext.Date.DAY, 1.25);
  18643. * console.log(dt3); // returns 'Fri Sep 29 2006 06:00:00'
  18644. *
  18645. * @param {Date} date The date to modify
  18646. * @param {String} interval A valid date interval enum value.
  18647. * @param {Number} value The amount to subtract from the current date.
  18648. * @param {Boolean} [preventDstAdjust=false] `true` to prevent adjustments when crossing
  18649. * daylight savings boundaries.
  18650. * @return {Date} The new Date instance.
  18651. */
  18652. subtract: function(date, interval, value, preventDstAdjust) {
  18653. return utilDate.add(date, interval, -value, preventDstAdjust);
  18654. },
  18655. /**
  18656. * Checks if a date falls on or between the given start and end dates.
  18657. * @param {Date} date The date to check
  18658. * @param {Date} start Start date
  18659. * @param {Date} end End date
  18660. * @return {Boolean} `true` if this date falls on or between the given start and end dates.
  18661. */
  18662. between: function(date, start, end) {
  18663. var t = date.getTime();
  18664. return start.getTime() <= t && t <= end.getTime();
  18665. },
  18666. /**
  18667. * Checks if the date is a weekend day. Uses {@link #weekendDays}.
  18668. * @param {Date} date The date.
  18669. * @return {Boolean} `true` if the day falls on a weekend.
  18670. *
  18671. * @since 6.2.0
  18672. */
  18673. isWeekend: function(date) {
  18674. return Ext.Array.indexOf(this.weekendDays, date.getDay()) > -1;
  18675. },
  18676. /**
  18677. * Converts the passed UTC date into a local date.
  18678. * For example, if the passed date is:
  18679. * `Wed Jun 01 2016 00:10:00 GMT+1000 (AUS Eastern Standard Time)`, then
  18680. * the returned date will be `Wed Jun 01 2016 00:00:00 GMT+1000 (AUS Eastern Standard Time)`.
  18681. * @param {Date} d The date to convert.
  18682. * @return {Date} The date as a local. Does not modify the passed date.
  18683. *
  18684. * @since 6.2.0
  18685. */
  18686. utcToLocal: function(d) {
  18687. return new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds());
  18688. },
  18689. /**
  18690. * Converts the passed local date into a UTC date.
  18691. * For example, if the passed date is:
  18692. * `Wed Jun 01 2016 00:00:00 GMT+1000 (AUS Eastern Standard Time)`, then
  18693. * the returned date will be `Wed Jun 01 2016 10:00:00 GMT+1000 (AUS Eastern Standard Time)`.
  18694. * @param {Date} d The date to convert.
  18695. * @return {Date} The date as UTC. Does not modify the passed date.
  18696. *
  18697. * @since 6.2.0
  18698. */
  18699. localToUtc: function(d) {
  18700. return utilDate.utc(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());
  18701. },
  18702. /**
  18703. * Create a UTC date.
  18704. * @param {Number} year The year.
  18705. * @param {Number} month The month.
  18706. * @param {Number} day The day.
  18707. * @param {Number} [hour=0] The hour.
  18708. * @param {Number} [min=0] The minutes.
  18709. * @param {Number} [s=0] The seconds.
  18710. * @param {Number} [ms=0] The milliseconds.
  18711. * @return {Date} The UTC date.
  18712. *
  18713. * @since 6.2.0
  18714. */
  18715. utc: function(year, month, day, hour, min, s, ms) {
  18716. return new Date(Date.UTC(year, month, day, hour || 0, min || 0, s || 0, ms || 0));
  18717. },
  18718. // Maintains compatibility with old static and prototype window.Date methods.
  18719. compat: function() {
  18720. var p,
  18721. /* eslint-disable max-len */
  18722. statics = [
  18723. 'useStrict',
  18724. 'formatCodeToRegex',
  18725. 'parseFunctions',
  18726. 'parseRegexes',
  18727. 'formatFunctions',
  18728. 'y2kYear',
  18729. 'MILLI',
  18730. 'SECOND',
  18731. 'MINUTE',
  18732. 'HOUR',
  18733. 'DAY',
  18734. 'MONTH',
  18735. 'YEAR',
  18736. 'defaults',
  18737. 'dayNames',
  18738. 'monthNames',
  18739. 'monthNumbers',
  18740. 'getShortMonthName',
  18741. 'getShortDayName',
  18742. 'getMonthNumber',
  18743. 'formatCodes',
  18744. 'isValid',
  18745. 'parseDate',
  18746. 'getFormatCode',
  18747. 'createFormat',
  18748. 'createParser',
  18749. 'parseCodes'
  18750. ],
  18751. proto = [
  18752. 'dateFormat',
  18753. 'format',
  18754. 'getTimezone',
  18755. 'getGMTOffset',
  18756. 'getDayOfYear',
  18757. 'getWeekOfYear',
  18758. 'isLeapYear',
  18759. 'getFirstDayOfMonth',
  18760. 'getLastDayOfMonth',
  18761. 'getDaysInMonth',
  18762. 'getSuffix',
  18763. 'clone',
  18764. 'isDST',
  18765. 'clearTime',
  18766. 'add',
  18767. 'between'
  18768. ],
  18769. /* eslint-enable max-len */
  18770. sLen = statics.length,
  18771. pLen = proto.length,
  18772. stat, prot, s;
  18773. // Append statics
  18774. for (s = 0; s < sLen; s++) {
  18775. stat = statics[s];
  18776. nativeDate[stat] = utilDate[stat];
  18777. }
  18778. // Append to prototype
  18779. for (p = 0; p < pLen; p++) {
  18780. prot = proto[p];
  18781. nativeDate.prototype[prot] = function() {
  18782. var args = Array.prototype.slice.call(arguments);
  18783. args.unshift(this);
  18784. return utilDate[prot].apply(utilDate, args);
  18785. };
  18786. }
  18787. },
  18788. /**
  18789. * Calculate how many units are there between two time.
  18790. * @param {Date} min The first time.
  18791. * @param {Date} max The second time.
  18792. * @param {String} unit The unit. This unit is compatible with the date interval constants.
  18793. * @return {Number} The maximum number n of units that min + n * unit <= max.
  18794. */
  18795. diff: function(min, max, unit) {
  18796. var diff = +max - min,
  18797. est;
  18798. switch (unit) {
  18799. case utilDate.MILLI:
  18800. return diff;
  18801. case utilDate.SECOND:
  18802. return Math.floor(diff / 1000);
  18803. case utilDate.MINUTE:
  18804. return Math.floor(diff / 60000);
  18805. case utilDate.HOUR:
  18806. return Math.floor(diff / 3600000);
  18807. case utilDate.DAY:
  18808. return Math.floor(diff / 86400000);
  18809. case 'w':
  18810. return Math.floor(diff / 604800000);
  18811. case utilDate.MONTH:
  18812. est = (max.getFullYear() * 12 + max.getMonth()) - (min.getFullYear() * 12 + min.getMonth());
  18813. if (utilDate.add(min, unit, est) > max) {
  18814. return est - 1;
  18815. };
  18816. return est;
  18817. case utilDate.YEAR:
  18818. est = max.getFullYear() - min.getFullYear();
  18819. if (utilDate.add(min, unit, est) > max) {
  18820. return est - 1;
  18821. } else {
  18822. return est;
  18823. };
  18824. }
  18825. },
  18826. /**
  18827. * Align the date to `unit`.
  18828. * @param {Date} date The date to be aligned.
  18829. * @param {String} unit The unit. This unit is compatible with the date interval constants.
  18830. * @param {Number} step
  18831. * @return {Date} The aligned date.
  18832. */
  18833. align: function(date, unit, step) {
  18834. var num = new nativeDate(+date);
  18835. switch (unit.toLowerCase()) {
  18836. case utilDate.MILLI:
  18837. return num;
  18838. case utilDate.SECOND:
  18839. num.setUTCSeconds(num.getUTCSeconds() - num.getUTCSeconds() % step);
  18840. num.setUTCMilliseconds(0);
  18841. return num;
  18842. case utilDate.MINUTE:
  18843. num.setUTCMinutes(num.getUTCMinutes() - num.getUTCMinutes() % step);
  18844. num.setUTCSeconds(0);
  18845. num.setUTCMilliseconds(0);
  18846. return num;
  18847. case utilDate.HOUR:
  18848. num.setUTCHours(num.getUTCHours() - num.getUTCHours() % step);
  18849. num.setUTCMinutes(0);
  18850. num.setUTCSeconds(0);
  18851. num.setUTCMilliseconds(0);
  18852. return num;
  18853. case utilDate.DAY:
  18854. if (step === 7 || step === 14) {
  18855. num.setUTCDate(num.getUTCDate() - num.getUTCDay() + 1);
  18856. };
  18857. num.setUTCHours(0);
  18858. num.setUTCMinutes(0);
  18859. num.setUTCSeconds(0);
  18860. num.setUTCMilliseconds(0);
  18861. return num;
  18862. case utilDate.MONTH:
  18863. num.setUTCMonth(num.getUTCMonth() - (num.getUTCMonth() - 1) % step, 1);
  18864. num.setUTCHours(0);
  18865. num.setUTCMinutes(0);
  18866. num.setUTCSeconds(0);
  18867. num.setUTCMilliseconds(0);
  18868. return num;
  18869. case utilDate.YEAR:
  18870. num.setUTCFullYear(num.getUTCFullYear() - num.getUTCFullYear() % step, 1, 1);
  18871. num.setUTCHours(0);
  18872. num.setUTCMinutes(0);
  18873. num.setUTCSeconds(0);
  18874. num.setUTCMilliseconds(0);
  18875. return date;
  18876. }
  18877. },
  18878. flexParse: function(inDate, defaultFormat) {
  18879. var parts = datePartsRe.exec(inDate),
  18880. firstFormatToken, day, month, year, result;
  18881. // Regex couldn't parse; invalid date.
  18882. if (!parts) {
  18883. return Ext.Date.parse(inDate, 'C');
  18884. }
  18885. // handle "YYYY-MM-DDThh:mm:ssZ"
  18886. // Use this format string to work out what is the desired date order, d/m/y|m/d/y|y/m/d
  18887. if (!defaultFormat) {
  18888. defaultFormat = Ext.Date.defaultFormat;
  18889. }
  18890. // Now the parts array will be:
  18891. // [0] - the full string
  18892. // [1] - The first token if numeric
  18893. // [2] - The first token if alphabetic
  18894. // [3] - The second token if numeric
  18895. // [4] - The second token if alphabetic
  18896. // [5] - The third token.
  18897. // If they've used all numeric parts, we have to use locale order
  18898. // to decide what the parts are. We have three valid choices:
  18899. // d/m/y
  18900. // m/d/y
  18901. // y/m/d
  18902. if (!(parts[2] || parts[4])) {
  18903. firstFormatToken = defaultFormat[0];
  18904. // Not in a y/m/d locale and (first character is a day token, or first
  18905. // token is definitely a day) - it's d/m/y
  18906. // eslint-disable-next-line no-undef
  18907. if (!yearInfo[firstFormatToken] && (dayInfo[firstFormatToken] || (parts[1] > 12 && parts[3] < 13))) {
  18908. day = parseInt(parts[1]);
  18909. month = parseInt(parts[3]) - 1;
  18910. year = parseInt(parts[5]);
  18911. } else if (!yearInfo[firstFormatToken] && (monthInfo[firstFormatToken] || (parts[3] > 12 && parts[1] < 13))) {
  18912. // Not in a y/m/d locale and (first charecter is a month token, or
  18913. // first token is definitely a month) - it's m/d/y
  18914. month = parseInt(parts[1]) - 1;
  18915. day = parseInt(parts[3]);
  18916. year = parseInt(parts[5]);
  18917. } else {
  18918. // y/m/d is the only other valid format
  18919. year = parseInt(parts[1]);
  18920. month = parseInt(parts[3]) - 1;
  18921. day = parseInt(parts[5]);
  18922. }
  18923. } else {
  18924. // They've used an alphabetic month
  18925. // Two alphabetic tokens - not valid.
  18926. if (parts[2] && parts[4]) {
  18927. return null;
  18928. }
  18929. // m/d/y
  18930. if (parts[2]) {
  18931. month = utilDate.monthNumbers[Ext.String.capitalize(parts[2].substr(0, 3))];
  18932. day = parseInt(parts[3]);
  18933. year = parseInt(parts[5]);
  18934. } else {
  18935. // d/m/y
  18936. day = parseInt(parts[1]);
  18937. month = utilDate.monthNumbers[Ext.String.capitalize(parts[4].substr(0, 3))];
  18938. year = parseInt(parts[5]);
  18939. }
  18940. }
  18941. // Alphabetic month couldn't be found, or numeric one out of range.
  18942. if (isNaN(month) || (month < 0 || month > 11)) {
  18943. return null;
  18944. }
  18945. // Short years must be upgraded according to the y2kYear setting
  18946. if (year < utilDate.y2kYear) {
  18947. year += 2000;
  18948. }
  18949. // Create the first of the month so that we can check the validity of the day
  18950. result = new Date(year, month, 1, 0, 0, 0);
  18951. // Validate the day of month.
  18952. if (day < 1 || day > Ext.Date.getDaysInMonth(result)) {
  18953. return null;
  18954. }
  18955. result.setDate(day);
  18956. return result;
  18957. }
  18958. };
  18959. utilDate.parseCodes.C = utilDate.parseCodes.c;
  18960. return utilDate;
  18961. }());
  18962. /**
  18963. * @class Ext.Function
  18964. *
  18965. * A collection of useful static methods to deal with function callbacks.
  18966. * @singleton
  18967. */
  18968. /* eslint-disable indent */
  18969. Ext.Function = (function() {
  18970. // @define Ext.lang.Function
  18971. // @define Ext.Function
  18972. // @require Ext
  18973. // @require Ext.lang.Array
  18974. var lastTime = 0,
  18975. animFrameId,
  18976. animFrameHandlers = [],
  18977. animFrameNoArgs = [],
  18978. idSource = 0,
  18979. animFrameMap = {},
  18980. slice = Array.prototype.slice,
  18981. win = window,
  18982. global = Ext.global,
  18983. // We disable setImmediate in unit tests because it derails internal Jasmine queue
  18984. hasImmediate = !Ext.disableImmediate && !!(global.setImmediate && global.clearImmediate),
  18985. requestAnimFrame = win.requestAnimationFrame || win.webkitRequestAnimationFrame || win.mozRequestAnimationFrame || win.oRequestAnimationFrame || function(callback) {
  18986. var currTime = Ext.now(),
  18987. timeToCall = Math.max(0, 16 - (currTime - lastTime)),
  18988. timerFn = function() {
  18989. callback(currTime + timeToCall);
  18990. },
  18991. id;
  18992. timerFn.$origFn = callback.$origFn || callback;
  18993. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18994. id = win.setTimeout(timerFn, timeToCall);
  18995. lastTime = currTime + timeToCall;
  18996. return id;
  18997. },
  18998. fireHandlers = function() {
  18999. var len = animFrameHandlers.length,
  19000. id, i, handler;
  19001. animFrameId = null;
  19002. var timer;
  19003. // eslint-disable-line vars-on-top
  19004. // Fire all animation frame handlers in one go
  19005. for (i = 0; i < len; i++) {
  19006. handler = animFrameHandlers[i];
  19007. id = handler[3];
  19008. // Check if this timer has been canceled; its map entry is going to be removed
  19009. if (animFrameMap[id]) {
  19010. delete animFrameMap[id];
  19011. timer = Ext.Timer.get(id, 'raf');
  19012. if (timer) {
  19013. timer.tick();
  19014. }
  19015. handler[0].apply(handler[1] || global, handler[2] || animFrameNoArgs);
  19016. if (timer) {
  19017. timer.tock();
  19018. }
  19019. }
  19020. }
  19021. // Clear all fired animation frame handlers, don't forget that new handlers
  19022. // could have been created in user handler functions called in the loop above
  19023. animFrameHandlers = animFrameHandlers.slice(len);
  19024. },
  19025. fireElevatedHandlers = function() {
  19026. Ext.elevate(fireHandlers);
  19027. },
  19028. ExtFunction = {
  19029. /**
  19030. * A very commonly used method throughout the framework. It acts as a wrapper around
  19031. * another method which originally accepts 2 arguments for `name` and `value`.
  19032. * The wrapped function then allows "flexible" value setting of either:
  19033. *
  19034. * - `name` and `value` as 2 arguments
  19035. * - one single object argument with multiple key - value pairs
  19036. *
  19037. * For example:
  19038. *
  19039. * var setValue = Ext.Function.flexSetter(function(name, value) {
  19040. * this[name] = value;
  19041. * });
  19042. *
  19043. * // Afterwards
  19044. * // Setting a single name - value
  19045. * setValue('name1', 'value1');
  19046. *
  19047. * // Settings multiple name - value pairs
  19048. * setValue({
  19049. * name1: 'value1',
  19050. * name2: 'value2',
  19051. * name3: 'value3'
  19052. * });
  19053. *
  19054. * @param {Function} setter The single value setter method.
  19055. * @param {String} setter.name The name of the value being set.
  19056. * @param {Object} setter.value The value being set.
  19057. * @return {Function}
  19058. */
  19059. flexSetter: function(setter) {
  19060. return function(name, value) {
  19061. var k, i;
  19062. if (name !== null) {
  19063. if (typeof name !== 'string') {
  19064. for (k in name) {
  19065. if (name.hasOwnProperty(k)) {
  19066. setter.call(this, k, name[k]);
  19067. }
  19068. }
  19069. if (Ext.enumerables) {
  19070. for (i = Ext.enumerables.length; i--; ) {
  19071. k = Ext.enumerables[i];
  19072. if (name.hasOwnProperty(k)) {
  19073. setter.call(this, k, name[k]);
  19074. }
  19075. }
  19076. }
  19077. } else {
  19078. setter.call(this, name, value);
  19079. }
  19080. }
  19081. return this;
  19082. };
  19083. },
  19084. /**
  19085. * Create a new function from the provided `fn`, change `this` to the provided scope,
  19086. * optionally overrides arguments for the call. Defaults to the arguments passed by
  19087. * the caller.
  19088. *
  19089. * {@link Ext#bind Ext.bind} is alias for {@link Ext.Function#bind Ext.Function.bind}
  19090. *
  19091. * **NOTE:** This method is similar to the native `bind()` method. The major difference
  19092. * is in the way the parameters are passed. This method expects an array of parameters,
  19093. * and if supplied, it does not automatically pass forward parameters from the bound
  19094. * function:
  19095. *
  19096. * function foo (a, b, c) {
  19097. * console.log(a, b, c);
  19098. * }
  19099. *
  19100. * var nativeFn = foo.bind(this, 1, 2);
  19101. * var extFn = Ext.Function.bind(foo, this, [1, 2]);
  19102. *
  19103. * nativeFn(3); // 1, 2, 3
  19104. * extFn(3); // 1, 2, undefined
  19105. *
  19106. * This method is unavailable natively on IE8 and IE/Quirks but Ext JS provides a
  19107. * "polyfill" to emulate the important features of the standard `bind` method. In
  19108. * particular, the polyfill only provides binding of "this" and optional arguments.
  19109. *
  19110. * @param {Function} fn The function to delegate.
  19111. * @param {Object} [scope] The scope (`this` reference) in which the function
  19112. * is executed.
  19113. * **If omitted, defaults to the global environment object (usually the browser `window`).**
  19114. * @param {Array} [args] Overrides arguments for the call. (Defaults to
  19115. * the arguments passed by the caller).
  19116. * @param {Boolean/Number} [appendArgs] if `true` the `args` are appended to the
  19117. * arguments passed to the returned wrapper (by default these arguments are ignored).
  19118. * If a number then the `args` are inserted at the specified position.
  19119. * @return {Function} The bound wrapper function.
  19120. */
  19121. bind: function(fn, scope, args, appendArgs) {
  19122. // Function.prototype.bind is polyfilled in IE8, otherwise native
  19123. if (arguments.length <= 2) {
  19124. return fn.bind(scope);
  19125. }
  19126. var method = fn;
  19127. // eslint-disable-line vars-on-top
  19128. return function() {
  19129. var callArgs = args || arguments;
  19130. if (appendArgs === true) {
  19131. callArgs = slice.call(arguments, 0);
  19132. callArgs = callArgs.concat(args);
  19133. } else if (typeof appendArgs === 'number') {
  19134. callArgs = slice.call(arguments, 0);
  19135. // copy arguments first
  19136. Ext.Array.insert(callArgs, appendArgs, args);
  19137. }
  19138. return method.apply(scope || global, callArgs);
  19139. };
  19140. },
  19141. /**
  19142. * Captures the given parameters for a later call to `Ext.callback`. This binding is
  19143. * most useful for resolving scopes for example to an `Ext.app.ViewController`.
  19144. *
  19145. * The arguments match that of `Ext.callback` except for the `args` which, if provided
  19146. * to this method, are prepended to any arguments supplied by the eventual caller of
  19147. * the returned function.
  19148. *
  19149. * @return {Function} A function that, when called, uses `Ext.callback` to call the
  19150. * captured `callback`.
  19151. * @since 5.0.0
  19152. */
  19153. bindCallback: function(callback, scope, args, delay, caller) {
  19154. return function() {
  19155. var a = slice.call(arguments);
  19156. return Ext.callback(callback, scope, args ? args.concat(a) : a, delay, caller);
  19157. };
  19158. },
  19159. /**
  19160. * Create a new function from the provided `fn`, the arguments of which are pre-set
  19161. * to `args`. New arguments passed to the newly created callback when it's invoked
  19162. * are appended after the pre-set ones.
  19163. * This is especially useful when creating callbacks.
  19164. *
  19165. * For example:
  19166. *
  19167. * var originalFunction = function(){
  19168. * alert(Ext.Array.from(arguments).join(' '));
  19169. * };
  19170. *
  19171. * var callback = Ext.Function.pass(originalFunction, ['Hello', 'World']);
  19172. *
  19173. * callback(); // alerts 'Hello World'
  19174. * callback('by Me'); // alerts 'Hello World by Me'
  19175. *
  19176. * {@link Ext#pass Ext.pass} is alias for {@link Ext.Function#pass Ext.Function.pass}
  19177. *
  19178. * @param {Function} fn The original function.
  19179. * @param {Array} args The arguments to pass to new callback.
  19180. * @param {Object} scope (optional) The scope (`this` reference) in which the function
  19181. * is executed.
  19182. * @return {Function} The new callback function.
  19183. */
  19184. pass: function(fn, args, scope) {
  19185. if (!Ext.isArray(args)) {
  19186. if (Ext.isIterable(args)) {
  19187. args = Ext.Array.clone(args);
  19188. } else {
  19189. args = args !== undefined ? [
  19190. args
  19191. ] : [];
  19192. }
  19193. }
  19194. return function() {
  19195. var fnArgs = args.slice();
  19196. fnArgs.push.apply(fnArgs, arguments);
  19197. return fn.apply(scope || this, fnArgs);
  19198. };
  19199. },
  19200. /**
  19201. * Create an alias to the provided method property with name `methodName` of `object`.
  19202. * Note that the execution scope will still be bound to the provided `object` itself.
  19203. *
  19204. * @param {Object/Function} object
  19205. * @param {String} methodName
  19206. * @return {Function} aliasFn
  19207. */
  19208. alias: function(object, methodName) {
  19209. return function() {
  19210. return object[methodName].apply(object, arguments);
  19211. };
  19212. },
  19213. /**
  19214. * Create a "clone" of the provided method. The returned method will call the given
  19215. * method passing along all arguments and the "this" pointer and return its result.
  19216. *
  19217. * @param {Function} method
  19218. * @return {Function} cloneFn
  19219. */
  19220. clone: function(method) {
  19221. var newMethod, prop;
  19222. newMethod = function() {
  19223. return method.apply(this, arguments);
  19224. };
  19225. for (prop in method) {
  19226. if (method.hasOwnProperty(prop)) {
  19227. newMethod[prop] = method[prop];
  19228. }
  19229. }
  19230. return newMethod;
  19231. },
  19232. /**
  19233. * Creates an interceptor function. The passed function is called before the original one.
  19234. * If it returns false, the original one is not called. The resulting function returns
  19235. * the results of the original function. The passed function is called with the parameters
  19236. * of the original function. Example usage:
  19237. *
  19238. * var sayHi = function(name){
  19239. * alert('Hi, ' + name);
  19240. * };
  19241. *
  19242. * sayHi('Fred'); // alerts "Hi, Fred"
  19243. *
  19244. * // create a new function that validates input without
  19245. * // directly modifying the original function:
  19246. * var sayHiToFriend = Ext.Function.createInterceptor(sayHi, function(name){
  19247. * return name === 'Brian';
  19248. * });
  19249. *
  19250. * sayHiToFriend('Fred'); // no alert
  19251. * sayHiToFriend('Brian'); // alerts "Hi, Brian"
  19252. *
  19253. * @param {Function} origFn The original function.
  19254. * @param {Function} newFn The function to call before the original.
  19255. * @param {Object} [scope] The scope (`this` reference) in which the passed function
  19256. * is executed. **If omitted, defaults to the scope in which the original function
  19257. * is called or the browser window.**
  19258. * @param {Object} [returnValue=null] The value to return if the passed function return
  19259. * `false`.
  19260. * @return {Function} The new function.
  19261. */
  19262. createInterceptor: function(origFn, newFn, scope, returnValue) {
  19263. if (!Ext.isFunction(newFn)) {
  19264. return origFn;
  19265. } else {
  19266. returnValue = Ext.isDefined(returnValue) ? returnValue : null;
  19267. return function() {
  19268. var me = this,
  19269. args = arguments;
  19270. return (newFn.apply(scope || me || global, args) !== false) ? origFn.apply(me || global, args) : returnValue;
  19271. };
  19272. }
  19273. },
  19274. /**
  19275. * Creates a delegate (callback) which, when called, executes after a specific delay.
  19276. *
  19277. * @param {Function} fn The function which will be called on a delay when the returned
  19278. * function is called. Optionally, a replacement (or additional) argument list
  19279. * may be specified.
  19280. * @param {Number} delay The number of milliseconds to defer execution by whenever called.
  19281. * @param {Object} scope (optional) The scope (`this` reference) used by the function
  19282. * at execution time.
  19283. * @param {Array} args (optional) Override arguments for the call.
  19284. * (Defaults to the arguments passed by the caller)
  19285. * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args
  19286. * instead of overriding, if a number the args are inserted at the specified position.
  19287. * @return {Function} A function which, when called, executes the original function
  19288. * after the specified delay.
  19289. */
  19290. createDelayed: function(fn, delay, scope, args, appendArgs) {
  19291. var boundFn = fn;
  19292. if (scope || args) {
  19293. boundFn = Ext.Function.bind(fn, scope, args, appendArgs);
  19294. }
  19295. return function() {
  19296. var me = this,
  19297. args = slice.call(arguments),
  19298. timerFn, timerId;
  19299. var timer;
  19300. // eslint-disable-line vars-on-top, one-var
  19301. timerFn = function() {
  19302. Ext.elevate(boundFn, me, args, timer);
  19303. };
  19304. // eslint-disable-line comma-style
  19305. timerId = setTimeout(timerFn, delay);
  19306. timerFn.$origFn = fn.$origFn || fn;
  19307. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  19308. timer = Ext.Timer.created('timeout', timerId, {
  19309. type: 'createDelayed',
  19310. fn: fn,
  19311. timerFn: timerFn
  19312. });
  19313. };
  19314. },
  19315. /**
  19316. * Calls function `fn` after the number of milliseconds specified, optionally with
  19317. * a specific `scope` (`this` pointer).
  19318. *
  19319. * Example usage:
  19320. *
  19321. * var sayHi = function(name) {
  19322. * alert('Hi, ' + name);
  19323. * }
  19324. *
  19325. * // executes immediately:
  19326. * sayHi('Fred');
  19327. *
  19328. * // executes after 2 seconds:
  19329. * Ext.defer(sayHi, 2000, this, ['Fred']);
  19330. *
  19331. * The following syntax is useful for scheduling anonymous functions:
  19332. *
  19333. * Ext.defer(function() {
  19334. * alert('Anonymous');
  19335. * }, 100);
  19336. *
  19337. * NOTE: The `Ext.Function.defer()` method is an alias for `Ext.defer()`.
  19338. *
  19339. * @param {Function} fn The function to defer.
  19340. * @param {Number} millis The number of milliseconds for the `setTimeout` call
  19341. * (if less than or equal to 0 the function is executed immediately).
  19342. * @param {Object} scope (optional) The scope (`this` reference) in which the function
  19343. * is executed. **If omitted, defaults to the browser window.**
  19344. * @param {Array} [args] Overrides arguments for the call. Defaults to the arguments passed
  19345. * by the caller.
  19346. * @param {Boolean/Number} [appendArgs=false] If `true` args are appended to call args
  19347. * instead of overriding, or, if a number, then the args are inserted at the specified
  19348. * position.
  19349. * @return {Number} The timeout id that can be used with `Ext.undefer`.
  19350. */
  19351. defer: function(fn, millis, scope, args, appendArgs) {
  19352. var timerId = 0,
  19353. timerFn, boundFn;
  19354. var timer;
  19355. // eslint-disable-line vars-on-top, one-var
  19356. if (!scope && !args && !appendArgs) {
  19357. boundFn = fn;
  19358. } else {
  19359. boundFn = Ext.Function.bind(fn, scope, args, appendArgs);
  19360. }
  19361. if (millis > 0) {
  19362. timerFn = function() {
  19363. Ext.elevate(boundFn, null, null, timer);
  19364. };
  19365. // eslint-disable-line comma-style
  19366. timerId = setTimeout(timerFn, millis);
  19367. timerFn.$origFn = fn.$origFn || fn;
  19368. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  19369. timer = Ext.Timer.created('timeout', timerId, {
  19370. type: 'defer',
  19371. fn: fn,
  19372. timerFn: timerFn
  19373. });
  19374. } else {
  19375. boundFn();
  19376. }
  19377. return timerId;
  19378. },
  19379. /**
  19380. * Calls the function `fn` repeatedly at a given interval, optionally with a
  19381. * specific `scope` (`this` pointer).
  19382. *
  19383. * var sayHi = function(name) {
  19384. * console.log('Hi, ' + name);
  19385. * }
  19386. *
  19387. * // executes every 2 seconds:
  19388. * var timerId = Ext.interval(sayHi, 2000, this, ['Fred']);
  19389. *
  19390. * The timer is stopped by:
  19391. *
  19392. * Ext.uninterval(timerId);
  19393. *
  19394. * NOTE: The `Ext.Function.interval()` method is an alias for `Ext.interval()`.
  19395. *
  19396. * @param {Function} fn The function to defer.
  19397. * @param {Number} millis The number of milliseconds for the `setInterval` call
  19398. * @param {Object} scope (optional) The scope (`this` reference) in which the function
  19399. * is executed. **If omitted, defaults to the browser window.**
  19400. * @param {Array} [args] Overrides arguments for the call. Defaults to the arguments
  19401. * passed by the caller.
  19402. * @param {Boolean/Number} [appendArgs=false] If `true` args are appended to call args
  19403. * instead of overriding, or, if a number, then the args are inserted at the specified
  19404. * position.
  19405. * @return {Number} The interval id that can be used with `Ext.uninterval`.
  19406. */
  19407. interval: function(fn, millis, scope, args, appendArgs) {
  19408. var timerFn, timerId, boundFn;
  19409. var timer;
  19410. // eslint-disable-line vars-on-top, one-var
  19411. boundFn = Ext.Function.bind(fn, scope, args, appendArgs);
  19412. timerFn = function() {
  19413. Ext.elevate(boundFn, null, null, timer);
  19414. };
  19415. // eslint-disable-line comma-style
  19416. timerId = setInterval(timerFn, millis);
  19417. timerFn.$origFn = boundFn.$origFn || fn;
  19418. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  19419. timer = Ext.Timer.created('interval', timerId, {
  19420. type: 'interval',
  19421. fn: fn,
  19422. timerFn: timerFn
  19423. });
  19424. return timerId;
  19425. },
  19426. /**
  19427. * Create a combined function call sequence of the original function + the passed function.
  19428. * The resulting function returns the results of the original function.
  19429. * The passed function is called with the parameters of the original function.
  19430. * Example usage:
  19431. *
  19432. * var sayHi = function(name){
  19433. * alert('Hi, ' + name);
  19434. * };
  19435. *
  19436. * sayHi('Fred'); // alerts "Hi, Fred"
  19437. *
  19438. * var sayGoodbye = Ext.Function.createSequence(sayHi, function(name){
  19439. * alert('Bye, ' + name);
  19440. * });
  19441. *
  19442. * sayGoodbye('Fred'); // both alerts show
  19443. *
  19444. * @param {Function} originalFn The original function.
  19445. * @param {Function} newFn The function to sequence.
  19446. * @param {Object} [scope] The scope (`this` reference) in which the passed function
  19447. * is executed. If omitted, defaults to the scope in which the original function is called
  19448. * or the default global environment object (usually the browser window).
  19449. * @return {Function} The new function.
  19450. */
  19451. createSequence: function(originalFn, newFn, scope) {
  19452. if (!newFn) {
  19453. return originalFn;
  19454. } else {
  19455. return function() {
  19456. var result = originalFn.apply(this, arguments);
  19457. newFn.apply(scope || this, arguments);
  19458. return result;
  19459. };
  19460. }
  19461. },
  19462. /**
  19463. * Creates a delegate function, optionally with a bound scope which, when called, buffers
  19464. * the execution of the passed function for the configured number of milliseconds.
  19465. * If called again within that period, the impending invocation will be canceled, and the
  19466. * timeout period will begin again.
  19467. *
  19468. * @param {Function} fn The function to invoke on a buffered timer.
  19469. * @param {Number} buffer The number of milliseconds by which to buffer the invocation
  19470. * of the function.
  19471. * @param {Object} [scope] The scope (`this` reference) in which.
  19472. * the passed function is executed. If omitted, defaults to the scope specified
  19473. * by the caller.
  19474. * @param {Array} [args] Override arguments for the call. Defaults to the arguments
  19475. * passed by the caller.
  19476. * @return {Function} A function which invokes the passed function after buffering
  19477. * for the specified time.
  19478. */
  19479. createBuffered: function(fn, buffer, scope, args) {
  19480. var timerId,
  19481. result = function() {
  19482. var callArgs = args || slice.call(arguments, 0),
  19483. me = scope || this,
  19484. timerFn;
  19485. var timer;
  19486. // eslint-disable-line vars-on-top, one-var
  19487. if (timerId) {
  19488. Ext.undefer(timerId);
  19489. }
  19490. timerFn = function() {
  19491. Ext.elevate(fn, me, callArgs, timer);
  19492. };
  19493. // eslint-disable-line comma-style
  19494. result.timer = timerId = setTimeout(timerFn, buffer);
  19495. timerFn.$origFn = fn.$origFn || fn;
  19496. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  19497. timer = Ext.Timer.created('timeout', timerId, {
  19498. type: 'createBuffered',
  19499. fn: fn,
  19500. timerFn: timerFn
  19501. });
  19502. };
  19503. return result;
  19504. },
  19505. /**
  19506. * Creates a wrapped function that, when invoked, defers execution until the next
  19507. * animation frame
  19508. * @private
  19509. * @param {Function} fn The function to call.
  19510. * @param {Object} [scope] The scope (`this` reference) in which the function is executed.
  19511. * Defaults to the window object.
  19512. * @param {Array} [args] The argument list to pass to the function.
  19513. * @param {Number} [queueStrategy=3] A bit flag that indicates how multiple calls to
  19514. * the returned function within the same animation frame should be handled.
  19515. *
  19516. * - 1: All calls will be queued - FIFO order
  19517. * - 2: Only the first call will be queued
  19518. * - 3: The last call will replace all previous calls
  19519. *
  19520. * @return {Function}
  19521. */
  19522. createAnimationFrame: function(fn, scope, args, queueStrategy) {
  19523. var boundFn, timerId;
  19524. queueStrategy = queueStrategy || 3;
  19525. boundFn = function() {
  19526. var timerFn,
  19527. callArgs = args || slice.call(arguments, 0);
  19528. scope = scope || this;
  19529. if (queueStrategy === 3 && timerId) {
  19530. ExtFunction.cancelAnimationFrame(timerId);
  19531. }
  19532. if ((queueStrategy & 1) || !timerId) {
  19533. timerFn = function() {
  19534. timerId = boundFn.timerId = null;
  19535. fn.apply(scope, callArgs);
  19536. };
  19537. timerFn.$origFn = fn.$origFn || fn;
  19538. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  19539. timerId = boundFn.timerId = ExtFunction.requestAnimationFrame(timerFn);
  19540. }
  19541. };
  19542. return boundFn;
  19543. },
  19544. /**
  19545. * @private
  19546. * Schedules the passed function to be called on the next animation frame.
  19547. * @param {Function} fn The function to call.
  19548. * @param {Object} [scope] The scope (`this` reference) in which the function is executed.
  19549. * Defaults to the window object.
  19550. * @param {Mixed[]} [args] The argument list to pass to the function.
  19551. *
  19552. * @return {Number} Timer id for the new animation frame to use when canceling it.
  19553. */
  19554. requestAnimationFrame: function(fn, scope, args) {
  19555. var id = ++idSource,
  19556. // Ids start at 1
  19557. handler = slice.call(arguments, 0);
  19558. handler[3] = id;
  19559. animFrameMap[id] = 1;
  19560. // A flag to indicate that the timer exists
  19561. Ext.Timer.created('raf', id, {
  19562. type: 'raf',
  19563. fn: fn
  19564. });
  19565. // We might be in fireHandlers at this moment but this new entry will not
  19566. // be executed until the next frame
  19567. animFrameHandlers.push(handler);
  19568. if (!animFrameId) {
  19569. animFrameId = requestAnimFrame(fireElevatedHandlers);
  19570. }
  19571. return id;
  19572. },
  19573. cancelAnimationFrame: function(id) {
  19574. // Don't remove any handlers from animFrameHandlers array, because
  19575. // the might be in use at the moment (when cancelAnimationFrame is called).
  19576. // Just remove the handler id from the map so it will not be executed
  19577. delete animFrameMap[id];
  19578. Ext.Timer.cancel('raf', id);
  19579. },
  19580. /**
  19581. * Creates a throttled version of the passed function which, when called repeatedly and
  19582. * rapidly, invokes the passed function only after a certain interval has elapsed since the
  19583. * previous invocation.
  19584. *
  19585. * This is useful for wrapping functions which may be called repeatedly, such as
  19586. * a handler of a mouse move event when the processing is expensive.
  19587. *
  19588. * @param {Function} fn The function to execute at a regular time interval.
  19589. * @param {Number} interval The interval in milliseconds on which the passed function
  19590. * is executed.
  19591. * @param {Object} [scope] The scope (`this` reference) in which
  19592. * the passed function is executed. If omitted, defaults to the scope specified
  19593. * by the caller.
  19594. * @return {Function} A function which invokes the passed function at the specified
  19595. * interval.
  19596. */
  19597. createThrottled: function(fn, interval, scope) {
  19598. var lastCallTime = 0,
  19599. elapsed, lastArgs, timerId,
  19600. execute = function() {
  19601. fn.apply(scope, lastArgs);
  19602. lastCallTime = Ext.now();
  19603. lastArgs = timerId = null;
  19604. };
  19605. execute.$origFn = fn.$origFn || fn;
  19606. execute.$skipTimerCheck = execute.$origFn.$skipTimerCheck;
  19607. return function() {
  19608. // Use scope of last call unless the creator specified a scope
  19609. if (!scope) {
  19610. scope = this;
  19611. }
  19612. elapsed = Ext.now() - lastCallTime;
  19613. lastArgs = Ext.Array.slice(arguments);
  19614. // If this is the first invocation, or the throttle interval has been reached,
  19615. // clear any pending invocation, and call the target function now.
  19616. if (elapsed >= interval) {
  19617. Ext.undefer(timerId);
  19618. execute();
  19619. }
  19620. // Throttle interval has not yet been reached. Only set the timer to fire
  19621. // if not already set.
  19622. else if (!timerId) {
  19623. timerId = Ext.defer(execute, interval - elapsed);
  19624. }
  19625. };
  19626. },
  19627. /**
  19628. * Wraps the passed function in a barrier function which will call the passed function
  19629. * after the passed number of invocations.
  19630. * @param {Number} count The number of invocations which will result in the calling
  19631. * of the passed function.
  19632. * @param {Function} fn The function to call after the required number of invocations.
  19633. * @param {Object} scope The scope (`this` reference) in which the function will be called.
  19634. */
  19635. createBarrier: function(count, fn, scope) {
  19636. var barrierFn = function() {
  19637. if (!--count) {
  19638. fn.apply(scope, arguments);
  19639. }
  19640. };
  19641. barrierFn.$origFn = fn.$origFn || fn;
  19642. barrierFn.$skipTimerCheck = barrierFn.$origFn.$skipTimerCheck;
  19643. return barrierFn;
  19644. },
  19645. /**
  19646. * Adds behavior to an existing method that is executed before the
  19647. * original behavior of the function. For example:
  19648. *
  19649. * var soup = {
  19650. * contents: [],
  19651. * add: function(ingredient) {
  19652. * this.contents.push(ingredient);
  19653. * }
  19654. * };
  19655. * Ext.Function.interceptBefore(soup, "add", function(ingredient){
  19656. * if (!this.contents.length && ingredient !== "water") {
  19657. * // Always add water to start with
  19658. * this.contents.push("water");
  19659. * }
  19660. * });
  19661. * soup.add("onions");
  19662. * soup.add("salt");
  19663. * soup.contents; // will contain: water, onions, salt
  19664. *
  19665. * @param {Object} object The target object
  19666. * @param {String} methodName Name of the method to override
  19667. * @param {Function} fn Function with the new behavior. It will
  19668. * be called with the same arguments as the original method. The
  19669. * return value of this function will be the return value of the
  19670. * new method.
  19671. * @param {Object} [scope] The scope to execute the interceptor function.
  19672. * Defaults to the object.
  19673. * @return {Function} The new function just created.
  19674. */
  19675. interceptBefore: function(object, methodName, fn, scope) {
  19676. var method = object[methodName] || Ext.emptyFn;
  19677. return (object[methodName] = function() {
  19678. var ret = fn.apply(scope || this, arguments);
  19679. method.apply(this, arguments);
  19680. return ret;
  19681. });
  19682. },
  19683. /**
  19684. * Adds behavior to an existing method that is executed after the
  19685. * original behavior of the function. For example:
  19686. *
  19687. * var soup = {
  19688. * contents: [],
  19689. * add: function(ingredient) {
  19690. * this.contents.push(ingredient);
  19691. * }
  19692. * };
  19693. * Ext.Function.interceptAfter(soup, "add", function(ingredient){
  19694. * // Always add a bit of extra salt
  19695. * this.contents.push("salt");
  19696. * });
  19697. * soup.add("water");
  19698. * soup.add("onions");
  19699. * soup.contents; // will contain: water, salt, onions, salt
  19700. *
  19701. * @param {Object} object The target object
  19702. * @param {String} methodName Name of the method to override
  19703. * @param {Function} fn Function with the new behavior. It will
  19704. * be called with the same arguments as the original method. The
  19705. * return value of this function will be the return value of the
  19706. * new method.
  19707. * @param {Object} [scope] The scope to execute the interceptor function.
  19708. * Defaults to the object.
  19709. * @return {Function} The new function just created.
  19710. */
  19711. interceptAfter: function(object, methodName, fn, scope) {
  19712. var method = object[methodName] || Ext.emptyFn;
  19713. return (object[methodName] = function() {
  19714. method.apply(this, arguments);
  19715. return fn.apply(scope || this, arguments);
  19716. });
  19717. },
  19718. interceptAfterOnce: function(object, methodName, fn, scope) {
  19719. var origMethod = object[methodName],
  19720. newMethod;
  19721. newMethod = function() {
  19722. var ret;
  19723. if (origMethod) {
  19724. origMethod.apply(this, arguments);
  19725. }
  19726. ret = fn.apply(scope || this, arguments);
  19727. object[methodName] = origMethod;
  19728. object = methodName = fn = scope = origMethod = newMethod = null;
  19729. return ret;
  19730. };
  19731. object[methodName] = newMethod;
  19732. return newMethod;
  19733. },
  19734. makeCallback: function(callback, scope) {
  19735. if (!scope[callback]) {
  19736. if (scope.$className) {
  19737. Ext.raise('No method "' + callback + '" on ' + scope.$className);
  19738. }
  19739. Ext.raise('No method "' + callback + '"');
  19740. }
  19741. return function() {
  19742. return scope[callback].apply(scope, arguments);
  19743. };
  19744. },
  19745. /**
  19746. * Returns a wrapper function that caches the return value for previously
  19747. * processed function argument(s).
  19748. *
  19749. * For example:
  19750. *
  19751. * function factorial (value) {
  19752. * var ret = value;
  19753. *
  19754. * while (--value > 1) {
  19755. * ret *= value;
  19756. * }
  19757. *
  19758. * return ret;
  19759. * }
  19760. *
  19761. * Each call to `factorial` will loop and multiply to produce the answer. Using
  19762. * this function we can wrap the above and cache its answers:
  19763. *
  19764. * factorial = Ext.Function.memoize(factorial);
  19765. *
  19766. * The returned function operates in the same manner as before, but results are
  19767. * stored in a cache to avoid calling the wrapped function when given the same
  19768. * arguments.
  19769. *
  19770. * var x = factorial(20); // first time; call real factorial()
  19771. * var y = factorial(20); // second time; return value from first call
  19772. *
  19773. * To support multi-argument methods, you will need to provide a `hashFn`.
  19774. *
  19775. * function permutation (n, k) {
  19776. * return factorial(n) / factorial(n - k);
  19777. * }
  19778. *
  19779. * permutation = Ext.Function.memoize(permutation, null, function(n, k) {
  19780. * n + '-' + k;
  19781. * });
  19782. *
  19783. * In this case, the `memoize` of `factorial` is sufficient optimization, but the
  19784. * example is simply to illustrate how to generate a unique key for an expensive,
  19785. * multi-argument method.
  19786. *
  19787. * **IMPORTANT**: This cache is unbounded so be cautious of memory leaks if the
  19788. * `memoize`d function is kept indefinitely or is given an unbounded set of
  19789. * possible arguments.
  19790. *
  19791. * @param {Function} fn Function to wrap.
  19792. * @param {Object} scope Optional scope in which to execute the wrapped function.
  19793. * @param {Function} hashFn Optional function used to compute a hash key for
  19794. * storing the result, based on the arguments to the original function.
  19795. * @return {Function} The caching wrapper function.
  19796. * @since 6.0.0
  19797. */
  19798. memoize: function(fn, scope, hashFn) {
  19799. var memo = {},
  19800. isFunc = hashFn && Ext.isFunction(hashFn);
  19801. return function(value) {
  19802. var key = isFunc ? hashFn.apply(scope, arguments) : value;
  19803. if (!(key in memo)) {
  19804. memo[key] = fn.apply(scope, arguments);
  19805. }
  19806. return memo[key];
  19807. };
  19808. },
  19809. _stripCommentRe: /(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(\/\/.*)/g,
  19810. toCode: function(fn) {
  19811. var s = fn ? fn.toString() : '';
  19812. s = s.replace(ExtFunction._stripCommentRe, '');
  19813. return s;
  19814. },
  19815. // This is useful for unit testing so we can force handlers which have been deferred
  19816. // to the next animation frame to run immediately
  19817. fireElevatedHandlers: function() {
  19818. // eslint-disable-line comma-style
  19819. fireElevatedHandlers();
  19820. }
  19821. };
  19822. // ExtFunction
  19823. /**
  19824. * @member Ext
  19825. * @method asap
  19826. * Schedules the specified callback function to be executed on the next turn of the
  19827. * event loop. Where available, this method uses the browser's `setImmediate` API. If
  19828. * not available, this method substitutes `setTimeout(0)`. Though not a perfect
  19829. * replacement for `setImmediate` it is sufficient for many use cases.
  19830. *
  19831. * For more details see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate).
  19832. *
  19833. * @param {Function} fn Callback function.
  19834. * @param {Object} [scope] The scope for the callback (`this` pointer).
  19835. * @param {Mixed[]} [parameters] Additional parameters to pass to `fn`.
  19836. * @return {Number} A cancellation id for `{@link Ext#unasap}`.
  19837. */
  19838. Ext.asap = hasImmediate ? function(fn, scope, parameters) {
  19839. var boundFn = fn,
  19840. timerFn, timerId;
  19841. var timer;
  19842. // eslint-disable-line vars-on-top, one-var
  19843. if (scope != null || parameters != null) {
  19844. boundFn = ExtFunction.bind(fn, scope, parameters);
  19845. }
  19846. timerFn = function() {
  19847. Ext.elevate(boundFn, null, null, timer);
  19848. };
  19849. // eslint-disable-line comma-style
  19850. timerId = setImmediate(timerFn);
  19851. timerFn.$origFn = fn.$origFn || fn;
  19852. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  19853. timer = Ext.Timer.created('asap', timerId, {
  19854. type: 'asap',
  19855. fn: fn,
  19856. timerFn: timerFn
  19857. });
  19858. return timerId;
  19859. } : function(fn, scope, parameters) {
  19860. var boundFn = fn,
  19861. timerFn, timerId;
  19862. var timer;
  19863. // eslint-disable-line vars-on-top, one-var
  19864. if (scope != null || parameters != null) {
  19865. boundFn = ExtFunction.bind(fn, scope, parameters);
  19866. }
  19867. timerFn = function() {
  19868. Ext.elevate(boundFn, null, null, timer);
  19869. };
  19870. // eslint-disable-line comma-style
  19871. timerId = setTimeout(timerFn, 0, true);
  19872. timerFn.$origFn = fn.$origFn || fn;
  19873. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  19874. timer = Ext.Timer.created('timeout', timerId, {
  19875. type: 'asap',
  19876. fn: fn,
  19877. timerFn: timerFn
  19878. });
  19879. return timerId;
  19880. };
  19881. /**
  19882. * @member Ext
  19883. * @method unasap
  19884. * Cancels a previously scheduled call to `{@link Ext#asap}`.
  19885. *
  19886. * var timerId = Ext.asap(me.method, me);
  19887. * ...
  19888. *
  19889. * if (nevermind) {
  19890. * Ext.unasap(timerId);
  19891. * }
  19892. *
  19893. * This method always returns `null` to enable simple cleanup:
  19894. *
  19895. * timerId = Ext.unasap(timerId); // safe even if !timerId
  19896. *
  19897. * @param {Number} id The id returned by `{@link Ext#asap}`.
  19898. * @return {Object} Always returns `null`.
  19899. */
  19900. Ext.unasap = hasImmediate ? function(id) {
  19901. if (id) {
  19902. clearImmediate(id);
  19903. Ext.Timer.cancel('asap', id);
  19904. }
  19905. return null;
  19906. } : function(id) {
  19907. return Ext.undefer(id);
  19908. };
  19909. /**
  19910. * @member Ext
  19911. * @method asapCancel
  19912. * Cancels a previously scheduled call to `{@link Ext#asap}`.
  19913. * @param {Number} id The id returned by `{@link Ext#asap}`.
  19914. * @deprecated 6.5.1 Use `Ext.unasap` instead.
  19915. */
  19916. Ext.asapCancel = function(id) {
  19917. return Ext.unasap(id);
  19918. };
  19919. /**
  19920. * @method defer
  19921. * @member Ext
  19922. * @inheritdoc Ext.Function#defer
  19923. */
  19924. Ext.defer = ExtFunction.defer;
  19925. /**
  19926. * @member Ext
  19927. * @method undefer
  19928. * Cancels a previously scheduled call to `{@link Ext#defer}`.
  19929. *
  19930. * var timerId = Ext.defer(me.method, me);
  19931. * ...
  19932. *
  19933. * if (nevermind) {
  19934. * Ext.undefer(timerId);
  19935. * }
  19936. *
  19937. * This method always returns `null` to enable simple cleanup:
  19938. *
  19939. * timerId = Ext.undefer(timerId); // safe even if !timerId
  19940. *
  19941. * @param {Number} id The id returned by `{@link Ext#defer}`.
  19942. */
  19943. Ext.undefer = function(id) {
  19944. if (id) {
  19945. clearTimeout(id);
  19946. Ext.Timer.cancel('timeout', id);
  19947. }
  19948. return null;
  19949. };
  19950. /**
  19951. * @method interval
  19952. * @member Ext
  19953. * @inheritdoc Ext.Function#interval
  19954. */
  19955. Ext.interval = ExtFunction.interval;
  19956. /**
  19957. * @member Ext
  19958. * @method uninterval
  19959. * Cancels a previously scheduled call to `{@link Ext#interval}`.
  19960. *
  19961. * var timerId = Ext.interval(me.method, me);
  19962. * ...
  19963. *
  19964. * if (nevermind) {
  19965. * Ext.uninterval(timerId);
  19966. * }
  19967. *
  19968. * This method always returns `null` to enable simple cleanup:
  19969. *
  19970. * timerId = Ext.uninterval(timerId); // safe even if !timerId
  19971. *
  19972. * @param {Number} id The id returned by `{@link Ext#interval}`.
  19973. */
  19974. Ext.uninterval = function(id) {
  19975. if (id) {
  19976. clearInterval(id);
  19977. Ext.Timer.cancel('interval', id);
  19978. }
  19979. return null;
  19980. };
  19981. /**
  19982. * @method pass
  19983. * @member Ext
  19984. * @inheritdoc Ext.Function#pass
  19985. */
  19986. Ext.pass = ExtFunction.pass;
  19987. /**
  19988. * @method bind
  19989. * @member Ext
  19990. * @inheritdoc Ext.Function#bind
  19991. */
  19992. Ext.bind = ExtFunction.bind;
  19993. Ext.raf = function() {
  19994. return ExtFunction.requestAnimationFrame.apply(ExtFunction, arguments);
  19995. };
  19996. Ext.unraf = function(id) {
  19997. ExtFunction.cancelAnimationFrame(id);
  19998. };
  19999. return ExtFunction;
  20000. })();
  20001. /**
  20002. * @class Ext.Number
  20003. *
  20004. * A collection of useful static methods to deal with numbers
  20005. * @singleton
  20006. */
  20007. Ext.Number = (new function() {
  20008. // jshint ignore:line
  20009. // @define Ext.lang.Number
  20010. // @define Ext.Number
  20011. // @require Ext
  20012. var ExtNumber = this,
  20013. isToFixedBroken = (0.9).toFixed() !== '1',
  20014. math = Math,
  20015. ClipDefault = {
  20016. count: false,
  20017. inclusive: false,
  20018. wrap: true
  20019. };
  20020. // polyfill
  20021. Number.MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -(math.pow(2, 53) - 1);
  20022. Number.MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || math.pow(2, 53) - 1;
  20023. Ext.apply(ExtNumber, {
  20024. MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,
  20025. MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,
  20026. MAX_32BIT_INTEGER: math.pow(2, 31) - 1,
  20027. // No good way to allow "9." w/o allowing "." alone but we use isNaN to reject that
  20028. floatRe: /^[-+]?(?:\d+|\d*\.\d*)(?:[Ee][+-]?\d+)?$/,
  20029. intRe: /^[-+]?\d+(?:[Ee]\+?\d+)?$/,
  20030. Clip: {
  20031. DEFAULT: ClipDefault,
  20032. COUNT: Ext.applyIf({
  20033. count: true
  20034. }, ClipDefault),
  20035. INCLUSIVE: Ext.applyIf({
  20036. inclusive: true
  20037. }, ClipDefault),
  20038. NOWRAP: Ext.applyIf({
  20039. wrap: false
  20040. }, ClipDefault)
  20041. },
  20042. /**
  20043. * Strictly parses the given value and returns the value as a number or `null` if
  20044. * the value is not a number or contains non-numeric pieces.
  20045. * @param {String} value
  20046. * @return {Number}
  20047. * @since 6.5.1
  20048. */
  20049. parseFloat: function(value) {
  20050. if (value === undefined) {
  20051. value = null;
  20052. }
  20053. if (value !== null && typeof value !== 'number') {
  20054. value = String(value);
  20055. value = ExtNumber.floatRe.test(value) ? +value : null;
  20056. if (isNaN(value)) {
  20057. value = null;
  20058. }
  20059. }
  20060. return value;
  20061. },
  20062. /**
  20063. * Strictly parses the given value and returns the value as a number or `null` if
  20064. * the value is not an integer number or contains non-integer pieces.
  20065. * @param {String} value
  20066. * @return {Number}
  20067. * @since 6.5.1
  20068. */
  20069. parseInt: function(value) {
  20070. if (value === undefined) {
  20071. value = null;
  20072. }
  20073. if (typeof value === 'number') {
  20074. value = Math.floor(value);
  20075. } else if (value !== null) {
  20076. value = String(value);
  20077. value = ExtNumber.intRe.test(value) ? +value : null;
  20078. }
  20079. return value;
  20080. },
  20081. binarySearch: function(array, value, begin, end) {
  20082. var middle, midVal;
  20083. if (begin === undefined) {
  20084. begin = 0;
  20085. }
  20086. if (end === undefined) {
  20087. end = array.length;
  20088. }
  20089. --end;
  20090. while (begin <= end) {
  20091. middle = (begin + end) >>> 1;
  20092. // unsigned right shift = Math.floor(x/2)
  20093. midVal = array[middle];
  20094. if (value === midVal) {
  20095. return middle;
  20096. }
  20097. if (midVal < value) {
  20098. begin = middle + 1;
  20099. } else {
  20100. end = middle - 1;
  20101. }
  20102. }
  20103. return begin;
  20104. },
  20105. bisectTuples: function(array, value, index, begin, end) {
  20106. var middle, midVal;
  20107. if (begin === undefined) {
  20108. begin = 0;
  20109. }
  20110. if (end === undefined) {
  20111. end = array.length;
  20112. }
  20113. --end;
  20114. while (begin <= end) {
  20115. middle = (begin + end) >>> 1;
  20116. // unsigned right shift = Math.floor(x/2)
  20117. midVal = array[middle][index];
  20118. if (value === midVal) {
  20119. return middle;
  20120. }
  20121. if (midVal < value) {
  20122. begin = middle + 1;
  20123. } else {
  20124. end = middle - 1;
  20125. }
  20126. }
  20127. return begin;
  20128. },
  20129. /**
  20130. * Coerces a given index into a valid index given a `length`.
  20131. *
  20132. * Negative indexes are interpreted starting at the end of the collection. That is,
  20133. * a value of -1 indicates the last item, or equivalent to `length - 1`.
  20134. *
  20135. * When handling methods that take "begin" and "end" arguments like most array or
  20136. * string methods, this method can be used like so:
  20137. *
  20138. * function foo (array, begin, end) {
  20139. * var range = Ext.Number.clipIndices(array.length, [begin, end]);
  20140. *
  20141. * begin = range[0];
  20142. * end = range[1];
  20143. *
  20144. * // 0 <= begin <= end <= array.length
  20145. *
  20146. * var length = end - begin;
  20147. * }
  20148. *
  20149. * For example:
  20150. *
  20151. * +---+---+---+---+---+---+---+---+
  20152. * | | | | | | | | | length = 8
  20153. * +---+---+---+---+---+---+---+---+
  20154. * 0 1 2 3 4 5 6 7
  20155. * -8 -7 -6 -5 -4 -3 -2 -1
  20156. *
  20157. * console.log(Ext.Number.clipIndices(8, [3, 10])); // logs "[3, 8]"
  20158. * console.log(Ext.Number.clipIndices(8, [-5])); // logs "[3, 8]"
  20159. * console.log(Ext.Number.clipIndices(8, []));
  20160. * console.log(Ext.Number.clipIndices(8, []));
  20161. *
  20162. * @param {Number} length
  20163. * @param {Number[]} indices
  20164. * @param {Object} [options] An object with different option flags.
  20165. * @param {Boolean} [options.count=false] The second number in `indices` is the
  20166. * count not and an index.
  20167. * @param {Boolean} [options.inclusive=false] The second number in `indices` is
  20168. * "inclusive" meaning that the item should be considered in the range. Normally,
  20169. * the second number is considered the first item outside the range or as an
  20170. * "exclusive" bound.
  20171. * @param {Boolean} [options.wrap=true] Wraps negative numbers backwards from the
  20172. * end of the array. Passing `false` simply clips negative index values at 0.
  20173. * @return {Number[]} The normalized `[begin, end]` array where `end` is now
  20174. * exclusive such that `length = end - begin`. Both values are between 0 and the
  20175. * given `length` and `end` will not be less-than `begin`.
  20176. */
  20177. clipIndices: function(length, indices, options) {
  20178. var defaultValue = 0,
  20179. // default value for "begin"
  20180. wrap, begin, end, i;
  20181. options = options || ClipDefault;
  20182. wrap = options.wrap;
  20183. indices = indices || [];
  20184. for (i = 0; i < 2; ++i) {
  20185. // names are off on first pass but used this way so things make sense
  20186. // following the loop..
  20187. begin = end;
  20188. // pick up and keep the result from the first loop
  20189. end = indices[i];
  20190. if (end == null) {
  20191. end = defaultValue;
  20192. } else if (i && options.count) {
  20193. end += begin;
  20194. // this is the length not "end" so convert to "end"
  20195. end = (end > length) ? length : end;
  20196. } else {
  20197. if (wrap) {
  20198. end = (end < 0) ? (length + end) : end;
  20199. }
  20200. if (i && options.inclusive) {
  20201. ++end;
  20202. }
  20203. end = (end < 0) ? 0 : ((end > length) ? length : end);
  20204. }
  20205. defaultValue = length;
  20206. }
  20207. // default value for "end"
  20208. // after loop:
  20209. // 0 <= begin <= length (calculated from indices[0])
  20210. // 0 <= end <= length (calculated from indices[1])
  20211. indices[0] = begin;
  20212. indices[1] = (end < begin) ? begin : end;
  20213. return indices;
  20214. },
  20215. /**
  20216. * Checks whether or not the passed number is within a desired range. If the number is
  20217. * already within the range it is returned, otherwise the min or max value is returned
  20218. * depending on which side of the range is exceeded. Note that this method returns the
  20219. * constrained value but does not change the current number.
  20220. * @param {Number} number The number to check
  20221. * @param {Number} min The minimum number in the range
  20222. * @param {Number} max The maximum number in the range
  20223. * @return {Number} The constrained value if outside the range, otherwise the current value
  20224. */
  20225. constrain: function(number, min, max) {
  20226. var x = parseFloat(number);
  20227. // (x < Nan) || (x < undefined) == false
  20228. // same for (x > NaN) || (x > undefined)
  20229. // sadly this is not true of null - (1 > null)
  20230. if (min === null) {
  20231. min = number;
  20232. }
  20233. if (max === null) {
  20234. max = number;
  20235. }
  20236. // Watch out for NaN in Chrome 18
  20237. // V8bug: http://code.google.com/p/v8/issues/detail?id=2056
  20238. // Operators are faster than Math.min/max. See http://jsperf.com/number-constrain
  20239. return (x < min) ? min : ((x > max) ? max : x);
  20240. },
  20241. /**
  20242. * Snaps the passed number between stopping points based upon a passed increment value.
  20243. *
  20244. * The difference between this and {@link #snapInRange} is that {@link #snapInRange} uses
  20245. * the minValue when calculating snap points:
  20246. *
  20247. * // Returns 56 - snap points are zero based
  20248. * r = Ext.Number.snap(56, 2, 55, 65);
  20249. *
  20250. * // Returns 57 - snap points are based from minValue
  20251. * r = Ext.Number.snapInRange(56, 2, 55, 65);
  20252. *
  20253. * @param {Number} value The unsnapped value.
  20254. * @param {Number} increment The increment by which the value must move.
  20255. * @param {Number} minValue The minimum value to which the returned value must be
  20256. * constrained. Overrides the increment.
  20257. * @param {Number} maxValue The maximum value to which the returned value must be
  20258. * constrained. Overrides the increment.
  20259. * @return {Number} The value of the nearest snap target.
  20260. */
  20261. snap: function(value, increment, minValue, maxValue) {
  20262. var m;
  20263. // If no value passed, or minValue was passed and value is less than minValue
  20264. // (anything < undefined is false)
  20265. // Then use the minValue (or zero if the value was undefined)
  20266. if (value === undefined || value < minValue) {
  20267. return minValue || 0;
  20268. }
  20269. if (increment) {
  20270. m = value % increment;
  20271. if (m !== 0) {
  20272. value -= m;
  20273. if (m * 2 >= increment) {
  20274. value += increment;
  20275. } else if (m * 2 < -increment) {
  20276. value -= increment;
  20277. }
  20278. }
  20279. }
  20280. return ExtNumber.constrain(value, minValue, maxValue);
  20281. },
  20282. /**
  20283. * Snaps the passed number between stopping points based upon a passed increment value.
  20284. *
  20285. * The difference between this and {@link #snap} is that {@link #snap} does not use
  20286. * the minValue when calculating snap points:
  20287. *
  20288. * // Returns 56 - snap points are zero based
  20289. * r = Ext.Number.snap(56, 2, 55, 65);
  20290. *
  20291. * // Returns 57 - snap points are based from minValue
  20292. * r = Ext.Number.snapInRange(56, 2, 55, 65);
  20293. *
  20294. * @param {Number} value The unsnapped value.
  20295. * @param {Number} increment The increment by which the value must move.
  20296. * @param {Number} [minValue=0] The minimum value to which the returned value must be
  20297. * constrained.
  20298. * @param {Number} [maxValue=Infinity] The maximum value to which the returned value
  20299. * must be constrained.
  20300. * @return {Number} The value of the nearest snap target.
  20301. */
  20302. snapInRange: function(value, increment, minValue, maxValue) {
  20303. var tween;
  20304. // default minValue to zero
  20305. minValue = (minValue || 0);
  20306. // If value is undefined, or less than minValue, use minValue
  20307. if (value === undefined || value < minValue) {
  20308. return minValue;
  20309. }
  20310. // Calculate how many snap points from the minValue the passed value is.
  20311. if (increment && (tween = ((value - minValue) % increment))) {
  20312. value -= tween;
  20313. tween *= 2;
  20314. if (tween >= increment) {
  20315. value += increment;
  20316. }
  20317. }
  20318. // If constraining within a maximum, ensure the maximum is on a snap point
  20319. if (maxValue !== undefined) {
  20320. if (value > (maxValue = ExtNumber.snapInRange(maxValue, increment, minValue))) {
  20321. value = maxValue;
  20322. }
  20323. }
  20324. return value;
  20325. },
  20326. /**
  20327. * Round a number to the nearest interval.
  20328. * @param {Number} value The value to round.
  20329. * @param {Number} interval The interval to round to.
  20330. * @return {Number} The rounded value.
  20331. *
  20332. * @since 6.2.0
  20333. */
  20334. roundToNearest: function(value, interval) {
  20335. interval = interval || 1;
  20336. return interval * math.round(value / interval);
  20337. },
  20338. /**
  20339. * Rounds a number to the specified precision.
  20340. * @param value
  20341. * @param precision
  20342. * @return {number}
  20343. */
  20344. roundToPrecision: function(value, precision) {
  20345. var factor = math.pow(10, precision || 1);
  20346. return math.round(value * factor) / factor;
  20347. },
  20348. /**
  20349. * Truncates a number to the specified precision,
  20350. * without rounding.
  20351. * @param value
  20352. * @param precision
  20353. * @return {number}
  20354. * @since 6.5.1
  20355. */
  20356. truncateToPrecision: function(value, precision) {
  20357. var factor = math.pow(10, precision || 1);
  20358. return parseInt(value * factor, 10) / factor;
  20359. },
  20360. /**
  20361. * Returns the sign of the given number. See also MDN for Math.sign documentation
  20362. * for the standard method this method emulates.
  20363. * @param {Number} x The number.
  20364. * @return {Number} The sign of the number `x`, indicating whether the number is
  20365. * positive (1), negative (-1) or zero (0).
  20366. * @method sign
  20367. */
  20368. sign: math.sign || function(x) {
  20369. x = +x;
  20370. // force to a Number
  20371. if (x === 0 || isNaN(x)) {
  20372. return x;
  20373. }
  20374. return (x > 0) ? 1 : -1;
  20375. },
  20376. /**
  20377. * Returns the base 10 logarithm of a number.
  20378. * This will use Math.log10, if available (ES6).
  20379. * @param {Number} x The number.
  20380. * @return {Number} Base 10 logarithm of the number 'x'.
  20381. * @method log10
  20382. */
  20383. log10: math.log10 || function(x) {
  20384. return math.log(x) * math.LOG10E;
  20385. },
  20386. /**
  20387. * Determines if two numbers `n1` and `n2` are equal within a given
  20388. * margin of precision `epsilon`.
  20389. * @param {Number} n1 First number.
  20390. * @param {Number} n2 Second number.
  20391. * @param {Number} epsilon Margin of precision.
  20392. * @return {Boolean} `true`, if numbers are equal. `false` otherwise.
  20393. */
  20394. isEqual: function(n1, n2, epsilon) {
  20395. /* eslint-disable-next-line max-len */
  20396. if (!(typeof n1 === 'number' && typeof n2 === 'number' && typeof epsilon === 'number')) {
  20397. Ext.raise("All parameters should be valid numbers.");
  20398. }
  20399. return math.abs(n1 - n2) < epsilon;
  20400. },
  20401. /**
  20402. * Determines if the value passed is a number and also finite.
  20403. * This a Polyfill version of Number.isFinite(),differently than
  20404. * the isFinite() function, this method doesn't convert the parameter to a number.
  20405. * @param {Number} value Number to be tested.
  20406. * @return {Boolean} `true`, if the parameter is a number and finite, `false` otherwise.
  20407. * @since 6.2
  20408. */
  20409. isFinite: Number.isFinite || function(value) {
  20410. return typeof value === 'number' && isFinite(value);
  20411. },
  20412. isInteger: Number.isInteger || function(value) {
  20413. // Add zero get a valid result in a special case where the value is a number string.
  20414. // E.g. '10' + 0 is '100'.
  20415. return ~~(value + 0) === value;
  20416. },
  20417. /**
  20418. * @method
  20419. * Formats a number using fixed-point notation
  20420. * @param {Number} value The number to format
  20421. * @param {Number} precision The number of digits to show after the decimal point
  20422. */
  20423. toFixed: isToFixedBroken ? function(value, precision) {
  20424. var pow;
  20425. precision = precision || 0;
  20426. pow = math.pow(10, precision);
  20427. return (math.round(value * pow) / pow).toFixed(precision);
  20428. } : function(value, precision) {
  20429. return value.toFixed(precision);
  20430. },
  20431. /**
  20432. * Validate that a value is numeric and convert it to a number if necessary.
  20433. * Returns the specified default value if it is not.
  20434. *
  20435. * Ext.Number.from('1.23', 1); // returns 1.23
  20436. * Ext.Number.from('abc', 1); // returns 1
  20437. *
  20438. * @param {Object} value
  20439. * @param {Number} defaultValue The value to return if the original value is non-numeric
  20440. * @return {Number} value, if numeric, defaultValue otherwise
  20441. */
  20442. from: function(value, defaultValue) {
  20443. if (isFinite(value)) {
  20444. value = parseFloat(value);
  20445. }
  20446. return !isNaN(value) ? value : defaultValue;
  20447. },
  20448. /**
  20449. * Returns a random integer between the specified range (inclusive)
  20450. * @param {Number} from Lowest value to return.
  20451. * @param {Number} to Highest value to return.
  20452. * @return {Number} A random integer within the specified range.
  20453. */
  20454. randomInt: function(from, to) {
  20455. return math.floor(math.random() * (to - from + 1) + from);
  20456. },
  20457. /**
  20458. * Corrects floating point numbers that overflow to a non-precise
  20459. * value because of their floating nature, for example `0.1 + 0.2`
  20460. * @param {Number} n The number
  20461. * @return {Number} The correctly rounded number
  20462. */
  20463. correctFloat: function(n) {
  20464. // This is to correct the type of errors where 2 floats end with
  20465. // a long string of decimals, eg 0.1 + 0.2. When they overflow in this
  20466. // manner, they usually go to 15-16 decimals, so we cut it off at 14.
  20467. return parseFloat(n.toPrecision(14));
  20468. }
  20469. });
  20470. /**
  20471. * @deprecated 4.0.0 Please use {@link Ext.Number#from} instead.
  20472. * @member Ext
  20473. * @method num
  20474. * @inheritdoc Ext.Number#from
  20475. */
  20476. Ext.num = function() {
  20477. return ExtNumber.from.apply(this, arguments);
  20478. };
  20479. }());
  20480. /**
  20481. * @class Ext.Object
  20482. *
  20483. * A collection of useful static methods to deal with objects.
  20484. *
  20485. * @singleton
  20486. */
  20487. (function() {
  20488. // The "constructor" for chain:
  20489. var TemplateClass = function() {},
  20490. queryRe = /^\?/,
  20491. keyRe = /(\[):?([^\]]*)\]/g,
  20492. nameRe = /^([^\[]+)/,
  20493. // eslint-disable-line no-useless-escape
  20494. plusRe = /\+/g,
  20495. ExtObject;
  20496. // @define Ext.lang.Object
  20497. // @define Ext.Object
  20498. // @require Ext
  20499. // @require Ext.lang.Date
  20500. ExtObject = Ext.Object = {
  20501. /**
  20502. * @method
  20503. * Returns a new object with the given object as the prototype chain. This method is
  20504. * designed to mimic the ECMA standard `Object.create` method and is assigned to that
  20505. * function when it is available.
  20506. *
  20507. * **NOTE** This method does not support the property definitions capability of the
  20508. * `Object.create` method. Only the first argument is supported.
  20509. *
  20510. * @param {Object} object The prototype chain for the new object.
  20511. */
  20512. chain: Object.create || function(object) {
  20513. var result;
  20514. TemplateClass.prototype = object;
  20515. result = new TemplateClass();
  20516. TemplateClass.prototype = null;
  20517. return result;
  20518. },
  20519. /**
  20520. * This method removes all keys from the given object.
  20521. * @param {Object} object The object from which to remove all keys.
  20522. * @return {Object} The given object.
  20523. */
  20524. clear: function(object) {
  20525. var key;
  20526. // Safe to delete during iteration
  20527. for (key in object) {
  20528. delete object[key];
  20529. }
  20530. return object;
  20531. },
  20532. /**
  20533. * Freezes the given object making it immutable. This operation is by default shallow
  20534. * and does not effect objects referenced by the given object.
  20535. *
  20536. * @method
  20537. * @param {Object} obj The object to freeze.
  20538. * @param {Boolean} [deep=false] Pass `true` to freeze sub-objects recursively.
  20539. * @return {Object} The given object `obj`.
  20540. */
  20541. freeze: Object.freeze ? function(obj, deep) {
  20542. var name;
  20543. if (obj && typeof obj === 'object' && !Object.isFrozen(obj)) {
  20544. Object.freeze(obj);
  20545. if (deep) {
  20546. for (name in obj) {
  20547. ExtObject.freeze(obj[name], deep);
  20548. }
  20549. }
  20550. }
  20551. return obj;
  20552. } : Ext.identityFn,
  20553. /**
  20554. * Converts a `name` - `value` pair to an array of objects with support for nested structures.
  20555. * Useful to construct query strings. For example:
  20556. *
  20557. * var objects = Ext.Object.toQueryObjects('hobbies', ['reading', 'cooking', 'swimming']);
  20558. *
  20559. * // objects then equals:
  20560. * [
  20561. * { name: 'hobbies', value: 'reading' },
  20562. * { name: 'hobbies', value: 'cooking' },
  20563. * { name: 'hobbies', value: 'swimming' },
  20564. * ];
  20565. *
  20566. * var objects = Ext.Object.toQueryObjects('dateOfBirth', {
  20567. * day: 3,
  20568. * month: 8,
  20569. * year: 1987,
  20570. * extra: {
  20571. * hour: 4
  20572. * minute: 30
  20573. * }
  20574. * }, true); // Recursive
  20575. *
  20576. * // objects then equals:
  20577. * [
  20578. * { name: 'dateOfBirth[day]', value: 3 },
  20579. * { name: 'dateOfBirth[month]', value: 8 },
  20580. * { name: 'dateOfBirth[year]', value: 1987 },
  20581. * { name: 'dateOfBirth[extra][hour]', value: 4 },
  20582. * { name: 'dateOfBirth[extra][minute]', value: 30 },
  20583. * ];
  20584. *
  20585. * @param {String} name
  20586. * @param {Object/Array} value
  20587. * @param {Boolean} [recursive=false] True to traverse object recursively
  20588. * @return {Object[]}
  20589. */
  20590. toQueryObjects: function(name, value, recursive) {
  20591. var self = ExtObject.toQueryObjects,
  20592. objects = [],
  20593. i, ln;
  20594. if (Ext.isArray(value)) {
  20595. for (i = 0 , ln = value.length; i < ln; i++) {
  20596. if (recursive) {
  20597. objects = objects.concat(self(name + '[' + i + ']', value[i], true));
  20598. } else {
  20599. objects.push({
  20600. name: name,
  20601. value: value[i]
  20602. });
  20603. }
  20604. }
  20605. } else if (Ext.isObject(value)) {
  20606. for (i in value) {
  20607. if (value.hasOwnProperty(i)) {
  20608. if (recursive) {
  20609. objects = objects.concat(self(name + '[' + i + ']', value[i], true));
  20610. } else {
  20611. objects.push({
  20612. name: name,
  20613. value: value[i]
  20614. });
  20615. }
  20616. }
  20617. }
  20618. } else {
  20619. objects.push({
  20620. name: name,
  20621. value: value
  20622. });
  20623. }
  20624. return objects;
  20625. },
  20626. /* eslint-disable max-len */
  20627. /**
  20628. * Takes an object and converts it to an encoded query string.
  20629. *
  20630. * Non-recursive:
  20631. *
  20632. * Ext.Object.toQueryString({foo: 1, bar: 2}); // returns "foo=1&bar=2"
  20633. * Ext.Object.toQueryString({foo: null, bar: 2}); // returns "foo=&bar=2"
  20634. * Ext.Object.toQueryString({'some price': '$300'}); // returns "some%20price=%24300"
  20635. * Ext.Object.toQueryString({date: new Date(2011, 0, 1)}); // returns "date=%222011-01-01T00%3A00%3A00%22"
  20636. * Ext.Object.toQueryString({colors: ['red', 'green', 'blue']}); // returns "colors=red&colors=green&colors=blue"
  20637. *
  20638. * Recursive:
  20639. *
  20640. * Ext.Object.toQueryString({
  20641. * username: 'Jacky',
  20642. * dateOfBirth: {
  20643. * day: 1,
  20644. * month: 2,
  20645. * year: 1911
  20646. * },
  20647. * hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]
  20648. * }, true); // returns the following string (broken down and url-decoded for ease of reading purpose):
  20649. * // username=Jacky
  20650. * // &dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911
  20651. * // &hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&hobbies[3][0]=nested&hobbies[3][1]=stuff
  20652. *
  20653. * @param {Object} object The object to encode
  20654. * @param {Boolean} [recursive=false] Whether or not to interpret the object in recursive format.
  20655. * (PHP / Ruby on Rails servers and similar).
  20656. * @return {String} queryString
  20657. */
  20658. toQueryString: function(object, recursive) {
  20659. var paramObjects = [],
  20660. params = [],
  20661. i, j, ln, paramObject, value;
  20662. for (i in object) {
  20663. if (object.hasOwnProperty(i)) {
  20664. paramObjects = paramObjects.concat(ExtObject.toQueryObjects(i, object[i], recursive));
  20665. }
  20666. }
  20667. for (j = 0 , ln = paramObjects.length; j < ln; j++) {
  20668. paramObject = paramObjects[j];
  20669. value = paramObject.value;
  20670. if (Ext.isEmpty(value)) {
  20671. value = '';
  20672. } else if (Ext.isDate(value)) {
  20673. value = Ext.Date.toString(value);
  20674. }
  20675. params.push(encodeURIComponent(paramObject.name) + '=' + encodeURIComponent(String(value)));
  20676. }
  20677. return params.join('&');
  20678. },
  20679. /**
  20680. * Converts a query string back into an object.
  20681. *
  20682. * Non-recursive:
  20683. *
  20684. * Ext.Object.fromQueryString("foo=1&bar=2"); // returns {foo: '1', bar: '2'}
  20685. * Ext.Object.fromQueryString("foo=&bar=2"); // returns {foo: '', bar: '2'}
  20686. * Ext.Object.fromQueryString("some%20price=%24300"); // returns {'some price': '$300'}
  20687. * Ext.Object.fromQueryString("colors=red&colors=green&colors=blue"); // returns {colors: ['red', 'green', 'blue']}
  20688. *
  20689. * Recursive:
  20690. *
  20691. * Ext.Object.fromQueryString(
  20692. * "username=Jacky&"+
  20693. * "dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911&"+
  20694. * "hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&"+
  20695. * "hobbies[3][0]=nested&hobbies[3][1]=stuff", true);
  20696. *
  20697. * // returns
  20698. * {
  20699. * username: 'Jacky',
  20700. * dateOfBirth: {
  20701. * day: '1',
  20702. * month: '2',
  20703. * year: '1911'
  20704. * },
  20705. * hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]
  20706. * }
  20707. *
  20708. * @param {String} queryString The query string to decode
  20709. * @param {Boolean} [recursive=false] Whether or not to recursively decode the string. This format is supported by
  20710. * PHP / Ruby on Rails servers and similar.
  20711. * @return {Object}
  20712. */
  20713. fromQueryString: function(queryString, recursive) {
  20714. var parts = queryString.replace(queryRe, '').split('&'),
  20715. object = {},
  20716. temp, components, name, value, i, ln, part, j, subLn, matchedKeys, matchedName, keys, key, nextKey;
  20717. for (i = 0 , ln = parts.length; i < ln; i++) {
  20718. part = parts[i];
  20719. if (part.length > 0) {
  20720. components = part.split('=');
  20721. name = components[0];
  20722. name = name.replace(plusRe, '%20');
  20723. name = decodeURIComponent(name);
  20724. value = components[1];
  20725. if (value !== undefined) {
  20726. value = value.replace(plusRe, '%20');
  20727. value = decodeURIComponent(value);
  20728. } else {
  20729. value = '';
  20730. }
  20731. if (!recursive) {
  20732. if (object.hasOwnProperty(name)) {
  20733. if (!Ext.isArray(object[name])) {
  20734. object[name] = [
  20735. object[name]
  20736. ];
  20737. }
  20738. object[name].push(value);
  20739. } else {
  20740. object[name] = value;
  20741. }
  20742. } else {
  20743. matchedKeys = name.match(keyRe);
  20744. matchedName = name.match(nameRe);
  20745. if (!matchedName) {
  20746. throw new Error('[Ext.Object.fromQueryString] Malformed query string given, failed parsing name from "' + part + '"');
  20747. }
  20748. name = matchedName[0];
  20749. keys = [];
  20750. if (matchedKeys === null) {
  20751. object[name] = value;
  20752. continue;
  20753. }
  20754. for (j = 0 , subLn = matchedKeys.length; j < subLn; j++) {
  20755. key = matchedKeys[j];
  20756. key = (key.length === 2) ? '' : key.substring(1, key.length - 1);
  20757. keys.push(key);
  20758. }
  20759. keys.unshift(name);
  20760. temp = object;
  20761. for (j = 0 , subLn = keys.length; j < subLn; j++) {
  20762. key = keys[j];
  20763. if (j === subLn - 1) {
  20764. if (Ext.isArray(temp) && key === '') {
  20765. temp.push(value);
  20766. } else {
  20767. temp[key] = value;
  20768. }
  20769. } else {
  20770. if (temp[key] === undefined || typeof temp[key] === 'string') {
  20771. nextKey = keys[j + 1];
  20772. temp[key] = (Ext.isNumeric(nextKey) || nextKey === '') ? [] : {};
  20773. }
  20774. temp = temp[key];
  20775. }
  20776. }
  20777. }
  20778. }
  20779. }
  20780. return object;
  20781. },
  20782. /* eslint-enable max-len */
  20783. /**
  20784. * Iterates through an object and invokes the given callback function for each iteration.
  20785. * The iteration can be stopped by returning `false` in the callback function. For example:
  20786. *
  20787. * var person = {
  20788. * name: 'Jacky'
  20789. * hairColor: 'black'
  20790. * loves: ['food', 'sleeping', 'wife']
  20791. * };
  20792. *
  20793. * Ext.Object.each(person, function(key, value, myself) {
  20794. * console.log(key + ":" + value);
  20795. *
  20796. * if (key === 'hairColor') {
  20797. * return false; // stop the iteration
  20798. * }
  20799. * });
  20800. *
  20801. * @param {Object} object The object to iterate
  20802. * @param {Function} fn The callback function.
  20803. * @param {String} fn.key
  20804. * @param {Object} fn.value
  20805. * @param {Object} fn.object The object itself
  20806. * @param {Object} [scope] The execution scope (`this`) of the callback function
  20807. */
  20808. each: function(object, fn, scope) {
  20809. var enumerables = Ext.enumerables,
  20810. i, property;
  20811. if (object) {
  20812. scope = scope || object;
  20813. for (property in object) {
  20814. if (object.hasOwnProperty(property)) {
  20815. if (fn.call(scope, property, object[property], object) === false) {
  20816. return;
  20817. }
  20818. }
  20819. }
  20820. if (enumerables) {
  20821. for (i = enumerables.length; i--; ) {
  20822. if (object.hasOwnProperty(property = enumerables[i])) {
  20823. if (fn.call(scope, property, object[property], object) === false) {
  20824. return;
  20825. }
  20826. }
  20827. }
  20828. }
  20829. }
  20830. },
  20831. /**
  20832. * Iterates through an object and invokes the given callback function for each iteration.
  20833. * The iteration can be stopped by returning `false` in the callback function. For example:
  20834. *
  20835. * var items = {
  20836. * 1: 'Hello',
  20837. * 2: 'World'
  20838. * };
  20839. *
  20840. * Ext.Object.eachValue(items, function(value) {
  20841. * console.log("Value: " + value);
  20842. * });
  20843. *
  20844. * This will log 'Hello' and 'World' in no particular order. This method is useful
  20845. * in cases where the keys are not important to the processing, just the values.
  20846. *
  20847. * @param {Object} object The object to iterate
  20848. * @param {Function} fn The callback function.
  20849. * @param {Object} fn.value The value of
  20850. * @param {Object} [scope] The execution scope (`this`) of the callback function
  20851. */
  20852. eachValue: function(object, fn, scope) {
  20853. var enumerables = Ext.enumerables,
  20854. i, property;
  20855. scope = scope || object;
  20856. for (property in object) {
  20857. if (object.hasOwnProperty(property)) {
  20858. if (fn.call(scope, object[property]) === false) {
  20859. return;
  20860. }
  20861. }
  20862. }
  20863. if (enumerables) {
  20864. for (i = enumerables.length; i--; ) {
  20865. if (object.hasOwnProperty(property = enumerables[i])) {
  20866. if (fn.call(scope, object[property]) === false) {
  20867. return;
  20868. }
  20869. }
  20870. }
  20871. }
  20872. },
  20873. /**
  20874. * Merges any number of objects recursively without referencing them or their children.
  20875. * Note: It will reference arrays if they are only present in one of the objects being merged.
  20876. *
  20877. * var extjs = {
  20878. * companyName: 'Ext JS',
  20879. * products: ['Ext JS', 'Ext GWT', 'Ext Designer'],
  20880. * isSuperCool: true,
  20881. * office: {
  20882. * size: 2000,
  20883. * location: 'Palo Alto',
  20884. * isFun: true
  20885. * }
  20886. * };
  20887. *
  20888. * var newStuff = {
  20889. * companyName: 'Sencha Inc.',
  20890. * products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],
  20891. * office: {
  20892. * size: 40000,
  20893. * location: 'Redwood City'
  20894. * }
  20895. * };
  20896. *
  20897. * var sencha = Ext.Object.merge(extjs, newStuff);
  20898. *
  20899. * // extjs and sencha then equals to
  20900. * {
  20901. * companyName: 'Sencha Inc.',
  20902. * products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],
  20903. * isSuperCool: true,
  20904. * office: {
  20905. * size: 40000,
  20906. * location: 'Redwood City',
  20907. * isFun: true
  20908. * }
  20909. * }
  20910. *
  20911. * @param {Object} destination The object into which all subsequent objects are merged.
  20912. * @param {Object...} object Any number of objects to merge into the destination.
  20913. * @return {Object} merged The destination object with all passed objects merged in.
  20914. */
  20915. merge: function(destination) {
  20916. var i = 1,
  20917. args = arguments,
  20918. ln = args.length,
  20919. mergeFn = ExtObject.merge,
  20920. cloneFn = Ext.clone,
  20921. object, key, value, sourceKey;
  20922. for (; i < ln; i++) {
  20923. object = args[i];
  20924. for (key in object) {
  20925. value = object[key];
  20926. if (value && value.constructor === Object) {
  20927. sourceKey = destination[key];
  20928. if (sourceKey && sourceKey.constructor === Object) {
  20929. mergeFn(sourceKey, value);
  20930. } else {
  20931. destination[key] = cloneFn(value);
  20932. }
  20933. } else {
  20934. destination[key] = value;
  20935. }
  20936. }
  20937. }
  20938. return destination;
  20939. },
  20940. /**
  20941. * @private
  20942. * @param destination
  20943. */
  20944. mergeIf: function(destination) {
  20945. var i = 1,
  20946. ln = arguments.length,
  20947. cloneFn = Ext.clone,
  20948. object, key, value;
  20949. for (; i < ln; i++) {
  20950. object = arguments[i];
  20951. for (key in object) {
  20952. if (!(key in destination)) {
  20953. value = object[key];
  20954. if (value && value.constructor === Object) {
  20955. destination[key] = cloneFn(value);
  20956. } else {
  20957. destination[key] = value;
  20958. }
  20959. }
  20960. }
  20961. }
  20962. return destination;
  20963. },
  20964. /**
  20965. * Returns all keys of the given object as an array.
  20966. *
  20967. * @param {Object} object
  20968. * @return {String[]} An array of keys from the object or any of its prototypes.
  20969. * @method
  20970. */
  20971. getAllKeys: function(object) {
  20972. var keys = [],
  20973. property;
  20974. for (property in object) {
  20975. keys.push(property);
  20976. }
  20977. return keys;
  20978. },
  20979. /**
  20980. * Returns the first matching key corresponding to the given value.
  20981. * If no matching value is found, null is returned.
  20982. *
  20983. * var person = {
  20984. * name: 'Jacky',
  20985. * loves: 'food'
  20986. * };
  20987. *
  20988. * alert(Ext.Object.getKey(person, 'food')); // alerts 'loves'
  20989. *
  20990. * @param {Object} object
  20991. * @param {Object} value The value to find
  20992. */
  20993. getKey: function(object, value) {
  20994. var property;
  20995. for (property in object) {
  20996. if (object.hasOwnProperty(property) && object[property] === value) {
  20997. return property;
  20998. }
  20999. }
  21000. return null;
  21001. },
  21002. /**
  21003. * Gets all values of the given object as an array.
  21004. *
  21005. * var values = Ext.Object.getValues({
  21006. * name: 'Jacky',
  21007. * loves: 'food'
  21008. * }); // ['Jacky', 'food']
  21009. *
  21010. * @param {Object} object
  21011. * @return {Array} An array of values from the object
  21012. */
  21013. getValues: function(object) {
  21014. var values = [],
  21015. property;
  21016. for (property in object) {
  21017. if (object.hasOwnProperty(property)) {
  21018. values.push(object[property]);
  21019. }
  21020. }
  21021. return values;
  21022. },
  21023. /**
  21024. * Returns the `hasOwnProperty` keys of the given object as an array.
  21025. *
  21026. * var values = Ext.Object.getKeys({
  21027. * name: 'Jacky',
  21028. * loves: 'food'
  21029. * }); // ['name', 'loves']
  21030. *
  21031. * @param {Object} object
  21032. * @return {String[]} An array of keys from the object
  21033. * @method
  21034. */
  21035. getKeys: (typeof Object.keys === 'function') ? function(object) {
  21036. if (!object) {
  21037. return [];
  21038. }
  21039. return Object.keys(object);
  21040. } : function(object) {
  21041. var keys = [],
  21042. property;
  21043. for (property in object) {
  21044. if (object.hasOwnProperty(property)) {
  21045. keys.push(property);
  21046. }
  21047. }
  21048. return keys;
  21049. },
  21050. /**
  21051. * Gets the total number of this object's own properties
  21052. *
  21053. * var size = Ext.Object.getSize({
  21054. * name: 'Jacky',
  21055. * loves: 'food'
  21056. * }); // size equals 2
  21057. *
  21058. * @param {Object} object
  21059. * @return {Number} size
  21060. */
  21061. getSize: function(object) {
  21062. var size = 0,
  21063. property;
  21064. for (property in object) {
  21065. if (object.hasOwnProperty(property)) {
  21066. size++;
  21067. }
  21068. }
  21069. return size;
  21070. },
  21071. /**
  21072. * Checks if there are any properties on this object.
  21073. * @param {Object} object
  21074. * @return {Boolean} `true` if there no properties on the object.
  21075. */
  21076. isEmpty: function(object) {
  21077. var key;
  21078. for (key in object) {
  21079. if (object.hasOwnProperty(key)) {
  21080. return false;
  21081. }
  21082. }
  21083. return true;
  21084. },
  21085. /**
  21086. * @method
  21087. * Shallow compares the contents of 2 objects using strict equality. Objects are
  21088. * considered equal if they both have the same set of properties and the
  21089. * value for those properties equals the other in the corresponding object.
  21090. *
  21091. * // Returns true
  21092. * Ext.Object.equals({
  21093. * foo: 1,
  21094. * bar: 2
  21095. * }, {
  21096. * foo: 1,
  21097. * bar: 2
  21098. * });
  21099. *
  21100. * @param {Object} object1
  21101. * @param {Object} object2
  21102. * @return {Boolean} `true` if the objects are equal.
  21103. */
  21104. equals: (function() {
  21105. var check = function(o1, o2) {
  21106. var key;
  21107. for (key in o1) {
  21108. if (o1.hasOwnProperty(key)) {
  21109. if (o1[key] !== o2[key]) {
  21110. return false;
  21111. }
  21112. }
  21113. }
  21114. return true;
  21115. };
  21116. return function(object1, object2) {
  21117. // Short circuit if the same object is passed twice
  21118. if (object1 === object2) {
  21119. return true;
  21120. }
  21121. if (object1 && object2) {
  21122. // Do the second check because we could have extra keys in
  21123. // object2 that don't exist in object1.
  21124. return check(object1, object2) && check(object2, object1);
  21125. } else if (!object1 && !object2) {
  21126. return object1 === object2;
  21127. } else {
  21128. return false;
  21129. }
  21130. };
  21131. })(),
  21132. /**
  21133. * @private
  21134. */
  21135. fork: function(obj) {
  21136. var ret, key, value;
  21137. if (obj && obj.constructor === Object) {
  21138. ret = ExtObject.chain(obj);
  21139. for (key in obj) {
  21140. value = obj[key];
  21141. if (value) {
  21142. if (value.constructor === Object) {
  21143. ret[key] = ExtObject.fork(value);
  21144. } else if (value instanceof Array) {
  21145. ret[key] = Ext.Array.clone(value);
  21146. }
  21147. }
  21148. }
  21149. } else {
  21150. ret = obj;
  21151. }
  21152. return ret;
  21153. },
  21154. defineProperty: ('defineProperty' in Object) ? Object.defineProperty : function(object, name, descriptor) {
  21155. if (!Object.prototype.__defineGetter__) {
  21156. return;
  21157. }
  21158. if (descriptor.get) {
  21159. object.__defineGetter__(name, descriptor.get);
  21160. }
  21161. if (descriptor.set) {
  21162. object.__defineSetter__(name, descriptor.set);
  21163. }
  21164. },
  21165. /**
  21166. * @private
  21167. */
  21168. classify: function(object) {
  21169. var prototype = object,
  21170. objectProperties = [],
  21171. propertyClassesMap = {},
  21172. objectClass, key, value;
  21173. objectClass = function() {
  21174. var property, i, ln;
  21175. for (i = 0 , ln = objectProperties.length; i < ln; i++) {
  21176. property = objectProperties[i];
  21177. this[property] = new propertyClassesMap[property]();
  21178. }
  21179. };
  21180. for (key in object) {
  21181. if (object.hasOwnProperty(key)) {
  21182. value = object[key];
  21183. if (value && value.constructor === Object) {
  21184. objectProperties.push(key);
  21185. propertyClassesMap[key] = ExtObject.classify(value);
  21186. }
  21187. }
  21188. }
  21189. objectClass.prototype = prototype;
  21190. return objectClass;
  21191. }
  21192. };
  21193. /**
  21194. * A convenient alias method for {@link Ext.Object#merge}.
  21195. *
  21196. * @member Ext
  21197. * @method merge
  21198. * @inheritdoc Ext.Object#merge
  21199. */
  21200. Ext.merge = Ext.Object.merge;
  21201. /**
  21202. * @private
  21203. * @member Ext
  21204. */
  21205. Ext.mergeIf = Ext.Object.mergeIf;
  21206. }());
  21207. /*
  21208. * This file contains miscellaneous utility methods that depends on various helper classes
  21209. * like `Ext.Array` and `Ext.Date`. Historically these methods were defined in Ext.js or
  21210. * Ext-more.js but that creates circular dependencies so they were consolidated here.
  21211. */
  21212. Ext.apply(Ext, {
  21213. // @define Ext.Util
  21214. // @require Ext
  21215. // @require Ext.lang.*
  21216. // shortcut for the special named scopes for listener scope resolution
  21217. _namedScopes: {
  21218. 'this': {
  21219. isThis: 1
  21220. },
  21221. controller: {
  21222. isController: 1
  21223. },
  21224. owner: {
  21225. isOwner: 1
  21226. },
  21227. // Uses helper Ext.lookUpFn to find the scope where fn is defined (skips the
  21228. // component at which things originate):
  21229. up: {
  21230. isUp: 1
  21231. },
  21232. // These two are private, used to indicate that listeners were declared on the
  21233. // class body with either an unspecified scope, or scope:'controller'
  21234. self: {
  21235. isSelf: 1
  21236. },
  21237. 'self.controller': {
  21238. isSelf: 1,
  21239. isController: 1
  21240. }
  21241. },
  21242. scrollbar: {
  21243. _size: null,
  21244. /**
  21245. * @member Ext.scrollbar
  21246. * Returns the size of the browser scrollbars. This can differ depending on
  21247. * operating system settings, such as the theme or font size.
  21248. * @param {Boolean} [force] Pass `true` to force a recalculation of scrollbar size.
  21249. * @return {Object} An object containing scrollbar sizes.
  21250. * @return {Number} return.width The width of the vertical scrollbar.
  21251. * @return {Number} return.height The height of the horizontal scrollbar.
  21252. */
  21253. size: function(force) {
  21254. var scrollbar = Ext.scrollbar,
  21255. size = scrollbar._size;
  21256. if (!Ext.isDomReady) {
  21257. Ext.raise("Ext.scrollbar.size() called before DomReady");
  21258. }
  21259. if (force || !size) {
  21260. /* eslint-disable-next-line vars-on-top */
  21261. var db = document.body,
  21262. div = document.createElement('div'),
  21263. h, w;
  21264. div.style.width = div.style.height = '100px';
  21265. div.style.overflow = 'scroll';
  21266. div.style.position = 'absolute';
  21267. db.appendChild(div);
  21268. // now we can measure the div...
  21269. // at least in iE9 the div is not 100px - the scrollbar size is removed!
  21270. scrollbar._size = size = {
  21271. width: w = div.offsetWidth - div.clientWidth,
  21272. height: h = div.offsetHeight - div.clientHeight
  21273. };
  21274. size.reservedWidth = w ? 'calc(100% - ' + w + 'px)' : '';
  21275. size.reservedHeight = h ? 'calc(100% - ' + h + 'px)' : '';
  21276. db.removeChild(div);
  21277. }
  21278. return size;
  21279. },
  21280. height: function(force) {
  21281. return Ext.scrollbar.size(force).height;
  21282. },
  21283. width: function(force) {
  21284. return Ext.scrollbar.size(force).width;
  21285. }
  21286. },
  21287. escapeId: (function() {
  21288. /* eslint-disable-next-line no-useless-escape */
  21289. var validIdRe = /^[a-zA-Z_][a-zA-Z0-9_\-]*$/i,
  21290. escapeRx = /([\W]{1})/g,
  21291. leadingNumRx = /^(\d)/g,
  21292. escapeFn = function(match, capture) {
  21293. return "\\" + capture;
  21294. },
  21295. numEscapeFn = function(match, capture) {
  21296. return '\\00' + capture.charCodeAt(0).toString(16) + ' ';
  21297. };
  21298. return function(id) {
  21299. return validIdRe.test(id) ? id : // replace the number portion last to keep the trailing ' '
  21300. // from being escaped
  21301. id.replace(escapeRx, escapeFn).replace(leadingNumRx, numEscapeFn);
  21302. };
  21303. }()),
  21304. lookUpFn: function(from, fn) {
  21305. if (!from || !Ext.isFunction(from.up)) {
  21306. Ext.raise('Callback "up" syntax requires a caller with "up" method');
  21307. }
  21308. // eslint-disable-next-line vars-on-top
  21309. var controller, scope;
  21310. for (scope = from.up(); scope && !scope[fn]; scope = scope.up()) {
  21311. controller = scope.controller;
  21312. if (controller && controller[fn]) {
  21313. scope = controller;
  21314. break;
  21315. }
  21316. }
  21317. if (!scope || !Ext.isFunction(scope[fn])) {
  21318. Ext.raise('No such method "' + fn + '" found up() from ' + (from.getId ? from.getId() : from.id));
  21319. }
  21320. return scope;
  21321. },
  21322. /**
  21323. * @method callback
  21324. * @member Ext
  21325. * Execute a callback function in a particular scope. If `callback` argument is a
  21326. * function reference, that is called. If it is a string, the string is assumed to
  21327. * be the name of a method on the given `scope`. If no function is passed the call
  21328. * is ignored.
  21329. *
  21330. * For example, these calls are equivalent:
  21331. *
  21332. * var myFunc = this.myFunc;
  21333. *
  21334. * Ext.callback('myFunc', this, [arg1, arg2]);
  21335. * Ext.callback(myFunc, this, [arg1, arg2]);
  21336. *
  21337. * Ext.isFunction(myFunc) && this.myFunc(arg1, arg2);
  21338. *
  21339. * @param {Function/String} callback The callback function to execute or the name of
  21340. * the callback method on the provided `scope`.
  21341. * @param {Object} [scope] The scope in which `callback` should be invoked. If `callback`
  21342. * is a string this object provides the method by that name. If this is `null` then
  21343. * the `caller` is used to resolve the scope to a `ViewController` or the proper
  21344. * `defaultListenerScope`.
  21345. * @param {Array} [args] The arguments to pass to the function.
  21346. * @param {Number} [delay] Pass a number to delay the call by a number of milliseconds.
  21347. * @param {Object} [caller] The object calling the callback. This is used to resolve
  21348. * named methods when no explicit `scope` is provided.
  21349. * @param {Object} [defaultScope=caller] The default scope to return if none is found.
  21350. * @return The value returned by the callback or `undefined` (if there is a `delay`
  21351. * or if the `callback` is not a function).
  21352. */
  21353. callback: function(callback, scope, args, delay, caller, defaultScope) {
  21354. if (!callback) {
  21355. return;
  21356. }
  21357. /* eslint-disable-next-line vars-on-top */
  21358. var namedScope = (scope in Ext._namedScopes),
  21359. ret;
  21360. if (callback.charAt) {
  21361. // if (isString(fn))
  21362. // Custom components cannot often use declarative method resolution when
  21363. // they need to allow the user to supply declarative method names that can
  21364. // reach the user's controller. The "up" callback syntax can help with that:
  21365. //
  21366. // xtype: 'button',
  21367. // handler: 'up.onFoo',
  21368. //
  21369. // When Ext.callback('up.onFoo',..., button) is called, we can perform a
  21370. // "button.up('[onFoo]')" search for the handler. Thus we have a declarative
  21371. // way to dispatch such handlers that will work even if the user can supply
  21372. // such handlers.
  21373. //
  21374. if (callback[2] === '.') {
  21375. // callback = 'up.foo'
  21376. if (callback.substr(0, 2) !== 'up') {
  21377. Ext.raise('Invalid callback method name "' + callback + '"');
  21378. }
  21379. if (scope) {
  21380. Ext.raise('Callback "up" syntax is incompatible with scopes');
  21381. }
  21382. scope = Ext.lookUpFn(caller, callback = callback.substr(3));
  21383. } else if (caller) {
  21384. if (namedScope && namedScope.isUp) {
  21385. scope = Ext.lookUpFn(caller, callback);
  21386. } else if (!scope || namedScope) {
  21387. scope = caller.resolveListenerScope(namedScope ? scope : defaultScope);
  21388. }
  21389. }
  21390. if (!scope || !Ext.isObject(scope)) {
  21391. Ext.raise('Named method "' + callback + '" requires a scope object');
  21392. }
  21393. if (!Ext.isFunction(scope[callback])) {
  21394. Ext.raise('No method named "' + callback + '" on ' + (scope.$className || 'scope object'));
  21395. }
  21396. callback = scope[callback];
  21397. } else if (namedScope) {
  21398. scope = defaultScope || caller;
  21399. } else if (!scope) {
  21400. scope = caller;
  21401. }
  21402. if (callback && Ext.isFunction(callback)) {
  21403. scope = scope || Ext.global;
  21404. if (delay) {
  21405. Ext.defer(callback, delay, scope, args);
  21406. } else {
  21407. ret = args ? callback.apply(scope, args) : callback.call(scope);
  21408. }
  21409. }
  21410. return ret;
  21411. },
  21412. /**
  21413. * @method coerce
  21414. * @member Ext
  21415. * Coerces the first value if possible so that it is comparable to the second value.
  21416. *
  21417. * Coercion only works between the basic atomic data types String, Boolean, Number, Date, null
  21418. * and undefined. Numbers and numeric strings are coerced to Dates using the value
  21419. * as the millisecond era value.
  21420. *
  21421. * Strings are coerced to Dates by parsing using the
  21422. * {@link Ext.Date#defaultFormat defaultFormat}.
  21423. *
  21424. * For example
  21425. *
  21426. * Ext.coerce('false', true);
  21427. *
  21428. * returns the boolean value `false` because the second parameter is of type `Boolean`.
  21429. *
  21430. * @param {Mixed} from The value to coerce
  21431. * @param {Mixed} to The value it must be compared against
  21432. * @return The coerced value.
  21433. */
  21434. coerce: function(from, to) {
  21435. var fromType = Ext.typeOf(from),
  21436. toType = Ext.typeOf(to),
  21437. isString = typeof from === 'string';
  21438. if (fromType !== toType) {
  21439. switch (toType) {
  21440. case 'string':
  21441. return String(from);
  21442. case 'number':
  21443. return Number(from);
  21444. case 'boolean':
  21445. // See http://ecma262-5.com/ELS5_HTML.htm#Section_11.9.3 as to why '0'.
  21446. // TL;DR => ('0' == 0), so if given string '0', we must return boolean false.
  21447. return isString && (!from || from === 'false' || from === '0') ? false : Boolean(from);
  21448. case 'null':
  21449. return isString && (!from || from === 'null') ? null : false;
  21450. case 'undefined':
  21451. return isString && (!from || from === 'undefined') ? undefined : false;
  21452. case 'date':
  21453. return isString && isNaN(from) ? Ext.Date.parse(from, Ext.Date.defaultFormat) : Date(Number(from));
  21454. }
  21455. }
  21456. return from;
  21457. },
  21458. /**
  21459. * @method copyTo
  21460. * @member Ext
  21461. * Copies a set of named properties fom the source object to the destination object.
  21462. *
  21463. * Example:
  21464. *
  21465. * var foo = { a: 1, b: 2, c: 3 };
  21466. *
  21467. * var bar = Ext.copyTo({}, foo, 'a,c');
  21468. * // bar = { a: 1, c: 3 };
  21469. *
  21470. * Important note: To borrow class prototype methods, use {@link Ext.Base#borrow} instead.
  21471. *
  21472. * @param {Object} dest The destination object.
  21473. * @param {Object} source The source object.
  21474. * @param {String/String[]} names Either an Array of property names, or a comma-delimited list
  21475. * of property names to copy.
  21476. * @param {Boolean} [usePrototypeKeys=false] Pass `true` to copy keys off of the
  21477. * prototype as well as the instance.
  21478. * @return {Object} The `dest` object.
  21479. * @deprecated 6.0.1 Use {@link Ext#copy Ext.copy} instead. This old method
  21480. * would copy the named properties even if they did not exist in the source which
  21481. * could produce `undefined` values in the destination.
  21482. */
  21483. copyTo: function(dest, source, names, usePrototypeKeys) {
  21484. var name, i, n;
  21485. if (typeof names === 'string') {
  21486. names = names.split(Ext.propertyNameSplitRe);
  21487. }
  21488. for (i = 0 , n = names ? names.length : 0; i < n; i++) {
  21489. name = names[i];
  21490. if (usePrototypeKeys || source.hasOwnProperty(name)) {
  21491. dest[name] = source[name];
  21492. }
  21493. }
  21494. return dest;
  21495. },
  21496. /**
  21497. * @method copy
  21498. * @member Ext
  21499. * Copies a set of named properties fom the source object to the destination object.
  21500. *
  21501. * Example:
  21502. *
  21503. * var foo = { a: 1, b: 2, c: 3 };
  21504. *
  21505. * var bar = Ext.copy({}, foo, 'a,c');
  21506. * // bar = { a: 1, c: 3 };
  21507. *
  21508. * Important note: To borrow class prototype methods, use {@link Ext.Base#borrow} instead.
  21509. *
  21510. * @param {Object} dest The destination object.
  21511. * @param {Object} source The source object.
  21512. * @param {String/String[]} names Either an Array of property names, or a comma-delimited list
  21513. * of property names to copy.
  21514. * @param {Boolean} [usePrototypeKeys=false] Pass `true` to copy keys off of the
  21515. * prototype as well as the instance.
  21516. * @return {Object} The `dest` object.
  21517. */
  21518. copy: function(dest, source, names, usePrototypeKeys) {
  21519. var name, i, n;
  21520. if (typeof names === 'string') {
  21521. names = names.split(Ext.propertyNameSplitRe);
  21522. }
  21523. for (i = 0 , n = names ? names.length : 0; i < n; i++) {
  21524. name = names[i];
  21525. // Only copy a property if the source actually *has* that property.
  21526. // If we are including prototype properties, then ensure that a property of
  21527. // that name can be found *somewhere* in the prototype chain (otherwise we'd be
  21528. // copying undefined in which may break things)
  21529. if (source.hasOwnProperty(name) || (usePrototypeKeys && name in source)) {
  21530. dest[name] = source[name];
  21531. }
  21532. }
  21533. return dest;
  21534. },
  21535. propertyNameSplitRe: /[,;\s]+/,
  21536. /**
  21537. * @method copyToIf
  21538. * @member Ext
  21539. * Copies a set of named properties fom the source object to the destination object
  21540. * if the destination object does not already have them.
  21541. *
  21542. * Example:
  21543. *
  21544. * var foo = { a: 1, b: 2, c: 3 };
  21545. *
  21546. * var bar = Ext.copyToIf({ a:42 }, foo, 'a,c');
  21547. * // bar = { a: 42, c: 3 };
  21548. *
  21549. * @param {Object} destination The destination object.
  21550. * @param {Object} source The source object.
  21551. * @param {String/String[]} names Either an Array of property names, or a single string
  21552. * with a list of property names separated by ",", ";" or spaces.
  21553. * @return {Object} The `dest` object.
  21554. * @deprecated 6.0.1 Use {@link Ext#copyIf Ext.copyIf} instead. This old method
  21555. * would copy the named preoperties even if they did not exist in the source which
  21556. * could produce `undefined` values in the destination.
  21557. */
  21558. copyToIf: function(destination, source, names) {
  21559. var name, i, n;
  21560. if (typeof names === 'string') {
  21561. names = names.split(Ext.propertyNameSplitRe);
  21562. }
  21563. for (i = 0 , n = names ? names.length : 0; i < n; i++) {
  21564. name = names[i];
  21565. if (destination[name] === undefined) {
  21566. destination[name] = source[name];
  21567. }
  21568. }
  21569. return destination;
  21570. },
  21571. /**
  21572. * @method copyIf
  21573. * @member Ext
  21574. * Copies a set of named properties fom the source object to the destination object
  21575. * if the destination object does not already have them.
  21576. *
  21577. * Example:
  21578. *
  21579. * var foo = { a: 1, b: 2, c: 3 };
  21580. *
  21581. * var bar = Ext.copyIf({ a:42 }, foo, 'a,c');
  21582. * // bar = { a: 42, c: 3 };
  21583. *
  21584. * @param {Object} destination The destination object.
  21585. * @param {Object} source The source object.
  21586. * @param {String/String[]} names Either an Array of property names, or a single string
  21587. * with a list of property names separated by ",", ";" or spaces.
  21588. * @return {Object} The `dest` object.
  21589. */
  21590. copyIf: function(destination, source, names) {
  21591. var name, i, n;
  21592. if (typeof names === 'string') {
  21593. names = names.split(Ext.propertyNameSplitRe);
  21594. }
  21595. for (i = 0 , n = names ? names.length : 0; i < n; i++) {
  21596. name = names[i];
  21597. // Only copy a property if the destination has no property by that name
  21598. if (!(name in destination) && (name in source)) {
  21599. destination[name] = source[name];
  21600. }
  21601. }
  21602. return destination;
  21603. },
  21604. /**
  21605. * @method extend
  21606. * @member Ext
  21607. * This method deprecated. Use {@link Ext#define Ext.define} instead.
  21608. * @param {Function} superclass
  21609. * @param {Object} overrides
  21610. * @return {Function} The subclass constructor from the <tt>overrides</tt> parameter,
  21611. * or a generated one if not provided.
  21612. * @deprecated 4.0.0 Use {@link Ext#define Ext.define} instead
  21613. */
  21614. extend: (function() {
  21615. // inline overrides
  21616. var objectConstructor = Object.prototype.constructor,
  21617. inlineOverrides = function(o) {
  21618. var m;
  21619. for (m in o) {
  21620. if (!o.hasOwnProperty(m)) {
  21621. continue;
  21622. }
  21623. this[m] = o[m];
  21624. }
  21625. };
  21626. return function(subclass, superclass, overrides) {
  21627. // First we check if the user passed in just the superClass with overrides
  21628. if (Ext.isObject(superclass)) {
  21629. overrides = superclass;
  21630. superclass = subclass;
  21631. subclass = overrides.constructor !== objectConstructor ? overrides.constructor : function() {
  21632. superclass.apply(this, arguments);
  21633. };
  21634. }
  21635. if (!superclass) {
  21636. Ext.raise({
  21637. sourceClass: 'Ext',
  21638. sourceMethod: 'extend',
  21639. msg: 'Attempting to extend from a class which has not been loaded on the page.'
  21640. });
  21641. }
  21642. // We create a new temporary class
  21643. /* eslint-disable-next-line vars-on-top */
  21644. var F = function() {},
  21645. superclassProto = superclass.prototype,
  21646. subclassProto;
  21647. F.prototype = superclassProto;
  21648. subclassProto = subclass.prototype = new F();
  21649. subclassProto.constructor = subclass;
  21650. subclass.superclass = superclassProto;
  21651. if (superclassProto.constructor === objectConstructor) {
  21652. superclassProto.constructor = superclass;
  21653. }
  21654. subclass.override = function(overrides) {
  21655. Ext.override(subclass, overrides);
  21656. };
  21657. subclassProto.override = inlineOverrides;
  21658. subclassProto.proto = subclassProto;
  21659. subclass.override(overrides);
  21660. subclass.extend = function(o) {
  21661. return Ext.extend(subclass, o);
  21662. };
  21663. return subclass;
  21664. };
  21665. }()),
  21666. /**
  21667. * @method isOnline
  21668. * @member Ext
  21669. * Indicates if the page is currently running in online or offline mode, according
  21670. * to the `navigator.onLine` property.
  21671. * @return {Boolean} `true` if the page is currently running in an online mode.
  21672. *
  21673. * @since 6.2.1
  21674. */
  21675. isOnline: function() {
  21676. return Ext.global.navigator.onLine;
  21677. },
  21678. /**
  21679. * @method iterate
  21680. * @member Ext
  21681. * Iterates either an array or an object. This method delegates to
  21682. * {@link Ext.Array#each Ext.Array.each} if the given value is iterable, and
  21683. * {@link Ext.Object#each Ext.Object.each} otherwise.
  21684. *
  21685. * @param {Object/Array} object The object or array to be iterated.
  21686. * @param {Function} fn The function to be called for each iteration. See and
  21687. * {@link Ext.Array#each Ext.Array.each} and {@link Ext.Object#each Ext.Object.each}
  21688. * for detailed lists of arguments passed to this function depending on the given object
  21689. * type that is being iterated.
  21690. * @param {Object} [scope] The scope (`this` reference) in which the specified function
  21691. * is executed. Defaults to the object being iterated itself.
  21692. */
  21693. iterate: function(object, fn, scope) {
  21694. if (Ext.isEmpty(object)) {
  21695. return;
  21696. }
  21697. if (scope === undefined) {
  21698. scope = object;
  21699. }
  21700. if (Ext.isIterable(object)) {
  21701. Ext.Array.each.call(Ext.Array, object, fn, scope);
  21702. } else {
  21703. Ext.Object.each.call(Ext.Object, object, fn, scope);
  21704. }
  21705. },
  21706. _resourcePoolRe: /^[<]([^<>@:]*)(?:[@]([^<>@:]+))?[>](.+)$/,
  21707. /**
  21708. * Resolves a resource URL that may contain a resource pool identifier token at the
  21709. * front. The tokens are formatted as HTML tags "&lt;poolName@packageName&gt;" followed
  21710. * by a normal relative path. This token is only processed if present at the first
  21711. * character of the given string.
  21712. *
  21713. * These tokens are parsed and the pieces are then passed to the
  21714. * {@link Ext#getResourcePath} method.
  21715. *
  21716. * For example:
  21717. *
  21718. * [{
  21719. * xtype: 'image',
  21720. * src: '<shared>images/foo.png'
  21721. * },{
  21722. * xtype: 'image',
  21723. * src: '<@package>images/foo.png'
  21724. * },{
  21725. * xtype: 'image',
  21726. * src: '<shared@package>images/foo.png'
  21727. * }]
  21728. *
  21729. * In the above example, "shared" is the name of a Sencha Cmd resource pool and
  21730. * "package" is the name of a Sencha Cmd package.
  21731. * @member Ext
  21732. * @param {String} url The URL that may contain a resource pool token at the front.
  21733. * @return {String}
  21734. * @since 6.0.1
  21735. */
  21736. resolveResource: function(url) {
  21737. var ret = url,
  21738. m;
  21739. if (url && url.charAt(0) === '<') {
  21740. m = Ext._resourcePoolRe.exec(url);
  21741. if (m) {
  21742. ret = Ext.getResourcePath(m[3], m[1], m[2]);
  21743. }
  21744. }
  21745. return ret;
  21746. },
  21747. /**
  21748. *
  21749. * @member Ext
  21750. * @method urlEncode
  21751. * @inheritdoc Ext.Object#toQueryString
  21752. * @deprecated 4.0.0 Use {@link Ext.Object#toQueryString} instead
  21753. */
  21754. urlEncode: function() {
  21755. var args = Ext.Array.from(arguments),
  21756. prefix = '';
  21757. // Support for the old `pre` argument
  21758. if (Ext.isString(args[1])) {
  21759. prefix = args[1] + '&';
  21760. args[1] = false;
  21761. }
  21762. return prefix + Ext.Object.toQueryString.apply(Ext.Object, args);
  21763. },
  21764. /**
  21765. * Alias for {@link Ext.Object#fromQueryString}.
  21766. *
  21767. * @member Ext
  21768. * @method urlDecode
  21769. * @inheritdoc Ext.Object#fromQueryString
  21770. * @deprecated 4.0.0 Use {@link Ext.Object#fromQueryString} instead
  21771. */
  21772. urlDecode: function() {
  21773. return Ext.Object.fromQueryString.apply(Ext.Object, arguments);
  21774. },
  21775. /**
  21776. * @method getScrollbarSize
  21777. * @member Ext
  21778. * Returns the size of the browser scrollbars. This can differ depending on
  21779. * operating system settings, such as the theme or font size.
  21780. * @param {Boolean} [force] true to force a recalculation of the value.
  21781. * @return {Object} An object containing scrollbar sizes.
  21782. * @return {Number} return.width The width of the vertical scrollbar.
  21783. * @return {Number} return.height The height of the horizontal scrollbar.
  21784. * @deprecated 7.0 Use `Ext.scrollbar.size` instead.
  21785. */
  21786. getScrollbarSize: function(force) {
  21787. return Ext.scrollbar.size(force);
  21788. },
  21789. /**
  21790. * @method typeOf
  21791. * @member Ext
  21792. * Returns the type of the given variable in string format. List of possible values are:
  21793. *
  21794. * - `undefined`: If the given value is `undefined`
  21795. * - `null`: If the given value is `null`
  21796. * - `string`: If the given value is a string
  21797. * - `number`: If the given value is a number
  21798. * - `boolean`: If the given value is a boolean value
  21799. * - `date`: If the given value is a `Date` object
  21800. * - `function`: If the given value is a function reference
  21801. * - `object`: If the given value is an object
  21802. * - `array`: If the given value is an array
  21803. * - `regexp`: If the given value is a regular expression
  21804. * - `element`: If the given value is a DOM Element
  21805. * - `textnode`: If the given value is a DOM text node and contains something other than
  21806. * whitespace
  21807. * - `whitespace`: If the given value is a DOM text node and contains only whitespace
  21808. *
  21809. * @param {Object} value
  21810. * @return {String}
  21811. */
  21812. typeOf: (function() {
  21813. var nonWhitespaceRe = /\S/,
  21814. toString = Object.prototype.toString,
  21815. typeofTypes = {
  21816. number: 1,
  21817. string: 1,
  21818. 'boolean': 1,
  21819. 'undefined': 1
  21820. },
  21821. toStringTypes = {
  21822. '[object Array]': 'array',
  21823. '[object Date]': 'date',
  21824. '[object Boolean]': 'boolean',
  21825. '[object Number]': 'number',
  21826. '[object RegExp]': 'regexp'
  21827. };
  21828. return function(value) {
  21829. if (value === null) {
  21830. return 'null';
  21831. }
  21832. /* eslint-disable-next-line vars-on-top */
  21833. var type = typeof value,
  21834. ret, typeToString;
  21835. if (typeofTypes[type]) {
  21836. return type;
  21837. }
  21838. ret = toStringTypes[typeToString = toString.call(value)];
  21839. if (ret) {
  21840. return ret;
  21841. }
  21842. if (type === 'function') {
  21843. return 'function';
  21844. }
  21845. if (type === 'object') {
  21846. if (value.nodeType !== undefined) {
  21847. if (value.nodeType === 3) {
  21848. return nonWhitespaceRe.test(value.nodeValue) ? 'textnode' : 'whitespace';
  21849. } else {
  21850. return 'element';
  21851. }
  21852. }
  21853. return 'object';
  21854. }
  21855. Ext.raise({
  21856. sourceClass: 'Ext',
  21857. sourceMethod: 'typeOf',
  21858. msg: 'Failed to determine the type of "' + value + '".'
  21859. });
  21860. return typeToString;
  21861. };
  21862. }()),
  21863. /**
  21864. * A global factory method to instantiate a class from a config object. For example,
  21865. * these two calls are equivalent:
  21866. *
  21867. * Ext.factory({ text: 'My Button' }, 'Ext.Button');
  21868. * Ext.create('Ext.Button', { text: 'My Button' });
  21869. *
  21870. * If an existing instance is also specified, it will be updated with the supplied config
  21871. * object. This is useful if you need to either create or update an object, depending on
  21872. * if an instance already exists. For example:
  21873. *
  21874. * var button;
  21875. * button = Ext.factory({ text: 'New Button' }, 'Ext.Button', button); // Button created
  21876. * button = Ext.factory({ text: 'Updated Button' }, 'Ext.Button', button); // Button updated
  21877. *
  21878. * @param {Object} config The config object to instantiate or update an instance with.
  21879. * @param {String} [classReference] The class to instantiate from (if there is a default).
  21880. * @param {Object} [instance] The instance to update.
  21881. * @param [aliasNamespace]
  21882. * @member Ext
  21883. * @deprecated 6.5.0 Use the {@link Ext.Factory#method!update update} method of the
  21884. * associated factory instead.
  21885. */
  21886. factory: function(config, classReference, instance, aliasNamespace) {
  21887. var manager = Ext.ClassManager,
  21888. newInstance;
  21889. // If config is falsy or a valid instance, destroy the current instance
  21890. // (if it exists) and replace with the new one
  21891. if (!config || config.isInstance) {
  21892. if (instance && instance !== config) {
  21893. instance.destroy();
  21894. }
  21895. return config;
  21896. }
  21897. if (aliasNamespace) {
  21898. // If config is a string value, treat it as an alias
  21899. if (typeof config === 'string') {
  21900. return manager.instantiateByAlias(aliasNamespace + '.' + config);
  21901. }
  21902. // Same if 'type' is given in config
  21903. else if (Ext.isObject(config) && 'type' in config) {
  21904. return manager.instantiateByAlias(aliasNamespace + '.' + config.type, config);
  21905. }
  21906. }
  21907. if (config === true) {
  21908. if (!instance && !classReference) {
  21909. Ext.raise('[Ext.factory] Cannot determine type of class to create');
  21910. }
  21911. return instance || Ext.create(classReference);
  21912. }
  21913. if (!Ext.isObject(config)) {
  21914. Ext.raise("Invalid config, must be a valid config object");
  21915. }
  21916. if ('xtype' in config) {
  21917. newInstance = manager.instantiateByAlias('widget.' + config.xtype, config);
  21918. } else if ('xclass' in config) {
  21919. newInstance = Ext.create(config.xclass, config);
  21920. }
  21921. if (newInstance) {
  21922. if (instance) {
  21923. instance.destroy();
  21924. }
  21925. return newInstance;
  21926. }
  21927. if (instance) {
  21928. return instance.setConfig(config);
  21929. }
  21930. return Ext.create(classReference, config);
  21931. },
  21932. /**
  21933. * This method converts an object containing config objects keyed by `itemId` into
  21934. * an array of config objects.
  21935. *
  21936. * @param {Object} items An object containing config objects keyed by `itemId`.
  21937. * @param {String} [defaultProperty="xtype"] The property to set for string items.
  21938. * @param functionProperty
  21939. * @return {Object[]}
  21940. * @member Ext
  21941. * @since 6.5.0
  21942. * @private
  21943. */
  21944. convertKeyedItems: function(items, defaultProperty, functionProperty) {
  21945. if (items && !items.isInstance && Ext.isObject(items)) {
  21946. /* eslint-disable-next-line vars-on-top */
  21947. var obj = items,
  21948. item, itemId, value;
  21949. items = [];
  21950. // See if obj looks like a single thing
  21951. if (obj.xtype || obj.xclass || obj.itemId || obj.id) {
  21952. items.push(obj);
  21953. } else {
  21954. for (itemId in obj) {
  21955. item = obj[itemId];
  21956. if (item) {
  21957. if (item === true) {
  21958. item = {};
  21959. } else if (typeof item === 'function') {
  21960. if (!functionProperty) {
  21961. Ext.raise('Function not expected here');
  21962. }
  21963. value = item;
  21964. item = {};
  21965. item[functionProperty] = value;
  21966. } else if (typeof item === 'string') {
  21967. value = item;
  21968. item = {};
  21969. item[defaultProperty || 'xtype'] = value;
  21970. } else {
  21971. item = Ext.apply({}, item);
  21972. }
  21973. item.itemId = itemId;
  21974. items.push(item);
  21975. }
  21976. }
  21977. }
  21978. }
  21979. return items;
  21980. },
  21981. sortByWeight: function(items) {
  21982. if (items) {
  21983. Ext.Array.sort(items, Ext.weightSortFn);
  21984. }
  21985. },
  21986. /**
  21987. * Comparison function for sorting an array of objects in ascending order of `weight`.
  21988. * @param {Object} lhs
  21989. * @param {Object} rhs
  21990. * @return {Number}
  21991. * @member Ext
  21992. * @private
  21993. * @since 6.5.0
  21994. */
  21995. weightSortFn: function(lhs, rhs) {
  21996. return (lhs.weight || 0) - (rhs.weight || 0);
  21997. },
  21998. /**
  21999. * Concatenate 2 arrays. If either argument is `null` or `undefined` then it's not
  22000. * concatenated.
  22001. *
  22002. * @param {Object/Object[]} a
  22003. * @param {Object/Object[]} b
  22004. * @return {Object[]}
  22005. * @member Ext
  22006. * @private
  22007. * @since 6.5.1
  22008. */
  22009. concat: function(a, b) {
  22010. var noB = b == null,
  22011. E = Ext.emptyArray;
  22012. return (a == null) ? (noB ? a : E.concat(b)) : (noB ? E.concat(a) : E.concat(a, b));
  22013. },
  22014. /**
  22015. * @method log
  22016. * @member Ext
  22017. * Logs a message. If a console is present it will be used. On Opera, the method
  22018. * "opera.postError" is called. In other cases, the message is logged to an array
  22019. * "Ext.log.out". An attached debugger can watch this array and view the log. The
  22020. * log buffer is limited to a maximum of "Ext.log.max" entries (defaults to 250).
  22021. *
  22022. * If additional parameters are passed, they are joined and appended to the message.
  22023. * A technique for tracing entry and exit of a function is this:
  22024. *
  22025. * function foo () {
  22026. * Ext.log({ indent: 1 }, '>> foo');
  22027. *
  22028. * // log statements in here or methods called from here will be indented
  22029. * // by one step
  22030. *
  22031. * Ext.log({ outdent: 1 }, '<< foo');
  22032. * }
  22033. *
  22034. * This method does nothing in a release build.
  22035. *
  22036. * @param {String/Object} [options] The message to log or an options object with any
  22037. * of the following properties:
  22038. *
  22039. * - `msg`: The message to log (required).
  22040. * - `level`: One of: "error", "warn", "info" or "log" (the default is "log").
  22041. * - `dump`: An object to dump to the log as part of the message.
  22042. * - `stack`: True to include a stack trace in the log.
  22043. * - `indent`: Cause subsequent log statements to be indented one step.
  22044. * - `outdent`: Cause this and following statements to be one step less indented.
  22045. *
  22046. * @param {String...} [message] The message to log (required unless specified in
  22047. * options object).
  22048. */
  22049. log: (function() {
  22050. /*
  22051. * Iterate through an object to dump its content into a string.
  22052. * For example:
  22053. * {
  22054. * style: {
  22055. * lineWidth: 1
  22056. * },
  22057. * label: {},
  22058. * marker: {
  22059. * strokeStyle: "#555",
  22060. * radius: 3,
  22061. * size: 3
  22062. * },
  22063. * subStyle: {
  22064. * fillStyle: [
  22065. * 0: "#133987",
  22066. * 1: "#1c55ca",
  22067. * 2: "#4d7fe6"
  22068. * ]
  22069. * },
  22070. * markerSubStyle: {}
  22071. * }
  22072. *
  22073. * @param {Object} object The object to iterate
  22074. * @param {Number} [level] Current level of identation (and recursion). Default is 0.
  22075. * @param {Number} [maxLevel] Maximum level of recursion. Default is 3.
  22076. * @param {Boolean} [withFunctions] Include functions in the output.
  22077. * @return {String} The string with the contents of the object
  22078. */
  22079. var primitiveRe = /string|number|boolean/;
  22080. function dumpObject(object, level, maxLevel, withFunctions) {
  22081. var member, type, value, name, prefix, suffix,
  22082. members = [];
  22083. if (Ext.isArray(object)) {
  22084. prefix = '[';
  22085. suffix = ']';
  22086. } else if (Ext.isObject(object)) {
  22087. prefix = '{';
  22088. suffix = '}';
  22089. }
  22090. if (!maxLevel) {
  22091. maxLevel = 3;
  22092. }
  22093. if (level > maxLevel) {
  22094. return prefix + '...' + suffix;
  22095. }
  22096. level = level || 1;
  22097. /* eslint-disable-next-line vars-on-top */
  22098. var spacer = (new Array(level)).join(' ');
  22099. // Cannot use Ext.encode since it can recurse endlessly
  22100. for (name in object) {
  22101. if (object.hasOwnProperty(name)) {
  22102. value = object[name];
  22103. type = typeof value;
  22104. if (type === 'function') {
  22105. if (!withFunctions) {
  22106. continue;
  22107. }
  22108. member = type;
  22109. } else if (type === 'undefined') {
  22110. member = type;
  22111. } else if (value === null || primitiveRe.test(type) || Ext.isDate(value)) {
  22112. member = Ext.encode(value);
  22113. } else if (Ext.isArray(value)) {
  22114. member = dumpObject(value, level + 1, maxLevel, withFunctions);
  22115. } else if (Ext.isObject(value)) {
  22116. member = dumpObject(value, level + 1, maxLevel, withFunctions);
  22117. } else {
  22118. member = type;
  22119. }
  22120. members.push(spacer + name + ': ' + member);
  22121. }
  22122. }
  22123. // or Ext.encode(name)
  22124. if (members.length) {
  22125. return prefix + '\n ' + members.join(',\n ') + '\n' + spacer + suffix;
  22126. }
  22127. return prefix + suffix;
  22128. }
  22129. function log(message) {
  22130. var options, dump,
  22131. con = Ext.global.console,
  22132. level = 'log',
  22133. indent = log.indent || 0,
  22134. prefix, stack, fn, out, max;
  22135. log.indent = indent;
  22136. if (typeof message !== 'string') {
  22137. options = message;
  22138. message = options.msg || '';
  22139. level = options.level || level;
  22140. dump = options.dump;
  22141. stack = options.stack;
  22142. prefix = options.prefix;
  22143. fn = options.fn;
  22144. if (options.indent) {
  22145. ++log.indent;
  22146. } else if (options.outdent) {
  22147. log.indent = indent = Math.max(indent - 1, 0);
  22148. }
  22149. if (dump && !(con && con.dir)) {
  22150. message += dumpObject(dump);
  22151. dump = null;
  22152. }
  22153. }
  22154. if (arguments.length > 1) {
  22155. message += Array.prototype.slice.call(arguments, 1).join('');
  22156. }
  22157. if (prefix) {
  22158. message = prefix + ' - ' + message;
  22159. }
  22160. message = indent ? Ext.String.repeat(' ', log.indentSize * indent) + message : message;
  22161. // w/o console, all messages are equal, so munge the level into the message:
  22162. if (level !== 'log') {
  22163. message = '[' + level.charAt(0).toUpperCase() + '] ' + message;
  22164. }
  22165. if (fn) {
  22166. message += '\nCaller: ' + fn.toString();
  22167. }
  22168. // Not obvious, but 'console' comes and goes when Firebug is turned on/off, so
  22169. // an early test may fail either direction if Firebug is toggled.
  22170. //
  22171. if (con) {
  22172. // if (Firebug-like console)
  22173. if (con[level]) {
  22174. con[level](message);
  22175. } else {
  22176. con.log(message);
  22177. }
  22178. if (dump) {
  22179. con.dir(dump);
  22180. }
  22181. if (stack && con.trace) {
  22182. // Firebug's console.error() includes a trace already...
  22183. if (!con.firebug || level !== 'error') {
  22184. con.trace();
  22185. }
  22186. }
  22187. } else if (Ext.isOpera) {
  22188. /* eslint-disable-next-line no-undef */
  22189. opera.postError(message);
  22190. } else {
  22191. out = log.out;
  22192. max = log.max;
  22193. if (out.length >= max) {
  22194. // this formula allows out.max to change (via debugger), where the
  22195. // more obvious "max/4" would not quite be the same
  22196. // keep newest 75%
  22197. Ext.Array.erase(out, 0, out.length - 3 * Math.floor(max / 4));
  22198. }
  22199. out.push(message);
  22200. }
  22201. // Mostly informational, but the Ext.Error notifier uses them:
  22202. ++log.count;
  22203. ++log.counters[level];
  22204. }
  22205. function logx(level, args) {
  22206. if (typeof args[0] === 'string') {
  22207. args.unshift({});
  22208. }
  22209. args[0].level = level;
  22210. log.apply(this, args);
  22211. }
  22212. log.error = function() {
  22213. logx('error', Array.prototype.slice.call(arguments));
  22214. };
  22215. log.info = function() {
  22216. logx('info', Array.prototype.slice.call(arguments));
  22217. };
  22218. log.warn = function() {
  22219. logx('warn', Array.prototype.slice.call(arguments));
  22220. };
  22221. log.count = 0;
  22222. log.counters = {
  22223. error: 0,
  22224. warn: 0,
  22225. info: 0,
  22226. log: 0
  22227. };
  22228. log.indentSize = 2;
  22229. log.out = [];
  22230. log.max = 750;
  22231. return log;
  22232. }()) || (function() {
  22233. var nullLog = function() {};
  22234. nullLog.info = nullLog.warn = nullLog.error = Ext.emptyFn;
  22235. return nullLog;
  22236. }())
  22237. });
  22238. /**
  22239. * @class Ext.Version
  22240. *
  22241. * A utility class that wraps around a version number string and provides convenient methods
  22242. * to perform comparisons. A version number is expressed in the following general format:
  22243. *
  22244. * major[.minor[.patch[.build[release]]]]
  22245. *
  22246. * The `Version` instance holds various readonly properties that contain the digested form
  22247. * of the version string. The numeric componnets of `major`, `minor`, `patch` and `build`
  22248. * as well as the textual suffix called `release`.
  22249. *
  22250. * Not depicted in the above syntax are three possible prefixes used to control partial
  22251. * matching. These are '^' (the default), '>' and '~'. These are discussed below.
  22252. *
  22253. * Examples:
  22254. *
  22255. * var version = new Ext.Version('1.0.2beta'); // or maybe "1.0" or "1.2.3.4RC"
  22256. * console.log("Version is " + version); // Version is 1.0.2beta
  22257. *
  22258. * console.log(version.getMajor()); // 1
  22259. * console.log(version.getMinor()); // 0
  22260. * console.log(version.getPatch()); // 2
  22261. * console.log(version.getBuild()); // 0
  22262. * console.log(version.getRelease()); // beta
  22263. *
  22264. * The understood values of `release` are assigned numberic equivalents for the sake of
  22265. * comparsion. The order of these from smallest to largest is as follows:
  22266. *
  22267. * * `"dev"`
  22268. * * `"alpha"` or `"a"`
  22269. * * `"beta"` or `"b"`
  22270. * * `"RC"` or `"rc"`
  22271. * * `"#"`
  22272. * * `"pl"` or `"p"`
  22273. *
  22274. * Any other (unrecognized) suffix is consider greater than any of these.
  22275. *
  22276. * ## Comparisons
  22277. * There are two forms of comparison that are commonly needed: full and partial. Full
  22278. * comparison is simpler and is also the default.
  22279. *
  22280. * Example:
  22281. *
  22282. * var version = new Ext.Version('1.0.2beta');
  22283. *
  22284. * console.log(version.isGreaterThan('1.0.1')); // True
  22285. * console.log(version.isGreaterThan('1.0.2alpha')); // True
  22286. * console.log(version.isGreaterThan('1.0.2RC')); // False
  22287. * console.log(version.isGreaterThan('1.0.2')); // False
  22288. * console.log(version.isLessThan('1.0.2')); // True
  22289. *
  22290. * console.log(version.match(1.0)); // True (using a Number)
  22291. * console.log(version.match('1.0.2')); // True (using a String)
  22292. *
  22293. * These comparisons are ultimately implemented by {@link Ext.Version#compareTo compareTo}
  22294. * which returns -1, 0 or 1 depending on whether the `Version' instance is less than, equal
  22295. * to, or greater than the given "other" version.
  22296. *
  22297. * For example:
  22298. *
  22299. * var n = version.compareTo('1.0.1'); // == 1 (because 1.0.2beta > 1.0.1)
  22300. *
  22301. * n = version.compareTo('1.1'); // == -1
  22302. * n = version.compareTo(version); // == 0
  22303. *
  22304. * ### Partial Comparisons
  22305. * By default, unspecified version number fields are filled with 0. In other words, the
  22306. * version number fields are 0-padded on the right or a "lower bound". This produces the
  22307. * most commonly used forms of comparsion:
  22308. *
  22309. * var ver = new Version('4.2');
  22310. *
  22311. * n = ver.compareTo('4.2.1'); // == -1 (4.2 promotes to 4.2.0 and is less than 4.2.1)
  22312. *
  22313. * There are two other ways to interpret comparisons of versions of different length. The
  22314. * first of these is to change the padding on the right to be a large number (scuh as
  22315. * Infinity) instead of 0. This has the effect of making the version an upper bound. For
  22316. * example:
  22317. *
  22318. * var ver = new Version('^4.2'); // NOTE: the '^' prefix used
  22319. *
  22320. * n = ver.compareTo('4.3'); // == -1 (less than 4.3)
  22321. *
  22322. * n = ver.compareTo('4.2'); // == 1 (greater than all 4.2's)
  22323. * n = ver.compareTo('4.2.1'); // == 1
  22324. * n = ver.compareTo('4.2.9'); // == 1
  22325. *
  22326. * The second way to interpret this comparison is to ignore the extra digits, making the
  22327. * match a prefix match. For example:
  22328. *
  22329. * var ver = new Version('~4.2'); // NOTE: the '~' prefix used
  22330. *
  22331. * n = ver.compareTo('4.3'); // == -1
  22332. *
  22333. * n = ver.compareTo('4.2'); // == 0
  22334. * n = ver.compareTo('4.2.1'); // == 0
  22335. *
  22336. * This final form can be useful when version numbers contain more components than are
  22337. * important for certain comparisons. For example, the full version of Ext JS 4.2.1 is
  22338. * "4.2.1.883" where 883 is the `build` number.
  22339. *
  22340. * This is how to create a "partial" `Version` and compare versions to it:
  22341. *
  22342. * var version421ish = new Version('~4.2.1');
  22343. *
  22344. * n = version421ish.compareTo('4.2.1.883'); // == 0
  22345. * n = version421ish.compareTo('4.2.1.2'); // == 0
  22346. * n = version421ish.compareTo('4.2.1'); // == 0
  22347. *
  22348. * n = version421ish.compareTo('4.2'); // == 1
  22349. *
  22350. * In the above example, '4.2.1.2' compares as equal to '4.2.1' because digits beyond the
  22351. * given "4.2.1" are ignored. However, '4.2' is less than the '4.2.1' prefix; its missing
  22352. * digit is filled with 0.
  22353. */
  22354. /* eslint-disable indent */
  22355. (function() {
  22356. // @define Ext.Version
  22357. // @require Ext.String
  22358. var // used by checkVersion to avoid temp arrays:
  22359. checkVerTemp = [
  22360. ''
  22361. ],
  22362. endOfVersionRe = /([^\d.])/,
  22363. notDigitsRe = /[^\d]/g,
  22364. plusMinusRe = /[-+]/g,
  22365. stripRe = /\s/g,
  22366. underscoreRe = /_/g,
  22367. toolkitNames = {
  22368. classic: 1,
  22369. modern: 1
  22370. },
  22371. Version;
  22372. Ext.Version = Version = function(version, defaultMode) {
  22373. var me = this,
  22374. padModes = me.padModes,
  22375. ch, i, pad, parts, release, releaseStartIndex, ver;
  22376. if (version.isVersion) {
  22377. version = version.version;
  22378. }
  22379. me.version = ver = String(version).toLowerCase().replace(underscoreRe, '.').replace(plusMinusRe, '');
  22380. ch = ver.charAt(0);
  22381. if (ch in padModes) {
  22382. ver = ver.substring(1);
  22383. pad = padModes[ch];
  22384. } else {
  22385. pad = defaultMode ? padModes[defaultMode] : 0;
  22386. }
  22387. // careful - NaN is falsey!
  22388. me.pad = pad;
  22389. releaseStartIndex = ver.search(endOfVersionRe);
  22390. me.shortVersion = ver;
  22391. if (releaseStartIndex !== -1) {
  22392. me.release = release = ver.substr(releaseStartIndex, version.length);
  22393. me.shortVersion = ver.substr(0, releaseStartIndex);
  22394. release = Version.releaseValueMap[release] || release;
  22395. }
  22396. me.releaseValue = release || pad;
  22397. me.shortVersion = me.shortVersion.replace(notDigitsRe, '');
  22398. /**
  22399. * @property {Number[]} parts
  22400. * The split array of version number components found in the version string.
  22401. * For example, for "1.2.3", this would be `[1, 2, 3]`.
  22402. * @readonly
  22403. * @private
  22404. */
  22405. me.parts = parts = ver.split('.');
  22406. for (i = parts.length; i--; ) {
  22407. parts[i] = parseInt(parts[i], 10);
  22408. }
  22409. if (pad === Infinity) {
  22410. // have to add this to the end to create an upper bound:
  22411. parts.push(pad);
  22412. }
  22413. /**
  22414. * @property {Number} major
  22415. * The first numeric part of the version number string.
  22416. * @readonly
  22417. */
  22418. me.major = parts[0] || pad;
  22419. /**
  22420. * @property {Number} [minor]
  22421. * The second numeric part of the version number string.
  22422. * @readonly
  22423. */
  22424. me.minor = parts[1] || pad;
  22425. /**
  22426. * @property {Number} [patch]
  22427. * The third numeric part of the version number string.
  22428. * @readonly
  22429. */
  22430. me.patch = parts[2] || pad;
  22431. /**
  22432. * @property {Number} [build]
  22433. * The fourth numeric part of the version number string.
  22434. * @readonly
  22435. */
  22436. me.build = parts[3] || pad;
  22437. return me;
  22438. };
  22439. Version.prototype = {
  22440. isVersion: true,
  22441. padModes: {
  22442. '~': NaN,
  22443. '^': Infinity
  22444. },
  22445. /**
  22446. * @property {String} [release=""]
  22447. * The release level. The following values are understood:
  22448. *
  22449. * * `"dev"`
  22450. * * `"alpha"` or `"a"`
  22451. * * `"beta"` or `"b"`
  22452. * * `"RC"` or `"rc"`
  22453. * * `"#"`
  22454. * * `"pl"` or `"p"`
  22455. * @readonly
  22456. */
  22457. release: '',
  22458. /**
  22459. * Compares this version instance to the specified `other` version.
  22460. *
  22461. * @param {String/Number/Ext.Version} other The other version to which to compare.
  22462. * @return {Number} -1 if this version is less than the target version, 1 if this
  22463. * version is greater, and 0 if they are equal.
  22464. */
  22465. compareTo: function(other) {
  22466. // "lhs" == "left-hand-side"
  22467. // "rhs" == "right-hand-side"
  22468. var me = this,
  22469. lhsPad = me.pad,
  22470. lhsParts = me.parts,
  22471. lhsLength = lhsParts.length,
  22472. rhsVersion = other.isVersion ? other : new Version(other),
  22473. rhsPad = rhsVersion.pad,
  22474. rhsParts = rhsVersion.parts,
  22475. rhsLength = rhsParts.length,
  22476. length = Math.max(lhsLength, rhsLength),
  22477. i, lhs, rhs;
  22478. for (i = 0; i < length; i++) {
  22479. lhs = (i < lhsLength) ? lhsParts[i] : lhsPad;
  22480. rhs = (i < rhsLength) ? rhsParts[i] : rhsPad;
  22481. // When one or both of the values are NaN these tests produce false
  22482. // and we end up treating NaN as equal to anything.
  22483. if (lhs < rhs) {
  22484. return -1;
  22485. }
  22486. if (lhs > rhs) {
  22487. return 1;
  22488. }
  22489. }
  22490. // same comments about NaN apply here...
  22491. lhs = me.releaseValue;
  22492. rhs = rhsVersion.releaseValue;
  22493. if (lhs < rhs) {
  22494. return -1;
  22495. }
  22496. if (lhs > rhs) {
  22497. return 1;
  22498. }
  22499. return 0;
  22500. },
  22501. /**
  22502. * Override the native `toString` method
  22503. * @private
  22504. * @return {String} version
  22505. */
  22506. toString: function() {
  22507. return this.version;
  22508. },
  22509. /**
  22510. * Override the native `valueOf` method
  22511. * @private
  22512. * @return {String} version
  22513. */
  22514. valueOf: function() {
  22515. return this.version;
  22516. },
  22517. /**
  22518. * Returns the major component value.
  22519. * @return {Number}
  22520. */
  22521. getMajor: function() {
  22522. return this.major;
  22523. },
  22524. /**
  22525. * Returns the minor component value.
  22526. * @return {Number}
  22527. */
  22528. getMinor: function() {
  22529. return this.minor;
  22530. },
  22531. /**
  22532. * Returns the patch component value.
  22533. * @return {Number}
  22534. */
  22535. getPatch: function() {
  22536. return this.patch;
  22537. },
  22538. /**
  22539. * Returns the build component value.
  22540. * @return {Number}
  22541. */
  22542. getBuild: function() {
  22543. return this.build;
  22544. },
  22545. /**
  22546. * Returns the release component text (e.g., "beta").
  22547. * @return {String}
  22548. */
  22549. getRelease: function() {
  22550. return this.release;
  22551. },
  22552. /**
  22553. * Returns the release component value for comparison purposes.
  22554. * @return {Number/String}
  22555. */
  22556. getReleaseValue: function() {
  22557. return this.releaseValue;
  22558. },
  22559. /**
  22560. * Returns whether this version if greater than the supplied argument
  22561. * @param {String/Number} target The version to compare with
  22562. * @return {Boolean} `true` if this version if greater than the target, `false` otherwise
  22563. */
  22564. isGreaterThan: function(target) {
  22565. return this.compareTo(target) > 0;
  22566. },
  22567. /**
  22568. * Returns whether this version if greater than or equal to the supplied argument
  22569. * @param {String/Number} target The version to compare with
  22570. * @return {Boolean} `true` if this version if greater than or equal to the target,
  22571. * `false` otherwise
  22572. */
  22573. isGreaterThanOrEqual: function(target) {
  22574. return this.compareTo(target) >= 0;
  22575. },
  22576. /**
  22577. * Returns whether this version if smaller than the supplied argument
  22578. * @param {String/Number} target The version to compare with
  22579. * @return {Boolean} `true` if this version if smaller than the target, `false` otherwise
  22580. */
  22581. isLessThan: function(target) {
  22582. return this.compareTo(target) < 0;
  22583. },
  22584. /**
  22585. * Returns whether this version if less than or equal to the supplied argument
  22586. * @param {String/Number} target The version to compare with
  22587. * @return {Boolean} `true` if this version if less than or equal to the target,
  22588. * `false` otherwise
  22589. */
  22590. isLessThanOrEqual: function(target) {
  22591. return this.compareTo(target) <= 0;
  22592. },
  22593. /**
  22594. * Returns whether this version equals to the supplied argument
  22595. * @param {String/Number} target The version to compare with
  22596. * @return {Boolean} `true` if this version equals to the target, `false` otherwise
  22597. */
  22598. equals: function(target) {
  22599. return this.compareTo(target) === 0;
  22600. },
  22601. /**
  22602. * Returns whether this version matches the supplied argument. Example:
  22603. *
  22604. * var version = new Ext.Version('1.0.2beta');
  22605. * console.log(version.match(1)); // true
  22606. * console.log(version.match(1.0)); // true
  22607. * console.log(version.match('1.0.2')); // true
  22608. * console.log(version.match('1.0.2RC')); // false
  22609. *
  22610. * @param {String/Number} target The version to compare with
  22611. * @return {Boolean} `true` if this version matches the target, `false` otherwise
  22612. */
  22613. match: function(target) {
  22614. target = String(target);
  22615. return this.version.substr(0, target.length) === target;
  22616. },
  22617. /**
  22618. * Returns this format: [major, minor, patch, build, release]. Useful for comparison.
  22619. * @return {Number[]}
  22620. */
  22621. toArray: function() {
  22622. var me = this;
  22623. return [
  22624. me.getMajor(),
  22625. me.getMinor(),
  22626. me.getPatch(),
  22627. me.getBuild(),
  22628. me.getRelease()
  22629. ];
  22630. },
  22631. /**
  22632. * Returns shortVersion version without dots and release
  22633. * @return {String}
  22634. */
  22635. getShortVersion: function() {
  22636. return this.shortVersion;
  22637. },
  22638. /**
  22639. * Convenient alias to {@link Ext.Version#isGreaterThan isGreaterThan}
  22640. * @param {String/Number/Ext.Version} target
  22641. * @return {Boolean}
  22642. */
  22643. gt: function(target) {
  22644. return this.compareTo(target) > 0;
  22645. },
  22646. /**
  22647. * Convenient alias to {@link Ext.Version#isLessThan isLessThan}
  22648. * @param {String/Number/Ext.Version} target
  22649. * @return {Boolean}
  22650. */
  22651. lt: function(target) {
  22652. return this.compareTo(target) < 0;
  22653. },
  22654. /**
  22655. * Convenient alias to {@link Ext.Version#isGreaterThanOrEqual isGreaterThanOrEqual}
  22656. * @param {String/Number/Ext.Version} target
  22657. * @return {Boolean}
  22658. */
  22659. gtEq: function(target) {
  22660. return this.compareTo(target) >= 0;
  22661. },
  22662. /**
  22663. * Convenient alias to {@link Ext.Version#isLessThanOrEqual isLessThanOrEqual}
  22664. * @param {String/Number/Ext.Version} target
  22665. * @return {Boolean}
  22666. */
  22667. ltEq: function(target) {
  22668. return this.compareTo(target) <= 0;
  22669. }
  22670. };
  22671. Ext.apply(Version, {
  22672. aliases: {
  22673. from: {
  22674. extjs: 'ext',
  22675. core: 'core',
  22676. touch: 'modern'
  22677. },
  22678. to: {
  22679. ext: [
  22680. 'extjs'
  22681. ],
  22682. 'core': [
  22683. 'core'
  22684. ],
  22685. modern: [
  22686. 'touch'
  22687. ]
  22688. }
  22689. },
  22690. /**
  22691. * @private
  22692. */
  22693. releaseValueMap: {
  22694. dev: -6,
  22695. alpha: -5,
  22696. a: -5,
  22697. beta: -4,
  22698. b: -4,
  22699. rc: -3,
  22700. '#': -2,
  22701. p: -1,
  22702. pl: -1
  22703. },
  22704. /**
  22705. * Converts a version component to a comparable value
  22706. *
  22707. * @static
  22708. * @param {Object} value The value to convert
  22709. * @return {Object}
  22710. */
  22711. getComponentValue: function(value) {
  22712. // eslint-disable-next-line max-len
  22713. return !value ? 0 : (isNaN(value) ? this.releaseValueMap[value] || value : parseInt(value, 10));
  22714. },
  22715. /**
  22716. * Compare 2 specified versions by ensuring the first parameter is a `Version`
  22717. * instance and then calling the `compareTo` method.
  22718. *
  22719. * @static
  22720. * @param {String} current The current version to compare to
  22721. * @param {String} target The target version to compare to
  22722. * @return {Number} Returns -1 if the current version is smaller than the target version,
  22723. * 1 if greater, and 0 if they're equivalent
  22724. */
  22725. compare: function(current, target) {
  22726. var ver = current.isVersion ? current : new Version(current);
  22727. return ver.compareTo(target);
  22728. },
  22729. set: function(collection, packageName, version) {
  22730. var aliases = Version.aliases.to[packageName],
  22731. ver = version.isVersion ? version : new Version(version),
  22732. i;
  22733. collection[packageName] = ver;
  22734. if (aliases) {
  22735. for (i = aliases.length; i-- > 0; ) {
  22736. collection[aliases[i]] = ver;
  22737. }
  22738. }
  22739. return ver;
  22740. }
  22741. });
  22742. /**
  22743. * @class Ext
  22744. */
  22745. Ext.apply(Ext, {
  22746. /**
  22747. * @private
  22748. */
  22749. compatVersions: {},
  22750. /**
  22751. * @private
  22752. *
  22753. * Object containing version information for all packages utilized by your
  22754. * application.
  22755. *
  22756. * For a public getter, please see `Ext.getVersion()`.
  22757. */
  22758. versions: {},
  22759. /**
  22760. * @private
  22761. */
  22762. lastRegisteredVersion: null,
  22763. /**
  22764. * Get the compatibility level (a version number) for the given package name. If
  22765. * none has been registered with `Ext.setCompatVersion` then `Ext.getVersion` is
  22766. * used to get the current version.
  22767. *
  22768. * @param {String} packageName The package name, e.g. 'core', 'touch', 'ext'.
  22769. * @since 5.0.0
  22770. * @private
  22771. */
  22772. getCompatVersion: function(packageName) {
  22773. var versions = Ext.compatVersions,
  22774. compat;
  22775. if (!packageName) {
  22776. compat = versions.ext || versions.touch || versions.core;
  22777. } else {
  22778. compat = versions[Version.aliases.from[packageName] || packageName];
  22779. }
  22780. return compat || Ext.getVersion(packageName);
  22781. },
  22782. /**
  22783. * Set the compatibility level (a version number) for the given package name.
  22784. *
  22785. * @param {String} packageName The package name, e.g. 'core', 'touch', 'ext'.
  22786. * @param {String/Ext.Version} version The version, e.g. '4.2'.
  22787. * @since 5.0.0
  22788. * @private
  22789. */
  22790. setCompatVersion: function(packageName, version) {
  22791. Version.set(Ext.compatVersions, packageName, version);
  22792. },
  22793. /**
  22794. * Set version number for the given package name.
  22795. *
  22796. * @param {String} packageName The package name, e.g. 'core', 'touch', 'ext'.
  22797. * @param {String/Ext.Version} version The version, e.g. '1.2.3alpha', '2.4.0-dev'.
  22798. * @return {Ext}
  22799. */
  22800. setVersion: function(packageName, version) {
  22801. if (packageName in toolkitNames) {
  22802. Ext.toolkit = packageName;
  22803. }
  22804. Ext.lastRegisteredVersion = Version.set(Ext.versions, packageName, version);
  22805. return this;
  22806. },
  22807. /**
  22808. * Get the version number of the supplied package name; will return the version of
  22809. * the framework.
  22810. *
  22811. * @param {String} [packageName] The package name, e.g., 'core', 'touch', 'ext'.
  22812. * @return {Ext.Version} The version.
  22813. */
  22814. getVersion: function(packageName) {
  22815. var versions = Ext.versions;
  22816. if (!packageName) {
  22817. return versions.ext || versions.touch || versions.core;
  22818. }
  22819. return versions[Version.aliases.from[packageName] || packageName];
  22820. },
  22821. /**
  22822. * This method checks the registered package versions against the provided version
  22823. * `specs`. A `spec` is either a string or an object indicating a boolean operator.
  22824. * This method accepts either form or an array of these as the first argument. The
  22825. * second argument applies only when the first is an array and indicates whether
  22826. * all `specs` must match or just one.
  22827. *
  22828. * ## Package Version Specifications
  22829. * The string form of a `spec` is used to indicate a version or range of versions
  22830. * for a particular package. This form of `spec` consists of three (3) parts:
  22831. *
  22832. * * Package name followed by "@". If not provided, the framework is assumed.
  22833. * * Minimum version.
  22834. * * Maximum version.
  22835. *
  22836. * At least one version number must be provided. If both minimum and maximum are
  22837. * provided, these must be separated by a "-".
  22838. *
  22839. * Some examples of package version specifications:
  22840. *
  22841. * 4.2.2 (exactly version 4.2.2 of the framework)
  22842. * 4.2.2+ (version 4.2.2 or higher of the framework)
  22843. * 4.2.2- (version 4.2.2 or higher of the framework)
  22844. * 4.2.1 - 4.2.3 (versions from 4.2.1 up to 4.2.3 of the framework)
  22845. * - 4.2.2 (any version up to version 4.2.1 of the framework)
  22846. *
  22847. * foo@1.0 (exactly version 1.0 of package "foo")
  22848. * foo@1.0-1.3 (versions 1.0 up to 1.3 of package "foo")
  22849. *
  22850. * **NOTE:** This syntax is the same as that used in Sencha Cmd's package
  22851. * requirements declarations.
  22852. *
  22853. * ## Boolean Operator Specifications
  22854. * Instead of a string, an object can be used to describe a boolean operation to
  22855. * perform on one or more `specs`. The operator is either **`and`** or **`or`**
  22856. * and can contain an optional **`not`**.
  22857. *
  22858. * For example:
  22859. *
  22860. * {
  22861. * not: true, // negates boolean result
  22862. * and: [
  22863. * '4.2.2',
  22864. * 'foo@1.0.1 - 2.0.1'
  22865. * ]
  22866. * }
  22867. *
  22868. * Each element of the array can in turn be a string or object spec. In other
  22869. * words, the value is passed to this method (recursively) as the first argument
  22870. * so these two calls are equivalent:
  22871. *
  22872. * Ext.checkVersion({
  22873. * not: true, // negates boolean result
  22874. * and: [
  22875. * '4.2.2',
  22876. * 'foo@1.0.1 - 2.0.1'
  22877. * ]
  22878. * });
  22879. *
  22880. * !Ext.checkVersion([
  22881. * '4.2.2',
  22882. * 'foo@1.0.1 - 2.0.1'
  22883. * ], true);
  22884. *
  22885. * ## Examples
  22886. *
  22887. * // A specific framework version
  22888. * Ext.checkVersion('4.2.2');
  22889. *
  22890. * // A range of framework versions:
  22891. * Ext.checkVersion('4.2.1-4.2.3');
  22892. *
  22893. * // A specific version of a package:
  22894. * Ext.checkVersion('foo@1.0.1');
  22895. *
  22896. * // A single spec that requires both a framework version and package
  22897. * // version range to match:
  22898. * Ext.checkVersion({
  22899. * and: [
  22900. * '4.2.2',
  22901. * 'foo@1.0.1-1.0.2'
  22902. * ]
  22903. * });
  22904. *
  22905. * // These checks can be nested:
  22906. * Ext.checkVersion({
  22907. * and: [
  22908. * '4.2.2', // exactly version 4.2.2 of the framework *AND*
  22909. * {
  22910. * // either (or both) of these package specs:
  22911. * or: [
  22912. * 'foo@1.0.1-1.0.2',
  22913. * 'bar@3.0+'
  22914. * ]
  22915. * }
  22916. * ]
  22917. * });
  22918. *
  22919. * ## Version Comparisons
  22920. * Version comparsions are assumed to be "prefix" based. That is to say, `"foo@1.2"`
  22921. * matches any version of "foo" that has a major version 1 and a minor version of 2.
  22922. *
  22923. * This also applies to ranges. For example `"foo@1.2-2.2"` matches all versions
  22924. * of "foo" from 1.2 up to 2.2 regardless of the specific patch and build.
  22925. *
  22926. * ## Use in Overrides
  22927. * This methods primary use is in support of conditional overrides on an
  22928. * `Ext.define` declaration.
  22929. *
  22930. * @param {String/Array/Object} specs A version specification string, an object
  22931. * containing `or` or `and` with a value that is equivalent to `specs` or an array
  22932. * of either of these.
  22933. * @param {Boolean} [matchAll=false] Pass `true` to require all specs to match.
  22934. * @return {Boolean} True if `specs` matches the registered package versions.
  22935. */
  22936. checkVersion: function(specs, matchAll) {
  22937. var isArray = Ext.isArray(specs),
  22938. aliases = Version.aliases.from,
  22939. compat = isArray ? specs : checkVerTemp,
  22940. length = compat.length,
  22941. versions = Ext.versions,
  22942. frameworkVer = versions.ext || versions.touch,
  22943. i, index, matches, minVer, maxVer, packageName, spec, range, ver;
  22944. if (!isArray) {
  22945. checkVerTemp[0] = specs;
  22946. }
  22947. for (i = 0; i < length; ++i) {
  22948. if (!Ext.isString(spec = compat[i])) {
  22949. matches = Ext.checkVersion(spec.and || spec.or, !spec.or);
  22950. if (spec.not) {
  22951. matches = !matches;
  22952. }
  22953. } else {
  22954. if (spec.indexOf(' ') >= 0) {
  22955. spec = spec.replace(stripRe, '');
  22956. }
  22957. // For "name@..." syntax, we need to find the package by the given name
  22958. // as a registered package.
  22959. index = spec.indexOf('@');
  22960. if (index < 0) {
  22961. range = spec;
  22962. ver = frameworkVer;
  22963. } else {
  22964. packageName = spec.substring(0, index);
  22965. if (!(ver = versions[aliases[packageName] || packageName])) {
  22966. // The package is not registered, so if we must matchAll then
  22967. // we are done - FAIL:
  22968. if (matchAll) {
  22969. return false;
  22970. }
  22971. // Otherwise this spec is not a match so we can move on to the
  22972. // next...
  22973. continue;
  22974. }
  22975. range = spec.substring(index + 1);
  22976. }
  22977. // Now look for a version, version range or partial range:
  22978. index = range.indexOf('-');
  22979. if (index < 0) {
  22980. // just a version or "1.0+"
  22981. if (range.charAt(index = range.length - 1) === '+') {
  22982. minVer = range.substring(0, index);
  22983. maxVer = null;
  22984. } else {
  22985. minVer = maxVer = range;
  22986. }
  22987. } else if (index > 0) {
  22988. // a range like "1.0-1.5" or "1.0-"
  22989. minVer = range.substring(0, index);
  22990. maxVer = range.substring(index + 1);
  22991. } else // may be empty
  22992. {
  22993. // an upper limit like "-1.5"
  22994. minVer = null;
  22995. maxVer = range.substring(index + 1);
  22996. }
  22997. matches = true;
  22998. if (minVer) {
  22999. minVer = new Version(minVer, '~');
  23000. // prefix matching
  23001. matches = minVer.ltEq(ver);
  23002. }
  23003. if (matches && maxVer) {
  23004. maxVer = new Version(maxVer, '~');
  23005. // prefix matching
  23006. matches = maxVer.gtEq(ver);
  23007. }
  23008. }
  23009. // string spec
  23010. if (matches) {
  23011. // spec matched and we are looking for any match, so we are GO!
  23012. if (!matchAll) {
  23013. return true;
  23014. }
  23015. } else if (matchAll) {
  23016. // spec does not match the registered package version
  23017. return false;
  23018. }
  23019. }
  23020. // In the loop above, for matchAll we return FALSE on mismatch, so getting
  23021. // here with matchAll means we had no mismatches. On the other hand, if we
  23022. // are !matchAll, we return TRUE on match and so we get here only if we found
  23023. // no matches.
  23024. return !!matchAll;
  23025. },
  23026. /**
  23027. * Create a closure for deprecated code.
  23028. *
  23029. * // This means Ext.oldMethod is only supported in 4.0.0beta and older.
  23030. * // If Ext.getVersion('extjs') returns a version that is later than '4.0.0beta',
  23031. * // for example '4.0.0RC', the closure will not be invoked
  23032. * Ext.deprecate('extjs', '4.0.0beta', function() {
  23033. * Ext.oldMethod = Ext.newMethod;
  23034. *
  23035. * ...
  23036. * });
  23037. *
  23038. * @param {String} packageName The package name
  23039. * @param {String} since The last version before it's deprecated
  23040. * @param {Function} closure The callback function to be executed with the specified
  23041. * version is less than the current version
  23042. * @param {Object} scope The execution scope (`this`) if the closure
  23043. * @private
  23044. */
  23045. deprecate: function(packageName, since, closure, scope) {
  23046. if (Version.compare(Ext.getVersion(packageName), since) < 1) {
  23047. closure.call(scope);
  23048. }
  23049. }
  23050. });
  23051. }());
  23052. // End Versioning
  23053. // load the cmd-5 style app manifest metadata now, if available...
  23054. (function(manifest) {
  23055. var packages = (manifest && manifest.packages) || {},
  23056. compat = manifest && manifest.compatibility,
  23057. name, pkg;
  23058. for (name in packages) {
  23059. pkg = packages[name];
  23060. if (pkg && pkg.version) {
  23061. Ext.setVersion(name, pkg.version);
  23062. }
  23063. }
  23064. if (compat) {
  23065. if (Ext.isString(compat)) {
  23066. Ext.setCompatVersion('core', compat);
  23067. } else {
  23068. for (name in compat) {
  23069. Ext.setCompatVersion(name, compat[name]);
  23070. }
  23071. }
  23072. }
  23073. if (!packages.ext && !packages.touch) {
  23074. Ext.setVersion('ext', '7.4.0.42');
  23075. Ext.setVersion('core', '7.4.0.42');
  23076. }
  23077. })(Ext.manifest);
  23078. /**
  23079. * @class Ext.Config
  23080. * This class manages a config property. Instances of this type are created and cached as
  23081. * classes declare their config properties. One instance of this class is created per
  23082. * config property name.
  23083. *
  23084. * Ext.define('MyClass', {
  23085. * config: {
  23086. * foo: 42
  23087. * }
  23088. * });
  23089. *
  23090. * This uses the cached `Ext.Config` instance for the "foo" property.
  23091. *
  23092. * When config properties apply options to config properties a prototype chained object is
  23093. * created from the cached instance. For example:
  23094. *
  23095. * Ext.define('MyClass', {
  23096. * config: {
  23097. * foo: {
  23098. * $value: 42,
  23099. * lazy: true
  23100. * }
  23101. * }
  23102. * });
  23103. *
  23104. * This creates a prototype chain to the cached "foo" instance of `Ext.Config` and applies
  23105. * the `lazy` option to that new instance. This chained instance is then kept by the
  23106. * `Ext.Configurator` for that class.
  23107. * @private
  23108. */
  23109. Ext.Config = function(name) {
  23110. // @define Ext.class.Config
  23111. // @define Ext.Config
  23112. var me = this,
  23113. capitalizedName = name.charAt(0).toUpperCase() + name.substr(1);
  23114. /**
  23115. * @property {String} name
  23116. * The name of this config property.
  23117. * @readonly
  23118. * @private
  23119. * @since 5.0.0
  23120. */
  23121. me.name = name;
  23122. /**
  23123. * @property {Object} names
  23124. * This object holds the cached names used to lookup properties or methods for this
  23125. * config property. The properties of this object are explained in the context of an
  23126. * example property named "foo".
  23127. *
  23128. * @property {String} names.internal The default backing property ("_foo").
  23129. *
  23130. * @property {String} names.initializing The property that is `true` when the config
  23131. * is being initialized ("isFooInitializing").
  23132. *
  23133. * @property {String} names.apply The name of the applier method ("applyFoo").
  23134. *
  23135. * @property {String} names.update The name of the updater method ("updateFoo").
  23136. *
  23137. * @property {String} names.get The name of the getter method ("getFoo").
  23138. *
  23139. * @property {String} names.set The name of the setter method ("setFoo").
  23140. *
  23141. * @property {String} names.initGet The name of the initializing getter ("initGetFoo").
  23142. *
  23143. * @property {String} names.changeEvent The name of the change event ("foochange").
  23144. *
  23145. * @readonly
  23146. * @private
  23147. * @since 5.0.0
  23148. */
  23149. me.names = {
  23150. internal: '_' + name,
  23151. initializing: 'is' + capitalizedName + 'Initializing',
  23152. apply: 'apply' + capitalizedName,
  23153. update: 'update' + capitalizedName,
  23154. get: 'get' + capitalizedName,
  23155. set: 'set' + capitalizedName,
  23156. initGet: 'initGet' + capitalizedName,
  23157. changeEvent: name.toLowerCase() + 'change'
  23158. };
  23159. // This allows folks to prototype chain on top of these objects and yet still cache
  23160. // generated methods at the bottom of the chain.
  23161. me.root = me;
  23162. };
  23163. Ext.Config.map = {};
  23164. Ext.Config.get = function(name) {
  23165. var map = Ext.Config.map,
  23166. ret = map[name] || (map[name] = new Ext.Config(name));
  23167. return ret;
  23168. };
  23169. Ext.Config.prototype = {
  23170. self: Ext.Config,
  23171. isConfig: true,
  23172. /**
  23173. * @cfg {Boolean} [cached=false]
  23174. * When set as `true` the config property will be stored on the class prototype once
  23175. * the first instance has had a chance to process the default value.
  23176. * @private
  23177. * @since 5.0.0
  23178. */
  23179. /**
  23180. * @cfg {Boolean} [lazy=false]
  23181. * When set as `true` the config property will not be immediately initialized during
  23182. * the `initConfig` call.
  23183. * @private
  23184. * @since 5.0.0
  23185. */
  23186. /**
  23187. * @cfg {Boolean} [evented=false]
  23188. * When set as `true` the config property will be treated as a
  23189. * {@link Ext.Evented Evented Config}.
  23190. * @private
  23191. * @since 6.0.0
  23192. */
  23193. /**
  23194. * @cfg {Function} [merge]
  23195. * This function if supplied will be called as classes or instances provide values
  23196. * that need to be combined with inherited values. The function should return the
  23197. * value that will be the config value. Further calls may receive such returned
  23198. * values as `oldValue`.
  23199. *
  23200. * @cfg {Mixed} merge.newValue The new value to merge with the old.
  23201. *
  23202. * @cfg {Mixed} merge.oldValue The current value prior to `newValue` being merged.
  23203. *
  23204. * @cfg {Mixed} merge.target The class or instance to which the merged config value
  23205. * will be applied.
  23206. *
  23207. * @cfg {Ext.Class} merge.mixinClass The mixin providing the `newValue` or `null` if
  23208. * the `newValue` is not being provided by a mixin.
  23209. */
  23210. combine: function(value, baseValue, instance, clone) {
  23211. var cfg = this;
  23212. if (cfg.merge) {
  23213. value = cfg.merge(clone ? Ext.clone(value) : value, baseValue, instance);
  23214. } else if (value && value.constructor === Object && baseValue && baseValue.constructor === Object) {
  23215. value = Ext.merge({}, baseValue, value);
  23216. } else if (clone && value) {
  23217. value = Ext.clone(value);
  23218. }
  23219. return value;
  23220. },
  23221. equals: function(value1, value2) {
  23222. return value1 === value2;
  23223. },
  23224. getGetter: function() {
  23225. return this.getter || (this.root.getter = this.makeGetter());
  23226. },
  23227. getInitGetter: function() {
  23228. return this.initGetter || (this.root.initGetter = this.makeInitGetter());
  23229. },
  23230. getSetter: function() {
  23231. return this.setter || (this.root.setter = this.makeSetter());
  23232. },
  23233. getEventedSetter: function() {
  23234. return this.eventedSetter || (this.root.eventedSetter = this.makeEventedSetter());
  23235. },
  23236. /**
  23237. * Returns the name of the property that stores this config on the given instance or
  23238. * class prototype.
  23239. * @param {Object} target
  23240. * @return {String}
  23241. */
  23242. getInternalName: function(target) {
  23243. return target.$configPrefixed ? this.names.internal : this.name;
  23244. },
  23245. mergeNew: function(newValue, oldValue, target, mixinClass) {
  23246. var ret, key;
  23247. if (!oldValue) {
  23248. ret = newValue;
  23249. } else if (!newValue) {
  23250. ret = oldValue;
  23251. } else {
  23252. ret = Ext.Object.chain(oldValue);
  23253. for (key in newValue) {
  23254. if (!mixinClass || !(key in ret)) {
  23255. ret[key] = newValue[key];
  23256. }
  23257. }
  23258. }
  23259. return ret;
  23260. },
  23261. /**
  23262. * Merges the `newValue` and the `oldValue` assuming that these are basically objects
  23263. * the represent sets. For example something like:
  23264. *
  23265. * {
  23266. * foo: true,
  23267. * bar: true
  23268. * }
  23269. *
  23270. * The merge process converts arrays like the following into the above:
  23271. *
  23272. * [ 'foo', 'bar' ]
  23273. *
  23274. * @param {String/String[]/Object} newValue
  23275. * @param {Object} oldValue
  23276. * @param {Boolean} [preserveExisting=false]
  23277. * @return {Object}
  23278. * @private
  23279. * @since 5.0.0
  23280. */
  23281. mergeSets: function(newValue, oldValue, preserveExisting) {
  23282. var ret = oldValue ? Ext.Object.chain(oldValue) : {},
  23283. i, val;
  23284. if (newValue instanceof Array) {
  23285. for (i = newValue.length; i--; ) {
  23286. val = newValue[i];
  23287. if (!preserveExisting || !(val in ret)) {
  23288. ret[val] = true;
  23289. }
  23290. }
  23291. } else if (newValue) {
  23292. if (newValue.constructor === Object) {
  23293. for (i in newValue) {
  23294. val = newValue[i];
  23295. if (!preserveExisting || !(i in ret)) {
  23296. ret[i] = val;
  23297. }
  23298. }
  23299. } else if (!preserveExisting || !(newValue in ret)) {
  23300. ret[newValue] = true;
  23301. }
  23302. }
  23303. return ret;
  23304. },
  23305. //--------------------------------------------------
  23306. // Factories
  23307. makeGetter: function() {
  23308. var name = this.name,
  23309. prefixedName = this.names.internal;
  23310. return function() {
  23311. var internalName = this.$configPrefixed ? prefixedName : name;
  23312. return this[internalName];
  23313. };
  23314. },
  23315. makeInitGetter: function() {
  23316. var name = this.name,
  23317. names = this.names,
  23318. setName = names.set,
  23319. getName = names.get,
  23320. initializingName = names.initializing;
  23321. return function() {
  23322. var me = this;
  23323. me[initializingName] = true;
  23324. // Remove the initGetter from the instance now that the value has been set.
  23325. delete me[getName];
  23326. me[setName](me.config[name]);
  23327. delete me[initializingName];
  23328. return me[getName].apply(me, arguments);
  23329. };
  23330. },
  23331. makeSetter: function() {
  23332. var name = this.name,
  23333. names = this.names,
  23334. prefixedName = names.internal,
  23335. getName = names.get,
  23336. applyName = names.apply,
  23337. updateName = names.update,
  23338. setter;
  23339. // http://jsperf.com/method-call-apply-or-direct
  23340. // http://jsperf.com/method-detect-invoke
  23341. setter = function(value) {
  23342. var me = this,
  23343. internalName = me.$configPrefixed ? prefixedName : name,
  23344. oldValue = me[internalName],
  23345. watch;
  23346. // Remove the initGetter from the instance now that the value has been set.
  23347. delete me[getName];
  23348. if (!me[applyName] || (value = me[applyName](value, oldValue)) !== undefined) {
  23349. // The old value might have been changed at this point
  23350. // (after the apply call chain) so it should be read again
  23351. if (value !== (oldValue = me[internalName])) {
  23352. me[internalName] = value;
  23353. if (me[updateName]) {
  23354. me[updateName](value, oldValue);
  23355. }
  23356. watch = me.$configWatch;
  23357. if (watch && !me.isConfiguring) {
  23358. // Since the updater could have modified things (tho unlikely), just
  23359. // re-read the stored value:
  23360. watch.fire(name, [
  23361. me,
  23362. name,
  23363. me[internalName],
  23364. oldValue
  23365. ]);
  23366. }
  23367. }
  23368. }
  23369. return me;
  23370. };
  23371. setter.$isDefault = true;
  23372. return setter;
  23373. },
  23374. makeEventedSetter: function() {
  23375. var name = this.name,
  23376. names = this.names,
  23377. prefixedName = names.internal,
  23378. getName = names.get,
  23379. applyName = names.apply,
  23380. updateName = names.update,
  23381. changeEventName = names.changeEvent,
  23382. updateFn = function(me, value, oldValue, internalName) {
  23383. me[internalName] = value;
  23384. if (me[updateName]) {
  23385. me[updateName](value, oldValue);
  23386. }
  23387. // eslint-disable-next-line vars-on-top
  23388. var watch = me.$configWatch;
  23389. if (watch) {
  23390. // !me.isConfiguring is assured
  23391. watch.fire(name, [
  23392. me,
  23393. name,
  23394. value,
  23395. oldValue
  23396. ]);
  23397. }
  23398. },
  23399. setter;
  23400. // http://jsperf.com/method-call-apply-or-direct
  23401. // http://jsperf.com/method-detect-invoke
  23402. setter = function(value) {
  23403. var me = this,
  23404. internalName = me.$configPrefixed ? prefixedName : name,
  23405. oldValue = me[internalName];
  23406. // Remove the initGetter from the instance now that the value has been set.
  23407. delete me[getName];
  23408. if (!me[applyName] || (value = me[applyName](value, oldValue)) !== undefined) {
  23409. // The old value might have been changed at this point
  23410. // (after the apply call chain) so it should be read again
  23411. if (value !== (oldValue = me[internalName])) {
  23412. if (me.isConfiguring) {
  23413. me[internalName] = value;
  23414. if (me[updateName]) {
  23415. me[updateName](value, oldValue);
  23416. }
  23417. } else {
  23418. me.fireEventedAction(changeEventName, [
  23419. me,
  23420. value,
  23421. oldValue
  23422. ], updateFn, me, [
  23423. me,
  23424. value,
  23425. oldValue,
  23426. internalName
  23427. ]);
  23428. }
  23429. }
  23430. }
  23431. return me;
  23432. };
  23433. setter.$isDefault = true;
  23434. return setter;
  23435. }
  23436. };
  23437. /**
  23438. * @class Ext.Configurator
  23439. * This class manages the config properties for a class.
  23440. * @private
  23441. */
  23442. (function() {
  23443. // see end of file (and please don't indent the whole file)
  23444. var ExtConfig = Ext.Config,
  23445. configPropMap = ExtConfig.map,
  23446. ExtObject = Ext.Object;
  23447. Ext.Configurator = function(cls) {
  23448. // @define Ext.class.Configurator
  23449. // @define Ext.Configurator
  23450. // @require Ext.Config
  23451. var me = this,
  23452. prototype = cls.prototype,
  23453. superCfg = cls.superclass ? cls.superclass.self.$config : null;
  23454. /**
  23455. * @property {Ext.Class} cls The class to which this instance is associated.
  23456. * @private
  23457. * @readonly
  23458. */
  23459. me.cls = cls;
  23460. /**
  23461. * The super class `Configurator` instance or `null` if there is no super class.
  23462. *
  23463. * @property {Ext.Configurator} superCfg
  23464. * @private
  23465. * @readonly
  23466. */
  23467. me.superCfg = superCfg;
  23468. if (superCfg) {
  23469. /**
  23470. * This object holds an `Ext.Config` value for each config property keyed by name.
  23471. * This object has as its prototype object the `configs` of its super class.
  23472. *
  23473. * This map is maintained as each property is added via the `add` method.
  23474. *
  23475. * @property {Object} configs
  23476. * @private
  23477. * @readonly
  23478. */
  23479. me.configs = ExtObject.chain(superCfg.configs);
  23480. /**
  23481. * This object holds a bool value for each cachedConfig property keyed by name.
  23482. *
  23483. * This map is maintained as each property is added via the `add` method.
  23484. *
  23485. * @property {Object} cachedConfigs
  23486. * @private
  23487. * @readonly
  23488. */
  23489. me.cachedConfigs = ExtObject.chain(superCfg.cachedConfigs);
  23490. /**
  23491. * This object holds a `Number` for each config property keyed by name. This object has
  23492. * as its prototype object the `initMap` of its super class. The value of each property
  23493. * has the following meaning:
  23494. *
  23495. * * `0` - initial value is `null` and requires no processing.
  23496. * * `1` - initial value must be set on each instance.
  23497. * * `2` - initial value can be cached on the prototype by the first instance.
  23498. *
  23499. * Any `null` values will either never be added to this map or (if added by a base
  23500. * class and set to `null` by a derived class) will cause the entry to be 0.
  23501. *
  23502. * This map is maintained as each property is added via the `add` method.
  23503. *
  23504. * @property {Object} initMap
  23505. * @private
  23506. * @readonly
  23507. */
  23508. me.initMap = ExtObject.chain(superCfg.initMap);
  23509. /**
  23510. * This object holds the default value for each config property keyed by name. This
  23511. * object has as its prototype object the `values` of its super class.
  23512. *
  23513. * This map is maintained as each property is added via the `add` method.
  23514. *
  23515. * @property {Object} values
  23516. * @private
  23517. * @readonly
  23518. */
  23519. me.values = ExtObject.chain(superCfg.values);
  23520. me.needsFork = superCfg.needsFork;
  23521. // The reason this feature is debug only is that we would have to create this
  23522. // map for all classes because deprecations could be added to bases after the
  23523. // derived class had created its Configurator.
  23524. me.deprecations = ExtObject.chain(superCfg.deprecations);
  23525. } else {
  23526. me.configs = {};
  23527. me.cachedConfigs = {};
  23528. me.initMap = {};
  23529. me.values = {};
  23530. me.deprecations = {};
  23531. }
  23532. prototype.config = prototype.defaultConfig = me.values;
  23533. cls.$config = me;
  23534. };
  23535. Ext.Configurator.prototype = {
  23536. self: Ext.Configurator,
  23537. needsFork: false,
  23538. /**
  23539. * This array holds the properties that need to be set on new instances.
  23540. *
  23541. * This array is populated when the first instance is passed to `configure` (basically
  23542. * when the first instance is created). The entries in `initMap` are iterated to find
  23543. * those configs needing per-instance processing.
  23544. *
  23545. * @property {Ext.Config[]} initList
  23546. * @private
  23547. */
  23548. initList: null,
  23549. /**
  23550. * This method adds new config properties. This is called for classes when they are
  23551. * declared, then for any mixins that class may define and finally for any overrides
  23552. * defined that target the class.
  23553. *
  23554. * @param {Object} config The config object containing the new config properties.
  23555. * @param {Ext.Class} [mixinClass] The mixin class if the configs are from a mixin.
  23556. * @private
  23557. */
  23558. add: function(config, mixinClass) {
  23559. var me = this,
  23560. Cls = me.cls,
  23561. configs = me.configs,
  23562. cachedConfigs = me.cachedConfigs,
  23563. initMap = me.initMap,
  23564. prototype = Cls.prototype,
  23565. mixinConfigs = mixinClass && mixinClass.$config.configs,
  23566. values = me.values,
  23567. isObject, meta, isCached, merge, cfg, currentValue, name, names, s, value;
  23568. for (name in config) {
  23569. value = config[name];
  23570. isObject = value && value.constructor === Object;
  23571. meta = isObject && '$value' in value ? value : null;
  23572. isCached = false;
  23573. if (meta) {
  23574. isCached = !!meta.cached;
  23575. value = meta.$value;
  23576. isObject = value && value.constructor === Object;
  23577. }
  23578. merge = meta && meta.merge;
  23579. cfg = configs[name];
  23580. if (cfg) {
  23581. // Only proceed with a mixin if we have a custom merge.
  23582. if (mixinClass) {
  23583. merge = cfg.merge;
  23584. if (!merge) {
  23585. continue;
  23586. }
  23587. // Don't want the mixin meta modifying our own
  23588. meta = null;
  23589. } else {
  23590. merge = merge || cfg.merge;
  23591. }
  23592. // This means that we've already declared this as a config in a superclass
  23593. // Let's not allow us to change it here.
  23594. if (!mixinClass && isCached && !cachedConfigs[name]) {
  23595. Ext.raise('Redefining config as cached: ' + name + ' in class: ' + Cls.$className);
  23596. }
  23597. // There is already a value for this config and we are not allowed to
  23598. // modify it. So, if it is an object and the new value is also an object,
  23599. // the result is a merge so we have to merge both on to a new object.
  23600. currentValue = values[name];
  23601. if (merge) {
  23602. value = merge.call(cfg, value, currentValue, Cls, mixinClass);
  23603. } else if (isObject) {
  23604. if (currentValue && currentValue.constructor === Object) {
  23605. // We favor moving the cost of an "extra" copy here because this
  23606. // is likely to be a rare thing two object values for the same
  23607. // property. The alternative would be to clone the initial value
  23608. // to make it safely modifiable even though it is likely to never
  23609. // need to be modified.
  23610. value = Ext.merge({}, currentValue, value);
  23611. }
  23612. }
  23613. } else // else "currentValue" is a primitive so "value" can just replace it
  23614. // else "value" is a primitive and it can just replace currentValue
  23615. {
  23616. // This is a new property value, so add it to the various maps "as is".
  23617. // In the majority of cases this value will not be overridden or need to
  23618. // be forked.
  23619. if (mixinConfigs) {
  23620. // Since this is a config from a mixin, we don't want to apply its
  23621. // meta-ness because it already has. Instead we want to use its cfg
  23622. // instance:
  23623. cfg = mixinConfigs[name];
  23624. meta = null;
  23625. } else {
  23626. cfg = ExtConfig.get(name);
  23627. }
  23628. configs[name] = cfg;
  23629. if (cfg.cached || isCached) {
  23630. cachedConfigs[name] = true;
  23631. }
  23632. // Ensure that the new config has a getter and setter. Because this method
  23633. // is called during class creation as the "config" (or "cachedConfig") is
  23634. // being processed, the user's methods will not be on the prototype yet.
  23635. //
  23636. // This has the following trade-offs:
  23637. //
  23638. // - Custom getters are rare so there is minimal waste generated by them.
  23639. //
  23640. // - Custom setters are more common but, by putting the default setter on
  23641. // the prototype prior to addMembers, when the user methods are added
  23642. // callParent can be used to call the generated setter. This is almost
  23643. // certainly desirable as the setter has some very important semantics
  23644. // that a custom setter would probably want to preserve by just adding
  23645. // logic before and/or after the callParent.
  23646. //
  23647. // - By not adding these to the class body we avoid all the "is function"
  23648. // tests that get applied to each class member thereby streamlining the
  23649. // downstream class creation process.
  23650. //
  23651. // We still check for getter and/or setter but primarily for reasons of
  23652. // backwards compatibility and "just in case" someone relied on inherited
  23653. // getter/setter even though the base did not have the property listed as
  23654. // a "config" (obscure case certainly).
  23655. //
  23656. names = cfg.names;
  23657. if (!prototype[s = names.get]) {
  23658. prototype[s] = cfg.getter || cfg.getGetter();
  23659. }
  23660. if (!prototype[s = names.set]) {
  23661. prototype[s] = (meta && meta.evented) ? (cfg.eventedSetter || cfg.getEventedSetter()) : (cfg.setter || cfg.getSetter());
  23662. }
  23663. }
  23664. if (meta) {
  23665. if (cfg.owner !== Cls) {
  23666. configs[name] = cfg = Ext.Object.chain(cfg);
  23667. cfg.owner = Cls;
  23668. }
  23669. Ext.apply(cfg, meta);
  23670. delete cfg.$value;
  23671. }
  23672. // Fork checks all the default values to see if they are arrays or objects
  23673. // Do this to save us from doing it on each run
  23674. if (!me.needsFork && value && (value.constructor === Object || value instanceof Array)) {
  23675. me.needsFork = true;
  23676. }
  23677. // If the value is non-null, we need to initialize it.
  23678. if (value !== null) {
  23679. initMap[name] = true;
  23680. } else {
  23681. if (prototype.$configPrefixed) {
  23682. prototype[configs[name].names.internal] = null;
  23683. } else {
  23684. prototype[configs[name].name] = null;
  23685. }
  23686. if (name in initMap) {
  23687. // Only set this to false if we already have it in the map, otherwise,
  23688. // just leave it out!
  23689. initMap[name] = false;
  23690. }
  23691. }
  23692. values[name] = value;
  23693. }
  23694. },
  23695. addDeprecations: function(configs) {
  23696. var me = this,
  23697. deprecations = me.deprecations,
  23698. className = (me.cls.$className || '') + '#',
  23699. message, newName, oldName;
  23700. for (oldName in configs) {
  23701. newName = configs[oldName];
  23702. // configs: {
  23703. // dead: null,
  23704. //
  23705. // renamed: 'newName',
  23706. //
  23707. // removed: {
  23708. // message: 'This config was replaced by pixie dust'
  23709. // }
  23710. // }
  23711. if (!newName) {
  23712. message = 'This config has been removed.';
  23713. } else if (!(message = newName.message)) {
  23714. message = 'This config has been renamed to "' + newName + '"';
  23715. }
  23716. deprecations[oldName] = className + oldName + ': ' + message;
  23717. }
  23718. },
  23719. /**
  23720. * This method configures the given `instance` using the specified `instanceConfig`.
  23721. * The given `instance` should have been created by this object's `cls`.
  23722. *
  23723. * @param {Object} instance The instance to configure.
  23724. * @param {Object} instanceConfig The configuration properties to apply to `instance`.
  23725. * @private
  23726. */
  23727. configure: function(instance, instanceConfig) {
  23728. var me = this,
  23729. configs = me.configs,
  23730. deprecations = me.deprecations,
  23731. initMap = me.initMap,
  23732. initListMap = me.initListMap,
  23733. initList = me.initList,
  23734. prototype = me.cls.prototype,
  23735. values = me.values,
  23736. remaining = 0,
  23737. firstInstance = !initList,
  23738. cachedInitList, cfg, getter, i, internalName, ln, names, name, value, isCached, valuesKey, field, transforms;
  23739. values = me.needsFork ? ExtObject.fork(values) : ExtObject.chain(values);
  23740. // Let apply/update methods know that the initConfig is currently running.
  23741. instance.isConfiguring = true;
  23742. if (firstInstance) {
  23743. // When called to configure the first instance of the class to which we are
  23744. // bound we take a bit to plan for instance 2+.
  23745. me.initList = initList = [];
  23746. me.initListMap = initListMap = {};
  23747. instance.isFirstInstance = true;
  23748. for (name in initMap) {
  23749. cfg = configs[name];
  23750. isCached = cfg.cached;
  23751. if (initMap[name]) {
  23752. names = cfg.names;
  23753. value = values[name];
  23754. if (!prototype[names.set].$isDefault || prototype[names.apply] || prototype[names.update] || typeof value === 'object') {
  23755. if (isCached) {
  23756. // This is a cachedConfig, so it needs to be initialized with
  23757. // the default value and placed on the prototype... but the
  23758. // instanceConfig may have a different value so the value may
  23759. // need resetting. We have to defer the call to the setter so
  23760. // that all of the initGetters are set up first.
  23761. (cachedInitList || (cachedInitList = [])).push(cfg);
  23762. } else {
  23763. // Remember this config so that all instances (including this
  23764. // one) can invoke the setter to properly initialize it.
  23765. initList.push(cfg);
  23766. initListMap[name] = true;
  23767. }
  23768. // Point all getters to the initGetters. By doing this here we
  23769. // avoid creating initGetters for configs that don't need them
  23770. // and we can easily pick up the cached fn to save the call.
  23771. instance[names.get] = cfg.initGetter || cfg.getInitGetter();
  23772. } else {
  23773. // Non-object configs w/o custom setter, applier or updater can
  23774. // be simply stored on the prototype.
  23775. prototype[cfg.getInternalName(prototype)] = value;
  23776. }
  23777. } else if (isCached) {
  23778. prototype[cfg.getInternalName(prototype)] = undefined;
  23779. }
  23780. }
  23781. }
  23782. // TODO - we need to combine the cached loop with the instanceConfig loop to
  23783. // avoid duplication of init getter setups (for correctness if a cached cfg
  23784. // calls on a non-cached cfg)
  23785. ln = cachedInitList && cachedInitList.length;
  23786. if (ln) {
  23787. // This is only ever done on the first instance we configure. Any config in
  23788. // cachedInitList has to be set to the default value to allow any side-effects
  23789. // or transformations to occur. The resulting values can then be elevated to
  23790. // the prototype and this property need not be initialized on each instance.
  23791. for (i = 0; i < ln; ++i) {
  23792. internalName = cachedInitList[i].getInternalName(prototype);
  23793. // Since these are cached configs the base class will potentially have put
  23794. // its cached values on the prototype so we need to hide these while we
  23795. // run the inits for our cached configs.
  23796. instance[internalName] = null;
  23797. }
  23798. for (i = 0; i < ln; ++i) {
  23799. names = (cfg = cachedInitList[i]).names;
  23800. getter = names.get;
  23801. if (instance.hasOwnProperty(getter)) {
  23802. instance[names.set](values[cfg.name]);
  23803. delete instance[getter];
  23804. }
  23805. }
  23806. for (i = 0; i < ln; ++i) {
  23807. internalName = cachedInitList[i].getInternalName(prototype);
  23808. prototype[internalName] = instance[internalName];
  23809. delete instance[internalName];
  23810. }
  23811. }
  23812. // The cachedConfigs have all been set to the default values including any of
  23813. // those that may have been triggered by their getter.
  23814. // If the instanceConfig has a platformConfig in it, we need to merge the active
  23815. // rules of that object to make the actual instanceConfig.
  23816. if (instanceConfig && instanceConfig.platformConfig) {
  23817. instanceConfig = me.resolvePlatformConfig(instance, instanceConfig);
  23818. }
  23819. if (firstInstance) {
  23820. // Allow the class to do things once the cachedConfig has been processed.
  23821. // We need to call this method always when the first instance is configured
  23822. // whether or not it actually has cached configs
  23823. if (instance.afterCachedConfig && !instance.afterCachedConfig.$nullFn) {
  23824. instance.afterCachedConfig(instanceConfig);
  23825. }
  23826. }
  23827. // Now that the cachedConfigs have been processed we can apply the instanceConfig
  23828. // and hide the "configs" on the prototype. This will serve as the source for any
  23829. // configs that need to initialize from their initial getter call.
  23830. // IMPORTANT: "this.hasOwnProperty('config')" is how a config applier/updater can
  23831. // tell it is processing the cached config value vs an instance config value.
  23832. instance.config = values;
  23833. // There are 2 possibilities here:
  23834. // 1) If it's the first time in this function, we may have had cachedConfigs running.
  23835. // these configs may have called the getters for any of the normal getters, which
  23836. // means the initial getters have been clobbered on the instance and won't be able
  23837. // to be called below when we iterate over the initList. As such, we need to
  23838. // reinitialize them here, even though we've done it up above.
  23839. //
  23840. // 2) If this the second time in this function, the cachedConfigs won't be processed,
  23841. // so we don't need to worry about them clobbering config values. However, since
  23842. // we've already done all our setup, we won't enter into the block that sets the
  23843. // initGetter, so we need to do it here anyway.
  23844. //
  23845. // Also note, that lazy configs will appear in the initList because we need
  23846. // to spin up the initGetter.
  23847. for (i = 0 , ln = initList.length; i < ln; ++i) {
  23848. cfg = initList[i];
  23849. instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
  23850. }
  23851. // Give the class a chance to transform the configs. These are stored on the class
  23852. // as a sorted array after the first instance is created. Prior to that, these are
  23853. // stored as a prototype chained object on the class prototype. This allows the
  23854. // transforms to be registered at any time during class load so long as they are
  23855. // all loaded before instances are created.
  23856. if (!(transforms = instance.self.$configTransforms)) {
  23857. instance.self.$configTransforms = transforms = [];
  23858. ln = instance.$configTransforms;
  23859. for (name in ln) {
  23860. transforms.push([
  23861. name,
  23862. ln[name]
  23863. ]);
  23864. }
  23865. ln = transforms.length;
  23866. if (ln > 1) {
  23867. transforms.sort(me.transformSorter);
  23868. for (i = 0; i < ln; ++i) {
  23869. transforms[i] = transforms[i][0];
  23870. }
  23871. } else if (ln) {
  23872. transforms[0] = transforms[0][0];
  23873. }
  23874. }
  23875. for (i = 0; i < transforms.length; ++i) {
  23876. name = transforms[i];
  23877. if (instance[name]) {
  23878. instanceConfig = instance[name](instanceConfig, me);
  23879. }
  23880. }
  23881. // Important: We are looping here twice on purpose. This first loop serves 2 purposes:
  23882. //
  23883. // 1) Ensure the values collection is fully populated before we call any setters. Since
  23884. // a setter may have an updater/applier, it could potentially call another getter() to grab
  23885. // the value for some other property, so this ensures they are all set on the config object.
  23886. //
  23887. // 2) Ensure that the initGetter is set as the getter for any config that doesn't appear in
  23888. // the initList. We need to ensure that the initGetter is pushed on for everything that
  23889. // we will be setting during init time.
  23890. //
  23891. // The merging in this loop cannot be completed by Ext.merge(), since we do NOT want
  23892. // to merge non-strict values, they should always just be assigned across without
  23893. // modification.
  23894. if (instanceConfig) {
  23895. for (name in instanceConfig) {
  23896. value = instanceConfig[name];
  23897. cfg = configs[name];
  23898. if (deprecations[name]) {
  23899. Ext.log.warn(deprecations[name]);
  23900. if (!cfg) {
  23901. // If there is a Config for this, perhaps the class is emulating
  23902. // the old config... If there is not a Config we don't want to
  23903. // proceed and put the property on the instance. That will likely
  23904. // hide the bug during development.
  23905. continue;
  23906. }
  23907. }
  23908. if (!cfg) {
  23909. field = instance.self.prototype[name];
  23910. if (instance.$configStrict && (typeof field === 'function') && !field.$nullFn) {
  23911. // In strict mode you cannot override functions
  23912. Ext.raise('Cannot override method ' + name + ' on ' + instance.$className + ' instance.');
  23913. }
  23914. // Not all "configs" use the config system so in this case simply put
  23915. // the value on the instance:
  23916. instance[name] = value;
  23917. } else {
  23918. // However we still need to create the initial value that needs
  23919. // to be used. We also need to spin up the initGetter.
  23920. if (!cfg.lazy) {
  23921. ++remaining;
  23922. }
  23923. if (!initListMap[name]) {
  23924. instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
  23925. }
  23926. valuesKey = values[name];
  23927. if (cfg.merge) {
  23928. value = cfg.merge(value, valuesKey, instance);
  23929. } else if (value && value.constructor === Object) {
  23930. if (valuesKey && valuesKey.constructor === Object) {
  23931. value = Ext.merge(values[name], value);
  23932. } else {
  23933. value = Ext.clone(value, false);
  23934. }
  23935. }
  23936. }
  23937. values[name] = value;
  23938. }
  23939. }
  23940. // Give the class a chance to hook in prior to initializing the configs.
  23941. if (instance.beforeInitConfig && !instance.beforeInitConfig.$nullFn) {
  23942. if (instance.beforeInitConfig(instanceConfig) === false) {
  23943. return;
  23944. }
  23945. }
  23946. if (instanceConfig) {
  23947. for (name in instanceConfig) {
  23948. if (!remaining) {
  23949. // For classes that have few proper Config properties, this saves us
  23950. // from making the full 2 passes over the instanceConfig.
  23951. break;
  23952. }
  23953. // We can ignore deprecated configs here because we warned about them
  23954. // above. Further, since we only process proper Config's here we would
  23955. // not be skipping them anyway.
  23956. cfg = configs[name];
  23957. if (cfg && !cfg.lazy) {
  23958. --remaining;
  23959. // A proper "config" property so call the setter to set the value.
  23960. names = cfg.names;
  23961. getter = names.get;
  23962. // At this point the initGetter may have already been called and
  23963. // cleared if the getter was called from the applier or updater of a
  23964. // previously processed instance config. checking if the instance has
  23965. // its own getter ensures the setter does not get called twice.
  23966. if (instance.hasOwnProperty(getter)) {
  23967. instance[names.set](values[name]);
  23968. // The generated setter will remove the initGetter from the instance
  23969. // but the user may have provided their own setter so we have to do
  23970. // this here as well:
  23971. delete instance[names.get];
  23972. }
  23973. }
  23974. }
  23975. }
  23976. // Process configs declared on the class that need per-instance initialization.
  23977. for (i = 0 , ln = initList.length; i < ln; ++i) {
  23978. cfg = initList[i];
  23979. names = cfg.names;
  23980. getter = names.get;
  23981. if (!cfg.lazy && instance.hasOwnProperty(getter)) {
  23982. // Since the instance still hasOwn the getter, that means we've set an initGetter
  23983. // and it hasn't been cleared by calling any setter. Since we've never set the value
  23984. // because it wasn't passed in the instance, we go and set it here, taking the value
  23985. // from our definition config and passing it through finally clear off the getter.
  23986. instance[names.set](values[cfg.name]);
  23987. delete instance[getter];
  23988. }
  23989. }
  23990. // Expose the value from the prototype chain (false):
  23991. delete instance.isConfiguring;
  23992. },
  23993. getCurrentConfig: function(instance) {
  23994. var defaultConfig = instance.defaultConfig,
  23995. config = {},
  23996. name;
  23997. for (name in defaultConfig) {
  23998. config[name] = instance[configPropMap[name].names.get]();
  23999. }
  24000. return config;
  24001. },
  24002. /**
  24003. * This method is called to update the internal state of a given config when that
  24004. * config is needed in a config transform (such as responsive or stateful mixins).
  24005. *
  24006. * @param {Ext.Base} instance The instance to configure.
  24007. * @param {Object} instanceConfig The config for the instance.
  24008. * @param {String[]} names The name(s) of the config(s) to process.
  24009. * @private
  24010. * @since 6.7.0
  24011. */
  24012. hoistConfigs: function(instance, instanceConfig, names) {
  24013. var config = instance.config,
  24014. configs = this.configs,
  24015. initListMap = this.initListMap,
  24016. ret = false,
  24017. cfg, i, name;
  24018. for (i = 0; i < names.length; ++i) {
  24019. name = names[i];
  24020. if (instanceConfig && name in instanceConfig) {
  24021. cfg = configs[name];
  24022. // the Ext.Config instance
  24023. config[name] = cfg.combine(instanceConfig[name], config[name], instance);
  24024. if (!initListMap[name]) {
  24025. instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
  24026. }
  24027. }
  24028. // The config could be defined on the class, so may be present even if
  24029. // not in instance config.
  24030. if (config[name] != null) {
  24031. ret = true;
  24032. }
  24033. }
  24034. return ret;
  24035. },
  24036. /**
  24037. * Merges the values of a config object onto a base config.
  24038. * @param {Ext.Base} instance
  24039. * @param {Object} baseConfig
  24040. * @param {Object} config
  24041. * @param {Boolean} [clone=false]
  24042. * @return {Object} the merged config
  24043. * @private
  24044. */
  24045. merge: function(instance, baseConfig, config, clone) {
  24046. // Although this is a "private" method. It is used by Sencha Architect and so
  24047. // its api should remain stable.
  24048. var configs = this.configs,
  24049. name, value, baseValue, cfg;
  24050. if (clone) {
  24051. baseConfig = Ext.clone(baseConfig, /* cloneDom= */
  24052. false);
  24053. }
  24054. for (name in config) {
  24055. value = config[name];
  24056. cfg = configs[name];
  24057. if (cfg) {
  24058. baseValue = baseConfig[name];
  24059. if (cfg.merge) {
  24060. value = cfg.merge(value, baseValue, instance);
  24061. } else if (value && value.constructor === Object) {
  24062. if (baseValue && baseValue.constructor === Object) {
  24063. value = Ext.merge(baseValue, value);
  24064. } else {
  24065. value = Ext.clone(value, false);
  24066. }
  24067. }
  24068. }
  24069. baseConfig[name] = value;
  24070. }
  24071. return baseConfig;
  24072. },
  24073. /**
  24074. * @private
  24075. */
  24076. reconfigure: function(instance, instanceConfig, options) {
  24077. var currentConfig = instance.config,
  24078. configList = [],
  24079. strict = instance.$configStrict && !(options && options.strict === false),
  24080. configs = this.configs,
  24081. defaults = options && options.defaults,
  24082. cfg, getter, i, len, name, names, prop;
  24083. for (name in instanceConfig) {
  24084. cfg = configs[name];
  24085. /* eslint-disable-next-line max-len */
  24086. if (defaults && instance.hasOwnProperty(cfg && instance.$configPrefixed ? cfg.names.internal : name)) {
  24087. continue;
  24088. }
  24089. currentConfig[name] = instanceConfig[name];
  24090. if (this.deprecations[name]) {
  24091. // See similar logic doc in configure() method.
  24092. Ext.log.warn(this.deprecations[name]);
  24093. if (!cfg) {
  24094. continue;
  24095. }
  24096. }
  24097. if (cfg) {
  24098. // To ensure that configs being set here get processed in the proper order
  24099. // we must give them init getters just in case they depend upon each other
  24100. instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
  24101. } else {
  24102. // Check for existence of the property on the prototype before proceeding.
  24103. // If present on the prototype, and if the property is a function we
  24104. // do not allow it to be overridden by a property in the config object
  24105. // in strict mode (unless the function on the prototype is a emptyFn or
  24106. // identityFn). Note that we always check the prototype, not the instance
  24107. // because calling setConfig a second time should have the same results -
  24108. // the first call may have set a function on the instance.
  24109. prop = instance.self.prototype[name];
  24110. if (strict) {
  24111. if ((typeof prop === 'function') && !prop.$nullFn) {
  24112. Ext.Error.raise("Cannot override method " + name + " on " + instance.$className + " instance.");
  24113. continue;
  24114. } else {
  24115. if (name !== 'type') {
  24116. Ext.log.warn('No such config "' + name + '" for class ' + instance.$className);
  24117. }
  24118. }
  24119. }
  24120. }
  24121. configList.push(name);
  24122. }
  24123. for (i = 0 , len = configList.length; i < len; i++) {
  24124. name = configList[i];
  24125. cfg = configs[name];
  24126. if (cfg) {
  24127. names = cfg.names;
  24128. getter = names.get;
  24129. if (instance.hasOwnProperty(getter)) {
  24130. // Since the instance still hasOwn the getter, that means we've set
  24131. // an initGetter and it hasn't been cleared by calling any setter.
  24132. // Since we've never set the value because it wasn't passed in the instance,
  24133. // we go and set it here, taking the value from our definition config
  24134. // and passing it through finally clear off the getter.
  24135. instance[names.set](instanceConfig[name]);
  24136. delete instance[getter];
  24137. }
  24138. } else {
  24139. cfg = configPropMap[name] || Ext.Config.get(name);
  24140. names = cfg.names;
  24141. if (instance[names.set]) {
  24142. instance[names.set](instanceConfig[name]);
  24143. } else {
  24144. // apply non-config props directly to the instance
  24145. instance[name] = instanceConfig[name];
  24146. }
  24147. }
  24148. }
  24149. },
  24150. /**
  24151. * This method accepts an instance config object containing a `platformConfig`
  24152. * property and merges the appropriate rules from that sub-object with the root object
  24153. * to create the final config object that should be used. This is method called by
  24154. * `{@link #configure}` when it receives an `instanceConfig` containing a
  24155. * `platformConfig` property.
  24156. *
  24157. * @param {Ext.Base} instance
  24158. * @param {Object} instanceConfig The instance config parameter.
  24159. * @return {Object} The new instance config object with platformConfig results applied.
  24160. * @private
  24161. * @since 5.1.0
  24162. */
  24163. resolvePlatformConfig: function(instance, instanceConfig) {
  24164. var platformConfig = instanceConfig && instanceConfig.platformConfig,
  24165. ret = instanceConfig,
  24166. i, keys, n;
  24167. if (platformConfig) {
  24168. keys = Ext.getPlatformConfigKeys(platformConfig);
  24169. n = keys.length;
  24170. if (n) {
  24171. ret = Ext.merge({}, ret);
  24172. // this deep copies sub-objects
  24173. for (i = 0 , n = keys.length; i < n; ++i) {
  24174. this.merge(instance, ret, platformConfig[keys[i]]);
  24175. }
  24176. }
  24177. }
  24178. return ret;
  24179. },
  24180. transformSorter: function(a, b) {
  24181. return a[1] - b[1];
  24182. }
  24183. };
  24184. }());
  24185. // prototype
  24186. // closure on whole file
  24187. // @tag class
  24188. /**
  24189. * @class Ext.Base
  24190. *
  24191. * The root of all classes created with {@link Ext#define}.
  24192. *
  24193. * Ext.Base is the building block of all Ext classes. All classes in Ext inherit from Ext.Base.
  24194. * All prototype and static members of this class are inherited by all other classes.
  24195. */
  24196. Ext.Base = (function(flexSetter) {
  24197. // @define Ext.Base
  24198. // @require Ext.Util
  24199. // @require Ext.Version
  24200. // @require Ext.Configurator
  24201. // @uses Ext.ClassManager
  24202. // @uses Ext.mixin.Watchable
  24203. /* eslint-disable indent */
  24204. var noArgs = [],
  24205. baseStaticMember,
  24206. baseStaticMembers = [],
  24207. makeDeprecatedMethod = function(oldName, newName, msg) {
  24208. var message = '"' + oldName + '" is deprecated.';
  24209. if (msg) {
  24210. message += ' ' + msg;
  24211. } else if (newName) {
  24212. message += ' Please use "' + newName + '" instead.';
  24213. }
  24214. return function() {
  24215. Ext.raise(message);
  24216. };
  24217. },
  24218. addDeprecatedProperty = function(object, oldName, newName, message) {
  24219. if (!message) {
  24220. message = '"' + oldName + '" is deprecated.';
  24221. }
  24222. if (newName) {
  24223. message += ' Please use "' + newName + '" instead.';
  24224. }
  24225. if (message) {
  24226. Ext.Object.defineProperty(object, oldName, {
  24227. get: function() {
  24228. // eslint-disable-line getter-return
  24229. Ext.raise(message);
  24230. },
  24231. set: function(value) {
  24232. Ext.raise(message);
  24233. },
  24234. configurable: true
  24235. });
  24236. }
  24237. },
  24238. getOwnObject = function(proto, name) {
  24239. if (!proto.hasOwnProperty(name)) {
  24240. proto[name] = Ext.Object.chain(getOwnObject(proto.superclass, name));
  24241. }
  24242. return proto[name];
  24243. },
  24244. makeAliasFn = function(name) {
  24245. return function() {
  24246. return this[name].apply(this, arguments);
  24247. };
  24248. },
  24249. Version = Ext.Version,
  24250. leadingDigitRe = /^\d/,
  24251. oneMember = {},
  24252. aliasOneMember = {},
  24253. Base = function() {},
  24254. BasePrototype = Base.prototype,
  24255. Reaper;
  24256. Ext.Reaper = Reaper = {
  24257. delay: 100,
  24258. queue: [],
  24259. timer: null,
  24260. add: function(obj) {
  24261. if (!Reaper.timer) {
  24262. Reaper.timer = Ext.defer(Reaper.tick, Reaper.delay);
  24263. }
  24264. Reaper.queue.push(obj);
  24265. },
  24266. flush: function() {
  24267. if (Reaper.timer) {
  24268. Ext.undefer(Reaper.timer);
  24269. Reaper.timer = null;
  24270. }
  24271. /* eslint-disable-next-line vars-on-top */
  24272. var queue = Reaper.queue,
  24273. n = queue.length,
  24274. i, obj;
  24275. Reaper.queue = [];
  24276. for (i = 0; i < n; ++i) {
  24277. obj = queue[i];
  24278. if (obj && obj.$reap) {
  24279. obj.$reap();
  24280. }
  24281. }
  24282. },
  24283. tick: function() {
  24284. Reaper.timer = null;
  24285. Reaper.flush();
  24286. }
  24287. };
  24288. // These static properties will be copied to every newly created class with {@link Ext#define}
  24289. Ext.apply(Base, {
  24290. $className: 'Ext.Base',
  24291. $isClass: true,
  24292. /**
  24293. * Create a new instance of this Class.
  24294. *
  24295. * Ext.define('My.cool.Class', {
  24296. * ...
  24297. * });
  24298. *
  24299. * My.cool.Class.create({
  24300. * someConfig: true
  24301. * });
  24302. *
  24303. * All parameters are passed to the constructor of the class.
  24304. *
  24305. * @return {Object} the created instance.
  24306. * @static
  24307. * @inheritable
  24308. */
  24309. create: function() {
  24310. return Ext.create.apply(Ext, [
  24311. this
  24312. ].concat(Array.prototype.slice.call(arguments, 0)));
  24313. },
  24314. addConfigTransform: function(methodName, priority) {
  24315. var transforms = getOwnObject(this.prototype, '$configTransforms');
  24316. if (this.$configTransforms) {
  24317. Ext.raise('Config transforms cannot be added after instances are created');
  24318. }
  24319. transforms[methodName] = priority;
  24320. },
  24321. /**
  24322. * This method applies a versioned, deprecation declaration to this class. This
  24323. * is typically called by the `deprecated` config.
  24324. * @private
  24325. */
  24326. addDeprecations: function(deprecations) {
  24327. var me = this,
  24328. all = [],
  24329. compatVersion = Ext.getCompatVersion(deprecations.name),
  24330. configurator = me.getConfigurator(),
  24331. displayName = (me.$className || '') + '#',
  24332. deprecate, versionSpec, index, message, target, enabled, existing, fn, names, oldName, newName, member, statics, version;
  24333. for (versionSpec in deprecations) {
  24334. if (leadingDigitRe.test(versionSpec)) {
  24335. version = new Ext.Version(versionSpec);
  24336. version.deprecations = deprecations[versionSpec];
  24337. all.push(version);
  24338. }
  24339. }
  24340. all.sort(Version.compare);
  24341. for (index = all.length; index--; ) {
  24342. deprecate = (version = all[index]).deprecations;
  24343. target = me.prototype;
  24344. statics = deprecate.statics;
  24345. // If user specifies, say 4.2 compatibility and we have a 5.0 deprecation
  24346. // then that block needs to be "enabled" to "revert" to behaviors prior
  24347. // to 5.0. By default, compatVersion === currentVersion, so there are no
  24348. // enabled blocks. In dev mode we still want to visit all the blocks and
  24349. // possibly add shims to detect use of deprecated methods, but in a build
  24350. // (if the deprecated block remains somehow) we just break the loop.
  24351. enabled = compatVersion && compatVersion.lt(version);
  24352. if (!enabled) {}
  24353. // eslint-disable-line no-empty, brace-style
  24354. else if (!enabled) {
  24355. // we won't get here in dev mode when !enabled
  24356. break;
  24357. }
  24358. while (deprecate) {
  24359. names = deprecate.methods;
  24360. if (names) {
  24361. for (oldName in names) {
  24362. member = names[oldName];
  24363. fn = null;
  24364. if (!member) {
  24365. /*
  24366. * Something like:
  24367. *
  24368. * '5.1': {
  24369. * methods: {
  24370. * removedMethod: null
  24371. * }
  24372. * }
  24373. *
  24374. * Since there is no recovering the method, we always put
  24375. * on a shim to catch abuse.
  24376. */
  24377. // The class should not already have a method by the oldName
  24378. Ext.Assert.isNotDefinedProp(target, oldName);
  24379. fn = makeDeprecatedMethod(displayName + oldName);
  24380. } else if (Ext.isString(member)) {
  24381. /*
  24382. * Something like:
  24383. *
  24384. * '5.1': {
  24385. * methods: {
  24386. * oldName: 'newName'
  24387. * }
  24388. * }
  24389. *
  24390. * If this block is enabled, we just put an alias in place.
  24391. * Otherwise we need to inject a
  24392. */
  24393. // The class should not already have a method by the oldName
  24394. Ext.Assert.isNotDefinedProp(target, oldName);
  24395. Ext.Assert.isDefinedProp(target, member);
  24396. if (enabled) {
  24397. // This call to the real method name must be late
  24398. // bound if it is to pick up overrides and such.
  24399. fn = makeAliasFn(member);
  24400. } else {
  24401. fn = makeDeprecatedMethod(displayName + oldName, member);
  24402. }
  24403. } else {
  24404. /*
  24405. * Something like:
  24406. *
  24407. * '5.1': {
  24408. * methods: {
  24409. * foo: function() { ... }
  24410. * }
  24411. * }
  24412. *
  24413. * Or this:
  24414. *
  24415. * '5.1': {
  24416. * methods: {
  24417. * foo: {
  24418. * fn: function() { ... },
  24419. * message: 'Please use "bar" instead.'
  24420. * }
  24421. * }
  24422. * }
  24423. *
  24424. * Or just this:
  24425. *
  24426. * '5.1': {
  24427. * methods: {
  24428. * foo: {
  24429. * message: 'Use something else instead.'
  24430. * }
  24431. * }
  24432. * }
  24433. *
  24434. * If this block is enabled, and "foo" is an existing
  24435. * method, than we apply the given method as an override.
  24436. * If "foo" is not existing, we simply add the method.
  24437. *
  24438. * If the block is not enabled and there is no existing
  24439. * method by that name, than we add a shim to prevent
  24440. * abuse.
  24441. */
  24442. message = '';
  24443. if (member.message || member.fn) {
  24444. message = member.message;
  24445. member = member.fn;
  24446. }
  24447. existing = target.hasOwnProperty(oldName) && target[oldName];
  24448. if (enabled && member) {
  24449. member.$owner = me;
  24450. member.$name = oldName;
  24451. member.name = displayName + oldName;
  24452. if (existing) {
  24453. member.$previous = existing;
  24454. }
  24455. fn = member;
  24456. } else if (!existing) {
  24457. fn = makeDeprecatedMethod(displayName + oldName, null, message);
  24458. }
  24459. }
  24460. if (fn) {
  24461. target[oldName] = fn;
  24462. }
  24463. }
  24464. }
  24465. // for oldName
  24466. //-------------------------------------
  24467. // Debug only
  24468. names = deprecate.configs;
  24469. if (names) {
  24470. //
  24471. // '6.0': {
  24472. // configs: {
  24473. // dead: null,
  24474. //
  24475. // renamed: 'newName',
  24476. //
  24477. // removed: {
  24478. // message: 'This config was replaced by pixie dust'
  24479. // }
  24480. // }
  24481. // }
  24482. //
  24483. configurator.addDeprecations(names);
  24484. }
  24485. names = deprecate.properties;
  24486. if (names && !enabled) {
  24487. // For properties about the only thing we can do is (on Good
  24488. // Browsers), add warning shims for accessing them. So if the
  24489. // block is enabled, we don't want those.
  24490. for (oldName in names) {
  24491. newName = names[oldName];
  24492. if (Ext.isString(newName)) {
  24493. addDeprecatedProperty(target, displayName + oldName, newName);
  24494. } else if (newName && newName.message) {
  24495. addDeprecatedProperty(target, displayName + oldName, null, newName.message);
  24496. } else {
  24497. addDeprecatedProperty(target, displayName + oldName);
  24498. }
  24499. }
  24500. }
  24501. //-------------------------------------
  24502. // reset to handle statics and apply them to the class
  24503. deprecate = statics;
  24504. statics = null;
  24505. target = me;
  24506. }
  24507. }
  24508. },
  24509. /**
  24510. * @private
  24511. * @static
  24512. * @inheritable
  24513. * @param parentClass
  24514. */
  24515. extend: function(parentClass) {
  24516. var me = this,
  24517. parentPrototype = parentClass.prototype,
  24518. prototype, name, statics;
  24519. prototype = me.prototype = Ext.Object.chain(parentPrototype);
  24520. prototype.self = me;
  24521. me.superclass = prototype.superclass = parentPrototype;
  24522. if (!parentClass.$isClass) {
  24523. for (name in BasePrototype) {
  24524. if (name in prototype) {
  24525. prototype[name] = BasePrototype[name];
  24526. }
  24527. }
  24528. }
  24529. // Statics inheritance
  24530. statics = parentPrototype.$inheritableStatics;
  24531. if (statics) {
  24532. for (name in statics) {
  24533. if (!me.hasOwnProperty(name)) {
  24534. me[name] = parentClass[name];
  24535. }
  24536. }
  24537. }
  24538. if (parentClass.$onExtended) {
  24539. me.$onExtended = parentClass.$onExtended.slice();
  24540. }
  24541. me.getConfigurator();
  24542. },
  24543. /**
  24544. * @private
  24545. * @static
  24546. * @inheritable
  24547. */
  24548. $onExtended: [],
  24549. /**
  24550. * @private
  24551. * @static
  24552. * @inheritable
  24553. */
  24554. triggerExtended: function() {
  24555. if (Ext.classSystemMonitor) {
  24556. Ext.classSystemMonitor(this, 'Ext.Base#triggerExtended', arguments);
  24557. }
  24558. /* eslint-disable-next-line vars-on-top */
  24559. var callbacks = this.$onExtended,
  24560. ln = callbacks.length,
  24561. i, callback;
  24562. if (ln > 0) {
  24563. for (i = 0; i < ln; i++) {
  24564. callback = callbacks[i];
  24565. callback.fn.apply(callback.scope || this, arguments);
  24566. }
  24567. }
  24568. },
  24569. /**
  24570. * @private
  24571. * @static
  24572. * @inheritable
  24573. */
  24574. onExtended: function(fn, scope) {
  24575. this.$onExtended.push({
  24576. fn: fn,
  24577. scope: scope
  24578. });
  24579. return this;
  24580. },
  24581. /**
  24582. * Add / override static properties of this class.
  24583. *
  24584. * Ext.define('My.cool.Class', {
  24585. * ...
  24586. * });
  24587. *
  24588. * My.cool.Class.addStatics({
  24589. * someProperty: 'someValue', // My.cool.Class.someProperty = 'someValue'
  24590. * method1: function() { ... }, // My.cool.Class.method1 = function() { ... };
  24591. * method2: function() { ... } // My.cool.Class.method2 = function() { ... };
  24592. * });
  24593. *
  24594. * @param {Object} members
  24595. * @return {Ext.Base} this
  24596. * @static
  24597. * @inheritable
  24598. */
  24599. addStatics: function(members) {
  24600. this.addMembers(members, true);
  24601. return this;
  24602. },
  24603. /**
  24604. * @private
  24605. * @static
  24606. * @inheritable
  24607. * @param {Object} members
  24608. */
  24609. addInheritableStatics: function(members) {
  24610. var me = this,
  24611. proto = me.prototype,
  24612. inheritableStatics = me.$inheritableStatics,
  24613. name, member, current;
  24614. if (!inheritableStatics) {
  24615. inheritableStatics = Ext.apply({}, proto.$inheritableStatics);
  24616. me.$inheritableStatics = proto.$inheritableStatics = inheritableStatics;
  24617. }
  24618. /* eslint-disable-next-line vars-on-top */
  24619. var className = Ext.getClassName(me) + '.';
  24620. for (name in members) {
  24621. if (members.hasOwnProperty(name)) {
  24622. member = members[name];
  24623. current = me[name];
  24624. if (typeof member === 'function') {
  24625. member.name = className + name;
  24626. }
  24627. if (typeof current === 'function' && !current.$isClass && !current.$nullFn) {
  24628. member.$previous = current;
  24629. }
  24630. me[name] = member;
  24631. inheritableStatics[name] = true;
  24632. }
  24633. }
  24634. return me;
  24635. },
  24636. /**
  24637. * Add methods / properties to the prototype of this class.
  24638. *
  24639. * Ext.define('My.awesome.Cat', {
  24640. * constructor: function() {
  24641. * ...
  24642. * }
  24643. * });
  24644. *
  24645. * My.awesome.Cat.addMembers({
  24646. * meow: function() {
  24647. * alert('Meowww...');
  24648. * }
  24649. * });
  24650. *
  24651. * var kitty = new My.awesome.Cat();
  24652. * kitty.meow();
  24653. *
  24654. * @param {Object} members The members to add to this class.
  24655. * @param {Boolean} [isStatic=false] Pass `true` if the members are static.
  24656. * @param {Boolean} [privacy=false] Pass `true` if the members are private. This
  24657. * only has meaning in debug mode and only for methods.
  24658. * @static
  24659. * @inheritable
  24660. */
  24661. addMembers: function(members, isStatic, privacy) {
  24662. var me = this,
  24663. // this class
  24664. cloneFunction = Ext.Function.clone,
  24665. target = isStatic ? me : me.prototype,
  24666. defaultConfig = !isStatic && target.defaultConfig,
  24667. enumerables = Ext.enumerables,
  24668. privates = members.privates,
  24669. configs, i, ln, member, name, subPrivacy, privateStatics;
  24670. /* eslint-disable-next-line vars-on-top, one-var */
  24671. var displayName = (me.$className || '') + '#';
  24672. if (privates) {
  24673. // This won't run for normal class private members but will pick up all
  24674. // others (statics, overrides, etc).
  24675. delete members.privates;
  24676. if (!isStatic) {
  24677. privateStatics = privates.statics;
  24678. delete privates.statics;
  24679. }
  24680. subPrivacy = privates.privacy || privacy || 'framework';
  24681. me.addMembers(privates, isStatic, subPrivacy);
  24682. if (privateStatics) {
  24683. me.addMembers(privateStatics, true, subPrivacy);
  24684. }
  24685. }
  24686. for (name in members) {
  24687. if (members.hasOwnProperty(name)) {
  24688. member = members[name];
  24689. if (privacy === true) {
  24690. privacy = 'framework';
  24691. }
  24692. if (member && member.$nullFn && privacy !== member.$privacy) {
  24693. Ext.raise('Cannot use stock function for private method ' + (me.$className ? me.$className + '#' : '') + name);
  24694. }
  24695. if (typeof member === 'function' && !member.$isClass && !member.$nullFn) {
  24696. if (member.$owner) {
  24697. member = cloneFunction(member);
  24698. }
  24699. if (target.hasOwnProperty(name)) {
  24700. member.$previous = target[name];
  24701. }
  24702. // This information is needed by callParent() and callSuper() as
  24703. // well as statics() and even Ext.fly().
  24704. member.$owner = me;
  24705. member.$name = name;
  24706. member.name = displayName + name;
  24707. /* eslint-disable-next-line vars-on-top */
  24708. var existing = target[name];
  24709. if (privacy) {
  24710. member.$privacy = privacy;
  24711. // The general idea here is that an existing, non-private
  24712. // method can be marked private. This is because the other
  24713. // way is strictly forbidden (private method going public)
  24714. // so if a method is in that gray area it can only be made
  24715. // private in doc form which allows a derived class to make
  24716. // it public.
  24717. if (existing && existing.$privacy && existing.$privacy !== privacy) {
  24718. Ext.privacyViolation(me, existing, member, isStatic);
  24719. }
  24720. } else if (existing && existing.$privacy) {
  24721. Ext.privacyViolation(me, existing, member, isStatic);
  24722. }
  24723. }
  24724. // The last part of the check here resolves a conflict if we have the same
  24725. // property declared as both a config and a member on the class so that
  24726. // the config wins.
  24727. else if (defaultConfig && (name in defaultConfig) && !target.config.hasOwnProperty(name)) {
  24728. // This is a config property so it must be added to the configs
  24729. // collection not just smashed on the prototype...
  24730. (configs || (configs = {}))[name] = member;
  24731. continue;
  24732. }
  24733. target[name] = member;
  24734. }
  24735. }
  24736. if (configs) {
  24737. // Add any configs found in the normal members arena:
  24738. me.addConfig(configs);
  24739. }
  24740. if (enumerables) {
  24741. for (i = 0 , ln = enumerables.length; i < ln; ++i) {
  24742. if (members.hasOwnProperty(name = enumerables[i])) {
  24743. member = members[name];
  24744. // The enumerables are all functions...
  24745. if (member && !member.$nullFn) {
  24746. if (member.$owner) {
  24747. member = cloneFunction(member);
  24748. }
  24749. member.$owner = me;
  24750. member.$name = name;
  24751. member.name = displayName + name;
  24752. if (target.hasOwnProperty(name)) {
  24753. member.$previous = target[name];
  24754. }
  24755. }
  24756. target[name] = member;
  24757. }
  24758. }
  24759. }
  24760. return this;
  24761. },
  24762. /**
  24763. * @private
  24764. * @static
  24765. * @inheritable
  24766. * @param name
  24767. * @param member
  24768. * @param privacy
  24769. */
  24770. addMember: function(name, member, privacy) {
  24771. oneMember[name] = member;
  24772. this.addMembers(oneMember, false, privacy);
  24773. delete oneMember[name];
  24774. return this;
  24775. },
  24776. hookMember: function(name, member) {
  24777. var existing = this.prototype[name];
  24778. return this.addMember(name, member, existing && existing.$privacy);
  24779. },
  24780. /**
  24781. * Borrow another class' members to the prototype of this class.
  24782. *
  24783. * Ext.define('Bank', {
  24784. * money: '$$$',
  24785. * printMoney: function() {
  24786. * alert('$$$$$$$');
  24787. * }
  24788. * });
  24789. *
  24790. * Ext.define('Thief', {
  24791. * ...
  24792. * });
  24793. *
  24794. * Thief.borrow(Bank, ['money', 'printMoney']);
  24795. *
  24796. * var steve = new Thief();
  24797. *
  24798. * alert(steve.money); // alerts '$$$'
  24799. * steve.printMoney(); // alerts '$$$$$$$'
  24800. *
  24801. * @param {Ext.Base} fromClass The class to borrow members from
  24802. * @param {Array/String} members The names of the members to borrow
  24803. * @return {Ext.Base} this
  24804. * @static
  24805. * @inheritable
  24806. * @private
  24807. */
  24808. borrow: function(fromClass, members) {
  24809. if (Ext.classSystemMonitor) {
  24810. Ext.classSystemMonitor(this, 'Ext.Base#borrow', arguments);
  24811. }
  24812. /* eslint-disable-next-line vars-on-top */
  24813. var prototype = fromClass.prototype,
  24814. membersObj = {},
  24815. i, ln, name;
  24816. members = Ext.Array.from(members);
  24817. for (i = 0 , ln = members.length; i < ln; i++) {
  24818. name = members[i];
  24819. membersObj[name] = prototype[name];
  24820. }
  24821. return this.addMembers(membersObj);
  24822. },
  24823. /**
  24824. * Override members of this class. Overridden methods can be invoked via
  24825. * {@link Ext.Base#method!callParent}.
  24826. *
  24827. * Ext.define('My.Cat', {
  24828. * constructor: function() {
  24829. * alert("I'm a cat!");
  24830. * }
  24831. * });
  24832. *
  24833. * My.Cat.override({
  24834. * constructor: function() {
  24835. * alert("I'm going to be a cat!");
  24836. *
  24837. * this.callParent(arguments);
  24838. *
  24839. * alert("Meeeeoooowwww");
  24840. * }
  24841. * });
  24842. *
  24843. * var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
  24844. * // alerts "I'm a cat!"
  24845. * // alerts "Meeeeoooowwww"
  24846. *
  24847. * Direct use of this method should be rare. Use {@link Ext#define Ext.define}
  24848. * instead:
  24849. *
  24850. * Ext.define('My.CatOverride', {
  24851. * override: 'My.Cat',
  24852. * constructor: function() {
  24853. * alert("I'm going to be a cat!");
  24854. *
  24855. * this.callParent(arguments);
  24856. *
  24857. * alert("Meeeeoooowwww");
  24858. * }
  24859. * });
  24860. *
  24861. * The above accomplishes the same result but can be managed by the {@link Ext.Loader}
  24862. * which can properly order the override and its target class and the build process
  24863. * can determine whether the override is needed based on the required state of the
  24864. * target class (My.Cat).
  24865. *
  24866. * @param {Object} members The properties to add to this class. This should be
  24867. * specified as an object literal containing one or more properties.
  24868. * @return {Ext.Base} this class
  24869. * @static
  24870. * @inheritable
  24871. */
  24872. override: function(members) {
  24873. var me = this,
  24874. statics = members.statics,
  24875. inheritableStatics = members.inheritableStatics,
  24876. config = members.config,
  24877. mixins = members.mixins,
  24878. cachedConfig = members.cachedConfig;
  24879. if (statics || inheritableStatics || config) {
  24880. members = Ext.apply({}, members);
  24881. }
  24882. if (statics) {
  24883. me.addMembers(statics, true);
  24884. delete members.statics;
  24885. }
  24886. if (inheritableStatics) {
  24887. me.addInheritableStatics(inheritableStatics);
  24888. delete members.inheritableStatics;
  24889. }
  24890. if (members.platformConfig) {
  24891. me.addPlatformConfig(members);
  24892. }
  24893. if (config) {
  24894. me.addConfig(config);
  24895. delete members.config;
  24896. }
  24897. if (cachedConfig) {
  24898. me.addCachedConfig(cachedConfig);
  24899. delete members.cachedConfig;
  24900. }
  24901. delete members.mixins;
  24902. me.addMembers(members);
  24903. if (mixins) {
  24904. me.mixin(mixins);
  24905. }
  24906. return me;
  24907. },
  24908. addPlatformConfig: function(data) {
  24909. var me = this,
  24910. prototype = me.prototype,
  24911. platformConfigs = data.platformConfig,
  24912. added, classConfigs, configs, configurator, keys, name, value, i, ln;
  24913. delete prototype.platformConfig;
  24914. if (platformConfigs instanceof Array) {
  24915. throw new Error('platformConfigs must be specified as an object.');
  24916. }
  24917. configurator = me.getConfigurator();
  24918. classConfigs = configurator.configs;
  24919. // Get the keys shortest to longest (ish).
  24920. keys = Ext.getPlatformConfigKeys(platformConfigs);
  24921. // To leverage the Configurator#add method, we want to generate potentially
  24922. // two objects to pass in: "added" and "hoisted". For any properties in an
  24923. // active platformConfig rule that set proper Configs in the base class, we
  24924. // need to put them in "added". If instead of the proper Config coming from
  24925. // a base class, it comes from this class's config block, we still need to
  24926. // put that config in "added" but we also need move the class-level config
  24927. // out of "config" and into "hoisted".
  24928. //
  24929. // This will ensure that the config defined at the class level is added to
  24930. // the Configurator first.
  24931. for (i = 0 , ln = keys.length; i < ln; ++i) {
  24932. configs = platformConfigs[keys[i]];
  24933. added = null;
  24934. for (name in configs) {
  24935. value = configs[name];
  24936. // We have a few possibilities for each config name:
  24937. if (name in classConfigs) {
  24938. // It is a proper Config defined by a base class.
  24939. (added || (added = {}))[name] = value;
  24940. } else {
  24941. // It is just a property to put on the prototype.
  24942. prototype[name] = value;
  24943. }
  24944. }
  24945. if (added) {
  24946. configurator.add(added);
  24947. }
  24948. }
  24949. },
  24950. /**
  24951. * @protected
  24952. * @static
  24953. * @inheritable
  24954. */
  24955. callParent: function(args) {
  24956. var method;
  24957. // This code is intentionally inlined for the least amount of debugger stepping
  24958. return (method = this.callParent.caller) && (method.$previous || ((method = method.$owner ? method : method.caller) && method.$owner.superclass.self[method.$name])).apply(this, args || noArgs);
  24959. },
  24960. /**
  24961. * @protected
  24962. * @static
  24963. * @inheritable
  24964. */
  24965. callSuper: function(args) {
  24966. var method;
  24967. // This code is intentionally inlined for the least amount of debugger stepping
  24968. return (method = this.callSuper.caller) && ((method = method.$owner ? method : method.caller) && method.$owner.superclass.self[method.$name]).apply(this, args || noArgs);
  24969. },
  24970. /**
  24971. * Used internally by the mixins pre-processor
  24972. * @private
  24973. * @static
  24974. * @inheritable
  24975. */
  24976. mixin: function(name, mixinClass) {
  24977. var me = this,
  24978. mixin, prototype, key, statics, i, ln, mixinName, mixinValue, mixins, mixinStatics, staticName;
  24979. if (typeof name !== 'string') {
  24980. mixins = name;
  24981. if (mixins instanceof Array) {
  24982. for (i = 0 , ln = mixins.length; i < ln; i++) {
  24983. mixin = mixins[i];
  24984. me.mixin(mixin.prototype.mixinId || mixin.$className, mixin);
  24985. }
  24986. } else {
  24987. // Not a string or array - process the object form:
  24988. // mixins: {
  24989. // foo: ...
  24990. // }
  24991. for (mixinName in mixins) {
  24992. me.mixin(mixinName, mixins[mixinName]);
  24993. }
  24994. }
  24995. return;
  24996. }
  24997. mixin = mixinClass.prototype;
  24998. prototype = me.prototype;
  24999. if (mixin.onClassMixedIn) {
  25000. mixin.onClassMixedIn.call(mixinClass, me);
  25001. }
  25002. if (!prototype.hasOwnProperty('mixins')) {
  25003. if ('mixins' in prototype) {
  25004. prototype.mixins = Ext.Object.chain(prototype.mixins);
  25005. } else {
  25006. prototype.mixins = {};
  25007. }
  25008. }
  25009. for (key in mixin) {
  25010. mixinValue = mixin[key];
  25011. if (key === 'mixins') {
  25012. // if 2 superclasses (e.g. a base class and a mixin) of this class both
  25013. // have a mixin with the same id, the first one wins, that is to say,
  25014. // the first mixin's methods to be applied to the prototype will not
  25015. // be overwritten by the second one. Since this is the case we also
  25016. // want to make sure we use the first mixin's prototype as the mixin
  25017. // reference, hence the "applyIf" below. A real world example of this
  25018. // is Ext.Widget which mixes in Ext.mixin.Observable. Ext.Widget can
  25019. // be mixed into subclasses of Ext.Component, which mixes in
  25020. // Ext.util.Observable. In this example, since the first "observable"
  25021. // mixin's methods win, we also want its reference to be preserved.
  25022. Ext.applyIf(prototype.mixins, mixinValue);
  25023. }
  25024. /* eslint-disable-next-line max-len */
  25025. else if (!(key === 'mixinId' || key === 'config' || key === '$inheritableStatics') && (prototype[key] === undefined)) {
  25026. prototype[key] = mixinValue;
  25027. }
  25028. }
  25029. // Mixin statics inheritance
  25030. statics = mixin.$inheritableStatics;
  25031. if (statics) {
  25032. mixinStatics = {};
  25033. for (staticName in statics) {
  25034. if (!me.hasOwnProperty(staticName)) {
  25035. mixinStatics[staticName] = mixinClass[staticName];
  25036. }
  25037. }
  25038. me.addInheritableStatics(mixinStatics);
  25039. }
  25040. if ('config' in mixin) {
  25041. me.addConfig(mixin.config, mixinClass);
  25042. }
  25043. prototype.mixins[name] = mixin;
  25044. if (mixin.afterClassMixedIn) {
  25045. mixin.afterClassMixedIn.call(mixinClass, me);
  25046. }
  25047. return me;
  25048. },
  25049. /**
  25050. * Adds new config properties to this class. This is called for classes when they
  25051. * are declared, then for any mixins that class may define and finally for any
  25052. * overrides defined that target the class.
  25053. *
  25054. * @param {Object} config
  25055. * @param {Ext.Class} [mixinClass] The mixin class if the configs are from a mixin.
  25056. * @private
  25057. * @static
  25058. * @inheritable
  25059. */
  25060. addConfig: function(config, mixinClass) {
  25061. var cfg = this.$config || this.getConfigurator();
  25062. cfg.add(config, mixinClass);
  25063. },
  25064. addCachedConfig: function(config, isMixin) {
  25065. var cached = {},
  25066. key;
  25067. for (key in config) {
  25068. cached[key] = {
  25069. cached: true,
  25070. $value: config[key]
  25071. };
  25072. }
  25073. this.addConfig(cached, isMixin);
  25074. },
  25075. /**
  25076. * Returns the `Ext.Configurator` for this class.
  25077. *
  25078. * @return {Ext.Configurator}
  25079. * @private
  25080. * @static
  25081. * @inheritable
  25082. */
  25083. getConfigurator: function() {
  25084. // the Ext.Configurator ctor will set $config so micro-opt out fn call:
  25085. return this.$config || new Ext.Configurator(this);
  25086. },
  25087. /**
  25088. * Get the current class' name in string format.
  25089. *
  25090. * Ext.define('My.cool.Class', {
  25091. * constructor: function() {
  25092. * alert(this.self.getName()); // alerts 'My.cool.Class'
  25093. * }
  25094. * });
  25095. *
  25096. * My.cool.Class.getName(); // 'My.cool.Class'
  25097. *
  25098. * @return {String} className
  25099. * @static
  25100. * @inheritable
  25101. */
  25102. getName: function() {
  25103. return Ext.getClassName(this);
  25104. },
  25105. /**
  25106. * Create aliases for existing prototype methods. Example:
  25107. *
  25108. * Ext.define('My.cool.Class', {
  25109. * method1: function() { ... },
  25110. * method2: function() { ... }
  25111. * });
  25112. *
  25113. * var test = new My.cool.Class();
  25114. *
  25115. * My.cool.Class.createAlias({
  25116. * method3: 'method1',
  25117. * method4: 'method2'
  25118. * });
  25119. *
  25120. * test.method3(); // test.method1()
  25121. *
  25122. * My.cool.Class.createAlias('method5', 'method3');
  25123. *
  25124. * test.method5(); // test.method3() -> test.method1()
  25125. *
  25126. * @param {String/Object} alias The new method name, or an object to set multiple aliases.
  25127. * See {@link Ext.Function#flexSetter flexSetter}
  25128. * @param {String/Object} origin The original method name
  25129. * @static
  25130. * @inheritable
  25131. * @method
  25132. */
  25133. createAlias: flexSetter(function(alias, origin) {
  25134. aliasOneMember[alias] = function() {
  25135. return this[origin].apply(this, arguments);
  25136. };
  25137. this.override(aliasOneMember);
  25138. delete aliasOneMember[alias];
  25139. })
  25140. });
  25141. // Capture the set of static members on Ext.Base that we want to copy to all
  25142. // derived classes. This array is used by Ext.Class as well as the optimizer.
  25143. for (baseStaticMember in Base) {
  25144. if (Base.hasOwnProperty(baseStaticMember)) {
  25145. baseStaticMembers.push(baseStaticMember);
  25146. }
  25147. }
  25148. Base.$staticMembers = baseStaticMembers;
  25149. Base.getConfigurator();
  25150. // lazily create now so as not capture in $staticMembers
  25151. Base.addMembers({
  25152. /** @private */
  25153. $className: 'Ext.Base',
  25154. /**
  25155. * @property {Object/Array} $configTransforms
  25156. * A prototype-chained object storing transform method names and priorities stored
  25157. * on the class prototype. On first instantiation, this object is converted into
  25158. * an array that is sorted by priority and stored on the constructor.
  25159. * @private
  25160. */
  25161. $configTransforms: {},
  25162. /**
  25163. * @property {Boolean} isInstance
  25164. * This value is `true` and is used to identify plain objects from instances of
  25165. * a defined class.
  25166. * @protected
  25167. * @readonly
  25168. */
  25169. isInstance: true,
  25170. /**
  25171. * @property {Boolean} $configPrefixed
  25172. * The value `true` causes `config` values to be stored on instances using a
  25173. * property name prefixed with an underscore ("_") character. A value of `false`
  25174. * stores `config` values as properties using their exact name (no prefix).
  25175. * @private
  25176. * @since 5.0.0
  25177. */
  25178. $configPrefixed: true,
  25179. /**
  25180. * @property {Boolean} $configStrict
  25181. * The value `true` instructs the `initConfig` method to only honor values for
  25182. * properties declared in the `config` block of a class. When `false`, properties
  25183. * that are not declared in a `config` block will be placed on the instance.
  25184. * @private
  25185. * @since 5.0.0
  25186. */
  25187. $configStrict: true,
  25188. /**
  25189. * @property {Boolean} isConfiguring
  25190. * This property is set to `true` during the call to `initConfig`.
  25191. * @protected
  25192. * @readonly
  25193. * @since 5.0.0
  25194. */
  25195. isConfiguring: false,
  25196. /**
  25197. * @property {Boolean} isFirstInstance
  25198. * This property is set to `true` if this instance is the first of its class.
  25199. * @protected
  25200. * @readonly
  25201. * @since 5.0.0
  25202. */
  25203. isFirstInstance: false,
  25204. /**
  25205. * @property {Boolean} destroyed
  25206. * This property is set to `true` after the `destroy` method is called.
  25207. */
  25208. destroyed: false,
  25209. /**
  25210. * @property {Boolean/"async"} [clearPropertiesOnDestroy=true]
  25211. * Setting this property to `false` will prevent nulling object references
  25212. * on a Class instance after destruction. Setting this to `"async"` will delay
  25213. * the clearing for approx 50ms.
  25214. * @protected
  25215. * @since 6.2.0
  25216. */
  25217. clearPropertiesOnDestroy: true,
  25218. /**
  25219. * @property {Boolean} [clearPrototypeOnDestroy=false]
  25220. * Setting this property to `true` will result in setting the object's
  25221. * prototype to `null` after the destruction sequence is fully completed.
  25222. * After that, most attempts at calling methods on the object instance
  25223. * will result in "method not defined" exception. This can be very helpful
  25224. * with tracking down otherwise hard to find bugs like runaway Ajax requests,
  25225. * timed functions not cleared on destruction, etc.
  25226. *
  25227. * Note that this option can only work in browsers that support `Object.setPrototypeOf`
  25228. * method, and is only available in debugging mode.
  25229. * @private
  25230. * @since 6.2.0
  25231. */
  25232. clearPrototypeOnDestroy: false,
  25233. /**
  25234. * Get the reference to the class from which this object was instantiated. Note that unlike
  25235. * {@link Ext.Base#self}, `this.statics()` is scope-independent and it always returns
  25236. * the class from which it was called, regardless of what `this` points to during run-time
  25237. *
  25238. * Ext.define('My.Cat', {
  25239. * statics: {
  25240. * totalCreated: 0,
  25241. * speciesName: 'Cat' // My.Cat.speciesName = 'Cat'
  25242. * },
  25243. *
  25244. * constructor: function() {
  25245. * var statics = this.statics();
  25246. *
  25247. * // always equals to 'Cat' no matter what 'this' refers to
  25248. * // equivalent to: My.Cat.speciesName
  25249. * alert(statics.speciesName);
  25250. *
  25251. *
  25252. * alert(this.self.speciesName); // dependent on 'this'
  25253. *
  25254. * statics.totalCreated++;
  25255. * },
  25256. *
  25257. * clone: function() {
  25258. * var cloned = new this.self(); // dependent on 'this'
  25259. *
  25260. * // equivalent to: My.Cat.speciesName
  25261. * cloned.groupName = this.statics().speciesName;
  25262. *
  25263. * return cloned;
  25264. * }
  25265. * });
  25266. *
  25267. *
  25268. * Ext.define('My.SnowLeopard', {
  25269. * extend: 'My.Cat',
  25270. *
  25271. * statics: {
  25272. * speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'
  25273. * },
  25274. *
  25275. * constructor: function() {
  25276. * this.callParent();
  25277. * }
  25278. * });
  25279. *
  25280. * var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat'
  25281. *
  25282. * var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard'
  25283. *
  25284. * var clone = snowLeopard.clone();
  25285. * alert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'
  25286. * alert(clone.groupName); // alerts 'Cat'
  25287. *
  25288. * alert(My.Cat.totalCreated); // alerts 3
  25289. *
  25290. * @protected
  25291. * @return {Ext.Class}
  25292. */
  25293. statics: function() {
  25294. var method = this.statics.caller,
  25295. self = this.self;
  25296. if (!method) {
  25297. return self;
  25298. }
  25299. return method.$owner;
  25300. },
  25301. /**
  25302. * Call the "parent" method of the current method. That is the method previously
  25303. * overridden by derivation or by an override (see {@link Ext#define}).
  25304. *
  25305. * Ext.define('My.Base', {
  25306. * constructor: function(x) {
  25307. * this.x = x;
  25308. * },
  25309. *
  25310. * statics: {
  25311. * method: function(x) {
  25312. * return x;
  25313. * }
  25314. * }
  25315. * });
  25316. *
  25317. * Ext.define('My.Derived', {
  25318. * extend: 'My.Base',
  25319. *
  25320. * constructor: function() {
  25321. * this.callParent([21]);
  25322. * }
  25323. * });
  25324. *
  25325. * var obj = new My.Derived();
  25326. *
  25327. * alert(obj.x); // alerts 21
  25328. *
  25329. * This can be used with an override as follows:
  25330. *
  25331. * Ext.define('My.DerivedOverride', {
  25332. * override: 'My.Derived',
  25333. *
  25334. * constructor: function(x) {
  25335. * this.callParent([x*2]); // calls original My.Derived constructor
  25336. * }
  25337. * });
  25338. *
  25339. * var obj = new My.Derived();
  25340. *
  25341. * alert(obj.x); // now alerts 42
  25342. *
  25343. * This also works with static and private methods.
  25344. *
  25345. * Ext.define('My.Derived2', {
  25346. * extend: 'My.Base',
  25347. *
  25348. * // privates: {
  25349. * statics: {
  25350. * method: function(x) {
  25351. * return this.callParent([x*2]); // calls My.Base.method
  25352. * }
  25353. * }
  25354. * });
  25355. *
  25356. * alert(My.Base.method(10)); // alerts 10
  25357. * alert(My.Derived2.method(10)); // alerts 20
  25358. *
  25359. * Lastly, it also works with overridden static methods.
  25360. *
  25361. * Ext.define('My.Derived2Override', {
  25362. * override: 'My.Derived2',
  25363. *
  25364. * // privates: {
  25365. * statics: {
  25366. * method: function(x) {
  25367. * return this.callParent([x*2]); // calls My.Derived2.method
  25368. * }
  25369. * }
  25370. * });
  25371. *
  25372. * alert(My.Derived2.method(10); // now alerts 40
  25373. *
  25374. * To override a method and replace it and also call the superclass method, use
  25375. * {@link #method-callSuper}. This is often done to patch a method to fix a bug.
  25376. *
  25377. * @protected
  25378. * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
  25379. * from the current method, for example: `this.callParent(arguments)`
  25380. * @return {Object} Returns the result of calling the parent method
  25381. */
  25382. callParent: function(args) {
  25383. // NOTE: this code is deliberately as few expressions (and no function calls)
  25384. // as possible so that a debugger can skip over this noise with the minimum number
  25385. // of steps. Basically, just hit Step Into until you are where you really wanted
  25386. // to be.
  25387. var method,
  25388. superMethod = (method = this.callParent.caller) && (method.$previous || ((method = method.$owner ? method : method.caller) && method.$owner.superclass[method.$name]));
  25389. if (!superMethod) {
  25390. method = this.callParent.caller;
  25391. /* eslint-disable-next-line vars-on-top */
  25392. var parentClass, methodName;
  25393. if (!method.$owner) {
  25394. if (!method.caller) {
  25395. throw new Error("Attempting to call a protected method from the " + "public scope, which is not allowed");
  25396. }
  25397. method = method.caller;
  25398. }
  25399. parentClass = method.$owner.superclass;
  25400. methodName = method.$name;
  25401. if (!(methodName in parentClass)) {
  25402. throw new Error("this.callParent() was called but there's no such method (" + methodName + ") found in the parent class (" + (Ext.getClassName(parentClass) || 'Object') + ")");
  25403. }
  25404. }
  25405. return superMethod.apply(this, args || noArgs);
  25406. },
  25407. /**
  25408. * This method is used by an **override** to call the superclass method but
  25409. * bypass any overridden method. This is often done to "patch" a method that
  25410. * contains a bug but for whatever reason cannot be fixed directly.
  25411. *
  25412. * Consider:
  25413. *
  25414. * Ext.define('Ext.some.Class', {
  25415. * method: function() {
  25416. * console.log('Good');
  25417. * }
  25418. * });
  25419. *
  25420. * Ext.define('Ext.some.DerivedClass', {
  25421. * extend: 'Ext.some.Class',
  25422. *
  25423. * method: function() {
  25424. * console.log('Bad');
  25425. *
  25426. * // ... logic but with a bug ...
  25427. *
  25428. * this.callParent();
  25429. * }
  25430. * });
  25431. *
  25432. * To patch the bug in `Ext.some.DerivedClass.method`, the typical solution is to create an
  25433. * override:
  25434. *
  25435. * Ext.define('App.patches.DerivedClass', {
  25436. * override: 'Ext.some.DerivedClass',
  25437. *
  25438. * method: function() {
  25439. * console.log('Fixed');
  25440. *
  25441. * // ... logic but with bug fixed ...
  25442. *
  25443. * this.callSuper();
  25444. * }
  25445. * });
  25446. *
  25447. * The patch method cannot use {@link #method-callParent} to call the superclass
  25448. * `method` since that would call the overridden method containing the bug. In
  25449. * other words, the above patch would only produce "Fixed" then "Good" in the
  25450. * console log, whereas, using `callParent` would produce "Fixed" then "Bad"
  25451. * then "Good".
  25452. *
  25453. * @protected
  25454. * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
  25455. * from the current method, for example: `this.callSuper(arguments)`
  25456. * @return {Object} Returns the result of calling the superclass method
  25457. */
  25458. callSuper: function(args) {
  25459. // NOTE: this code is deliberately as few expressions (and no function calls)
  25460. // as possible so that a debugger can skip over this noise with the minimum number
  25461. // of steps. Basically, just hit Step Into until you are where you really wanted
  25462. // to be.
  25463. var method,
  25464. superMethod = (method = this.callSuper.caller) && ((method = method.$owner ? method : method.caller) && method.$owner.superclass[method.$name]);
  25465. if (!superMethod) {
  25466. method = this.callSuper.caller;
  25467. /* eslint-disable-next-line vars-on-top */
  25468. var parentClass, methodName;
  25469. if (!method.$owner) {
  25470. if (!method.caller) {
  25471. throw new Error("Attempting to call a protected method from the " + "public scope, which is not allowed");
  25472. }
  25473. method = method.caller;
  25474. }
  25475. parentClass = method.$owner.superclass;
  25476. methodName = method.$name;
  25477. if (!(methodName in parentClass)) {
  25478. throw new Error("this.callSuper() was called but there's no such method (" + methodName + ") found in the parent class (" + (Ext.getClassName(parentClass) || 'Object') + ")");
  25479. }
  25480. }
  25481. return superMethod.apply(this, args || noArgs);
  25482. },
  25483. /**
  25484. * @property {Ext.Class} self
  25485. *
  25486. * Get the reference to the current class from which this object was instantiated. Unlike
  25487. * {@link Ext.Base#statics}, `this.self` is scope-dependent and it's meant to be used
  25488. * for dynamic inheritance. See {@link Ext.Base#statics} for a detailed comparison
  25489. *
  25490. * Ext.define('My.Cat', {
  25491. * statics: {
  25492. * speciesName: 'Cat' // My.Cat.speciesName = 'Cat'
  25493. * },
  25494. *
  25495. * constructor: function() {
  25496. * alert(this.self.speciesName); // dependent on 'this'
  25497. * },
  25498. *
  25499. * clone: function() {
  25500. * return new this.self();
  25501. * }
  25502. * });
  25503. *
  25504. *
  25505. * Ext.define('My.SnowLeopard', {
  25506. * extend: 'My.Cat',
  25507. * statics: {
  25508. * speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'
  25509. * }
  25510. * });
  25511. *
  25512. * var cat = new My.Cat(); // alerts 'Cat'
  25513. * var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard'
  25514. *
  25515. * var clone = snowLeopard.clone();
  25516. * alert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'
  25517. *
  25518. * @protected
  25519. */
  25520. self: Base,
  25521. // Default constructor, simply returns `this`
  25522. constructor: function() {
  25523. return this;
  25524. },
  25525. /**
  25526. * Initialize configuration for this class. a typical example:
  25527. *
  25528. * Ext.define('My.awesome.Class', {
  25529. * // The default config
  25530. * config: {
  25531. * name: 'Awesome',
  25532. * isAwesome: true
  25533. * },
  25534. *
  25535. * constructor: function(config) {
  25536. * this.initConfig(config);
  25537. * }
  25538. * });
  25539. *
  25540. * var awesome = new My.awesome.Class({
  25541. * name: 'Super Awesome'
  25542. * });
  25543. *
  25544. * alert(awesome.getName()); // 'Super Awesome'
  25545. *
  25546. * @protected
  25547. * @param {Object} instanceConfig
  25548. * @return {Ext.Base} this
  25549. * @chainable
  25550. */
  25551. initConfig: function(instanceConfig) {
  25552. var me = this,
  25553. cfg = me.self.getConfigurator();
  25554. me.initConfig = Ext.emptyFn;
  25555. // ignore subsequent calls to initConfig
  25556. me.initialConfig = instanceConfig || {};
  25557. cfg.configure(me, instanceConfig);
  25558. return me;
  25559. },
  25560. beforeInitConfig: Ext.emptyFn,
  25561. /**
  25562. * Returns a specified config property value. If the name parameter is not passed,
  25563. * all current configuration options will be returned as key value pairs.
  25564. * @param {String} [name] The name of the config property to get.
  25565. * @param {Boolean} [peek=false] `true` to peek at the raw value without calling the getter.
  25566. * @param {Boolean} [ifInitialized=false] `true` to only return the initialized property
  25567. * value, not the raw config value, and *not* to trigger initialization. Returns
  25568. * `undefined` if the property has not yet been initialized.
  25569. * @return {Object} The config property value.
  25570. */
  25571. getConfig: function(name, peek, ifInitialized) {
  25572. var me = this,
  25573. ret, cfg, propName;
  25574. if (name) {
  25575. cfg = me.self.$config.configs[name];
  25576. if (cfg) {
  25577. propName = me.$configPrefixed ? cfg.names.internal : name;
  25578. // They only want the fully initialized value, not the initial config,
  25579. // but only if it's already present on this instance.
  25580. // They don't want to trigger the initGetter.
  25581. // This form is used by Bindable#updatePublishes to initially publish
  25582. // the properties it's being asked make publishable.
  25583. if (ifInitialized) {
  25584. ret = me.hasOwnProperty(propName) ? me[propName] : null;
  25585. } else if (peek) {
  25586. // Attempt to return the instantiated property on this instance first.
  25587. // Only return the config object if it has not yet been pulled through
  25588. // the applier into the instance.
  25589. ret = me.hasOwnProperty(propName) ? me[propName] : me.config[name];
  25590. } else {
  25591. ret = me[cfg.names.get]();
  25592. }
  25593. } else {
  25594. ret = me[name];
  25595. }
  25596. } else {
  25597. ret = me.getCurrentConfig();
  25598. }
  25599. return ret;
  25600. },
  25601. /**
  25602. * Destroys member properties by name.
  25603. *
  25604. * If a property name is the name of a *config*, the getter is *not* invoked, so
  25605. * if the config has not been initialized, nothing will be done.
  25606. *
  25607. * The property will be destroyed, and the corrected name (if the property is a *config*
  25608. * and config names are prefixed) will set to `null` in this object's dictionary.
  25609. *
  25610. * @param {String...} args One or more names of the properties to destroy and remove from
  25611. * the object.
  25612. */
  25613. destroyMembers: function() {
  25614. var me = this,
  25615. configs = me.self.$config.configs,
  25616. len = arguments.length,
  25617. cfg, name, value, i;
  25618. for (i = 0; i < len; i++) {
  25619. name = arguments[i];
  25620. cfg = configs[name];
  25621. name = cfg && me.$configPrefixed ? cfg.names.internal : name;
  25622. value = me.hasOwnProperty(name) && me[name];
  25623. if (value) {
  25624. Ext.destroy(value);
  25625. me[name] = null;
  25626. }
  25627. }
  25628. },
  25629. freezeConfig: function(name) {
  25630. var me = this,
  25631. config = Ext.Config.get(name),
  25632. names = config.names,
  25633. value = me[names.get]();
  25634. me[names.set] = function(v) {
  25635. if (v !== value) {
  25636. Ext.raise('Cannot change frozen config "' + name + '"');
  25637. }
  25638. return me;
  25639. };
  25640. if (!Ext.isIE8) {
  25641. Object.defineProperty(me, me.$configPrefixed ? names.internal : name, {
  25642. get: function() {
  25643. return value;
  25644. },
  25645. set: function(v) {
  25646. if (v !== value) {
  25647. Ext.raise('Cannot change frozen config "' + name + '"');
  25648. }
  25649. }
  25650. });
  25651. }
  25652. },
  25653. /**
  25654. * Sets a single/multiple configuration options.
  25655. * @param {String/Object} name The name of the property to set, or a set of key value
  25656. * pairs to set.
  25657. * @param {Object} [value] The value to set for the name parameter.
  25658. * @param {Object} [options] (private)
  25659. * @return {Ext.Base} this
  25660. */
  25661. setConfig: function(name, value, options) {
  25662. // options can have the following properties:
  25663. // - defaults `true` to only set the config(s) that have not been already set on
  25664. // this instance.
  25665. // - strict `false` to apply properties to the instance that are not configs,
  25666. // and do not have setters.
  25667. var me = this,
  25668. configurator, config, prop;
  25669. if (name) {
  25670. configurator = me.self.getConfigurator();
  25671. if (typeof name === 'string') {
  25672. config = configurator.configs[name];
  25673. if (!config) {
  25674. if (me.$configStrict) {
  25675. prop = me.self.prototype[name];
  25676. if ((typeof prop === 'function') && !prop.$nullFn) {
  25677. Ext.Error.raise("Cannot override method " + name + " on " + me.$className + " instance.");
  25678. return me;
  25679. } else {
  25680. if (name !== 'type') {
  25681. Ext.log.warn('No such config "' + name + '" for class ' + me.$className);
  25682. }
  25683. }
  25684. }
  25685. config = Ext.Config.map[name] || Ext.Config.get(name);
  25686. }
  25687. if (me[config.names.set]) {
  25688. me[config.names.set](value);
  25689. } else {
  25690. // apply non-config props directly to the instance
  25691. me[name] = value;
  25692. }
  25693. } else {
  25694. // This should not have "options ||" except that it shipped in that
  25695. // broken state, so we use it if present for compat.
  25696. configurator.reconfigure(me, name, options || value);
  25697. }
  25698. }
  25699. return me;
  25700. },
  25701. getConfigWatcher: function() {
  25702. return this.$configWatch || (this.$configWatch = new Ext.mixin.Watchable());
  25703. },
  25704. /**
  25705. * Watches config properties.
  25706. *
  25707. * instance.watchConfig({
  25708. * title: 'onTitleChange',
  25709. * scope: me
  25710. * });
  25711. *
  25712. * @private
  25713. * @since 6.7.0
  25714. */
  25715. watchConfig: function(name, fn, scope) {
  25716. var watcher = this.getConfigWatcher();
  25717. return watcher.on.apply(watcher, arguments);
  25718. },
  25719. $configWatch: null,
  25720. /**
  25721. * @private
  25722. */
  25723. getCurrentConfig: function() {
  25724. var cfg = this.self.getConfigurator();
  25725. return cfg.getCurrentConfig(this);
  25726. },
  25727. /**
  25728. * @param {String} name
  25729. * @private
  25730. */
  25731. hasConfig: function(name) {
  25732. return name in this.defaultConfig;
  25733. },
  25734. /**
  25735. * Returns the initial configuration passed to the constructor when
  25736. * instantiating this class.
  25737. *
  25738. * Given this example Ext.button.Button definition and instance:
  25739. *
  25740. * Ext.define('MyApp.view.Button', {
  25741. * extend: 'Ext.button.Button',
  25742. * xtype: 'mybutton',
  25743. *
  25744. * scale: 'large',
  25745. * enableToggle: true
  25746. * });
  25747. *
  25748. * var btn = Ext.create({
  25749. * xtype: 'mybutton',
  25750. * renderTo: Ext.getBody(),
  25751. * text: 'Test Button'
  25752. * });
  25753. *
  25754. * Calling `btn.getInitialConfig()` would return an object including the config
  25755. * options passed to the `create` method:
  25756. *
  25757. * xtype: 'mybutton',
  25758. * renderTo: // The document body itself
  25759. * text: 'Test Button'
  25760. *
  25761. * Calling `btn.getInitialConfig('text')`returns **'Test Button'**.
  25762. *
  25763. * @param {String} [name] Name of the config option to return.
  25764. * @return {Object/Mixed} The full config object or a single config value
  25765. * when `name` parameter specified.
  25766. */
  25767. getInitialConfig: function(name) {
  25768. var config = this.config;
  25769. if (!name) {
  25770. return config;
  25771. }
  25772. return config[name];
  25773. },
  25774. $links: null,
  25775. /**
  25776. * Adds a "destroyable" object to an internal list of objects that will be destroyed
  25777. * when this instance is destroyed (via `{@link #method!destroy}`).
  25778. * @param {String} name
  25779. * @param {Object} value
  25780. * @return {Object} The `value` passed.
  25781. * @private
  25782. */
  25783. link: function(name, value) {
  25784. var me = this,
  25785. links = me.$links || (me.$links = {});
  25786. links[name] = true;
  25787. me[name] = value;
  25788. return value;
  25789. },
  25790. /**
  25791. * Destroys a given set of `{@link #link linked}` objects. This is only needed if
  25792. * the linked object is being destroyed before this instance.
  25793. * @param {String[]} names The names of the linked objects to destroy.
  25794. * @return {Ext.Base} this
  25795. * @private
  25796. */
  25797. unlink: function(names) {
  25798. var me = this,
  25799. i, ln, link, value;
  25800. if (!Ext.isArray(names)) {
  25801. Ext.raise('Invalid argument - expected array of strings');
  25802. }
  25803. for (i = 0 , ln = names.length; i < ln; i++) {
  25804. link = names[i];
  25805. value = me[link];
  25806. if (value) {
  25807. if (value.isInstance && !value.destroyed) {
  25808. value.destroy();
  25809. } else if (value.parentNode && 'nodeType' in value) {
  25810. value.parentNode.removeChild(value);
  25811. }
  25812. }
  25813. me[link] = null;
  25814. }
  25815. return me;
  25816. },
  25817. $reap: function() {
  25818. var me = this,
  25819. keepers = me.$noClearOnDestroy,
  25820. props, prop, val, t, i, len;
  25821. // This only returns own keys which is *much* faster than iterating
  25822. // over the whole prototype chain and calling hasOwnProperty()
  25823. props = Ext.Object.getKeys(me);
  25824. for (i = 0 , len = props.length; i < len; i++) {
  25825. prop = props[i];
  25826. val = me[prop];
  25827. // typeof null === 'object' :(
  25828. if (val && !(keepers && keepers[prop])) {
  25829. t = typeof val;
  25830. // Object may retain references to other objects. Functions can do too
  25831. // if they are closures, and most of the *own* function properties
  25832. // are closures indeed. We skip Ext.emptyFn and the like though,
  25833. // they're mostly harmless.
  25834. if (t === 'object' || (t === 'function' && !val.$noClearOnDestroy)) {
  25835. me[prop] = null;
  25836. }
  25837. }
  25838. }
  25839. me.$nulled = true;
  25840. // We also want to make sure no methods are called on the destroyed object,
  25841. // because that may lead to accessing nulled properties and resulting exceptions.
  25842. if (Object.setPrototypeOf) {
  25843. if (me.clearPrototypeOnDestroy && !me.$vetoClearingPrototypeOnDestroy) {
  25844. props = me.$preservePrototypeProperties;
  25845. if (props) {
  25846. for (i = 0 , len = props.length; i < len; i++) {
  25847. prop = props[i];
  25848. if (!me.hasOwnProperty(prop)) {
  25849. /* eslint-disable-next-line no-self-assign */
  25850. me[prop] = me[prop];
  25851. }
  25852. }
  25853. }
  25854. Object.setPrototypeOf(me, null);
  25855. }
  25856. }
  25857. },
  25858. /**
  25859. * This method is called to cleanup an object and its resources. After calling
  25860. * this method, the object should not be used any further in any way, including
  25861. * access to its methods and properties.
  25862. *
  25863. * To prevent potential memory leaks, all object references will be nulled
  25864. * at the end of destruction sequence, unless {@link #clearPropertiesOnDestroy}
  25865. * is set to `false`.
  25866. */
  25867. destroy: function() {
  25868. var me = this,
  25869. links = me.$links,
  25870. clearPropertiesOnDestroy = me.clearPropertiesOnDestroy;
  25871. if (links) {
  25872. me.$links = null;
  25873. me.unlink(Ext.Object.getKeys(links));
  25874. }
  25875. me.destroy = Ext.emptyFn;
  25876. // isDestroyed added for compat reasons
  25877. me.isDestroyed = me.destroyed = true;
  25878. // By this time the destruction is complete. Now we can make sure
  25879. // no objects are retained by the husk of this ex-Instance.
  25880. if (clearPropertiesOnDestroy === true) {
  25881. // Observable mixin will call destroyObservable that will reap the properties.
  25882. if (!me.isObservable) {
  25883. me.$reap();
  25884. }
  25885. } else if (clearPropertiesOnDestroy) {
  25886. if (clearPropertiesOnDestroy !== 'async') {
  25887. Ext.raise('Invalid value for clearPropertiesOnDestroy');
  25888. }
  25889. Reaper.add(me);
  25890. }
  25891. }
  25892. });
  25893. /**
  25894. * @method callOverridden
  25895. * Call the original method that was previously overridden with {@link Ext.Base#override}
  25896. *
  25897. * Ext.define('My.Cat', {
  25898. * constructor: function() {
  25899. * alert("I'm a cat!");
  25900. * }
  25901. * });
  25902. *
  25903. * My.Cat.override({
  25904. * constructor: function() {
  25905. * alert("I'm going to be a cat!");
  25906. *
  25907. * this.callOverridden();
  25908. *
  25909. * alert("Meeeeoooowwww");
  25910. * }
  25911. * });
  25912. *
  25913. * var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
  25914. * // alerts "I'm a cat!"
  25915. * // alerts "Meeeeoooowwww"
  25916. *
  25917. * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
  25918. * from the current method, for example: `this.callOverridden(arguments)`
  25919. * @return {Object} Returns the result of calling the overridden method
  25920. * @deprecated 4.1.0 Use {@link #method-callParent} instead.
  25921. * @protected
  25922. */
  25923. BasePrototype.callOverridden = BasePrototype.callParent;
  25924. Ext.privacyViolation = function(cls, existing, member, isStatic) {
  25925. var name = member.$name,
  25926. conflictCls = existing.$owner && existing.$owner.$className,
  25927. s = isStatic ? 'static ' : '',
  25928. msg = member.$privacy ? 'Private ' + s + member.$privacy + ' method "' + name + '"' : 'Public ' + s + 'method "' + name + '"';
  25929. if (cls.$className) {
  25930. msg = cls.$className + ': ' + msg;
  25931. }
  25932. if (!existing.$privacy) {
  25933. msg += conflictCls ? ' hides public method inherited from ' + conflictCls : ' hides inherited public method.';
  25934. } else {
  25935. msg += conflictCls ? ' conflicts with private ' + existing.$privacy + ' method declared by ' + conflictCls : ' conflicts with inherited private ' + existing.$privacy + ' method.';
  25936. }
  25937. /* eslint-disable-next-line vars-on-top */
  25938. var compat = Ext.getCompatVersion(),
  25939. ver = Ext.getVersion();
  25940. // When compatibility is enabled, log problems instead of throwing errors.
  25941. if (ver && compat && compat.lt(ver)) {
  25942. Ext.log.error(msg);
  25943. } else {
  25944. Ext.raise(msg);
  25945. }
  25946. };
  25947. Ext.Reaper.tick.$skipTimerCheck = true;
  25948. return Base;
  25949. }(Ext.Function.flexSetter));
  25950. /**
  25951. * This class manages a double-linked list. It provides an absolutely minimal container
  25952. * interface.
  25953. *
  25954. * @class Ext.util.LRU
  25955. * @private
  25956. * @since 6.5.0
  25957. */
  25958. /* eslint-disable indent */
  25959. (function(LRU, prototype) {
  25960. // @define Ext.util.LRU
  25961. // NOTE: We have to implement this class old-school because it is used by the
  25962. // platformConfig class processor (so Ext.define is not yet ready for action).
  25963. (Ext.util || (Ext.util = {})).LRU = LRU = function(config) {
  25964. var me = this,
  25965. head;
  25966. if (config) {
  25967. Ext.apply(me, config);
  25968. }
  25969. // Give all entries the same object shape.
  25970. me.head = head = {
  25971. id: (me.seed = 0),
  25972. key: null,
  25973. value: null
  25974. };
  25975. /**
  25976. * @property {Object} map
  25977. * The items in the list indexed by their `key`.
  25978. * @readonly
  25979. */
  25980. me.map = {};
  25981. head.next = head.prev = head;
  25982. };
  25983. LRU.prototype = prototype = {
  25984. /**
  25985. * @property {Number} count
  25986. * The number of items in this list.
  25987. * @readonly
  25988. */
  25989. count: 0,
  25990. /**
  25991. * Adds an item to the list with the specified `key`. Items are added at the
  25992. * front (MRU) of the list.
  25993. * @param {String} key
  25994. * @param {Object} value
  25995. */
  25996. add: function(key, value) {
  25997. var me = this,
  25998. map = me.map,
  25999. entry = map[key];
  26000. if (entry) {
  26001. me.unlink(entry);
  26002. --me.count;
  26003. }
  26004. map[key] = entry = {
  26005. id: ++me.seed,
  26006. key: key,
  26007. value: value
  26008. };
  26009. me.link(entry);
  26010. ++me.count;
  26011. return entry;
  26012. },
  26013. /**
  26014. * Removes all items from this list optionally calling a function for each
  26015. * remove item.
  26016. * @param {Function} [fn] A function to call for each removed item.
  26017. * @param {Object} fn.key The key of the removed item.
  26018. * @param {Object} fn.value The removed item.
  26019. * @param {Object} [scope] The `this` pointer for `fn`.
  26020. */
  26021. clear: function(fn, scope) {
  26022. var me = this,
  26023. head = me.head,
  26024. entry = head.next;
  26025. head.next = head.prev = head;
  26026. me.count = 0;
  26027. if (fn && !fn.$nullFn) {
  26028. for (; entry !== head; entry = entry.next) {
  26029. fn.call(scope || me, entry.key, entry.value);
  26030. }
  26031. }
  26032. },
  26033. /**
  26034. * Calls the given function `fn` for each item in the list. The items will be
  26035. * passed to `fn` from most-to-least recently added or touched.
  26036. * @param {Function} fn The function to call for each cache item.
  26037. * @param {String} fn.key The key for the item.
  26038. * @param {Object} fn.value The item.
  26039. * @param {Object} [scope] The `this` pointer to use for `fn`.
  26040. */
  26041. each: function(fn, scope) {
  26042. var head, ent;
  26043. scope = scope || this;
  26044. for (head = this.head , ent = head.next; ent !== head; ent = ent.next) {
  26045. if (fn.call(scope, ent.key, ent.value)) {
  26046. break;
  26047. }
  26048. }
  26049. },
  26050. /**
  26051. * Removes the item at the end (LRU) of the list. Optionally the item can be passed
  26052. * to a callback function. If the list is empty, no callback is made and this
  26053. * method will return `undefined`.
  26054. * @param {Function} fn The function to call for the removed item.
  26055. * @param {Object} fn.key The key of the removed item.
  26056. * @param {Object} fn.value The removed item.
  26057. * @param {Object} [scope] The `this` pointer to use for `fn`.
  26058. * @return {Object} The removed item.
  26059. */
  26060. prune: function(fn, scope) {
  26061. var me = this,
  26062. entry = me.head.prev,
  26063. ret;
  26064. if (me.count) {
  26065. ret = entry.value;
  26066. me.unlink(entry);
  26067. --me.count;
  26068. if (fn) {
  26069. fn.call(scope || me, entry.key, ret);
  26070. }
  26071. }
  26072. return ret;
  26073. },
  26074. /**
  26075. * Removes an item from the list given its key.
  26076. * @param {String} key The key of the item to remove.
  26077. * @return {Object} The removed item or `undefined` if the key was not found.
  26078. */
  26079. remove: function(key) {
  26080. var me = this,
  26081. map = me.map,
  26082. entry = map[key],
  26083. value;
  26084. if (entry) {
  26085. me.unlink(entry);
  26086. value = entry.value;
  26087. delete map[key];
  26088. --me.count;
  26089. }
  26090. return value;
  26091. },
  26092. /**
  26093. * Moves the item with the given key to the front (MRU) of the list.
  26094. * @param {String} key The key of the item to move to the front.
  26095. */
  26096. touch: function(key) {
  26097. var me = this,
  26098. head = me.head,
  26099. entry = me.map[key];
  26100. if (entry && entry.prev !== head) {
  26101. // The entry is not at the front, so remove it and insert it at the front
  26102. // (to make it the MRU - Most Recently Used).
  26103. me.unlink(entry);
  26104. me.link(entry);
  26105. }
  26106. },
  26107. /**
  26108. * Reduces the length of the list to be no more than the specified `size`, removing
  26109. * items from the end of the list as necessary. Optionally each removed item can
  26110. * be passed to a callback `fn`.
  26111. * @param {Number} size The number of items in the list
  26112. * @param {Function} [fn] A function to call for each removed item.
  26113. * @param {Object} fn.key The key of the removed item.
  26114. * @param {Object} fn.value The removed item.
  26115. * @param {Object} [scope] The `this` pointer for `fn`.
  26116. */
  26117. trim: function(size, fn, scope) {
  26118. while (this.count > size) {
  26119. this.prune(fn, scope);
  26120. }
  26121. },
  26122. //-------------------------------------------------------------------------
  26123. // Internals
  26124. /**
  26125. * Inserts the given entry at the front (MRU) end of the entry list.
  26126. * @param {Object} entry The cache item entry.
  26127. * @private
  26128. */
  26129. link: function(entry) {
  26130. var head = this.head,
  26131. first = head.next;
  26132. entry.next = first;
  26133. entry.prev = head;
  26134. head.next = entry;
  26135. first.prev = entry;
  26136. },
  26137. /**
  26138. * Removes the given entry from the entry list.
  26139. * @param {Object} entry The cache item entry.
  26140. * @private
  26141. */
  26142. unlink: function(entry) {
  26143. var next = entry.next,
  26144. prev = entry.prev;
  26145. prev.next = next;
  26146. next.prev = prev;
  26147. }
  26148. };
  26149. prototype.destroy = function() {
  26150. this.clear.apply(this, arguments);
  26151. };
  26152. }());
  26153. /**
  26154. * This class is used to manage simple, LRU caches. It provides an absolutely minimal
  26155. * container interface. It is created like this:
  26156. *
  26157. * this.itemCache = new Ext.util.Cache({
  26158. * miss: function (key) {
  26159. * return new CacheItem(key);
  26160. * }
  26161. * });
  26162. *
  26163. * The `{@link #miss}` abstract method must be implemented by either a derived class or
  26164. * at the instance level as shown above.
  26165. *
  26166. * Once the cache exists and it can handle cache misses, the cache is used like so:
  26167. *
  26168. * var item = this.itemCache.get(key);
  26169. *
  26170. * The `key` is some value that uniquely identifies the cached item.
  26171. *
  26172. * In some cases, creating the cache item may require more than just the lookup key. In
  26173. * that case, any extra arguments passed to `get` will be passed to `miss`.
  26174. *
  26175. * this.otherCache = new Ext.util.Cache({
  26176. * miss: function (key, extra) {
  26177. * return new CacheItem(key, extra);
  26178. * }
  26179. * });
  26180. *
  26181. * var item = this.otherCache.get(key, extra);
  26182. *
  26183. * To process items as they are removed, you can provide an `{@link #evict}` method. The
  26184. * stock method is `Ext.emptyFn` and so does nothing.
  26185. *
  26186. * For example:
  26187. *
  26188. * this.itemCache = new Ext.util.Cache({
  26189. * miss: function (key) {
  26190. * return new CacheItem(key);
  26191. * },
  26192. *
  26193. * evict: function (key, cacheItem) {
  26194. * cacheItem.destroy();
  26195. * }
  26196. * });
  26197. *
  26198. * @class Ext.util.Cache
  26199. * @private
  26200. * @since 5.1.0
  26201. */
  26202. /* eslint-disable indent */
  26203. (function(LRU, fn, Cache) {
  26204. // @require Ext.util.LRU
  26205. // @define Ext.util.Cache
  26206. // NOTE: We have to implement this class old-school because it is used by the
  26207. // platformConfig class processor (so Ext.define is not yet ready for action).
  26208. Ext.util.Cache = Cache = function(config) {
  26209. LRU.call(this, config);
  26210. };
  26211. fn.prototype = LRU.prototype;
  26212. Cache.prototype = Ext.apply(new fn(), {
  26213. /**
  26214. * @cfg {Number} maxSize The maximum size the cache is allowed to grow to before
  26215. * further additions cause removal of the least recently used entry.
  26216. */
  26217. maxSize: 100,
  26218. /**
  26219. * This method is called by `{@link #get}` when the key is not found in the cache.
  26220. * The implementation of this method should create the (expensive) value and return
  26221. * it. Whatever arguments were passed to `{@link #get}` will be passed on to this
  26222. * method.
  26223. *
  26224. * @param {String} key The cache lookup key for the item.
  26225. * @param {Object...} args Any other arguments originally passed to `{@link #get}`.
  26226. * @method miss
  26227. * @abstract
  26228. * @protected
  26229. */
  26230. /**
  26231. * Removes all items from this cache.
  26232. */
  26233. clear: function() {
  26234. LRU.prototype.clear.call(this, this.evict);
  26235. },
  26236. /**
  26237. * Finds an item in this cache and returns its value. If the item is present, it is
  26238. * shuffled into the MRU (most-recently-used) position as necessary. If the item is
  26239. * missing, the `{@link #miss}` method is called to create the item.
  26240. *
  26241. * @param {String} key The cache key of the item.
  26242. * @param {Object...} args Arguments for the `miss` method should it be needed.
  26243. * @return {Object} The cached object.
  26244. */
  26245. get: function(key) {
  26246. var me = this,
  26247. entry = me.map[key],
  26248. value;
  26249. if (entry) {
  26250. value = entry.value;
  26251. me.touch(key);
  26252. } else {
  26253. value = me.miss.apply(me, arguments);
  26254. me.add(key, value);
  26255. me.trim(me.maxSize, me.evict);
  26256. }
  26257. return value;
  26258. },
  26259. //-------------------------------------------------------------------------
  26260. // Internals
  26261. /**
  26262. * This method is called internally from `{@link #get}` when the cache is full and
  26263. * the least-recently-used (LRU) item has been removed.
  26264. *
  26265. * @param {String} key The cache lookup key for the item being removed.
  26266. * @param {Object} value The cache value (returned by `{@link #miss}`) for the item
  26267. * being removed.
  26268. * @method evict
  26269. * @template
  26270. * @protected
  26271. */
  26272. evict: Ext.emptyFn
  26273. });
  26274. }(Ext.util.LRU, function() {}));
  26275. /**
  26276. * @class Ext.Class
  26277. *
  26278. * This is a low level factory that is used by {@link Ext#define Ext.define} and should not be used
  26279. * directly in application code.
  26280. *
  26281. * The configs of this class are intended to be used in `Ext.define` calls to describe the class you
  26282. * are declaring. For example:
  26283. *
  26284. * Ext.define('App.util.Thing', {
  26285. * extend: 'App.util.Other',
  26286. *
  26287. * alias: 'util.thing',
  26288. *
  26289. * config: {
  26290. * foo: 42
  26291. * }
  26292. * });
  26293. *
  26294. * Ext.Class is the factory and **not** the superclass of everything. For the base class
  26295. * that **all** classes inherit from, see {@link Ext.Base}.
  26296. */
  26297. /* eslint-disable indent */
  26298. (function() {
  26299. // @tag class
  26300. // @define Ext.Class
  26301. // @require Ext.Base
  26302. // @require Ext.Util
  26303. // @require Ext.util.Cache
  26304. var ExtClass,
  26305. Base = Ext.Base,
  26306. baseStaticMembers = Base.$staticMembers,
  26307. ruleKeySortFn = function(a, b) {
  26308. // longest to shortest, by text if names are equal
  26309. return (a.length - b.length) || ((a < b) ? -1 : ((a > b) ? 1 : 0));
  26310. };
  26311. // Creates a constructor that has nothing extra in its scope chain.
  26312. function makeCtor(className) {
  26313. function constructor() {
  26314. // Opera has some problems returning from a constructor when Dragonfly isn't running.
  26315. // The || null seems to be sufficient to stop it misbehaving. Known to be required
  26316. // against 10.53, 11.51 and 11.61.
  26317. return this.constructor.apply(this, arguments) || null;
  26318. }
  26319. if (className) {
  26320. constructor.name = className;
  26321. }
  26322. return constructor;
  26323. }
  26324. /**
  26325. * @method constructor
  26326. * Create a new anonymous class.
  26327. *
  26328. * @param Class
  26329. * @param {Object} data An object represent the properties of this class
  26330. * @param {Function} onCreated Optional, the callback function to be executed when this class
  26331. * is fully created. Note that the creation process can be asynchronous depending
  26332. * on the pre-processors used.
  26333. *
  26334. * @return {Ext.Base} The newly created class
  26335. */
  26336. Ext.Class = ExtClass = function(Class, data, onCreated) {
  26337. if (typeof Class !== 'function') {
  26338. onCreated = data;
  26339. data = Class;
  26340. Class = null;
  26341. }
  26342. if (!data) {
  26343. data = {};
  26344. }
  26345. Class = ExtClass.create(Class, data);
  26346. ExtClass.process(Class, data, onCreated);
  26347. return Class;
  26348. };
  26349. Ext.apply(ExtClass, {
  26350. makeCtor: makeCtor,
  26351. /**
  26352. * @private
  26353. */
  26354. onBeforeCreated: function(Class, data, hooks) {
  26355. if (Ext.classSystemMonitor) {
  26356. Ext.classSystemMonitor(Class, '>> Ext.Class#onBeforeCreated', arguments);
  26357. }
  26358. Class.addMembers(data);
  26359. hooks.onCreated.call(Class, Class);
  26360. if (Ext.classSystemMonitor) {
  26361. Ext.classSystemMonitor(Class, '<< Ext.Class#onBeforeCreated', arguments);
  26362. }
  26363. },
  26364. /**
  26365. * @private
  26366. */
  26367. create: function(Class, data) {
  26368. var i = baseStaticMembers.length,
  26369. name;
  26370. if (!Class) {
  26371. Class = makeCtor(data.$className);
  26372. }
  26373. while (i--) {
  26374. name = baseStaticMembers[i];
  26375. Class[name] = Base[name];
  26376. }
  26377. return Class;
  26378. },
  26379. /**
  26380. * @private
  26381. */
  26382. process: function(Class, data, onCreated) {
  26383. var preprocessorStack = data.preprocessors || ExtClass.defaultPreprocessors,
  26384. registeredPreprocessors = this.preprocessors,
  26385. hooks = {
  26386. onBeforeCreated: this.onBeforeCreated
  26387. },
  26388. preprocessors = [],
  26389. preprocessor, preprocessorsProperties, i, ln, j, subLn, preprocessorProperty;
  26390. delete data.preprocessors;
  26391. Class._classHooks = hooks;
  26392. for (i = 0 , ln = preprocessorStack.length; i < ln; i++) {
  26393. preprocessor = preprocessorStack[i];
  26394. if (typeof preprocessor === 'string') {
  26395. preprocessor = registeredPreprocessors[preprocessor];
  26396. preprocessorsProperties = preprocessor.properties;
  26397. if (preprocessorsProperties === true) {
  26398. preprocessors.push(preprocessor.fn);
  26399. } else if (preprocessorsProperties) {
  26400. for (j = 0 , subLn = preprocessorsProperties.length; j < subLn; j++) {
  26401. preprocessorProperty = preprocessorsProperties[j];
  26402. if (data.hasOwnProperty(preprocessorProperty)) {
  26403. preprocessors.push(preprocessor.fn);
  26404. break;
  26405. }
  26406. }
  26407. }
  26408. } else {
  26409. preprocessors.push(preprocessor);
  26410. }
  26411. }
  26412. hooks.onCreated = onCreated ? onCreated : Ext.emptyFn;
  26413. hooks.preprocessors = preprocessors;
  26414. this.doProcess(Class, data, hooks);
  26415. },
  26416. doProcess: function(Class, data, hooks) {
  26417. var me = this,
  26418. preprocessors = hooks.preprocessors,
  26419. preprocessor = preprocessors.shift(),
  26420. doProcess = me.doProcess;
  26421. for (; preprocessor; preprocessor = preprocessors.shift()) {
  26422. // Returning false signifies an asynchronous preprocessor - it will call doProcess
  26423. // when we can continue
  26424. if (preprocessor.call(me, Class, data, hooks, doProcess) === false) {
  26425. return;
  26426. }
  26427. }
  26428. hooks.onBeforeCreated.apply(me, arguments);
  26429. },
  26430. /**
  26431. * @private
  26432. * */
  26433. preprocessors: {},
  26434. /**
  26435. * Register a new pre-processor to be used during the class creation process
  26436. *
  26437. * @param {String} name The pre-processor's name
  26438. * @param {Function} fn The callback function to be executed. Typical format:
  26439. *
  26440. * function(cls, data, fn) {
  26441. * // Your code here
  26442. *
  26443. * // Execute this when the processing is finished.
  26444. * // Asynchronous processing is perfectly ok
  26445. * if (fn) {
  26446. * fn.call(this, cls, data);
  26447. * }
  26448. * });
  26449. *
  26450. * @param {Function} fn.cls The created class
  26451. * @param {Object} fn.data The set of properties passed in {@link Ext.Class} constructor
  26452. * @param {Function} fn.fn The callback function that **must** to be executed when this
  26453. * pre-processor finishes, regardless of whether the processing is synchronous or
  26454. * asynchronous.
  26455. * @param properties
  26456. * @param position
  26457. * @param relativeTo
  26458. * @return {Ext.Class} this
  26459. * @private
  26460. * @static
  26461. */
  26462. registerPreprocessor: function(name, fn, properties, position, relativeTo) {
  26463. if (!position) {
  26464. position = 'last';
  26465. }
  26466. if (!properties) {
  26467. properties = [
  26468. name
  26469. ];
  26470. }
  26471. this.preprocessors[name] = {
  26472. name: name,
  26473. properties: properties || false,
  26474. fn: fn
  26475. };
  26476. this.setDefaultPreprocessorPosition(name, position, relativeTo);
  26477. return this;
  26478. },
  26479. /**
  26480. * Retrieve a pre-processor callback function by its name, which has been registered before
  26481. *
  26482. * @param {String} name
  26483. * @return {Function} preprocessor
  26484. * @private
  26485. * @static
  26486. */
  26487. getPreprocessor: function(name) {
  26488. return this.preprocessors[name];
  26489. },
  26490. /**
  26491. * @private
  26492. */
  26493. getPreprocessors: function() {
  26494. return this.preprocessors;
  26495. },
  26496. /**
  26497. * @private
  26498. */
  26499. defaultPreprocessors: [],
  26500. /**
  26501. * Retrieve the array stack of default pre-processors
  26502. * @return {Function[]} defaultPreprocessors
  26503. * @private
  26504. * @static
  26505. */
  26506. getDefaultPreprocessors: function() {
  26507. return this.defaultPreprocessors;
  26508. },
  26509. /**
  26510. * Set the default array stack of default pre-processors
  26511. *
  26512. * @private
  26513. * @param {Array} preprocessors
  26514. * @return {Ext.Class} this
  26515. * @static
  26516. */
  26517. setDefaultPreprocessors: function(preprocessors) {
  26518. this.defaultPreprocessors = Ext.Array.from(preprocessors);
  26519. return this;
  26520. },
  26521. /**
  26522. * Insert this pre-processor at a specific position in the stack, optionally relative to
  26523. * any existing pre-processor. For example:
  26524. *
  26525. * Ext.Class.registerPreprocessor('debug', function(cls, data, fn) {
  26526. * // Your code here
  26527. *
  26528. * if (fn) {
  26529. * fn.call(this, cls, data);
  26530. * }
  26531. * }).setDefaultPreprocessorPosition('debug', 'last');
  26532. *
  26533. * @private
  26534. * @param {String} name The pre-processor name. Note that it needs to be registered with
  26535. * {@link Ext.Class#registerPreprocessor registerPreprocessor} before this
  26536. * @param {String} offset The insertion position. Four possible values are:
  26537. * 'first', 'last', or: 'before', 'after' (relative to the name provided in the third
  26538. * argument)
  26539. * @param {String} relativeName
  26540. * @return {Ext.Class} this
  26541. * @static
  26542. */
  26543. setDefaultPreprocessorPosition: function(name, offset, relativeName) {
  26544. var defaultPreprocessors = this.defaultPreprocessors,
  26545. index;
  26546. if (typeof offset === 'string') {
  26547. if (offset === 'first') {
  26548. defaultPreprocessors.unshift(name);
  26549. return this;
  26550. } else if (offset === 'last') {
  26551. defaultPreprocessors.push(name);
  26552. return this;
  26553. }
  26554. offset = (offset === 'after') ? 1 : -1;
  26555. }
  26556. index = Ext.Array.indexOf(defaultPreprocessors, relativeName);
  26557. if (index !== -1) {
  26558. Ext.Array.splice(defaultPreprocessors, Math.max(0, index + offset), 0, name);
  26559. }
  26560. return this;
  26561. }
  26562. });
  26563. /**
  26564. * @cfg {String} extend
  26565. * The parent class that this class extends. For example:
  26566. *
  26567. * Ext.define('Person', {
  26568. * say: function(text) { alert(text); }
  26569. * });
  26570. *
  26571. * Ext.define('Developer', {
  26572. * extend: 'Person',
  26573. * say: function(text) { this.callParent(["print "+text]); }
  26574. * });
  26575. */
  26576. ExtClass.registerPreprocessor('extend', function(Class, data, hooks) {
  26577. var Base = Ext.Base,
  26578. basePrototype = Base.prototype,
  26579. extend = data.extend,
  26580. Parent, parentPrototype, i;
  26581. if (Ext.classSystemMonitor) {
  26582. Ext.classSystemMonitor(Class, 'Ext.Class#extendPreProcessor', arguments);
  26583. }
  26584. delete data.extend;
  26585. if (extend && extend !== Object) {
  26586. Parent = extend;
  26587. } else {
  26588. Parent = Base;
  26589. }
  26590. parentPrototype = Parent.prototype;
  26591. if (!Parent.$isClass) {
  26592. for (i in basePrototype) {
  26593. if (!parentPrototype[i]) {
  26594. parentPrototype[i] = basePrototype[i];
  26595. }
  26596. }
  26597. }
  26598. Class.extend(Parent);
  26599. Class.triggerExtended.apply(Class, arguments);
  26600. /**
  26601. * @cfg {Object} eventedConfig
  26602. * Config options defined within `eventedConfig` will auto-generate the setter /
  26603. * getter methods (see {@link #cfg-config config} for more information on
  26604. * auto-generated getter / setter methods). Additionally, when an
  26605. * `eventedConfig` is set it will also fire a before{cfg}change and {cfg}change
  26606. * event when the value of the eventedConfig is changed from its originally
  26607. * defined value.
  26608. *
  26609. * **Note:** When creating a custom class you'll need to extend Ext.Evented
  26610. *
  26611. * Example custom class:
  26612. *
  26613. * Ext.define('MyApp.util.Test', {
  26614. * extend: 'Ext.Evented',
  26615. *
  26616. * eventedConfig: {
  26617. * foo: null
  26618. * }
  26619. * });
  26620. *
  26621. * In this example, the `foo` config will initially be null. Changing it via
  26622. * `setFoo` will fire the `beforefoochange` event. The call to the setter can be
  26623. * halted by returning `false` from a listener on the **before** event.
  26624. *
  26625. * var test = Ext.create('MyApp.util.Test', {
  26626. * listeners: {
  26627. * beforefoochange: function (instance, newValue, oldValue) {
  26628. * return newValue !== 'bar';
  26629. * },
  26630. * foochange: function (instance, newValue, oldValue) {
  26631. * console.log('foo changed to:', newValue);
  26632. * }
  26633. * }
  26634. * });
  26635. *
  26636. * test.setFoo('bar');
  26637. *
  26638. * The `before` event handler can be used to validate changes to `foo`.
  26639. * Returning `false` will prevent the setter from changing the value of the
  26640. * config. In the previous example the `beforefoochange` handler returns false
  26641. * so `foo` will not be updated and `foochange` will not be fired.
  26642. *
  26643. * test.setFoo('baz');
  26644. *
  26645. * Setting `foo` to 'baz' will not be prevented by the `before` handler. Foo
  26646. * will be set to the value: 'baz' and the `foochange` event will be fired.
  26647. */
  26648. if (data.onClassExtended) {
  26649. Class.onExtended(data.onClassExtended, Class);
  26650. delete data.onClassExtended;
  26651. }
  26652. }, true);
  26653. // true to always run this preprocessor even w/o "extend" keyword
  26654. /**
  26655. * @cfg {Object} privates
  26656. * The `privates` config is a list of methods intended to be used internally by the
  26657. * framework. Methods are placed in a `privates` block to prevent developers from
  26658. * accidentally overriding framework methods in custom classes.
  26659. *
  26660. * Ext.define('Computer', {
  26661. * privates: {
  26662. * runFactory: function(brand) {
  26663. * // internal only processing of brand passed to factory
  26664. * this.factory(brand);
  26665. * }
  26666. * },
  26667. *
  26668. * factory: function (brand) {}
  26669. * });
  26670. *
  26671. * In order to override a method from a `privates` block, the overridden method must
  26672. * also be placed in a `privates` block within the override class.
  26673. *
  26674. * Ext.define('Override.Computer', {
  26675. * override: 'Computer',
  26676. * privates: {
  26677. * runFactory: function() {
  26678. * // overriding logic
  26679. * }
  26680. * }
  26681. * });
  26682. */
  26683. ExtClass.registerPreprocessor('privates', function(Class, data) {
  26684. var privates = data.privates,
  26685. statics = privates.statics,
  26686. privacy = privates.privacy || true;
  26687. if (Ext.classSystemMonitor) {
  26688. Ext.classSystemMonitor(Class, 'Ext.Class#privatePreprocessor', arguments);
  26689. }
  26690. delete data.privates;
  26691. delete privates.statics;
  26692. // We have to add this preprocessor so that private getters/setters are picked up
  26693. // by the config system. This also catches duplication in the public part of the
  26694. // class since it is an error to override a private method with a public one.
  26695. Class.addMembers(privates, false, privacy);
  26696. if (statics) {
  26697. Class.addMembers(statics, true, privacy);
  26698. }
  26699. });
  26700. /**
  26701. * @cfg {Object} statics
  26702. * List of static methods for this class. For example:
  26703. *
  26704. * Ext.define('Computer', {
  26705. * statics: {
  26706. * factory: function(brand) {
  26707. * // 'this' in static methods refer to the class itself
  26708. * return new this(brand);
  26709. * }
  26710. * },
  26711. *
  26712. * constructor: function() { ... }
  26713. * });
  26714. *
  26715. * var dellComputer = Computer.factory('Dell');
  26716. */
  26717. ExtClass.registerPreprocessor('statics', function(Class, data) {
  26718. if (Ext.classSystemMonitor) {
  26719. Ext.classSystemMonitor(Class, 'Ext.Class#staticsPreprocessor', arguments);
  26720. }
  26721. Class.addStatics(data.statics);
  26722. delete data.statics;
  26723. });
  26724. /**
  26725. * @cfg {Object} inheritableStatics
  26726. * List of inheritable static methods for this class.
  26727. * Otherwise just like {@link #statics} but subclasses inherit these methods.
  26728. */
  26729. ExtClass.registerPreprocessor('inheritableStatics', function(Class, data) {
  26730. if (Ext.classSystemMonitor) {
  26731. Ext.classSystemMonitor(Class, 'Ext.Class#inheritableStaticsPreprocessor', arguments);
  26732. }
  26733. Class.addInheritableStatics(data.inheritableStatics);
  26734. delete data.inheritableStatics;
  26735. });
  26736. Ext.createRuleFn = function(code) {
  26737. return new Function('$c', 'with($c) { try { return (' + code + '); } catch(e) { return false;}}');
  26738. };
  26739. Ext.expressionCache = new Ext.util.Cache({
  26740. miss: Ext.createRuleFn
  26741. });
  26742. Ext.ruleKeySortFn = ruleKeySortFn;
  26743. Ext.getPlatformConfigKeys = function(platformConfig) {
  26744. var ret = [],
  26745. platform, rule;
  26746. for (platform in platformConfig) {
  26747. rule = Ext.expressionCache.get(platform);
  26748. if (rule(Ext.platformTags)) {
  26749. ret.push(platform);
  26750. }
  26751. }
  26752. ret.sort(ruleKeySortFn);
  26753. return ret;
  26754. };
  26755. /**
  26756. * @cfg {Object} config
  26757. *
  26758. * List of configuration options with their default values.
  26759. *
  26760. * __Note:__ You need to make sure {@link Ext.Base#initConfig} is called from your constructor
  26761. * if you are defining your own class or singleton, unless you are extending a Component.
  26762. * Otherwise the generated getter and setter methods will not be initialized.
  26763. *
  26764. * Each config item will have its own setter and getter method automatically generated inside
  26765. * the class prototype during class creation time, if the class does not have those methods
  26766. * explicitly defined.
  26767. *
  26768. * As an example, let's convert the name property of a Person class to be a config item, then
  26769. * add extra age and gender items.
  26770. *
  26771. * Ext.define('My.sample.Person', {
  26772. * config: {
  26773. * name: 'Mr. Unknown',
  26774. * age: 0,
  26775. * gender: 'Male'
  26776. * },
  26777. *
  26778. * constructor: function(config) {
  26779. * this.initConfig(config);
  26780. *
  26781. * return this;
  26782. * }
  26783. *
  26784. * // ...
  26785. * });
  26786. *
  26787. * Within the class, this.name still has the default value of "Mr. Unknown". However, it's now
  26788. * publicly accessible without sacrificing encapsulation, via setter and getter methods.
  26789. *
  26790. * var jacky = new My.sample.Person({
  26791. * name: "Jacky",
  26792. * age: 35
  26793. * });
  26794. *
  26795. * alert(jacky.getAge()); // alerts 35
  26796. * alert(jacky.getGender()); // alerts "Male"
  26797. *
  26798. * jacky.setName("Mr. Nguyen");
  26799. * alert(jacky.getName()); // alerts "Mr. Nguyen"
  26800. *
  26801. * Notice that we changed the class constructor to invoke this.initConfig() and pass in the
  26802. * provided config object. Two key things happened:
  26803. *
  26804. * - The provided config object when the class is instantiated is recursively merged with
  26805. * the default config object.
  26806. * - All corresponding setter methods are called with the merged values.
  26807. *
  26808. * Beside storing the given values, throughout the frameworks, setters generally have two key
  26809. * responsibilities:
  26810. *
  26811. * - Filtering / validation / transformation of the given value before it's actually stored
  26812. * within the instance.
  26813. * - Notification (such as firing events) / post-processing after the value has been set,
  26814. * or changed from a previous value.
  26815. *
  26816. * By standardize this common pattern, the default generated setters provide two extra template
  26817. * methods that you can put your own custom logic into, i.e: an "applyFoo" and "updateFoo"
  26818. * method for a "foo" config item, which are executed before and after the value is actually
  26819. * set, respectively. Back to the example class, let's validate that age must be a valid
  26820. * positive number, and fire an 'agechange' if the value is modified.
  26821. *
  26822. * Ext.define('My.sample.Person', {
  26823. * config: {
  26824. * // ...
  26825. * },
  26826. *
  26827. * constructor: {
  26828. * // ...
  26829. * },
  26830. *
  26831. * applyAge: function(age) {
  26832. * if (typeof age !== 'number' || age < 0) {
  26833. * console.warn("Invalid age, must be a positive number");
  26834. * return;
  26835. * }
  26836. *
  26837. * return age;
  26838. * },
  26839. *
  26840. * updateAge: function(newAge, oldAge) {
  26841. * // age has changed from "oldAge" to "newAge"
  26842. * this.fireEvent('agechange', this, newAge, oldAge);
  26843. * }
  26844. *
  26845. * // ...
  26846. * });
  26847. *
  26848. * var jacky = new My.sample.Person({
  26849. * name: "Jacky",
  26850. * age: 'invalid'
  26851. * });
  26852. *
  26853. * alert(jacky.getAge()); // alerts 0
  26854. *
  26855. * alert(jacky.setAge(-100)); // alerts 0
  26856. * alert(jacky.getAge()); // alerts 0
  26857. *
  26858. * alert(jacky.setAge(35)); // alerts 0
  26859. * alert(jacky.getAge()); // alerts 35
  26860. *
  26861. * In other words, when leveraging the config feature, you mostly never need to define setter
  26862. * and getter methods explicitly. Instead, "apply*" and "update*" methods should be implemented
  26863. * where necessary. Your code will be consistent throughout and only contain the minimal logic
  26864. * that you actually care about.
  26865. *
  26866. * When it comes to inheritance, the default config of the parent class is automatically,
  26867. * recursively merged with the child's default config. The same applies for mixins.
  26868. */
  26869. ExtClass.registerPreprocessor('config', function(Class, data) {
  26870. // Need to copy to the prototype here because that happens after preprocessors
  26871. if (data.hasOwnProperty('$configPrefixed')) {
  26872. Class.prototype.$configPrefixed = data.$configPrefixed;
  26873. }
  26874. Class.addConfig(data.config);
  26875. // We need to remove this or it will be applied by addMembers and smash the
  26876. // "config" placed on the prototype by Configurator (which includes *all* configs
  26877. // such as cachedConfigs).
  26878. delete data.config;
  26879. });
  26880. /**
  26881. * @cfg {Object} cachedConfig
  26882. *
  26883. * This configuration works in a very similar manner to the {@link #config} option.
  26884. * The difference is that the configurations are only ever processed when the first instance
  26885. * of that class is created. The processed value is then stored on the class prototype and
  26886. * will not be processed on subsequent instances of the class. Getters/setters will be generated
  26887. * in exactly the same way as {@link #config}.
  26888. *
  26889. * This option is useful for expensive objects that can be shared across class instances.
  26890. * The class itself ensures that the creation only occurs once.
  26891. */
  26892. ExtClass.registerPreprocessor('cachedConfig', function(Class, data) {
  26893. // Need to copy to the prototype here because that happens after preprocessors
  26894. if (data.hasOwnProperty('$configPrefixed')) {
  26895. Class.prototype.$configPrefixed = data.$configPrefixed;
  26896. }
  26897. Class.addCachedConfig(data.cachedConfig);
  26898. // Remove this so it won't be placed on the prototype.
  26899. delete data.cachedConfig;
  26900. });
  26901. /**
  26902. * @cfg {String[]/Object} mixins
  26903. * List of classes to mix into this class. For example:
  26904. *
  26905. * Ext.define('CanSing', {
  26906. * sing: function() {
  26907. * alert("For he's a jolly good fellow...")
  26908. * }
  26909. * });
  26910. *
  26911. * Ext.define('Musician', {
  26912. * mixins: ['CanSing']
  26913. * })
  26914. *
  26915. * In this case the Musician class will get a `sing` method from CanSing mixin.
  26916. *
  26917. * But what if the Musician already has a `sing` method? Or you want to mix
  26918. * in two classes, both of which define `sing`? In such a cases it's good
  26919. * to define mixins as an object, where you assign a name to each mixin:
  26920. *
  26921. * Ext.define('Musician', {
  26922. * mixins: {
  26923. * canSing: 'CanSing'
  26924. * },
  26925. *
  26926. * sing: function() {
  26927. * // delegate singing operation to mixin
  26928. * this.mixins.canSing.sing.call(this);
  26929. * }
  26930. * })
  26931. *
  26932. * In this case the `sing` method of Musician will overwrite the
  26933. * mixed in `sing` method. But you can access the original mixed in method
  26934. * through special `mixins` property.
  26935. */
  26936. ExtClass.registerPreprocessor('mixins', function(Class, data, hooks) {
  26937. var mixins = data.mixins,
  26938. onCreated = hooks.onCreated;
  26939. if (Ext.classSystemMonitor) {
  26940. Ext.classSystemMonitor(Class, 'Ext.Class#mixinsPreprocessor', arguments);
  26941. }
  26942. delete data.mixins;
  26943. hooks.onCreated = function() {
  26944. /* eslint-disable-next-line max-len */
  26945. if (Ext.classSystemMonitor) {
  26946. Ext.classSystemMonitor(Class, 'Ext.Class#mixinsPreprocessor#beforeCreated', arguments);
  26947. }
  26948. // Put back the original onCreated before processing mixins. This allows a
  26949. // mixin to hook onCreated by access Class._classHooks.
  26950. hooks.onCreated = onCreated;
  26951. Class.mixin(mixins);
  26952. // We must go back to hooks.onCreated here because it may have changed during
  26953. // calls to onClassMixedIn.
  26954. return hooks.onCreated.apply(this, arguments);
  26955. };
  26956. });
  26957. // Backwards compatible
  26958. Ext.extend = function(Class, Parent, members) {
  26959. var cls, m;
  26960. if (Ext.classSystemMonitor) {
  26961. Ext.classSystemMonitor(Class, 'Ext.Class#extend-backwards-compatible', arguments);
  26962. }
  26963. if (arguments.length === 2 && Ext.isObject(Parent)) {
  26964. members = Parent;
  26965. Parent = Class;
  26966. Class = null;
  26967. }
  26968. if (!Parent) {
  26969. throw new Error("[Ext.extend] Attempting to extend from a class which has not " + "been loaded on the page.");
  26970. }
  26971. members.extend = Parent;
  26972. /* eslint-disable comma-style */
  26973. members.preprocessors = [
  26974. 'extend',
  26975. 'statics',
  26976. 'inheritableStatics',
  26977. 'mixins',
  26978. 'config'
  26979. ];
  26980. /* eslint-enable comma-style */
  26981. if (Class) {
  26982. cls = new ExtClass(Class, members);
  26983. // The 'constructor' is given as 'Class' but also needs to be on prototype
  26984. cls.prototype.constructor = Class;
  26985. } else {
  26986. cls = new ExtClass(members);
  26987. }
  26988. cls.prototype.override = function(o) {
  26989. for (m in o) {
  26990. if (o.hasOwnProperty(m)) {
  26991. this[m] = o[m];
  26992. }
  26993. }
  26994. };
  26995. return cls;
  26996. };
  26997. }());
  26998. /**
  26999. * This object contains properties that describe the current device or platform. These
  27000. * values can be used in `{@link Ext.Class#platformConfig platformConfig}` as well as
  27001. * `{@link Ext.mixin.Responsive#responsiveConfig responsiveConfig}` statements.
  27002. *
  27003. * This object can be modified to include tags that are useful for the application. To
  27004. * add custom properties, it is advisable to use a sub-object. For example:
  27005. *
  27006. * Ext.platformTags.app = {
  27007. * mobile: true
  27008. * };
  27009. *
  27010. * @property {Object} platformTags
  27011. * @property {Boolean} platformTags.phone
  27012. * @property {Boolean} platformTags.tablet
  27013. * @property {Boolean} platformTags.desktop
  27014. * @property {Boolean} platformTags.touch Indicates touch inputs are available.
  27015. * @property {Boolean} platformTags.safari
  27016. * @property {Boolean} platformTags.chrome
  27017. * @property {Boolean} platformTags.windows
  27018. * @property {Boolean} platformTags.firefox
  27019. * @property {Boolean} platformTags.ios True for iPad, iPhone and iPod.
  27020. * @property {Boolean} platformTags.android
  27021. * @property {Boolean} platformTags.blackberry
  27022. * @property {Boolean} platformTags.tizen
  27023. * @member Ext
  27024. */
  27025. // @tag class
  27026. /**
  27027. * @class Ext.Inventory
  27028. * @private
  27029. */
  27030. Ext.Inventory = function() {
  27031. // @define Ext.Script
  27032. // @define Ext.Inventory
  27033. // @require Ext.Function
  27034. var me = this;
  27035. me.names = [];
  27036. me.paths = {};
  27037. me.alternateToName = {};
  27038. me.aliasToName = {};
  27039. me.nameToAliases = {};
  27040. me.nameToAlternates = {};
  27041. me.nameToPrefix = {};
  27042. };
  27043. Ext.Inventory.prototype = {
  27044. _array1: [
  27045. 0
  27046. ],
  27047. prefixes: null,
  27048. dotRe: /\./g,
  27049. wildcardRe: /\*/g,
  27050. addAlias: function(className, alias, update) {
  27051. return this.addMapping(className, alias, this.aliasToName, this.nameToAliases, update);
  27052. },
  27053. addAlternate: function(className, alternate) {
  27054. return this.addMapping(className, alternate, this.alternateToName, this.nameToAlternates);
  27055. },
  27056. addMapping: function(className, alternate, toName, nameTo, update) {
  27057. var name = className.$className || className,
  27058. mappings = name,
  27059. array = this._array1,
  27060. a, aliases, cls, i, length, nameMapping;
  27061. if (Ext.isString(name)) {
  27062. mappings = {};
  27063. mappings[name] = alternate;
  27064. }
  27065. for (cls in mappings) {
  27066. aliases = mappings[cls];
  27067. if (Ext.isString(aliases)) {
  27068. array[0] = aliases;
  27069. aliases = array;
  27070. }
  27071. length = aliases.length;
  27072. nameMapping = nameTo[cls] || (nameTo[cls] = []);
  27073. for (i = 0; i < length; ++i) {
  27074. if (!(a = aliases[i])) {
  27075. continue;
  27076. }
  27077. if (toName[a] !== cls) {
  27078. if (!update && toName[a] && ('Ext.Gadget' !== a)) {
  27079. Ext.log.warn("Overriding existing mapping: '" + a + "' From '" + toName[a] + "' to '" + cls + "'. Is this intentional?");
  27080. }
  27081. toName[a] = cls;
  27082. nameMapping.push(a);
  27083. }
  27084. }
  27085. }
  27086. },
  27087. /**
  27088. * Get the aliases of a class by the class name
  27089. *
  27090. * @param {String} name
  27091. * @return {Array} aliases
  27092. */
  27093. getAliasesByName: function(name) {
  27094. return this.nameToAliases[name] || null;
  27095. },
  27096. getAlternatesByName: function(name) {
  27097. return this.nameToAlternates[name] || null;
  27098. },
  27099. /**
  27100. * Get the name of a class by its alias.
  27101. *
  27102. * @param {String} alias
  27103. * @return {String} className
  27104. */
  27105. getNameByAlias: function(alias) {
  27106. return this.aliasToName[alias] || '';
  27107. },
  27108. /**
  27109. * Get the name of a class by its alternate name.
  27110. *
  27111. * @param {String} alternate
  27112. * @return {String} className
  27113. */
  27114. getNameByAlternate: function(alternate) {
  27115. return this.alternateToName[alternate] || '';
  27116. },
  27117. /**
  27118. * Converts a string expression to an array of matching class names. An expression can
  27119. * either refers to class aliases or class names. Expressions support wildcards:
  27120. *
  27121. * // returns ['Ext.window.Window']
  27122. * var window = Ext.ClassManager.getNamesByExpression('widget.window');
  27123. *
  27124. * // returns ['widget.panel', 'widget.window', ...]
  27125. * var allWidgets = Ext.ClassManager.getNamesByExpression('widget.*');
  27126. *
  27127. * // returns ['Ext.data.Store', 'Ext.data.ArrayProxy', ...]
  27128. * var allData = Ext.ClassManager.getNamesByExpression('Ext.data.*');
  27129. *
  27130. * @param {String/String[]} expression
  27131. * @param {Object} [exclude=null] An object keyed by class name containing classes to
  27132. * exclude from the returned classes. This must be provided if `accumulate` is set to
  27133. * `true`.
  27134. * @param {Boolean} [accumulate=false] Pass `true` to add matching classes to the
  27135. * specified `exclude` object.
  27136. * @return {String[]} An array of class names.
  27137. */
  27138. getNamesByExpression: function(expression, exclude, accumulate) {
  27139. var me = this,
  27140. aliasToName = me.aliasToName,
  27141. alternateToName = me.alternateToName,
  27142. nameToAliases = me.nameToAliases,
  27143. nameToAlternates = me.nameToAlternates,
  27144. map = accumulate ? exclude : {},
  27145. names = [],
  27146. expressions = Ext.isString(expression) ? [
  27147. expression
  27148. ] : expression,
  27149. length = expressions.length,
  27150. wildcardRe = me.wildcardRe,
  27151. expr, i, list, match, n, name, regex;
  27152. for (i = 0; i < length; ++i) {
  27153. if ((expr = expressions[i]).indexOf('*') < 0) {
  27154. // No wildcard
  27155. if (!(name = aliasToName[expr])) {
  27156. if (!(name = alternateToName[expr])) {
  27157. name = expr;
  27158. }
  27159. }
  27160. if (!(name in map) && !(exclude && (name in exclude))) {
  27161. map[name] = 1;
  27162. names.push(name);
  27163. }
  27164. } else {
  27165. regex = new RegExp('^' + expr.replace(wildcardRe, '(.*?)') + '$');
  27166. for (name in nameToAliases) {
  27167. if (!(name in map) && !(exclude && (name in exclude))) {
  27168. if (!(match = regex.test(name))) {
  27169. n = (list = nameToAliases[name]).length;
  27170. while (!match && n-- > 0) {
  27171. match = regex.test(list[n]);
  27172. }
  27173. list = nameToAlternates[name];
  27174. if (list && !match) {
  27175. n = list.length;
  27176. while (!match && n-- > 0) {
  27177. match = regex.test(list[n]);
  27178. }
  27179. }
  27180. }
  27181. if (match) {
  27182. map[name] = 1;
  27183. names.push(name);
  27184. }
  27185. }
  27186. }
  27187. }
  27188. }
  27189. return names;
  27190. },
  27191. getPath: function(className) {
  27192. var me = this,
  27193. paths = me.paths,
  27194. ret = '',
  27195. prefix;
  27196. if (className in paths) {
  27197. ret = paths[className];
  27198. } else {
  27199. prefix = me.nameToPrefix[className] || (me.nameToPrefix[className] = me.getPrefix(className));
  27200. if (prefix) {
  27201. className = className.substring(prefix.length + 1);
  27202. ret = paths[prefix];
  27203. if (ret) {
  27204. ret += '/';
  27205. }
  27206. }
  27207. ret += className.replace(me.dotRe, '/') + '.js';
  27208. }
  27209. return ret;
  27210. },
  27211. getPrefix: function(className) {
  27212. if (className in this.paths) {
  27213. return className;
  27214. } else if (className in this.nameToPrefix) {
  27215. return this.nameToPrefix[className];
  27216. }
  27217. /* eslint-disable-next-line vars-on-top */
  27218. var prefixes = this.getPrefixes(),
  27219. length = className.length,
  27220. items, currChar, prefix, j, jlen;
  27221. // Walk the prefixes backwards so we consider the longest ones first.
  27222. // Prefixes are kept in a sparse array grouped by length so we don't have to
  27223. // iterate over all of them, just the ones we need.
  27224. while (length-- > 0) {
  27225. items = prefixes[length];
  27226. if (items) {
  27227. currChar = className.charAt(length);
  27228. if (currChar !== '.') {
  27229. continue;
  27230. }
  27231. for (j = 0 , jlen = items.length; j < jlen; j++) {
  27232. prefix = items[j];
  27233. if (prefix === className.substring(0, length)) {
  27234. return prefix;
  27235. }
  27236. }
  27237. }
  27238. }
  27239. return '';
  27240. },
  27241. getPrefixes: function() {
  27242. var me = this,
  27243. prefixes = me.prefixes,
  27244. names, name, nameLength, items, i, len;
  27245. if (!prefixes) {
  27246. names = me.names.slice(0);
  27247. me.prefixes = prefixes = [];
  27248. for (i = 0 , len = names.length; i < len; i++) {
  27249. name = names[i];
  27250. nameLength = name.length;
  27251. items = prefixes[nameLength] || (prefixes[nameLength] = []);
  27252. items.push(name);
  27253. }
  27254. }
  27255. return prefixes;
  27256. },
  27257. removeName: function(name) {
  27258. var me = this,
  27259. aliasToName = me.aliasToName,
  27260. alternateToName = me.alternateToName,
  27261. nameToAliases = me.nameToAliases,
  27262. nameToAlternates = me.nameToAlternates,
  27263. aliases = nameToAliases[name],
  27264. alternates = nameToAlternates[name],
  27265. i, a;
  27266. delete nameToAliases[name];
  27267. delete nameToAlternates[name];
  27268. delete me.nameToPrefix[name];
  27269. if (aliases) {
  27270. for (i = aliases.length; i--; ) {
  27271. // Aliases can be reassigned so if this class is the current mapping of
  27272. // the alias, remove it. Since there is no chain to restore what was
  27273. // removed this is not perfect.
  27274. if (name === aliasToName[a = aliases[i]]) {
  27275. delete aliasToName[a];
  27276. }
  27277. }
  27278. }
  27279. if (alternates) {
  27280. for (i = alternates.length; i--; ) {
  27281. // Like aliases, alternate class names can also be remapped.
  27282. if (name === alternateToName[a = alternates[i]]) {
  27283. delete alternateToName[a];
  27284. }
  27285. }
  27286. }
  27287. },
  27288. resolveName: function(name) {
  27289. var me = this,
  27290. trueName;
  27291. // If the name has a registered alias, it is a true className (not an alternate)
  27292. // so we can stop now.
  27293. if (!(name in me.nameToAliases)) {
  27294. // The name is not a known class name, so check to see if it is a known alias:
  27295. if (!(trueName = me.aliasToName[name])) {
  27296. // The name does not correspond to a known alias, so check if it is a known
  27297. // alternateClassName:
  27298. trueName = me.alternateToName[name];
  27299. }
  27300. }
  27301. return trueName || name;
  27302. },
  27303. /**
  27304. * This method returns a selector object that produces a selection of classes and
  27305. * delivers them to the desired `receiver`.
  27306. *
  27307. * The returned selector object has the same methods as the given `receiver` object
  27308. * but these methods on the selector accept a first argument that expects a pattern
  27309. * or array of patterns. The actual method on the `receiver` will be called with an
  27310. * array of classes that match these patterns but with any patterns passed to an
  27311. * `exclude` call removed.
  27312. *
  27313. * For example:
  27314. *
  27315. * var sel = inventory.select({
  27316. * require: function (classes) {
  27317. * console.log('Classes: ' + classes.join(','));
  27318. * }
  27319. * });
  27320. *
  27321. * sel.exclude('Ext.chart.*').exclude('Ext.draw.*').require('*');
  27322. *
  27323. * // Logs all classes except those in the Ext.chart and Ext.draw namespaces.
  27324. *
  27325. * @param {Object} receiver
  27326. * @param {Object} [scope] Optional scope to use when calling `receiver` methods.
  27327. * @return {Object} An object with the same methods as `receiver` plus `exclude`.
  27328. */
  27329. select: function(receiver, scope) {
  27330. var me = this,
  27331. excludes = {},
  27332. ret = {
  27333. excludes: excludes,
  27334. exclude: function() {
  27335. me.getNamesByExpression(arguments[0], excludes, true);
  27336. return this;
  27337. }
  27338. },
  27339. name;
  27340. for (name in receiver) {
  27341. ret[name] = me.selectMethod(excludes, receiver[name], scope || receiver);
  27342. }
  27343. return ret;
  27344. },
  27345. selectMethod: function(excludes, fn, scope) {
  27346. var me = this;
  27347. return function(include) {
  27348. var args = Ext.Array.slice(arguments, 1);
  27349. args.unshift(me.getNamesByExpression(include, excludes));
  27350. return fn.apply(scope, args);
  27351. };
  27352. },
  27353. /**
  27354. * Sets the path of a namespace.
  27355. * For Example:
  27356. *
  27357. * inventory.setPath('Ext', '.');
  27358. * inventory.setPath({
  27359. * Ext: '.'
  27360. * });
  27361. *
  27362. * @param {String/Object} name The name of a single mapping or an object of mappings.
  27363. * @param {String} [path] If `name` is a String, then this is the path for that name.
  27364. * Otherwise this parameter is ignored.
  27365. * @return {Ext.Inventory} this
  27366. * @method
  27367. */
  27368. setPath: Ext.Function.flexSetter(function(name, path) {
  27369. var me = this;
  27370. me.paths[name] = path;
  27371. me.names.push(name);
  27372. me.prefixes = null;
  27373. me.nameToPrefix = {};
  27374. return me;
  27375. })
  27376. };
  27377. // @tag class
  27378. /**
  27379. * @class Ext.ClassManager
  27380. *
  27381. * Ext.ClassManager manages all classes and handles mapping from string class name to
  27382. * actual class objects throughout the whole framework. It is not generally accessed directly,
  27383. * rather through these convenient shorthands:
  27384. *
  27385. * - {@link Ext#define Ext.define}
  27386. * - {@link Ext#method!create Ext.create}
  27387. * - {@link Ext#widget Ext.widget}
  27388. * - {@link Ext#getClass Ext.getClass}
  27389. * - {@link Ext#getClassName Ext.getClassName}
  27390. *
  27391. * # Basic syntax:
  27392. *
  27393. * Ext.define(className, properties);
  27394. *
  27395. * in which `properties` is an object represent a collection of properties that apply to the class.
  27396. * See {@link Ext.ClassManager#method!create} for more detailed instructions.
  27397. *
  27398. * Ext.define('Person', {
  27399. * name: 'Unknown',
  27400. *
  27401. * constructor: function(name) {
  27402. * if (name) {
  27403. * this.name = name;
  27404. * }
  27405. * },
  27406. *
  27407. * eat: function(foodType) {
  27408. * alert("I'm eating: " + foodType);
  27409. *
  27410. * return this;
  27411. * }
  27412. * });
  27413. *
  27414. * var aaron = new Person("Aaron");
  27415. * aaron.eat("Sandwich"); // alert("I'm eating: Sandwich");
  27416. *
  27417. * Ext.Class has a powerful set of extensible {@link Ext.Class#registerPreprocessor pre-processors}
  27418. * which takes care of everything related to class creation, including but not limited to
  27419. * inheritance, mixins, configuration, statics, etc.
  27420. *
  27421. * # Inheritance:
  27422. *
  27423. * Ext.define('Developer', {
  27424. * extend: 'Person',
  27425. *
  27426. * constructor: function(name, isGeek) {
  27427. * this.isGeek = isGeek;
  27428. *
  27429. * // Apply a method from the parent class' prototype
  27430. * this.callParent([name]);
  27431. * },
  27432. *
  27433. * code: function(language) {
  27434. * alert("I'm coding in: " + language);
  27435. *
  27436. * this.eat("Bugs");
  27437. *
  27438. * return this;
  27439. * }
  27440. * });
  27441. *
  27442. * var jacky = new Developer("Jacky", true);
  27443. * jacky.code("JavaScript"); // alert("I'm coding in: JavaScript");
  27444. * // alert("I'm eating: Bugs");
  27445. *
  27446. * See {@link Ext.Base#method!callParent} for more details on calling superclass' methods
  27447. *
  27448. * # Mixins:
  27449. *
  27450. * Ext.define('CanPlayGuitar', {
  27451. * playGuitar: function() {
  27452. * alert("F#...G...D...A");
  27453. * }
  27454. * });
  27455. *
  27456. * Ext.define('CanComposeSongs', {
  27457. * composeSongs: function() { ... }
  27458. * });
  27459. *
  27460. * Ext.define('CanSing', {
  27461. * sing: function() {
  27462. * alert("For he's a jolly good fellow...")
  27463. * }
  27464. * });
  27465. *
  27466. * Ext.define('Musician', {
  27467. * extend: 'Person',
  27468. *
  27469. * mixins: {
  27470. * canPlayGuitar: 'CanPlayGuitar',
  27471. * canComposeSongs: 'CanComposeSongs',
  27472. * canSing: 'CanSing'
  27473. * }
  27474. * })
  27475. *
  27476. * Ext.define('CoolPerson', {
  27477. * extend: 'Person',
  27478. *
  27479. * mixins: {
  27480. * canPlayGuitar: 'CanPlayGuitar',
  27481. * canSing: 'CanSing'
  27482. * },
  27483. *
  27484. * sing: function() {
  27485. * alert("Ahem....");
  27486. *
  27487. * this.mixins.canSing.sing.call(this);
  27488. *
  27489. * alert("[Playing guitar at the same time...]");
  27490. *
  27491. * this.playGuitar();
  27492. * }
  27493. * });
  27494. *
  27495. * var me = new CoolPerson("Jacky");
  27496. *
  27497. * me.sing(); // alert("Ahem...");
  27498. * // alert("For he's a jolly good fellow...");
  27499. * // alert("[Playing guitar at the same time...]");
  27500. * // alert("F#...G...D...A");
  27501. *
  27502. * # Config:
  27503. *
  27504. * Ext.define('SmartPhone', {
  27505. * config: {
  27506. * hasTouchScreen: false,
  27507. * operatingSystem: 'Other',
  27508. * price: 500
  27509. * },
  27510. *
  27511. * isExpensive: false,
  27512. *
  27513. * constructor: function(config) {
  27514. * this.initConfig(config);
  27515. * },
  27516. *
  27517. * applyPrice: function(price) {
  27518. * this.isExpensive = (price > 500);
  27519. *
  27520. * return price;
  27521. * },
  27522. *
  27523. * applyOperatingSystem: function(operatingSystem) {
  27524. * if (!(/^(iOS|Android|BlackBerry)$/i).test(operatingSystem)) {
  27525. * return 'Other';
  27526. * }
  27527. *
  27528. * return operatingSystem;
  27529. * }
  27530. * });
  27531. *
  27532. * var iPhone = new SmartPhone({
  27533. * hasTouchScreen: true,
  27534. * operatingSystem: 'iOS'
  27535. * });
  27536. *
  27537. * iPhone.getPrice(); // 500;
  27538. * iPhone.getOperatingSystem(); // 'iOS'
  27539. * iPhone.getHasTouchScreen(); // true;
  27540. *
  27541. * iPhone.isExpensive; // false;
  27542. * iPhone.setPrice(600);
  27543. * iPhone.getPrice(); // 600
  27544. * iPhone.isExpensive; // true;
  27545. *
  27546. * iPhone.setOperatingSystem('AlienOS');
  27547. * iPhone.getOperatingSystem(); // 'Other'
  27548. *
  27549. * # Statics:
  27550. *
  27551. * Ext.define('Computer', {
  27552. * statics: {
  27553. * factory: function(brand) {
  27554. * // 'this' in static methods refer to the class itself
  27555. * return new this(brand);
  27556. * }
  27557. * },
  27558. *
  27559. * constructor: function() { ... }
  27560. * });
  27561. *
  27562. * var dellComputer = Computer.factory('Dell');
  27563. *
  27564. * Also see {@link Ext.Base#statics} and {@link Ext.Base#self} for more details on accessing
  27565. * static properties within class methods
  27566. *
  27567. * @singleton
  27568. */
  27569. Ext.ClassManager = (function(Class, alias, arraySlice, arrayFrom, global) {
  27570. // @define Ext.ClassManager
  27571. // @require Ext.Inventory
  27572. // @require Ext.Class
  27573. // @require Ext.Function
  27574. // @require Ext.Array
  27575. var makeCtor = Ext.Class.makeCtor,
  27576. nameLookupStack = [],
  27577. namespaceCache = {
  27578. Ext: {
  27579. name: 'Ext',
  27580. value: Ext
  27581. }
  27582. },
  27583. // specially added for sandbox (Ext === global.Ext6)
  27584. /*
  27585. 'Ext.grid': {
  27586. name: 'grid',
  27587. parent: namespaceCache['Ext']
  27588. },
  27589. 'Ext.grid.Panel': {
  27590. name: 'Panel',
  27591. parent: namespaceCache['Ext.grid']
  27592. },
  27593. ...
  27594. Also,
  27595. 'MyApp': {
  27596. name: 'MyApp',
  27597. value: MyApp
  27598. }
  27599. */
  27600. Manager = Ext.apply(new Ext.Inventory(), {
  27601. /**
  27602. * @property {Object} classes
  27603. * All classes which were defined through the ClassManager. Keys are the
  27604. * name of the classes and the values are references to the classes.
  27605. * @private
  27606. */
  27607. classes: {},
  27608. classCount: 0,
  27609. classState: {},
  27610. /*
  27611. * 'Ext.foo.Bar': <state enum>
  27612. *
  27613. * 10 = Ext.define called
  27614. * 20 = Ext.define/override called
  27615. * 30 = Manager.existCache[<name>] == true for define
  27616. * 40 = Manager.existCache[<name>] == true for define/override
  27617. * 50 = Manager.isCreated(<name>) == true for define
  27618. * 60 = Manager.isCreated(<name>) == true for define/override
  27619. *
  27620. */
  27621. /**
  27622. * @private
  27623. */
  27624. existCache: {},
  27625. /** @private */
  27626. instantiators: [],
  27627. /**
  27628. * Checks if a class has already been created.
  27629. *
  27630. * @param {String} className
  27631. * @return {Boolean} exist
  27632. */
  27633. isCreated: function(className) {
  27634. if (typeof className !== 'string' || className.length < 1) {
  27635. throw new Error("[Ext.ClassManager] Invalid classname, must be a string and " + "must not be empty");
  27636. }
  27637. if (Manager.classes[className] || Manager.existCache[className]) {
  27638. return true;
  27639. }
  27640. if (!Manager.lookupName(className, false)) {
  27641. return false;
  27642. }
  27643. Manager.triggerCreated(className);
  27644. return true;
  27645. },
  27646. /**
  27647. * @private
  27648. */
  27649. createdListeners: [],
  27650. /**
  27651. * @private
  27652. */
  27653. nameCreatedListeners: {},
  27654. /**
  27655. * @private
  27656. */
  27657. existsListeners: [],
  27658. /**
  27659. * @private
  27660. */
  27661. nameExistsListeners: {},
  27662. /**
  27663. * @private
  27664. */
  27665. overrideMap: {},
  27666. /**
  27667. * @private
  27668. */
  27669. triggerCreated: function(className, state) {
  27670. Manager.existCache[className] = state || 1;
  27671. Manager.classState[className] += 40;
  27672. Manager.notify(className, Manager.createdListeners, Manager.nameCreatedListeners);
  27673. },
  27674. /**
  27675. * @private
  27676. */
  27677. onCreated: function(fn, scope, className) {
  27678. Manager.addListener(fn, scope, className, Manager.createdListeners, Manager.nameCreatedListeners);
  27679. },
  27680. /**
  27681. * @private
  27682. */
  27683. notify: function(className, listeners, nameListeners) {
  27684. var alternateNames = Manager.getAlternatesByName(className),
  27685. names = [
  27686. className
  27687. ],
  27688. i, ln, j, subLn, listener, name;
  27689. for (i = 0 , ln = listeners.length; i < ln; i++) {
  27690. listener = listeners[i];
  27691. listener.fn.call(listener.scope, className);
  27692. }
  27693. while (names) {
  27694. for (i = 0 , ln = names.length; i < ln; i++) {
  27695. name = names[i];
  27696. listeners = nameListeners[name];
  27697. if (listeners) {
  27698. for (j = 0 , subLn = listeners.length; j < subLn; j++) {
  27699. listener = listeners[j];
  27700. listener.fn.call(listener.scope, name);
  27701. }
  27702. delete nameListeners[name];
  27703. }
  27704. }
  27705. names = alternateNames;
  27706. // for 2nd pass (if needed)
  27707. alternateNames = null;
  27708. }
  27709. },
  27710. // no 3rd pass
  27711. /**
  27712. * @private
  27713. */
  27714. addListener: function(fn, scope, className, listeners, nameListeners) {
  27715. var i;
  27716. if (Ext.isArray(className)) {
  27717. fn = Ext.Function.createBarrier(className.length, fn, scope);
  27718. for (i = 0; i < className.length; i++) {
  27719. this.addListener(fn, null, className[i], listeners, nameListeners);
  27720. }
  27721. return;
  27722. }
  27723. /* eslint-disable-next-line vars-on-top */
  27724. var listener = {
  27725. fn: fn,
  27726. scope: scope
  27727. };
  27728. if (className) {
  27729. if (this.isCreated(className)) {
  27730. fn.call(scope, className);
  27731. return;
  27732. }
  27733. if (!nameListeners[className]) {
  27734. nameListeners[className] = [];
  27735. }
  27736. nameListeners[className].push(listener);
  27737. } else {
  27738. listeners.push(listener);
  27739. }
  27740. },
  27741. /**
  27742. * Supports namespace rewriting.
  27743. * @private
  27744. */
  27745. $namespaceCache: namespaceCache,
  27746. /**
  27747. * See `{@link Ext#addRootNamespaces Ext.addRootNamespaces}`.
  27748. * @since 6.0.0
  27749. * @private
  27750. */
  27751. addRootNamespaces: function(namespaces) {
  27752. var name;
  27753. for (name in namespaces) {
  27754. namespaceCache[name] = {
  27755. name: name,
  27756. value: namespaces[name]
  27757. };
  27758. }
  27759. },
  27760. /**
  27761. * Clears the namespace lookup cache. After application launch, this cache can
  27762. * often contain several hundred entries that are unlikely to be needed again.
  27763. * These will be rebuilt as needed, so it is harmless to clear this cache even
  27764. * if its results will be used again.
  27765. * @since 6.0.0
  27766. * @private
  27767. */
  27768. clearNamespaceCache: function() {
  27769. var name;
  27770. nameLookupStack.length = 0;
  27771. for (name in namespaceCache) {
  27772. if (!namespaceCache[name].value) {
  27773. delete namespaceCache[name];
  27774. }
  27775. }
  27776. },
  27777. /**
  27778. * Return the namespace cache entry for the given a class name or namespace (e.g.,
  27779. * "Ext.grid.Panel").
  27780. *
  27781. * @param {String} namespace The namespace or class name to lookup.
  27782. * @return {Object} The cache entry.
  27783. * @return {String} return.name The leaf name ("Panel" for "Ext.grid.Panel").
  27784. * @return {Object} return.parent The entry of the parent namespace (i.e., "Ext.grid").
  27785. * @return {Object} return.value The namespace object. This is only set for
  27786. * top-level namespace entries to support renaming them for sandboxing ("Ext6" vs
  27787. * "Ext").
  27788. * @since 6.0.0
  27789. * @private
  27790. */
  27791. getNamespaceEntry: function(namespace) {
  27792. var entry, i;
  27793. if (typeof namespace !== 'string') {
  27794. return namespace;
  27795. }
  27796. // assume we've been given an entry object
  27797. entry = namespaceCache[namespace];
  27798. if (!entry) {
  27799. i = namespace.lastIndexOf('.');
  27800. if (i < 0) {
  27801. entry = {
  27802. name: namespace
  27803. };
  27804. } else {
  27805. entry = {
  27806. name: namespace.substring(i + 1),
  27807. parent: Manager.getNamespaceEntry(namespace.substring(0, i))
  27808. };
  27809. }
  27810. namespaceCache[namespace] = entry;
  27811. }
  27812. return entry;
  27813. },
  27814. /**
  27815. * Return the value of the given "dot path" name. This supports remapping (for use
  27816. * in sandbox builds) as well as auto-creating of namespaces.
  27817. *
  27818. * @param {String} namespace The name of the namespace or class.
  27819. * @param {Boolean} [autoCreate] Pass `true` to create objects for undefined names.
  27820. * @return {Object} The object that is the namespace or class name.
  27821. * @since 6.0.0
  27822. * @private
  27823. */
  27824. lookupName: function(namespace, autoCreate) {
  27825. var entry = Manager.getNamespaceEntry(namespace),
  27826. scope = Ext.global,
  27827. i = 0,
  27828. e, parent;
  27829. // Put entries on the stack in reverse order: [ 'Panel', 'grid', 'Ext' ]
  27830. for (e = entry; e; e = e.parent) {
  27831. // since we process only what we add to the array, and that always
  27832. // starts at index=0, we don't need to clean up the array (that would
  27833. // just encourage the GC to do something pointless).
  27834. nameLookupStack[i++] = e;
  27835. }
  27836. while (scope && i-- > 0) {
  27837. // We'll process entries in top-down order ('Ext', 'grid' then 'Panel').
  27838. e = nameLookupStack[i];
  27839. parent = scope;
  27840. scope = e.value || scope[e.name];
  27841. if (!scope && autoCreate) {
  27842. parent[e.name] = scope = {};
  27843. }
  27844. }
  27845. return scope;
  27846. },
  27847. /**
  27848. * Creates a namespace and assign the `value` to the created object.
  27849. *
  27850. * Ext.ClassManager.setNamespace('MyCompany.pkg.Example', someObject);
  27851. *
  27852. * alert(MyCompany.pkg.Example === someObject); // alerts true
  27853. *
  27854. * @param {String} namespace
  27855. * @param {Object} value
  27856. */
  27857. setNamespace: function(namespace, value) {
  27858. var entry = Manager.getNamespaceEntry(namespace),
  27859. scope = Ext.global;
  27860. if (entry.parent) {
  27861. scope = Manager.lookupName(entry.parent, true);
  27862. }
  27863. scope[entry.name] = value;
  27864. return value;
  27865. },
  27866. /**
  27867. * Changes the mapping of an `xtype` to map to the specified component class.
  27868. * @param {String/Ext.Class} cls The class or class name to which `xtype` is mapped.
  27869. * @param {String} xtype The `xtype` to map or redefine as `cls`.
  27870. * @since 6.0.1
  27871. * @private
  27872. */
  27873. setXType: function(cls, xtype) {
  27874. var className = cls.$className,
  27875. C = className ? cls : Manager.get(className = cls),
  27876. proto = C.prototype,
  27877. xtypes = proto.xtypes,
  27878. xtypesChain = proto.xtypesChain,
  27879. xtypesMap = proto.xtypesMap;
  27880. if (!proto.hasOwnProperty('xtypes')) {
  27881. proto.xtypes = xtypes = [];
  27882. proto.xtypesChain = xtypesChain = xtypesChain ? xtypesChain.slice(0) : [];
  27883. proto.xtypesMap = xtypesMap = Ext.apply({}, xtypesMap);
  27884. }
  27885. Manager.addAlias(className, 'widget.' + xtype, true);
  27886. xtypes.push(xtype);
  27887. xtypesChain.push(xtype);
  27888. xtypesMap[xtype] = true;
  27889. },
  27890. // TODO consider updating derived class xtypesChain / xtypesMap
  27891. /**
  27892. * Sets a name reference to a class.
  27893. *
  27894. * @param {String} name
  27895. * @param {Object} value
  27896. * @return {Ext.ClassManager} this
  27897. */
  27898. set: function(name, value) {
  27899. var targetName = Manager.getName(value);
  27900. Manager.classes[name] = Manager.setNamespace(name, value);
  27901. Manager.classCount++;
  27902. if (targetName && targetName !== name) {
  27903. Manager.addAlternate(targetName, name);
  27904. }
  27905. return Manager;
  27906. },
  27907. /**
  27908. * Retrieve a class by its name.
  27909. *
  27910. * @param {String} name
  27911. * @return {Ext.Class} class
  27912. */
  27913. get: function(name) {
  27914. return Manager.classes[name] || Manager.lookupName(name, false);
  27915. },
  27916. /**
  27917. * Adds a batch of class name to alias mappings.
  27918. * @param {Object} aliases The set of mappings of the form.
  27919. * className : [values...]
  27920. */
  27921. addNameAliasMappings: function(aliases) {
  27922. Manager.addAlias(aliases);
  27923. },
  27924. /**
  27925. *
  27926. * @param {Object} alternates The set of mappings of the form
  27927. * className : [values...]
  27928. */
  27929. addNameAlternateMappings: function(alternates) {
  27930. Manager.addAlternate(alternates);
  27931. },
  27932. /**
  27933. * Get a reference to the class by its alias.
  27934. *
  27935. * @param {String} alias
  27936. * @return {Ext.Class} class
  27937. */
  27938. getByAlias: function(alias) {
  27939. return Manager.get(Manager.getNameByAlias(alias));
  27940. },
  27941. /**
  27942. * Get a component class name from a config object.
  27943. * @param {Object} config The config object.
  27944. * @param {String} [aliasPrefix] A prefix to use when getting
  27945. * a class name by alias.
  27946. * @return {Ext.Class} The class.
  27947. *
  27948. * @private
  27949. */
  27950. getByConfig: function(config, aliasPrefix) {
  27951. var xclass = config.xclass,
  27952. name;
  27953. if (xclass) {
  27954. name = xclass;
  27955. } else {
  27956. name = config.xtype;
  27957. if (name) {
  27958. aliasPrefix = 'widget.';
  27959. } else {
  27960. name = config.type;
  27961. }
  27962. name = Manager.getNameByAlias(aliasPrefix + name);
  27963. }
  27964. return Manager.get(name);
  27965. },
  27966. /**
  27967. * Get the name of the class by its reference or its instance. This is
  27968. * usually invoked by the shorthand {@link Ext#getClassName}.
  27969. *
  27970. * Ext.ClassManager.getName(Ext.Action); // returns "Ext.Action"
  27971. *
  27972. * @param {Ext.Class/Object} object
  27973. * @return {String} className
  27974. */
  27975. getName: function(object) {
  27976. return object && object.$className || '';
  27977. },
  27978. /**
  27979. * Get the class of the provided object; returns null if it's not an instance
  27980. * of any class created with Ext.define. This is usually invoked by the
  27981. * shorthand {@link Ext#getClass}.
  27982. *
  27983. * var component = new Ext.Component();
  27984. *
  27985. * Ext.getClass(component); // returns Ext.Component
  27986. *
  27987. * @param {Object} object
  27988. * @return {Ext.Class} class
  27989. */
  27990. getClass: function(object) {
  27991. return object && object.self || null;
  27992. },
  27993. /**
  27994. * Defines a class.
  27995. * @deprecated 4.1 Use {@link Ext#define} instead.
  27996. * @private
  27997. */
  27998. create: function(className, data, createdFn) {
  27999. var ctor;
  28000. if (className != null && typeof className !== 'string') {
  28001. throw new Error("[Ext.define] Invalid class name '" + className + "' specified, must be a non-empty string");
  28002. }
  28003. ctor = makeCtor(className);
  28004. if (typeof data === 'function') {
  28005. data = data(ctor);
  28006. }
  28007. if (className) {
  28008. if (Manager.classes[className]) {
  28009. Ext.log.warn("[Ext.define] Duplicate class name '" + className + "' specified, must be a non-empty string");
  28010. }
  28011. ctor.name = className;
  28012. }
  28013. data.$className = className;
  28014. return new Class(ctor, data, function() {
  28015. var postprocessorStack = data.postprocessors || Manager.defaultPostprocessors,
  28016. registeredPostprocessors = Manager.postprocessors,
  28017. postprocessors = [],
  28018. postprocessor, i, ln, j, subLn, postprocessorProperties, postprocessorProperty;
  28019. delete data.postprocessors;
  28020. for (i = 0 , ln = postprocessorStack.length; i < ln; i++) {
  28021. postprocessor = postprocessorStack[i];
  28022. if (typeof postprocessor === 'string') {
  28023. postprocessor = registeredPostprocessors[postprocessor];
  28024. postprocessorProperties = postprocessor.properties;
  28025. if (postprocessorProperties === true) {
  28026. postprocessors.push(postprocessor.fn);
  28027. } else if (postprocessorProperties) {
  28028. for (j = 0 , subLn = postprocessorProperties.length; j < subLn; j++) {
  28029. postprocessorProperty = postprocessorProperties[j];
  28030. if (data.hasOwnProperty(postprocessorProperty)) {
  28031. postprocessors.push(postprocessor.fn);
  28032. break;
  28033. }
  28034. }
  28035. }
  28036. } else {
  28037. postprocessors.push(postprocessor);
  28038. }
  28039. }
  28040. data.postprocessors = postprocessors;
  28041. data.createdFn = createdFn;
  28042. Manager.processCreate(className, this, data);
  28043. });
  28044. },
  28045. processCreate: function(className, cls, clsData) {
  28046. var me = this,
  28047. postprocessor = clsData.postprocessors.shift(),
  28048. createdFn = clsData.createdFn;
  28049. if (!postprocessor) {
  28050. if (Ext.classSystemMonitor) {
  28051. Ext.classSystemMonitor(className, 'Ext.ClassManager#classCreated', arguments);
  28052. }
  28053. if (className) {
  28054. me.set(className, cls);
  28055. }
  28056. delete cls._classHooks;
  28057. if (createdFn) {
  28058. createdFn.call(cls, cls);
  28059. }
  28060. if (className) {
  28061. me.triggerCreated(className);
  28062. }
  28063. return;
  28064. }
  28065. if (postprocessor.call(me, className, cls, clsData, me.processCreate) !== false) {
  28066. me.processCreate(className, cls, clsData);
  28067. }
  28068. },
  28069. createOverride: function(className, data, createdFn) {
  28070. var me = this,
  28071. overriddenClassName = data.override,
  28072. requires = data.requires,
  28073. uses = data.uses,
  28074. mixins = data.mixins,
  28075. mixinsIsArray,
  28076. compat = 1,
  28077. // default if 'compatibility' is not specified
  28078. dependenciesLoaded, classReady;
  28079. classReady = function() {
  28080. var cls, dependencies, i, key, temp;
  28081. if (!dependenciesLoaded) {
  28082. dependencies = requires ? requires.slice(0) : [];
  28083. if (mixins) {
  28084. if (!(mixinsIsArray = mixins instanceof Array)) {
  28085. for (key in mixins) {
  28086. if (Ext.isString(cls = mixins[key])) {
  28087. dependencies.push(cls);
  28088. }
  28089. }
  28090. } else {
  28091. for (i = 0 , temp = mixins.length; i < temp; ++i) {
  28092. if (Ext.isString(cls = mixins[i])) {
  28093. dependencies.push(cls);
  28094. }
  28095. }
  28096. }
  28097. }
  28098. dependenciesLoaded = true;
  28099. if (dependencies.length) {
  28100. // Since the override is going to be used (its target class is
  28101. // now created), we need to fetch the required classes for the
  28102. // override and call us back once they are loaded:
  28103. Ext.require(dependencies, classReady);
  28104. return;
  28105. }
  28106. }
  28107. // else we have no dependencies, so proceed
  28108. // transform mixin class names into class references, This
  28109. // loop can handle both the array and object forms of
  28110. // mixin definitions
  28111. if (mixinsIsArray) {
  28112. for (i = 0 , temp = mixins.length; i < temp; ++i) {
  28113. if (Ext.isString(cls = mixins[i])) {
  28114. mixins[i] = Ext.ClassManager.get(cls);
  28115. }
  28116. }
  28117. } else if (mixins) {
  28118. for (key in mixins) {
  28119. if (Ext.isString(cls = mixins[key])) {
  28120. mixins[key] = Ext.ClassManager.get(cls);
  28121. }
  28122. }
  28123. }
  28124. // The target class and the required classes for this override are
  28125. // ready, so we can apply the override now:
  28126. cls = overriddenClassName.$isClass ? overriddenClassName : me.get(overriddenClassName);
  28127. // We don't want to apply these:
  28128. delete data.override;
  28129. delete data.compatibility;
  28130. delete data.requires;
  28131. delete data.uses;
  28132. Ext.override(cls, data);
  28133. // This pushes the overriding file itself into Ext.Loader.history
  28134. // Hence if the target class never exists, the overriding file will
  28135. // never be included in the build.
  28136. Ext.Loader.history.push(className);
  28137. if (uses) {
  28138. // This "hides" from the Cmd auto-dependency scanner since
  28139. // the reference is circular (Loader requires us).
  28140. /* eslint-disable-next-line dot-notation */
  28141. Ext['Loader'].addUsedClasses(uses);
  28142. }
  28143. // get these classes too!
  28144. if (createdFn) {
  28145. createdFn.call(cls, cls);
  28146. }
  28147. };
  28148. // last but not least!
  28149. if (className) {
  28150. Manager.overrideMap[className] = true;
  28151. }
  28152. // If specified, parse strings as versions, but otherwise treat as a
  28153. // boolean (maybe "compatibility: Ext.isIE8" or something).
  28154. //
  28155. if ('compatibility' in data) {
  28156. compat = data.compatibility;
  28157. if (!compat) {
  28158. // Cast '', null, undefined, 0 to false.
  28159. compat = false;
  28160. } else if (typeof compat === 'number') {
  28161. // By virtue of the condition above we must be a nonzero number.
  28162. compat = true;
  28163. } else if (typeof compat !== 'boolean') {
  28164. compat = Ext.checkVersion(compat);
  28165. }
  28166. }
  28167. if (compat) {
  28168. // override the target class right after it's created
  28169. if (overriddenClassName.$isClass) {
  28170. classReady();
  28171. } else {
  28172. me.onCreated(classReady, me, overriddenClassName);
  28173. }
  28174. }
  28175. me.triggerCreated(className, 2);
  28176. return me;
  28177. },
  28178. /**
  28179. * Instantiate a class by its alias. This is usually invoked by the
  28180. * shorthand {@link Ext#createByAlias}.
  28181. *
  28182. * If {@link Ext.Loader} is {@link Ext.Loader#setConfig enabled} and the class
  28183. * has not been defined yet, it will attempt to load the class via synchronous
  28184. * loading.
  28185. *
  28186. * var window = Ext.createByAlias('widget.window', { width: 600, height: 800 });
  28187. *
  28188. * @param {String} alias
  28189. * @param {Object...} args Additional arguments after the alias will be passed to the
  28190. * class constructor.
  28191. * @return {Object} instance
  28192. */
  28193. instantiateByAlias: function() {
  28194. var alias = arguments[0],
  28195. args = arraySlice.call(arguments),
  28196. className = this.getNameByAlias(alias);
  28197. if (!className) {
  28198. throw new Error("[Ext.createByAlias] Unrecognized alias: " + alias);
  28199. }
  28200. args[0] = className;
  28201. return Ext.create.apply(Ext, args);
  28202. },
  28203. /**
  28204. * Instantiate a class by either full name, alias or alternate name
  28205. * @param {String} name
  28206. * @param {Mixed} args Additional arguments after the name will be passed to the class'
  28207. * constructor.
  28208. * @return {Object} instance
  28209. * @deprecated 5.0 Use Ext.create() instead.
  28210. */
  28211. instantiate: function() {
  28212. Ext.log.warn('Ext.ClassManager.instantiate() is deprecated. Use Ext.create() instead.');
  28213. return Ext.create.apply(Ext, arguments);
  28214. },
  28215. /**
  28216. * @private
  28217. * @param name
  28218. * @param args
  28219. */
  28220. dynInstantiate: function(name, args) {
  28221. args = arrayFrom(args, true);
  28222. args.unshift(name);
  28223. return Ext.create.apply(Ext, args);
  28224. },
  28225. /**
  28226. * @private
  28227. * @param length
  28228. */
  28229. getInstantiator: function(length) {
  28230. var instantiators = this.instantiators,
  28231. instantiator, args, i;
  28232. instantiator = instantiators[length];
  28233. if (!instantiator) {
  28234. i = length;
  28235. args = [];
  28236. for (i = 0; i < length; i++) {
  28237. args.push('a[' + i + ']');
  28238. }
  28239. instantiator = instantiators[length] = new Function('c', 'a', 'return new c(' + args.join(',') + ')');
  28240. instantiator.name = "Ext.create" + length;
  28241. }
  28242. return instantiator;
  28243. },
  28244. /**
  28245. * @private
  28246. */
  28247. postprocessors: {},
  28248. /**
  28249. * @private
  28250. */
  28251. defaultPostprocessors: [],
  28252. /**
  28253. * Register a post-processor function.
  28254. *
  28255. * @param {String} name
  28256. * @param {Function} fn
  28257. * @param {String/String[]} properties
  28258. * @param {String} position
  28259. * @param {String} relativeTo
  28260. * @private
  28261. */
  28262. registerPostprocessor: function(name, fn, properties, position, relativeTo) {
  28263. if (!position) {
  28264. position = 'last';
  28265. }
  28266. if (!properties) {
  28267. properties = [
  28268. name
  28269. ];
  28270. }
  28271. this.postprocessors[name] = {
  28272. name: name,
  28273. properties: properties || false,
  28274. fn: fn
  28275. };
  28276. this.setDefaultPostprocessorPosition(name, position, relativeTo);
  28277. return this;
  28278. },
  28279. /**
  28280. * Set the default post processors array stack which are applied to every class.
  28281. *
  28282. * @private
  28283. * @param {String/Array} postprocessors The name of a registered post processor or an array
  28284. * of registered names.
  28285. * @return {Ext.ClassManager} this
  28286. */
  28287. setDefaultPostprocessors: function(postprocessors) {
  28288. this.defaultPostprocessors = arrayFrom(postprocessors);
  28289. return this;
  28290. },
  28291. /**
  28292. * Insert this post-processor at a specific position in the stack, optionally relative to
  28293. * any existing post-processor
  28294. *
  28295. * @private
  28296. * @param {String} name The post-processor name. Note that it needs to be registered with
  28297. * {@link Ext.ClassManager#registerPostprocessor} before this
  28298. * @param {String} offset The insertion position. Four possible values are:
  28299. * 'first', 'last', or: 'before', 'after' (relative to the name provided in the third
  28300. * argument)
  28301. * @param {String} relativeName
  28302. * @return {Ext.ClassManager} this
  28303. */
  28304. setDefaultPostprocessorPosition: function(name, offset, relativeName) {
  28305. var defaultPostprocessors = this.defaultPostprocessors,
  28306. index;
  28307. if (typeof offset === 'string') {
  28308. if (offset === 'first') {
  28309. defaultPostprocessors.unshift(name);
  28310. return this;
  28311. } else if (offset === 'last') {
  28312. defaultPostprocessors.push(name);
  28313. return this;
  28314. }
  28315. offset = (offset === 'after') ? 1 : -1;
  28316. }
  28317. index = Ext.Array.indexOf(defaultPostprocessors, relativeName);
  28318. if (index !== -1) {
  28319. Ext.Array.splice(defaultPostprocessors, Math.max(0, index + offset), 0, name);
  28320. }
  28321. return this;
  28322. }
  28323. });
  28324. /* eslint-disable indent */
  28325. /**
  28326. * @cfg xtype
  28327. * @member Ext.Class
  28328. * @inheritdoc Ext.Component#cfg-xtype
  28329. */
  28330. /**
  28331. * @cfg {String} override
  28332. * @member Ext.Class
  28333. * Overrides members of the specified `target` class.
  28334. *
  28335. * **NOTE:** the overridden class must have been defined using
  28336. * {@link Ext#define Ext.define} in order to use the `override` config.
  28337. *
  28338. * Methods defined on the overriding class will not automatically call the methods of
  28339. * the same name in the ancestor class chain. To call the parent's method of the
  28340. * same name you must call {@link Ext.Base#method!callParent callParent}. To skip the
  28341. * method of the overridden class and call its parent you will instead call
  28342. * {@link Ext.Base#method!callSuper callSuper}.
  28343. *
  28344. * See {@link Ext#define Ext.define} for additional usage examples.
  28345. */
  28346. /**
  28347. * @cfg {Object} platformConfig
  28348. * Allows setting config values for a class based on specific platforms. The value
  28349. * of this config is an object whose properties are "rules" and whose values are
  28350. * objects containing config values.
  28351. *
  28352. * For example:
  28353. *
  28354. * Ext.define('App.view.Foo', {
  28355. * extend: 'Ext.panel.Panel',
  28356. *
  28357. * platformConfig: {
  28358. * desktop: {
  28359. * title: 'Some Rather Descriptive Title'
  28360. * },
  28361. *
  28362. * '!desktop': {
  28363. * title: 'Short Title'
  28364. * }
  28365. * }
  28366. * });
  28367. *
  28368. * In the above, "desktop" and "!desktop" are (mutually exclusive) rules. Whichever
  28369. * evaluates to `true` will have its configs applied to the class. In this case, only
  28370. * the "title" property, but the object can contain any number of config properties.
  28371. * In this case, the `platformConfig` is evaluated as part of the class and there is
  28372. * no cost for each instance created.
  28373. *
  28374. * The rules are evaluated expressions in the context of the platform tags contained
  28375. * in `{@link Ext#platformTags Ext.platformTags}`. Any properties of that object are
  28376. * implicitly usable (as shown above).
  28377. *
  28378. * If a `platformConfig` specifies a config value, it will replace any values declared
  28379. * on the class itself.
  28380. *
  28381. * Use of `platformConfig` on instances is handled by the config system when classes
  28382. * call `{@link Ext.Base#initConfig initConfig}`. For example:
  28383. *
  28384. * Ext.create({
  28385. * xtype: 'panel',
  28386. *
  28387. * platformConfig: {
  28388. * desktop: {
  28389. * title: 'Some Rather Descriptive Title'
  28390. * },
  28391. *
  28392. * '!desktop': {
  28393. * title: 'Short Title'
  28394. * }
  28395. * }
  28396. * });
  28397. *
  28398. * The following is equivalent to the above:
  28399. *
  28400. * if (Ext.platformTags.desktop) {
  28401. * Ext.create({
  28402. * xtype: 'panel',
  28403. * title: 'Some Rather Descriptive Title'
  28404. * });
  28405. * } else {
  28406. * Ext.create({
  28407. * xtype: 'panel',
  28408. * title: 'Short Title'
  28409. * });
  28410. * }
  28411. *
  28412. * To adjust configs based on dynamic conditions, see `{@link Ext.mixin.Responsive}`.
  28413. */
  28414. Manager.registerPostprocessor('platformConfig', function(name, Class, data) {
  28415. Class.addPlatformConfig(data);
  28416. });
  28417. /**
  28418. * @cfg {String/String[]} alias
  28419. * @member Ext.Class
  28420. * List of short aliases for class names. An alias consists of a namespace and a name
  28421. * concatenated by a period as &#60;namespace&#62;.&#60;name&#62;
  28422. *
  28423. * - **namespace** - The namespace describes what kind of alias this is and must be
  28424. * all lowercase.
  28425. * - **name** - The name of the alias which allows the lazy-instantiation via the
  28426. * alias. The name shouldn't contain any periods.
  28427. *
  28428. * A list of namespaces and the usages are:
  28429. *
  28430. * - **feature** - {@link Ext.grid.Panel Grid} features
  28431. * - **plugin** - Plugins
  28432. * - **store** - {@link Ext.data.Store}
  28433. * - **widget** - Components
  28434. *
  28435. * Most useful for defining xtypes for widgets:
  28436. *
  28437. * Ext.define('MyApp.CoolPanel', {
  28438. * extend: 'Ext.panel.Panel',
  28439. * alias: ['widget.coolpanel'],
  28440. * title: 'Yeah!'
  28441. * });
  28442. *
  28443. * // Using Ext.create
  28444. * Ext.create('widget.coolpanel');
  28445. *
  28446. * // Using the shorthand for defining widgets by xtype
  28447. * Ext.widget('panel', {
  28448. * items: [
  28449. * {xtype: 'coolpanel', html: 'Foo'},
  28450. * {xtype: 'coolpanel', html: 'Bar'}
  28451. * ]
  28452. * });
  28453. */
  28454. Manager.registerPostprocessor('alias', function(name, cls, data) {
  28455. if (Ext.classSystemMonitor) {
  28456. Ext.classSystemMonitor(name, 'Ext.ClassManager#aliasPostProcessor', arguments);
  28457. }
  28458. /* eslint-disable-next-line vars-on-top */
  28459. var aliases = Ext.Array.from(data.alias),
  28460. i, ln;
  28461. for (i = 0 , ln = aliases.length; i < ln; i++) {
  28462. alias = aliases[i];
  28463. this.addAlias(cls, alias);
  28464. }
  28465. }, [
  28466. 'xtype',
  28467. 'alias'
  28468. ]);
  28469. /**
  28470. * @cfg {Boolean} singleton
  28471. * @member Ext.Class
  28472. * When set to true, the class will be instantiated as singleton. For example:
  28473. *
  28474. * Ext.define('Logger', {
  28475. * singleton: true,
  28476. * log: function(msg) {
  28477. * console.log(msg);
  28478. * }
  28479. * });
  28480. *
  28481. * Logger.log('Hello');
  28482. */
  28483. Manager.registerPostprocessor('singleton', function(name, cls, data, fn) {
  28484. if (Ext.classSystemMonitor) {
  28485. Ext.classSystemMonitor(name, 'Ext.ClassManager#singletonPostProcessor', arguments);
  28486. }
  28487. if (data.singleton) {
  28488. fn.call(this, name, new cls(), data);
  28489. } else {
  28490. return true;
  28491. }
  28492. return false;
  28493. });
  28494. /**
  28495. * @cfg {String/String[]} alternateClassName
  28496. * @member Ext.Class
  28497. * Defines alternate names for this class. For example:
  28498. *
  28499. * Ext.define('Developer', {
  28500. * alternateClassName: ['Coder', 'Hacker'],
  28501. * code: function(msg) {
  28502. * alert('Typing... ' + msg);
  28503. * }
  28504. * });
  28505. *
  28506. * var joe = Ext.create('Developer');
  28507. * joe.code('stackoverflow');
  28508. *
  28509. * var rms = Ext.create('Hacker');
  28510. * rms.code('hack hack');
  28511. */
  28512. Manager.registerPostprocessor('alternateClassName', function(name, cls, data) {
  28513. var alternates = data.alternateClassName,
  28514. i, ln, alternate;
  28515. if (Ext.classSystemMonitor) {
  28516. Ext.classSystemMonitor(name, 'Ext.ClassManager#alternateClassNamePostprocessor', arguments);
  28517. }
  28518. if (!(alternates instanceof Array)) {
  28519. alternates = [
  28520. alternates
  28521. ];
  28522. }
  28523. for (i = 0 , ln = alternates.length; i < ln; i++) {
  28524. alternate = alternates[i];
  28525. if (typeof alternate !== 'string') {
  28526. throw new Error("[Ext.define] Invalid alternate of: '" + alternate + "' for class: '" + name + "'; must be a valid string");
  28527. }
  28528. this.set(alternate, cls);
  28529. }
  28530. });
  28531. /**
  28532. * @cfg {Object} debugHooks
  28533. * A collection of diagnostic methods to decorate the real methods of the class. These
  28534. * methods are applied as an `override` if this class has debug enabled as defined by
  28535. * `Ext.isDebugEnabled`.
  28536. *
  28537. * These will be automatically removed by the Sencha Cmd compiler for production builds.
  28538. *
  28539. * Example usage:
  28540. *
  28541. * Ext.define('Foo.bar.Class', {
  28542. * foo: function(a, b, c) {
  28543. * ...
  28544. * },
  28545. *
  28546. * bar: function(a, b) {
  28547. * ...
  28548. * return 42;
  28549. * },
  28550. *
  28551. * debugHooks: {
  28552. * foo: function(a, b, c) {
  28553. * // check arguments...
  28554. * return this.callParent(arguments);
  28555. * }
  28556. * }
  28557. * });
  28558. *
  28559. * If you specify a `$enabled` property in the `debugHooks` object that will be used
  28560. * as the default enabled state for the hooks. If the `{@link Ext#manifest}` contains
  28561. * a `debug` object of if `{@link Ext#debugConfig}` is specified, the `$enabled` flag
  28562. * will override its "*" value.
  28563. */
  28564. Manager.registerPostprocessor('debugHooks', function(name, Class, data) {
  28565. var target;
  28566. if (Ext.classSystemMonitor) {
  28567. Ext.classSystemMonitor(Class, 'Ext.Class#debugHooks', arguments);
  28568. }
  28569. if (Ext.isDebugEnabled(Class.$className, data.debugHooks.$enabled)) {
  28570. delete data.debugHooks.$enabled;
  28571. Ext.override(Class, data.debugHooks);
  28572. }
  28573. // may already have an instance here in the case of singleton
  28574. target = Class.isInstance ? Class.self : Class;
  28575. delete target.prototype.debugHooks;
  28576. });
  28577. /**
  28578. * @cfg {Object} deprecated
  28579. * The object given has properties that describe the versions at which the deprecations
  28580. * apply.
  28581. *
  28582. * The purpose of the `deprecated` declaration is to enable development mode to give
  28583. * suitable error messages when deprecated methods or properties are used. Methods can
  28584. * always be injected to provide this feedback, but properties can only be handled on
  28585. * some browsers (those that support `Object.defineProperty`).
  28586. *
  28587. * In some cases, deprecated methods can be restored to their previous behavior or
  28588. * added back if they have been removed.
  28589. *
  28590. * The structure of a `deprecated` declaration is this:
  28591. *
  28592. * Ext.define('Foo.bar.Class', {
  28593. * ...
  28594. *
  28595. * deprecated: {
  28596. * // Optional package name - default is the framework (ext or touch)
  28597. * name: 'foobar',
  28598. *
  28599. * '5.0': {
  28600. * methods: {
  28601. * // Throws: '"removedMethod" is deprecated.'
  28602. * removedMethod: null,
  28603. *
  28604. * // Throws: '"oldMethod" is deprecated. Please use "newMethod" instead.'
  28605. * oldMethod: 'newMethod',
  28606. *
  28607. * // When this block is enabled, this method is applied as an
  28608. * // override. Otherwise you get same as "removeMethod".
  28609. * method: function() {
  28610. * // Do what v5 "method" did. If "method" exists in newer
  28611. * // versions callParent can call it. If 5.1 has "method"
  28612. * // then it would be next in line, otherwise 5.2 and last
  28613. * // would be the current class.
  28614. * },
  28615. *
  28616. * moreHelpful: {
  28617. * message: 'Something helpful to do instead.',
  28618. * fn: function() {
  28619. * // The v5 "moreHelpful" method to use when enabled.
  28620. * }
  28621. * }
  28622. * },
  28623. * properties: {
  28624. * // Throws: '"removedProp" is deprecated.'
  28625. * removedProp: null,
  28626. *
  28627. * // Throws: '"oldProp" is deprecated. Please use "newProp" instead.'
  28628. * oldProp: 'newProp',
  28629. *
  28630. * helpful: {
  28631. * message: 'Something helpful message about what to do.'
  28632. * }
  28633. * ...
  28634. * },
  28635. * statics: {
  28636. * methods: {
  28637. * ...
  28638. * },
  28639. * properties: {
  28640. * ...
  28641. * },
  28642. * }
  28643. * },
  28644. *
  28645. * '5.1': {
  28646. * ...
  28647. * },
  28648. *
  28649. * '5.2': {
  28650. * ...
  28651. * }
  28652. * }
  28653. * });
  28654. *
  28655. * The primary content of `deprecated` are the version number keys. These indicate
  28656. * a version number where methods or properties were deprecated. These versions are
  28657. * compared to the version reported by `Ext.getCompatVersion` to determine the action
  28658. * to take for each "block".
  28659. *
  28660. * When the compatibility version is set to a value less than a version number key,
  28661. * that block is said to be "enabled". For example, if a method was deprecated in
  28662. * version 5.0 but the desired compatibility level is 4.2 then the block is used to
  28663. * patch methods and (to some degree) restore pre-5.0 compatibility.
  28664. *
  28665. * When multiple active blocks have the same method name, each method is applied as
  28666. * an override in reverse order of version. In the above example, if a method appears
  28667. * in the "5.0", "5.1" and "5.2" blocks then the "5.2" method is applied as an override
  28668. * first, followed by the "5.1" method and finally the "5.0" method. This means that
  28669. * the `callParent` from the "5.0" method calls the "5.1" method which calls the
  28670. * "5.2" method which can (if applicable) call the current version.
  28671. */
  28672. Manager.registerPostprocessor('deprecated', function(name, Class, data) {
  28673. var target;
  28674. if (Ext.classSystemMonitor) {
  28675. Ext.classSystemMonitor(Class, 'Ext.Class#deprecated', arguments);
  28676. }
  28677. // may already have an instance here in the case of singleton
  28678. target = Class.isInstance ? Class.self : Class;
  28679. target.addDeprecations(data.deprecated);
  28680. delete target.prototype.deprecated;
  28681. });
  28682. Ext.apply(Ext, {
  28683. /**
  28684. * Instantiate a class by either full name, alias or alternate name.
  28685. *
  28686. * If {@link Ext.Loader} is {@link Ext.Loader#setConfig enabled} and the class has
  28687. * not been defined yet, it will attempt to load the class via synchronous loading.
  28688. *
  28689. * For example, all these three lines return the same result:
  28690. *
  28691. * // xtype
  28692. * var window = Ext.create({
  28693. * xtype: 'window',
  28694. * width: 600,
  28695. * height: 800,
  28696. * ...
  28697. * });
  28698. *
  28699. * // alias
  28700. * var window = Ext.create('widget.window', {
  28701. * width: 600,
  28702. * height: 800,
  28703. * ...
  28704. * });
  28705. *
  28706. * // alternate name
  28707. * var window = Ext.create('Ext.Window', {
  28708. * width: 600,
  28709. * height: 800,
  28710. * ...
  28711. * });
  28712. *
  28713. * // full class name
  28714. * var window = Ext.create('Ext.window.Window', {
  28715. * width: 600,
  28716. * height: 800,
  28717. * ...
  28718. * });
  28719. *
  28720. * // single object with xclass property:
  28721. * var window = Ext.create({
  28722. * xclass: 'Ext.window.Window', // any valid value for 'name' (above)
  28723. * width: 600,
  28724. * height: 800,
  28725. * ...
  28726. * });
  28727. *
  28728. * @param {String} [name] The class name or alias. Can be specified as `xclass`
  28729. * property if only one object parameter is specified.
  28730. * @param {Object...} [args] Additional arguments after the name will be passed to
  28731. * the class' constructor.
  28732. * @return {Object} instance
  28733. * @member Ext
  28734. * @method create
  28735. */
  28736. create: function() {
  28737. var name = arguments[0],
  28738. nameType = typeof name,
  28739. args = arraySlice.call(arguments, 1),
  28740. cls;
  28741. if (nameType === 'function') {
  28742. cls = name;
  28743. } else {
  28744. if (nameType !== 'string' && args.length === 0) {
  28745. args = [
  28746. name
  28747. ];
  28748. if (!(name = name.xclass)) {
  28749. name = args[0].xtype;
  28750. if (name) {
  28751. name = 'widget.' + name;
  28752. }
  28753. }
  28754. }
  28755. if (typeof name !== 'string' || name.length < 1) {
  28756. throw new Error("[Ext.create] Invalid class name or alias '" + name + "' specified, must be a non-empty string");
  28757. }
  28758. name = Manager.resolveName(name);
  28759. cls = Manager.get(name);
  28760. }
  28761. // Still not existing at this point, try to load it via synchronous mode as the last
  28762. // resort
  28763. if (!cls) {
  28764. Ext.syncRequire(name);
  28765. cls = Manager.get(name);
  28766. }
  28767. if (!cls) {
  28768. throw new Error("[Ext.create] Unrecognized class name / alias: " + name);
  28769. }
  28770. if (typeof cls !== 'function') {
  28771. throw new Error("[Ext.create] Singleton '" + name + "' cannot be instantiated.");
  28772. }
  28773. return Manager.getInstantiator(args.length)(cls, args);
  28774. },
  28775. /**
  28776. * Convenient shorthand to create a widget by its xtype or a config object.
  28777. *
  28778. * var button = Ext.widget('button'); // Equivalent to Ext.create('widget.button');
  28779. *
  28780. * var panel = Ext.widget('panel', { // Equivalent to Ext.create('widget.panel')
  28781. * title: 'Panel'
  28782. * });
  28783. *
  28784. * var grid = Ext.widget({
  28785. * xtype: 'grid',
  28786. * ...
  28787. * });
  28788. *
  28789. * If a {@link Ext.Component component} instance is passed, it is simply returned.
  28790. *
  28791. * @member Ext
  28792. * @param {String} [name] The xtype of the widget to create.
  28793. * @param {Object} [config] The configuration object for the widget constructor.
  28794. * @return {Object} The widget instance
  28795. */
  28796. widget: function(name, config) {
  28797. // forms:
  28798. // 1: (xtype)
  28799. // 2: (xtype, config)
  28800. // 3: (config)
  28801. // 4: (xtype, component)
  28802. // 5: (component)
  28803. //
  28804. var xtype = name,
  28805. alias, className, T;
  28806. if (typeof xtype !== 'string') {
  28807. // if (form 3 or 5)
  28808. // first arg is config or component
  28809. config = name;
  28810. // arguments[0]
  28811. xtype = config.xtype;
  28812. className = config.xclass;
  28813. } else {
  28814. config = config || {};
  28815. }
  28816. if (config.isComponent) {
  28817. return config;
  28818. }
  28819. if (!className) {
  28820. alias = 'widget.' + xtype;
  28821. className = Manager.getNameByAlias(alias);
  28822. }
  28823. // this is needed to support demand loading of the class
  28824. if (className) {
  28825. T = Manager.get(className);
  28826. }
  28827. if (!T) {
  28828. return Ext.create(className || alias, config);
  28829. }
  28830. return new T(config);
  28831. },
  28832. /**
  28833. * @method createByAlias
  28834. * @inheritdoc Ext.ClassManager#method-instantiateByAlias
  28835. * @member Ext
  28836. */
  28837. createByAlias: alias(Manager, 'instantiateByAlias'),
  28838. /**
  28839. * Defines a class or override. A basic class is defined like this:
  28840. *
  28841. * Ext.define('My.awesome.Class', {
  28842. * someProperty: 'something',
  28843. *
  28844. * someMethod: function(s) {
  28845. * alert(s + this.someProperty);
  28846. * }
  28847. *
  28848. * ...
  28849. * });
  28850. *
  28851. * var obj = new My.awesome.Class();
  28852. *
  28853. * obj.someMethod('Say '); // alerts 'Say something'
  28854. *
  28855. * To create an anonymous class, pass `null` for the `className`:
  28856. *
  28857. * Ext.define(null, {
  28858. * constructor: function() {
  28859. * // ...
  28860. * }
  28861. * });
  28862. *
  28863. * In some cases, it is helpful to create a nested scope to contain some private
  28864. * properties. The best way to do this is to pass a function instead of an object
  28865. * as the second parameter. This function will be called to produce the class
  28866. * body:
  28867. *
  28868. * Ext.define('MyApp.foo.Bar', function() {
  28869. * var id = 0;
  28870. *
  28871. * return {
  28872. * nextId: function() {
  28873. * return ++id;
  28874. * }
  28875. * };
  28876. * });
  28877. *
  28878. * _Note_ that when using override, the above syntax will not override successfully,
  28879. * because the passed function would need to be executed first to determine whether or not
  28880. * the result is an override or defining a new object. As such, an alternative syntax that
  28881. * immediately invokes the function can be used:
  28882. *
  28883. * Ext.define('MyApp.override.BaseOverride', function() {
  28884. * var counter = 0;
  28885. *
  28886. * return {
  28887. * override: 'Ext.Component',
  28888. * logId: function() {
  28889. * console.log(++counter, this.id);
  28890. * }
  28891. * };
  28892. * }());
  28893. *
  28894. *
  28895. * When using this form of `Ext.define`, the function is passed a reference to its
  28896. * class. This can be used as an efficient way to access any static properties you
  28897. * may have:
  28898. *
  28899. * Ext.define('MyApp.foo.Bar', function(Bar) {
  28900. * return {
  28901. * statics: {
  28902. * staticMethod: function() {
  28903. * // ...
  28904. * }
  28905. * },
  28906. *
  28907. * method: function() {
  28908. * return Bar.staticMethod();
  28909. * }
  28910. * };
  28911. * });
  28912. *
  28913. * To define an override, include the `override` property. The content of an
  28914. * override is aggregated with the specified class in order to extend or modify
  28915. * that class. This can be as simple as setting default property values or it can
  28916. * extend and/or replace methods. This can also extend the statics of the class.
  28917. *
  28918. * One use for an override is to break a large class into manageable pieces.
  28919. *
  28920. * // File: /src/app/Panel.js
  28921. *
  28922. * Ext.define('My.app.Panel', {
  28923. * extend: 'Ext.panel.Panel',
  28924. * requires: [
  28925. * 'My.app.PanelPart2',
  28926. * 'My.app.PanelPart3'
  28927. * ]
  28928. *
  28929. * constructor: function(config) {
  28930. * this.callParent(arguments); // calls Ext.panel.Panel's constructor
  28931. * //...
  28932. * },
  28933. *
  28934. * statics: {
  28935. * method: function() {
  28936. * return 'abc';
  28937. * }
  28938. * }
  28939. * });
  28940. *
  28941. * // File: /src/app/PanelPart2.js
  28942. * Ext.define('My.app.PanelPart2', {
  28943. * override: 'My.app.Panel',
  28944. *
  28945. * constructor: function(config) {
  28946. * this.callParent(arguments); // calls My.app.Panel's constructor
  28947. * //...
  28948. * }
  28949. * });
  28950. *
  28951. * Another use of overrides is to provide optional parts of classes that can be
  28952. * independently required. In this case, the class may even be unaware of the
  28953. * override altogether.
  28954. *
  28955. * Ext.define('My.ux.CoolTip', {
  28956. * override: 'Ext.tip.ToolTip',
  28957. *
  28958. * constructor: function(config) {
  28959. * this.callParent(arguments); // calls Ext.tip.ToolTip's constructor
  28960. * //...
  28961. * }
  28962. * });
  28963. *
  28964. * The above override can now be required as normal.
  28965. *
  28966. * Ext.define('My.app.App', {
  28967. * requires: [
  28968. * 'My.ux.CoolTip'
  28969. * ]
  28970. * });
  28971. *
  28972. * Overrides can also contain statics, inheritableStatics, or privates:
  28973. *
  28974. * Ext.define('My.app.BarMod', {
  28975. * override: 'Ext.foo.Bar',
  28976. *
  28977. * statics: {
  28978. * method: function(x) {
  28979. * return this.callParent([x * 2]); // call Ext.foo.Bar.method
  28980. * }
  28981. * }
  28982. * });
  28983. *
  28984. * Starting in version 4.2.2, overrides can declare their `compatibility` based
  28985. * on the framework version or on versions of other packages. For details on the
  28986. * syntax and options for these checks, see `Ext.checkVersion`.
  28987. *
  28988. * The simplest use case is to test framework version for compatibility:
  28989. *
  28990. * Ext.define('App.overrides.grid.Panel', {
  28991. * override: 'Ext.grid.Panel',
  28992. *
  28993. * compatibility: '4.2.2', // only if framework version is 4.2.2
  28994. *
  28995. * //...
  28996. * });
  28997. *
  28998. * An array is treated as an OR, so if any specs match, the override is
  28999. * compatible.
  29000. *
  29001. * Ext.define('App.overrides.some.Thing', {
  29002. * override: 'Foo.some.Thing',
  29003. *
  29004. * compatibility: [
  29005. * '4.2.2',
  29006. * 'foo@1.0.1-1.0.2'
  29007. * ],
  29008. *
  29009. * //...
  29010. * });
  29011. *
  29012. * To require that all specifications match, an object can be provided:
  29013. *
  29014. * Ext.define('App.overrides.some.Thing', {
  29015. * override: 'Foo.some.Thing',
  29016. *
  29017. * compatibility: {
  29018. * and: [
  29019. * '4.2.2',
  29020. * 'foo@1.0.1-1.0.2'
  29021. * ]
  29022. * },
  29023. *
  29024. * //...
  29025. * });
  29026. *
  29027. * Because the object form is just a recursive check, these can be nested:
  29028. *
  29029. * Ext.define('App.overrides.some.Thing', {
  29030. * override: 'Foo.some.Thing',
  29031. *
  29032. * compatibility: {
  29033. * and: [
  29034. * '4.2.2', // exactly version 4.2.2 of the framework *AND*
  29035. * {
  29036. * // either (or both) of these package specs:
  29037. * or: [
  29038. * 'foo@1.0.1-1.0.2',
  29039. * 'bar@3.0+'
  29040. * ]
  29041. * }
  29042. * ]
  29043. * },
  29044. *
  29045. * //...
  29046. * });
  29047. *
  29048. * IMPORTANT: An override is only included in a build if the class it overrides is
  29049. * required. Otherwise, the override, like the target class, is not included. In
  29050. * Sencha Cmd v4, the `compatibility` declaration can likewise be used to remove
  29051. * incompatible overrides from a build.
  29052. *
  29053. * @param {String} className The class name to create in string dot-namespaced format,
  29054. * for example: 'My.very.awesome.Class', 'FeedViewer.plugin.CoolPager'
  29055. *
  29056. * It is highly recommended to follow this simple convention:
  29057. * - The root and the class name are 'CamelCased'
  29058. * - Everything else is lower-cased
  29059. * Pass `null` to create an anonymous class.
  29060. * @param {Object} data The key - value pairs of properties to apply to this class.
  29061. * Property names can be of any valid strings, except those in the reserved listed below:
  29062. *
  29063. * - {@link Ext.Class#cfg-alias alias}
  29064. * - {@link Ext.Class#cfg-alternateClassName alternateClassName}
  29065. * - {@link Ext.Class#cfg-cachedConfig cachedConfig}
  29066. * - {@link Ext.Class#cfg-config config}
  29067. * - {@link Ext.Class#cfg-extend extend}
  29068. * - {@link Ext.Class#cfg-inheritableStatics inheritableStatics}
  29069. * - {@link Ext.Class#cfg-mixins mixins}
  29070. * - {@link Ext.Class#cfg-override override}
  29071. * - {@link Ext.Class#cfg-platformConfig platformConfig}
  29072. * - {@link Ext.Class#cfg-privates privates}
  29073. * - {@link Ext.Class#cfg-requires requires}
  29074. * - `self`
  29075. * - {@link Ext.Class#cfg-singleton singleton}
  29076. * - {@link Ext.Class#cfg-statics statics}
  29077. * - {@link Ext.Class#cfg-uses uses}
  29078. * - {@link Ext.Class#cfg-xtype xtype} (for {@link Ext.Component Components} only)
  29079. *
  29080. * @param {Function} [createdFn] Callback to execute after the class is created,
  29081. * the execution scope of which (`this`) will be the newly created class itself.
  29082. * @return {Ext.Base}
  29083. * @member Ext
  29084. */
  29085. define: function(className, data, createdFn) {
  29086. if (Ext.classSystemMonitor) {
  29087. Ext.classSystemMonitor(className, 'ClassManager#define', arguments);
  29088. }
  29089. if (data.override) {
  29090. Manager.classState[className] = 20;
  29091. return Manager.createOverride.apply(Manager, arguments);
  29092. }
  29093. Manager.classState[className] = 10;
  29094. return Manager.create.apply(Manager, arguments);
  29095. },
  29096. /**
  29097. * Undefines a class defined using the #define method. Typically used
  29098. * for unit testing where setting up and tearing down a class multiple
  29099. * times is required. For example:
  29100. *
  29101. * // define a class
  29102. * Ext.define('Foo', {
  29103. * ...
  29104. * });
  29105. *
  29106. * // run test
  29107. *
  29108. * // undefine the class
  29109. * Ext.undefine('Foo');
  29110. * @param {String} className The class name to undefine in string dot-namespaced format.
  29111. * @private
  29112. */
  29113. undefine: function(className) {
  29114. var classes = Manager.classes;
  29115. if (Ext.classSystemMonitor) {
  29116. Ext.classSystemMonitor(className, 'Ext.ClassManager#undefine', arguments);
  29117. }
  29118. if (classes[className]) {
  29119. Manager.classCount--;
  29120. }
  29121. delete classes[className];
  29122. delete Manager.existCache[className];
  29123. delete Manager.classState[className];
  29124. Manager.removeName(className);
  29125. // Indiscriminately clear all factory caches here. It might be slightly inefficient
  29126. // however undefine is typically only called during unit testing.
  29127. Ext.Factory.clearCaches();
  29128. /* eslint-disable-next-line vars-on-top */
  29129. var entry = Manager.getNamespaceEntry(className),
  29130. scope = entry.parent ? Manager.lookupName(entry.parent, false) : Ext.global,
  29131. entryName;
  29132. if (scope) {
  29133. entryName = entry.name;
  29134. // Old IE blows up on attempt to delete window property
  29135. try {
  29136. delete scope[entryName];
  29137. } catch (e) {
  29138. scope[entryName] = undefined;
  29139. }
  29140. }
  29141. // We need to know entry name in unit tests
  29142. return entryName;
  29143. },
  29144. /**
  29145. * @method getClassName
  29146. * @inheritdoc Ext.ClassManager#method-getName
  29147. * @member Ext
  29148. */
  29149. getClassName: alias(Manager, 'getName'),
  29150. /**
  29151. * Returns the displayName property or className or object. When all else fails,
  29152. * returns "Anonymous".
  29153. * @param {Object} object
  29154. * @return {String}
  29155. */
  29156. getDisplayName: function(object) {
  29157. if (object) {
  29158. if (object.displayName) {
  29159. return object.displayName;
  29160. }
  29161. if (object.$name && object.$class) {
  29162. return Ext.getClassName(object.$class) + '#' + object.$name;
  29163. }
  29164. if (object.$className) {
  29165. return object.$className;
  29166. }
  29167. }
  29168. return 'Anonymous';
  29169. },
  29170. /**
  29171. * @method getClass
  29172. * @inheritdoc Ext.ClassManager#method-getClass
  29173. * @member Ext
  29174. */
  29175. getClass: alias(Manager, 'getClass'),
  29176. /**
  29177. * Creates namespaces to be used for scoping variables and classes so that they are not
  29178. * global. Specifying the last node of a namespace implicitly creates all other nodes.
  29179. * Usage:
  29180. *
  29181. * Ext.namespace('Company', 'Company.data');
  29182. *
  29183. * // equivalent and preferable to the above syntax
  29184. * Ext.ns('Company.data');
  29185. *
  29186. * Company.Widget = function() { ... };
  29187. *
  29188. * Company.data.CustomStore = function(config) { ... };
  29189. *
  29190. * @param {String...} namespaces
  29191. * @return {Object} The (last) namespace object created.
  29192. * @member Ext
  29193. * @method namespace
  29194. */
  29195. namespace: function() {
  29196. var root = global,
  29197. i;
  29198. for (i = arguments.length; i-- > 0; ) {
  29199. root = Manager.lookupName(arguments[i], true);
  29200. }
  29201. return root;
  29202. }
  29203. });
  29204. /**
  29205. * This function registers top-level (root) namespaces. This is needed for "sandbox"
  29206. * builds.
  29207. *
  29208. * Ext.addRootNamespaces({
  29209. * MyApp: MyApp,
  29210. * Common: Common
  29211. * });
  29212. *
  29213. * In the above example, `MyApp` and `Common` are top-level namespaces that happen
  29214. * to also be included in the sandbox closure. Something like this:
  29215. *
  29216. * (function(Ext) {
  29217. *
  29218. * Ext.sandboxName = 'Ext6';
  29219. * Ext.isSandboxed = true;
  29220. * Ext.buildSettings = { baseCSSPrefix: "x6-", scopeResetCSS: true };
  29221. *
  29222. * var MyApp = MyApp || {};
  29223. * Ext.addRootNamespaces({ MyApp: MyApp );
  29224. *
  29225. * ... normal app.js goes here ...
  29226. *
  29227. * })(this.Ext6 || (this.Ext6 = {}));
  29228. *
  29229. * The sandbox wrapper around the normally built `app.js` content has to take care
  29230. * of introducing top-level namespaces as well as call this method.
  29231. *
  29232. * @param {Object} namespaces
  29233. * @method addRootNamespaces
  29234. * @member Ext
  29235. * @since 6.0.0
  29236. * @private
  29237. */
  29238. Ext.addRootNamespaces = Manager.addRootNamespaces;
  29239. /**
  29240. * Old name for {@link Ext#widget}.
  29241. * @deprecated 5.0 Use {@link Ext#widget} instead.
  29242. * @method createWidget
  29243. * @member Ext
  29244. * @private
  29245. */
  29246. Ext.createWidget = Ext.widget;
  29247. /**
  29248. * @method ns
  29249. * Convenient alias for {@link Ext#namespace Ext.namespace}.
  29250. * @inheritdoc Ext#method-namespace
  29251. * @member Ext
  29252. */
  29253. Ext.ns = Ext.namespace;
  29254. Class.registerPreprocessor('className', function(cls, data) {
  29255. if ('$className' in data) {
  29256. cls.$className = data.$className;
  29257. cls.displayName = cls.$className;
  29258. }
  29259. if (Ext.classSystemMonitor) {
  29260. Ext.classSystemMonitor(cls, 'Ext.ClassManager#classNamePreprocessor', arguments);
  29261. }
  29262. }, true, 'first');
  29263. Class.registerPreprocessor('alias', function(cls, data) {
  29264. if (Ext.classSystemMonitor) {
  29265. Ext.classSystemMonitor(cls, 'Ext.ClassManager#aliasPreprocessor', arguments);
  29266. }
  29267. /* eslint-disable-next-line vars-on-top */
  29268. var prototype = cls.prototype,
  29269. xtypes = arrayFrom(data.xtype),
  29270. aliases = arrayFrom(data.alias),
  29271. widgetPrefix = 'widget.',
  29272. widgetPrefixLength = widgetPrefix.length,
  29273. xtypesChain = Array.prototype.slice.call(prototype.xtypesChain || []),
  29274. xtypesMap = Ext.merge({}, prototype.xtypesMap || {}),
  29275. i, ln, alias, xtype;
  29276. for (i = 0 , ln = aliases.length; i < ln; i++) {
  29277. alias = aliases[i];
  29278. if (typeof alias !== 'string' || alias.length < 1) {
  29279. throw new Error("[Ext.define] Invalid alias of: '" + alias + "' for class: '" + name + "'; must be a valid string");
  29280. }
  29281. if (alias.substring(0, widgetPrefixLength) === widgetPrefix) {
  29282. xtype = alias.substring(widgetPrefixLength);
  29283. Ext.Array.include(xtypes, xtype);
  29284. }
  29285. }
  29286. cls.xtype = data.xtype = xtypes[0];
  29287. data.xtypes = xtypes;
  29288. for (i = 0 , ln = xtypes.length; i < ln; i++) {
  29289. xtype = xtypes[i];
  29290. if (!xtypesMap[xtype]) {
  29291. xtypesMap[xtype] = true;
  29292. xtypesChain.push(xtype);
  29293. }
  29294. }
  29295. data.xtypesChain = xtypesChain;
  29296. data.xtypesMap = xtypesMap;
  29297. // Class is already extended at this point
  29298. Ext.Function.interceptAfterOnce(cls, 'onClassCreated', function() {
  29299. var cls = this,
  29300. prototype = cls.prototype,
  29301. mixins = prototype.mixins,
  29302. key, mixin;
  29303. if (Ext.classSystemMonitor) {
  29304. Ext.classSystemMonitor(cls, 'Ext.ClassManager#aliasPreprocessor#afterClassCreated', arguments);
  29305. }
  29306. for (key in mixins) {
  29307. if (mixins.hasOwnProperty(key)) {
  29308. mixin = mixins[key];
  29309. xtypes = mixin.xtypes;
  29310. if (xtypes) {
  29311. for (i = 0 , ln = xtypes.length; i < ln; i++) {
  29312. xtype = xtypes[i];
  29313. if (!xtypesMap[xtype]) {
  29314. xtypesMap[xtype] = true;
  29315. xtypesChain.push(xtype);
  29316. }
  29317. }
  29318. }
  29319. }
  29320. }
  29321. });
  29322. for (i = 0 , ln = xtypes.length; i < ln; i++) {
  29323. xtype = xtypes[i];
  29324. if (typeof xtype !== 'string' || xtype.length < 1) {
  29325. throw new Error("[Ext.define] Invalid xtype of: '" + xtype + "' for class: '" + name + "'; must be a valid non-empty string");
  29326. }
  29327. Ext.Array.include(aliases, widgetPrefix + xtype);
  29328. }
  29329. data.alias = aliases;
  29330. }, [
  29331. 'xtype',
  29332. 'alias'
  29333. ]);
  29334. // load the cmd-5 style app manifest metadata now, if available...
  29335. if (Ext.manifest) {
  29336. /* eslint-disable-next-line vars-on-top */
  29337. var manifest = Ext.manifest,
  29338. classes = manifest.classes,
  29339. paths = manifest.paths,
  29340. aliases = {},
  29341. alternates = {},
  29342. className, obj, name, path, baseUrl;
  29343. if (paths) {
  29344. // if the manifest paths were calculated as relative to the
  29345. // bootstrap file, then we need to prepend Boot.baseUrl to the
  29346. // paths before processing
  29347. if (manifest.bootRelative) {
  29348. baseUrl = Ext.Boot.baseUrl;
  29349. for (path in paths) {
  29350. if (paths.hasOwnProperty(path)) {
  29351. paths[path] = baseUrl + paths[path];
  29352. }
  29353. }
  29354. }
  29355. Manager.setPath(paths);
  29356. }
  29357. if (classes) {
  29358. for (className in classes) {
  29359. alternates[className] = [];
  29360. aliases[className] = [];
  29361. obj = classes[className];
  29362. if (obj.alias) {
  29363. aliases[className] = obj.alias;
  29364. }
  29365. if (obj.alternates) {
  29366. alternates[className] = obj.alternates;
  29367. }
  29368. }
  29369. }
  29370. Manager.addAlias(aliases);
  29371. Manager.addAlternate(alternates);
  29372. }
  29373. return Manager;
  29374. }(Ext.Class, Ext.Function.alias, Array.prototype.slice, Ext.Array.from, Ext.global));
  29375. // @tag class
  29376. /**
  29377. *
  29378. * @since 6.7.0
  29379. * @private
  29380. */
  29381. Ext.define('Ext.mixin.Watchable', {
  29382. on: function(name, fn, scope) {
  29383. return this._watchUpdate(false, '_watchAdd', name, fn, scope);
  29384. },
  29385. fire: function(event, args) {
  29386. var me = this,
  29387. watching = me.watching,
  29388. watchers = watching && watching[event],
  29389. fn, i, r, scope;
  29390. if (watchers) {
  29391. ++watchers.$firing;
  29392. for (i = 0; i < watchers.length; ++i) {
  29393. scope = watchers[i][0];
  29394. fn = watchers[i][1];
  29395. if (fn.charAt) {
  29396. r = args ? scope[fn].apply(scope, args) : scope[fn]();
  29397. } else {
  29398. r = args ? fn.apply(scope, args) : fn.call(scope);
  29399. }
  29400. if (r === false) {
  29401. return r;
  29402. }
  29403. }
  29404. --watchers.$firing;
  29405. }
  29406. },
  29407. fireEvent: function() {
  29408. var args = Ext.Array.slice(arguments),
  29409. event = args.shift();
  29410. return this.fire(event, args);
  29411. },
  29412. un: function(name, fn, scope) {
  29413. return this._watchUpdate(true, '_watchRemove', name, fn, scope);
  29414. },
  29415. privates: {
  29416. watching: null,
  29417. $watchOptions: {
  29418. destroyable: 1,
  29419. scope: 1
  29420. },
  29421. _watchAdd: function(watching, name, fn, scope, destroyable) {
  29422. if (typeof fn === 'string' && !scope[fn]) {
  29423. Ext.raise('No such method "' + fn + '" on ' + scope.$className);
  29424. }
  29425. // eslint-disable-next-line vars-on-top
  29426. var watchers = watching[name],
  29427. entry = [
  29428. scope,
  29429. fn
  29430. ],
  29431. i, ent;
  29432. if (!watchers) {
  29433. watching[name] = watchers = [];
  29434. watchers.$firing = 0;
  29435. } else {
  29436. // If the scope/fn pair is already registered, don't duplicate it.
  29437. for (i = watchers.length; i-- > 0; ) /* empty */
  29438. {
  29439. ent = watchers[i];
  29440. if (fn === ent[1]) {
  29441. if (scope ? ent[0] === scope : !ent[0]) {
  29442. return;
  29443. }
  29444. }
  29445. }
  29446. if (watchers.$firing) {
  29447. watching[name] = watchers = watchers.slice();
  29448. watchers.$firing = 0;
  29449. }
  29450. }
  29451. watchers.push(entry);
  29452. if (destroyable) {
  29453. entry.push(name);
  29454. destroyable.items.push(entry);
  29455. }
  29456. },
  29457. _watchRemove: function(watching, name, fn, scope) {
  29458. var watchers = watching[name],
  29459. i;
  29460. if (watchers) {
  29461. if (watchers.$firing) {
  29462. watching[name] = watchers = watchers.slice();
  29463. watchers.$firing = 0;
  29464. }
  29465. for (i = watchers.length; i-- > 0; ) /* empty */
  29466. {
  29467. if (watchers[i][0] === scope && watchers[i][1] === fn) {
  29468. watchers.splice(i, 1);
  29469. }
  29470. }
  29471. }
  29472. },
  29473. _watchUpdate: function(remove, process, name, fn, scope) {
  29474. var me = this,
  29475. watch = name,
  29476. watching = me.watching,
  29477. destroyable;
  29478. if (!watching) {
  29479. if (remove) {
  29480. return;
  29481. }
  29482. me.watching = watching = {};
  29483. }
  29484. if (typeof name === 'string') {
  29485. me[process](watching, name, fn, scope);
  29486. } else {
  29487. destroyable = watch.destroyable ? {
  29488. owner: me,
  29489. items: [],
  29490. destroy: me._watcherDestroyer
  29491. } : null;
  29492. scope = watch.scope;
  29493. for (name in watch) {
  29494. if (!me.$watchOptions[name]) {
  29495. me[process](watching, name, watch[name], scope, destroyable);
  29496. }
  29497. }
  29498. }
  29499. return destroyable;
  29500. },
  29501. _watcherDestroyer: function() {
  29502. var me = this.owner,
  29503. watching = me.watching,
  29504. items = this.items,
  29505. entry, i;
  29506. for (i = 0; i < items.length; ++i) {
  29507. entry = items[i];
  29508. me._watchRemove(watching, entry[2], entry[1], entry[0]);
  29509. }
  29510. }
  29511. }
  29512. });
  29513. /**
  29514. * @class Ext.env.Browser
  29515. * Provides information about browser.
  29516. *
  29517. * Should not be manually instantiated unless for unit-testing.
  29518. * Access the global instance stored in {@link Ext.browser} instead.
  29519. * @private
  29520. */
  29521. (Ext.env || (Ext.env = {})).Browser = function(userAgent, publish) {
  29522. // @define Ext.env.Browser
  29523. // @define Ext.browser
  29524. // @require Ext.Object
  29525. // @require Ext.Version
  29526. var me = this,
  29527. browserPrefixes = Ext.Boot.browserPrefixes,
  29528. browserNames = Ext.Boot.browserNames,
  29529. enginePrefixes = me.enginePrefixes,
  29530. engineNames = me.engineNames,
  29531. browserMatch = userAgent.match(new RegExp('((?:' + Ext.Object.getValues(browserPrefixes).join(')|(?:') + '))([\\w\\._]+)')),
  29532. engineMatch = userAgent.match(new RegExp('((?:' + Ext.Object.getValues(enginePrefixes).join(')|(?:') + '))([\\w\\._]+)')),
  29533. browserName = browserNames.other,
  29534. engineName = engineNames.other,
  29535. browserVersion = '',
  29536. engineVersion = '',
  29537. majorVer = '',
  29538. isWebView = false,
  29539. edgeRE = /(Edge\/)([\w.]+)/,
  29540. ripple = '',
  29541. i, prefix, name;
  29542. /**
  29543. * @property {String}
  29544. * Browser User Agent string.
  29545. */
  29546. me.userAgent = userAgent;
  29547. /**
  29548. * A "hybrid" property, can be either accessed as a method call, for example:
  29549. *
  29550. * if (Ext.browser.is('IE')) {
  29551. * // ...
  29552. * }
  29553. *
  29554. * Or as an object with Boolean properties, for example:
  29555. *
  29556. * if (Ext.browser.is.IE) {
  29557. * // ...
  29558. * }
  29559. *
  29560. * Versions can be conveniently checked as well. For example:
  29561. *
  29562. * if (Ext.browser.is.IE10) {
  29563. * // Equivalent to (Ext.browser.is.IE && Ext.browser.version.equals(10))
  29564. * }
  29565. *
  29566. * __Note:__ Only {@link Ext.Version#getMajor major component} and
  29567. * {@link Ext.Version#getShortVersion simplified} value of the version are available via
  29568. * direct property checking.
  29569. *
  29570. * Supported values are:
  29571. *
  29572. * - IE
  29573. * - Firefox
  29574. * - Safari
  29575. * - Chrome
  29576. * - Opera
  29577. * - WebKit
  29578. * - Gecko
  29579. * - Presto
  29580. * - Trident
  29581. * - WebView
  29582. * - Other
  29583. *
  29584. * @param {String} name The OS name to check.
  29585. * @return {Boolean}
  29586. */
  29587. this.is = function(name) {
  29588. // Since this function reference also acts as a map, we do not want it to be
  29589. // shared between instances, so it is defined here, not on the prototype.
  29590. return !!this.is[name];
  29591. };
  29592. // Edge has a userAgent with All browsers so we manage it separately
  29593. // "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
  29594. // Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
  29595. if (/Edge\//.test(userAgent)) {
  29596. browserMatch = userAgent.match(edgeRE);
  29597. engineMatch = userAgent.match(edgeRE);
  29598. }
  29599. if (browserMatch) {
  29600. browserName = browserNames[Ext.Object.getKey(browserPrefixes, browserMatch[1])];
  29601. if (browserName === 'Safari' && /^Opera/.test(userAgent)) {
  29602. // Prevent Opera 12 and earlier from being incorrectly reported as Safari
  29603. browserName = 'Opera';
  29604. }
  29605. browserVersion = new Ext.Version(browserMatch[2]);
  29606. }
  29607. if (engineMatch) {
  29608. engineName = engineNames[Ext.Object.getKey(enginePrefixes, engineMatch[1])];
  29609. engineVersion = new Ext.Version(engineMatch[2]);
  29610. }
  29611. if (engineName === 'Trident' && browserName !== 'IE') {
  29612. browserName = 'IE';
  29613. var version = userAgent.match(/.*rv:(\d+.\d+)/);
  29614. // eslint-disable-line vars-on-top
  29615. if (version && version.length) {
  29616. version = version[1];
  29617. browserVersion = new Ext.Version(version);
  29618. }
  29619. }
  29620. if (browserName && browserVersion) {
  29621. Ext.setVersion(browserName, browserVersion);
  29622. }
  29623. /**
  29624. * @property chromeVersion
  29625. * The current version of Chrome (0 if the browser is not Chrome).
  29626. * @readonly
  29627. * @type Number
  29628. * @member Ext
  29629. */
  29630. /**
  29631. * @property firefoxVersion
  29632. * The current version of Firefox (0 if the browser is not Firefox).
  29633. * @readonly
  29634. * @type Number
  29635. * @member Ext
  29636. */
  29637. /**
  29638. * @property ieVersion
  29639. * The current version of IE (0 if the browser is not IE). This does not account
  29640. * for the documentMode of the current page, which is factored into {@link #isIE8},
  29641. * and {@link #isIE9}. Thus this is not always true:
  29642. *
  29643. * Ext.isIE8 == (Ext.ieVersion == 8)
  29644. *
  29645. * @readonly
  29646. * @type Number
  29647. * @member Ext
  29648. */
  29649. /**
  29650. * @property isChrome
  29651. * True if the detected browser is Chrome.
  29652. * @readonly
  29653. * @type Boolean
  29654. * @member Ext
  29655. */
  29656. /**
  29657. * @property isGecko
  29658. * True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox).
  29659. * @readonly
  29660. * @type Boolean
  29661. * @member Ext
  29662. */
  29663. /**
  29664. * @property isIE
  29665. * True if the detected browser is Internet Explorer.
  29666. * @readonly
  29667. * @type Boolean
  29668. * @member Ext
  29669. */
  29670. /**
  29671. * @property isIE8
  29672. * True if the detected browser is Internet Explorer 8.x.
  29673. * @readonly
  29674. * @type Boolean
  29675. * @member Ext
  29676. */
  29677. /**
  29678. * @property isIE8m
  29679. * True if the detected browser is Internet Explorer 8.x or lower.
  29680. * @readonly
  29681. * @type Boolean
  29682. * @member Ext
  29683. */
  29684. /**
  29685. * @property isIE8p
  29686. * True if the detected browser is Internet Explorer 8.x or higher.
  29687. * @readonly
  29688. * @type Boolean
  29689. * @member Ext
  29690. */
  29691. /**
  29692. * @property isIE9
  29693. * True if the detected browser is Internet Explorer 9.x.
  29694. * @readonly
  29695. * @type Boolean
  29696. * @member Ext
  29697. */
  29698. /**
  29699. * @property isIE9m
  29700. * True if the detected browser is Internet Explorer 9.x or lower.
  29701. * @readonly
  29702. * @type Boolean
  29703. * @member Ext
  29704. */
  29705. /**
  29706. * @property isIE9p
  29707. * True if the detected browser is Internet Explorer 9.x or higher.
  29708. * @readonly
  29709. * @type Boolean
  29710. * @member Ext
  29711. */
  29712. /**
  29713. * @property isIE10
  29714. * True if the detected browser is Internet Explorer 10.x.
  29715. * @readonly
  29716. * @type Boolean
  29717. * @member Ext
  29718. */
  29719. /**
  29720. * @property isIE10m
  29721. * True if the detected browser is Internet Explorer 10.x or lower.
  29722. * @readonly
  29723. * @type Boolean
  29724. * @member Ext
  29725. */
  29726. /**
  29727. * @property isIE10p
  29728. * True if the detected browser is Internet Explorer 10.x or higher.
  29729. * @readonly
  29730. * @type Boolean
  29731. * @member Ext
  29732. */
  29733. /**
  29734. * @property isIE11
  29735. * True if the detected browser is Internet Explorer 11.x.
  29736. * @readonly
  29737. * @type Boolean
  29738. * @member Ext
  29739. */
  29740. /**
  29741. * @property isIE11m
  29742. * True if the detected browser is Internet Explorer 11.x or lower.
  29743. * @readonly
  29744. * @type Boolean
  29745. * @member Ext
  29746. */
  29747. /**
  29748. * @property isIE11p
  29749. * True if the detected browser is Internet Explorer 11.x or higher.
  29750. * @readonly
  29751. * @type Boolean
  29752. * @member Ext
  29753. */
  29754. /**
  29755. * @property isEdge
  29756. * True if the detected browser is Edge.
  29757. * @readonly
  29758. * @type Boolean
  29759. * @member Ext
  29760. */
  29761. /**
  29762. * @property isLinux
  29763. * True if the detected platform is Linux.
  29764. * @readonly
  29765. * @type Boolean
  29766. * @member Ext
  29767. */
  29768. /**
  29769. * @property isMac
  29770. * True if the detected platform is Mac OS.
  29771. * @readonly
  29772. * @type Boolean
  29773. * @member Ext
  29774. */
  29775. /**
  29776. * @property isOpera
  29777. * True if the detected browser is Opera.
  29778. * @readonly
  29779. * @type Boolean
  29780. * @member Ext
  29781. */
  29782. /**
  29783. * @property isSafari
  29784. * True if the detected browser is Safari.
  29785. * @readonly
  29786. * @type Boolean
  29787. * @member Ext
  29788. */
  29789. /**
  29790. * @property isWebKit
  29791. * True if the detected browser uses WebKit.
  29792. * @readonly
  29793. * @type Boolean
  29794. * @member Ext
  29795. */
  29796. /**
  29797. * @property isWindows
  29798. * True if the detected platform is Windows.
  29799. * @readonly
  29800. * @type Boolean
  29801. * @member Ext
  29802. */
  29803. /**
  29804. * @property operaVersion
  29805. * The current version of Opera (0 if the browser is not Opera).
  29806. * @readonly
  29807. * @type Number
  29808. * @member Ext
  29809. */
  29810. /**
  29811. * @property safariVersion
  29812. * The current version of Safari (0 if the browser is not Safari).
  29813. * @readonly
  29814. * @type Number
  29815. * @member Ext
  29816. */
  29817. /**
  29818. * @property webKitVersion
  29819. * The current version of WebKit (0 if the browser does not use WebKit).
  29820. * @readonly
  29821. * @type Number
  29822. * @member Ext
  29823. */
  29824. // Facebook changes the userAgent when you view a website within their iOS app.
  29825. // For some reason, the strip out information about the browser, so we have to detect
  29826. // that and fake it...
  29827. if (userAgent.match(/FB/) && browserName === 'Other') {
  29828. browserName = browserNames.safari;
  29829. engineName = engineNames.webkit;
  29830. }
  29831. // Detect chrome first as Chrome in Android 8.0 introduced OPR in the user agent
  29832. else if (userAgent.match(/Android.*Chrome/g)) {
  29833. browserName = 'ChromeMobile';
  29834. } else {
  29835. browserMatch = userAgent.match(/OPR\/(\d+.\d+)/);
  29836. if (browserMatch) {
  29837. browserName = 'Opera';
  29838. browserVersion = new Ext.Version(browserMatch[1]);
  29839. }
  29840. }
  29841. Ext.apply(this, {
  29842. engineName: engineName,
  29843. engineVersion: engineVersion,
  29844. name: browserName,
  29845. version: browserVersion
  29846. });
  29847. this.setFlag(browserName, true, publish);
  29848. // e.g., Ext.isIE
  29849. if (browserVersion) {
  29850. majorVer = browserVersion.getMajor() || '';
  29851. if (me.is.IE) {
  29852. majorVer = document.documentMode || parseInt(majorVer, 10);
  29853. for (i = 7; i <= 11; ++i) {
  29854. prefix = 'isIE' + i;
  29855. Ext[prefix] = majorVer === i;
  29856. Ext[prefix + 'm'] = majorVer <= i;
  29857. Ext[prefix + 'p'] = majorVer >= i;
  29858. }
  29859. }
  29860. if (me.is.Opera && parseInt(majorVer, 10) <= 12) {
  29861. Ext.isOpera12m = true;
  29862. }
  29863. Ext.chromeVersion = Ext.isChrome ? majorVer : 0;
  29864. Ext.firefoxVersion = Ext.isFirefox ? majorVer : 0;
  29865. Ext.ieVersion = Ext.isIE ? majorVer : 0;
  29866. Ext.operaVersion = Ext.isOpera ? majorVer : 0;
  29867. Ext.safariVersion = Ext.isSafari ? majorVer : 0;
  29868. Ext.webKitVersion = Ext.isWebKit ? majorVer : 0;
  29869. this.setFlag(browserName + majorVer, true, publish);
  29870. // Ext.isIE10
  29871. this.setFlag(browserName + browserVersion.getShortVersion());
  29872. }
  29873. for (i in browserNames) {
  29874. if (browserNames.hasOwnProperty(i)) {
  29875. name = browserNames[i];
  29876. this.setFlag(name, browserName === name);
  29877. }
  29878. }
  29879. this.setFlag(name);
  29880. if (engineVersion) {
  29881. this.setFlag(engineName + (engineVersion.getMajor() || ''));
  29882. this.setFlag(engineName + engineVersion.getShortVersion());
  29883. }
  29884. for (i in engineNames) {
  29885. if (engineNames.hasOwnProperty(i)) {
  29886. name = engineNames[i];
  29887. this.setFlag(name, engineName === name, publish);
  29888. }
  29889. }
  29890. this.setFlag('Standalone', !!navigator.standalone);
  29891. // Cross domain access could throw an error
  29892. try {
  29893. ripple = window.top.ripple;
  29894. } catch (e) {}
  29895. // Do nothing, can't access cross frame so leave it empty
  29896. /* eslint-disable-next-line max-len */
  29897. this.setFlag('Ripple', !!document.getElementById("tinyhippos-injected") && !Ext.isEmpty(ripple));
  29898. this.setFlag('WebWorks', !!window.blackberry);
  29899. if (window.PhoneGap !== undefined || window.Cordova !== undefined || window.cordova !== undefined) {
  29900. isWebView = true;
  29901. this.setFlag('PhoneGap');
  29902. this.setFlag('Cordova');
  29903. }
  29904. // Check if running in UIWebView
  29905. if (/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)(?!.*FBAN)/i.test(userAgent)) {
  29906. isWebView = true;
  29907. }
  29908. // Flag to check if it we are in the WebView
  29909. this.setFlag('WebView', isWebView);
  29910. /**
  29911. * @property {Boolean}
  29912. * `true` if browser is using strict mode.
  29913. */
  29914. this.isStrict = Ext.isStrict = document.compatMode === "CSS1Compat";
  29915. /**
  29916. * @property {Boolean}
  29917. * `true` if page is running over SSL.
  29918. */
  29919. this.isSecure = Ext.isSecure;
  29920. // IE10Quirks, Chrome26Strict, etc.
  29921. this.identity = browserName + majorVer + (this.isStrict ? 'Strict' : 'Quirks');
  29922. };
  29923. Ext.env.Browser.prototype = {
  29924. constructor: Ext.env.Browser,
  29925. engineNames: {
  29926. edge: 'Edge',
  29927. webkit: 'WebKit',
  29928. gecko: 'Gecko',
  29929. presto: 'Presto',
  29930. trident: 'Trident',
  29931. other: 'Other'
  29932. },
  29933. enginePrefixes: {
  29934. edge: 'Edge/',
  29935. webkit: 'AppleWebKit/',
  29936. gecko: 'Gecko/',
  29937. presto: 'Presto/',
  29938. trident: 'Trident/'
  29939. },
  29940. styleDashPrefixes: {
  29941. WebKit: '-webkit-',
  29942. Gecko: '-moz-',
  29943. Trident: '-ms-',
  29944. Presto: '-o-',
  29945. Other: ''
  29946. },
  29947. stylePrefixes: {
  29948. WebKit: 'Webkit',
  29949. Gecko: 'Moz',
  29950. Trident: 'ms',
  29951. Presto: 'O',
  29952. Other: ''
  29953. },
  29954. propertyPrefixes: {
  29955. WebKit: 'webkit',
  29956. Gecko: 'moz',
  29957. Trident: 'ms',
  29958. Presto: 'o',
  29959. Other: ''
  29960. },
  29961. // scope: Ext.env.Browser.prototype
  29962. /**
  29963. * The full name of the current browser.
  29964. * Possible values are:
  29965. *
  29966. * - IE
  29967. * - Firefox
  29968. * - Safari
  29969. * - Chrome
  29970. * - Opera
  29971. * - Other
  29972. * @type String
  29973. * @readonly
  29974. */
  29975. name: null,
  29976. /**
  29977. * Refer to {@link Ext.Version}.
  29978. * @type Ext.Version
  29979. * @readonly
  29980. */
  29981. version: null,
  29982. /**
  29983. * The full name of the current browser's engine.
  29984. * Possible values are:
  29985. *
  29986. * - WebKit
  29987. * - Gecko
  29988. * - Presto
  29989. * - Trident
  29990. * - Other
  29991. * @type String
  29992. * @readonly
  29993. */
  29994. engineName: null,
  29995. /**
  29996. * Refer to {@link Ext.Version}.
  29997. * @type Ext.Version
  29998. * @readonly
  29999. */
  30000. engineVersion: null,
  30001. setFlag: function(name, value, publish) {
  30002. if (value === undefined) {
  30003. value = true;
  30004. }
  30005. this.is[name] = value;
  30006. this.is[name.toLowerCase()] = value;
  30007. if (publish) {
  30008. Ext['is' + name] = value;
  30009. }
  30010. return this;
  30011. },
  30012. getStyleDashPrefix: function() {
  30013. return this.styleDashPrefixes[this.engineName];
  30014. },
  30015. getStylePrefix: function() {
  30016. return this.stylePrefixes[this.engineName];
  30017. },
  30018. getVendorProperyName: function(name) {
  30019. var prefix = this.propertyPrefixes[this.engineName];
  30020. if (prefix.length > 0) {
  30021. return prefix + Ext.String.capitalize(name);
  30022. }
  30023. return name;
  30024. }
  30025. };
  30026. /**
  30027. * @class Ext.browser
  30028. * @extends Ext.env.Browser
  30029. * @singleton
  30030. * Provides useful information about the current browser.
  30031. *
  30032. * Example:
  30033. *
  30034. * if (Ext.browser.is.IE) {
  30035. * // IE specific code here
  30036. * }
  30037. *
  30038. * if (Ext.browser.is.WebKit) {
  30039. * // WebKit specific code here
  30040. * }
  30041. *
  30042. * console.log("Version " + Ext.browser.version);
  30043. *
  30044. * For a full list of supported values, refer to {@link #is} property/method.
  30045. *
  30046. */
  30047. (function(userAgent) {
  30048. Ext.browser = new Ext.env.Browser(userAgent, true);
  30049. Ext.userAgent = userAgent.toLowerCase();
  30050. /**
  30051. * @property {String} SSL_SECURE_URL
  30052. * URL to a blank file used by Ext when in secure mode for iframe src and onReady src
  30053. * to prevent the IE insecure content warning (`'about:blank'`, except for IE
  30054. * in secure mode, which is `'javascript:""'`).
  30055. * @member Ext
  30056. */
  30057. Ext.SSL_SECURE_URL = Ext.isSecure && Ext.isIE ? 'javascript:\'\'' : 'about:blank';
  30058. }(Ext.global.navigator.userAgent));
  30059. /**
  30060. * @class Ext.env.OS
  30061. *
  30062. * Provides information about operating system environment.
  30063. *
  30064. * Should not be manually instantiated unless for unit-testing.
  30065. * Access the global instance stored in {@link Ext.os} instead.
  30066. * @private
  30067. */
  30068. Ext.env.OS = function(userAgent, platform, browserScope) {
  30069. // @define Ext.env.OS
  30070. // @define Ext.os
  30071. // @require Ext.Version
  30072. // @require Ext.env.Browser
  30073. var me = this,
  30074. names = Ext.Boot.osNames,
  30075. prefixes = Ext.Boot.osPrefixes,
  30076. name,
  30077. version = '',
  30078. is = me.is,
  30079. i, prefix, match, item, match1;
  30080. browserScope = browserScope || Ext.browser;
  30081. for (i in prefixes) {
  30082. if (prefixes.hasOwnProperty(i)) {
  30083. prefix = prefixes[i];
  30084. match = userAgent.match(new RegExp('(?:' + prefix + ')([^\\s;]+)'));
  30085. if (match) {
  30086. name = names[i];
  30087. match1 = match[1];
  30088. // This is here because some HTC android devices show an OSX Snow Leopard
  30089. // userAgent by default.
  30090. // And the Kindle Fire doesn't have any indicator of Android as the OS in its
  30091. // User Agent
  30092. if (match1 && match1 === "HTC_") {
  30093. version = new Ext.Version("2.3");
  30094. } else if (match1 && match1 === "Silk/") {
  30095. version = new Ext.Version("2.3");
  30096. } else {
  30097. version = new Ext.Version(match[match.length - 1]);
  30098. }
  30099. break;
  30100. }
  30101. }
  30102. }
  30103. if (!name) {
  30104. name = names[(userAgent.toLowerCase().match(/mac|win|linux/) || [
  30105. 'other'
  30106. ])[0]];
  30107. version = new Ext.Version('');
  30108. }
  30109. this.name = name;
  30110. this.version = version;
  30111. // This is added as a workaround for Chrome iPad emulation mode
  30112. // it will report the platform of the machine (MacIntel, Win32, etc) instead
  30113. // of an emulated platform
  30114. // iOS versions 12 and lower will include 'iPad' in the user agent string, iPadOS 13+ will
  30115. // not report 'iPad' but 'Mac Intel' so we have to check the touch points.
  30116. if (userAgent.match(/ipad/i) || (!userAgent.match(/iphone/i) && userAgent.match(/Mac/) && navigator.maxTouchPoints > 2)) {
  30117. name = 'iOS';
  30118. platform = 'iPad';
  30119. }
  30120. if (platform) {
  30121. this.setFlag(platform.replace(/ simulator$/i, ''));
  30122. }
  30123. this.setFlag(name);
  30124. if (version) {
  30125. this.setFlag(name + (version.getMajor() || ''));
  30126. this.setFlag(name + version.getShortVersion());
  30127. }
  30128. for (i in names) {
  30129. if (names.hasOwnProperty(i)) {
  30130. item = names[i];
  30131. if (!is.hasOwnProperty(name)) {
  30132. this.setFlag(item, (name === item));
  30133. }
  30134. }
  30135. }
  30136. // Detect if the device is the iPhone 5.
  30137. if (this.name === "iOS" && window.screen.height === 568) {
  30138. this.setFlag('iPhone5');
  30139. }
  30140. if (browserScope.is.Safari || browserScope.is.Silk) {
  30141. // Ext.browser.version.shortVersion == 501 is for debugging off device
  30142. if (this.is.Android2 || this.is.Android3 || browserScope.version.shortVersion === 501) {
  30143. browserScope.setFlag("AndroidStock");
  30144. }
  30145. if (this.is.Android4) {
  30146. browserScope.setFlag("AndroidStock");
  30147. browserScope.setFlag("AndroidStock4");
  30148. }
  30149. }
  30150. };
  30151. Ext.env.OS.prototype = {
  30152. constructor: Ext.env.OS,
  30153. /**
  30154. * A "hybrid" property, can be either accessed as a method call, i.e:
  30155. *
  30156. * if (Ext.os.is('Android')) {
  30157. * // ...
  30158. * }
  30159. *
  30160. * or as an object with boolean properties, i.e:
  30161. *
  30162. * if (Ext.os.is.Android) {
  30163. * // ...
  30164. * }
  30165. *
  30166. * Versions can be conveniently checked as well. For example:
  30167. *
  30168. * if (Ext.os.is.Android2) {
  30169. * // Equivalent to (Ext.os.is.Android && Ext.os.version.equals(2))
  30170. * }
  30171. *
  30172. * if (Ext.os.is.iOS32) {
  30173. * // Equivalent to (Ext.os.is.iOS && Ext.os.version.equals(3.2))
  30174. * }
  30175. *
  30176. * Note that only {@link Ext.Version#getMajor major component} and
  30177. * {@link Ext.Version#getShortVersion simplified} value of the version are available
  30178. * via direct property checking. Supported values are:
  30179. *
  30180. * - iOS
  30181. * - iPad
  30182. * - iPhone
  30183. * - iPhone5 (also true for 4in iPods).
  30184. * - iPod
  30185. * - Android
  30186. * - WebOS
  30187. * - BlackBerry
  30188. * - Bada
  30189. * - MacOS
  30190. * - Windows
  30191. * - Linux
  30192. * - Other
  30193. * @member Ext.os
  30194. * @param {String} name The OS name to check.
  30195. * @return {Boolean}
  30196. */
  30197. is: function(name) {
  30198. return !!this[name];
  30199. },
  30200. /**
  30201. * @property {String} [name=null]
  30202. * @readonly
  30203. * @member Ext.os
  30204. * The full name of the current operating system. Possible values are:
  30205. *
  30206. * - iOS
  30207. * - Android
  30208. * - WebOS
  30209. * - BlackBerry,
  30210. * - MacOS
  30211. * - Windows
  30212. * - Linux
  30213. * - Other
  30214. */
  30215. name: null,
  30216. /**
  30217. * @property {Ext.Version} [version=null]
  30218. * Refer to {@link Ext.Version}
  30219. * @member Ext.os
  30220. * @readonly
  30221. */
  30222. version: null,
  30223. setFlag: function(name, value) {
  30224. if (value === undefined) {
  30225. value = true;
  30226. }
  30227. if (this.flags) {
  30228. this.flags[name] = value;
  30229. }
  30230. this.is[name] = value;
  30231. this.is[name.toLowerCase()] = value;
  30232. return this;
  30233. }
  30234. };
  30235. (function() {
  30236. var navigation = Ext.global.navigator,
  30237. userAgent = navigation.userAgent,
  30238. OS = Ext.env.OS,
  30239. is = (Ext.is || (Ext.is = {})),
  30240. osEnv, osName, deviceType;
  30241. OS.prototype.flags = is;
  30242. /**
  30243. * @class Ext.os
  30244. * @extends Ext.env.OS
  30245. * @singleton
  30246. * Provides useful information about the current operating system environment.
  30247. *
  30248. * Example:
  30249. *
  30250. * if (Ext.os.is.Windows) {
  30251. * // Windows specific code here
  30252. * }
  30253. *
  30254. * if (Ext.os.is.iOS) {
  30255. * // iPad, iPod, iPhone, etc.
  30256. * }
  30257. *
  30258. * console.log("Version " + Ext.os.version);
  30259. *
  30260. * For a full list of supported values, refer to the {@link #is} property/method.
  30261. *
  30262. */
  30263. Ext.os = osEnv = new OS(userAgent, navigation.platform);
  30264. osName = osEnv.name;
  30265. // A couple compatible flavors:
  30266. Ext['is' + osName] = true;
  30267. // e.g., Ext.isWindows
  30268. Ext.isMac = is.Mac = is.MacOS;
  30269. Ext.isApple = Ext.isMac || Ext.isiOS;
  30270. // eslint-disable-next-line vars-on-top
  30271. var search = window.location.search.match(/deviceType=(Tablet|Phone)/),
  30272. nativeDeviceType = window.deviceType;
  30273. // Override deviceType by adding a get variable of deviceType. NEEDED FOR DOCS APP.
  30274. // E.g: example/kitchen-sink.html?deviceType=Phone
  30275. if (search && search[1]) {
  30276. deviceType = search[1];
  30277. } else if (nativeDeviceType === 'iPhone') {
  30278. deviceType = 'Phone';
  30279. } else if (nativeDeviceType === 'iPad') {
  30280. deviceType = 'Tablet';
  30281. } else {
  30282. if (!osEnv.is.Android && !osEnv.is.iOS && !osEnv.is.WindowsPhone && /Windows|Linux|MacOS|ChromeOS/.test(osName)) {
  30283. deviceType = 'Desktop';
  30284. // always set it to false when you are on a desktop not using Ripple Emulation
  30285. Ext.browser.is.WebView = !!Ext.browser.is.Ripple;
  30286. } else if (osEnv.is.iPad || osEnv.is.RIMTablet || osEnv.is.Android3 || Ext.browser.is.Silk || (osEnv.is.Android && userAgent.search(/mobile/i) === -1)) {
  30287. deviceType = 'Tablet';
  30288. } else {
  30289. deviceType = 'Phone';
  30290. }
  30291. }
  30292. // With iPadOS the operating system name is returned as 'MacOS' so let's check if we are
  30293. // using a tablet and if so set it to 'iOS' instead.
  30294. if (deviceType === 'Tablet' && osName === 'MacOS') {
  30295. Ext.isiOS = true;
  30296. Ext.isiPadOS = true;
  30297. }
  30298. /**
  30299. * @property {String} deviceType
  30300. * The generic type of the current device.
  30301. *
  30302. * Possible values:
  30303. *
  30304. * - Phone
  30305. * - Tablet
  30306. * - Desktop
  30307. *
  30308. * For testing purposes the deviceType can be overridden by adding
  30309. * a deviceType parameter to the URL of the page, like so:
  30310. *
  30311. * http://localhost/mypage.html?deviceType=Tablet
  30312. *
  30313. * @member Ext.os
  30314. */
  30315. osEnv.setFlag(deviceType, true);
  30316. osEnv.deviceType = deviceType;
  30317. delete OS.prototype.flags;
  30318. }());
  30319. /**
  30320. * @class Ext.feature
  30321. * @singleton
  30322. *
  30323. * A simple class to verify if a browser feature exists or not on the current device.
  30324. *
  30325. * if (Ext.feature.has.Canvas) {
  30326. * // do some cool things with canvas here
  30327. * }
  30328. *
  30329. * See the {@link #has} property/method for details of the features that can be detected.
  30330. *
  30331. */
  30332. /* eslint-disable vars-on-top */
  30333. Ext.feature = {
  30334. // @define Ext.env.Feature
  30335. // @define Ext.feature
  30336. // @define Ext.supports
  30337. // @require Ext.String
  30338. // @require Ext.env.Browser
  30339. // @require Ext.env.OS
  30340. /**
  30341. * @method has
  30342. * @member Ext.feature
  30343. * Verifies if a browser feature exists or not on the current device.
  30344. *
  30345. * A "hybrid" property, can be either accessed as a method call, i.e:
  30346. *
  30347. * if (Ext.feature.has('Canvas')) {
  30348. * // ...
  30349. * }
  30350. *
  30351. * or as an object with boolean properties, i.e:
  30352. *
  30353. * if (Ext.feature.has.Canvas) {
  30354. * // ...
  30355. * }
  30356. *
  30357. * For possible properties/parameter values see `Ext.supports`.
  30358. *
  30359. * @param {String} name The feature name to check.
  30360. * @return {Boolean}
  30361. */
  30362. has: function(name) {
  30363. return !!this.has[name];
  30364. },
  30365. testElements: {},
  30366. getTestElement: function(tag, createNew) {
  30367. if (tag === undefined) {
  30368. tag = 'div';
  30369. } else if (typeof tag !== 'string') {
  30370. return tag;
  30371. }
  30372. if (createNew) {
  30373. return document.createElement(tag);
  30374. }
  30375. if (!this.testElements[tag]) {
  30376. this.testElements[tag] = document.createElement(tag);
  30377. }
  30378. return this.testElements[tag];
  30379. },
  30380. isStyleSupported: function(name, tag) {
  30381. var elementStyle = this.getTestElement(tag).style,
  30382. cName = Ext.String.capitalize(name);
  30383. if (typeof elementStyle[name] !== 'undefined' || typeof elementStyle[Ext.browser.getStylePrefix(name) + cName] !== 'undefined') {
  30384. return true;
  30385. }
  30386. return false;
  30387. },
  30388. isStyleSupportedWithoutPrefix: function(name, tag) {
  30389. var elementStyle = this.getTestElement(tag).style;
  30390. if (typeof elementStyle[name] !== 'undefined') {
  30391. return true;
  30392. }
  30393. return false;
  30394. },
  30395. isEventSupported: function(name, tag) {
  30396. if (tag === undefined) {
  30397. tag = window;
  30398. }
  30399. var element = this.getTestElement(tag),
  30400. eventName = 'on' + name.toLowerCase(),
  30401. isSupported = (eventName in element);
  30402. if (!isSupported) {
  30403. if (element.setAttribute && element.removeAttribute) {
  30404. element.setAttribute(eventName, '');
  30405. isSupported = typeof element[eventName] === 'function';
  30406. if (typeof element[eventName] !== 'undefined') {
  30407. element[eventName] = undefined;
  30408. }
  30409. element.removeAttribute(eventName);
  30410. }
  30411. }
  30412. return isSupported;
  30413. },
  30414. // This is a local copy of certain logic from Element.getStyle
  30415. // to break a dependancy between the supports mechanism and Element
  30416. // use this instead of element references to check for styling info
  30417. getStyle: function(element, styleName) {
  30418. var view = element.ownerDocument.defaultView,
  30419. style = (view ? view.getComputedStyle(element, null) : element.currentStyle);
  30420. return (style || element.style)[styleName];
  30421. },
  30422. getSupportedPropertyName: function(object, name) {
  30423. var vendorName = Ext.browser.getVendorProperyName(name);
  30424. if (vendorName in object) {
  30425. return vendorName;
  30426. } else if (name in object) {
  30427. return name;
  30428. }
  30429. return null;
  30430. },
  30431. /**
  30432. * Runs feature detection routines and sets the various flags. This is called when
  30433. * the scripts loads (very early) and again at {@link Ext#onReady}. Some detections
  30434. * can be run immediately. Others that require the document body will not run until
  30435. * domready (these have the `ready` flag set).
  30436. *
  30437. * Each test is run only once, so calling this method from an onReady function is safe
  30438. * and ensures that all flags have been set.
  30439. * @private
  30440. */
  30441. detect: function(isReady) {
  30442. var me = this,
  30443. doc = document,
  30444. toRun = me.toRun || me.tests,
  30445. n = toRun.length,
  30446. div = doc.createElement('div'),
  30447. notRun = [],
  30448. supports = Ext.supports,
  30449. has = me.has,
  30450. name, names, test, vector, value;
  30451. // Only the legacy browser tests use this div so clip this out if we don't need
  30452. // to use it.
  30453. div.innerHTML = '<div style="height:30px;width:50px;">' + '<div style="height:20px;width:20px;"></div>' + '</div>' + '<div style="width: 200px; height: 200px; position: relative; padding: 5px;">' + '<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></div>' + // eslint-disable-line max-len
  30454. '</div>' + '<div style="position: absolute; left: 10%; top: 10%;"></div>' + '<div style="float:left; background-color:transparent;"></div>';
  30455. if (isReady) {
  30456. doc.body.appendChild(div);
  30457. }
  30458. vector = me.preDetected[Ext.browser.identity] || [];
  30459. while (n--) {
  30460. test = toRun[n];
  30461. value = vector[n];
  30462. name = test.name;
  30463. names = test.names;
  30464. if (value === undefined) {
  30465. if (!isReady && test.ready) {
  30466. // test requires domready state
  30467. notRun.push(test);
  30468. continue;
  30469. }
  30470. value = test.fn.call(me, doc, div);
  30471. }
  30472. // Store test results on Ext.supports and Ext.feature.has
  30473. if (name) {
  30474. supports[name] = has[name] = value;
  30475. } else if (names) {
  30476. while (names.length) {
  30477. name = names.pop();
  30478. supports[name] = has[name] = value;
  30479. }
  30480. }
  30481. }
  30482. if (isReady) {
  30483. doc.body.removeChild(div);
  30484. }
  30485. me.toRun = notRun;
  30486. },
  30487. //</debug>
  30488. report: function() {
  30489. var values = [],
  30490. len = this.tests.length,
  30491. i;
  30492. for (i = 0; i < len; ++i) {
  30493. values.push(this.has[this.tests[i].name] ? 1 : 0);
  30494. }
  30495. Ext.log(Ext.browser.identity + ': [' + values.join(',') + ']');
  30496. },
  30497. //</debug>
  30498. preDetected: {},
  30499. // TODO
  30500. /**
  30501. * @class Ext.supports
  30502. *
  30503. * Contains information about features supported in the current environment as well
  30504. * as bugs detected.
  30505. *
  30506. * @singleton
  30507. */
  30508. tests: [
  30509. {
  30510. /**
  30511. * @property CloneNodeCopiesExpando `true` if the native DOM cloneNode method copies
  30512. * expando properties to the newly cloned node.
  30513. *
  30514. * This property is available at application boot time, before document ready.
  30515. * @type {Boolean}
  30516. */
  30517. name: 'CloneNodeCopiesExpando',
  30518. fn: function() {
  30519. var el = document.createElement('div');
  30520. el.expandoProp = {};
  30521. return el.cloneNode().expandoProp === el.expandoProp;
  30522. }
  30523. },
  30524. {
  30525. /**
  30526. * @property CSSPointerEvents `true` if document environment supports the CSS3
  30527. * pointer-events style.
  30528. *
  30529. * This property is available at application boot time, before document ready.
  30530. * @type {Boolean}
  30531. */
  30532. name: 'CSSPointerEvents',
  30533. fn: function(doc) {
  30534. return 'pointerEvents' in doc.documentElement.style;
  30535. }
  30536. },
  30537. {
  30538. /**
  30539. * @property CSS3BoxShadow `true` if document environment supports the CSS3
  30540. * box-shadow style.
  30541. *
  30542. * This property is available at application boot time, before document ready.
  30543. * @type {Boolean}
  30544. */
  30545. name: 'CSS3BoxShadow',
  30546. fn: function(doc) {
  30547. return 'boxShadow' in doc.documentElement.style || 'WebkitBoxShadow' in doc.documentElement.style || 'MozBoxShadow' in doc.documentElement.style;
  30548. }
  30549. },
  30550. {
  30551. name: 'CSS3NegationSelector',
  30552. fn: function(doc) {
  30553. try {
  30554. doc.querySelectorAll("foo:not(bar)");
  30555. } catch (e) {
  30556. return false;
  30557. }
  30558. return true;
  30559. }
  30560. },
  30561. {
  30562. /**
  30563. * @property ClassList `true` if document environment supports the HTML5
  30564. * classList API.
  30565. *
  30566. * This property is available at application boot time, before document ready.
  30567. * @type {Boolean}
  30568. */
  30569. name: 'ClassList',
  30570. fn: function(doc) {
  30571. return !!doc.documentElement.classList;
  30572. }
  30573. },
  30574. {
  30575. /**
  30576. * @property Canvas `true` if the device supports Canvas.
  30577. *
  30578. * This property is available at application boot time, before document ready.
  30579. * @type {Boolean}
  30580. */
  30581. name: 'Canvas',
  30582. fn: function() {
  30583. var element = this.getTestElement('canvas');
  30584. return !!(element && element.getContext && element.getContext('2d'));
  30585. }
  30586. },
  30587. {
  30588. /**
  30589. * @property Svg `true` if the device supports SVG.
  30590. *
  30591. * This property is available at application boot time, before document ready.
  30592. * @type {Boolean}
  30593. */
  30594. name: 'Svg',
  30595. fn: function(doc) {
  30596. /* eslint-disable-next-line max-len */
  30597. return !!(doc.createElementNS && !!doc.createElementNS("http:/" + "/www.w3.org/2000/svg", "svg").createSVGRect);
  30598. }
  30599. },
  30600. {
  30601. /**
  30602. * @property Vml `true` if the device supports VML.
  30603. * @type {Boolean}
  30604. *
  30605. * This property is available at application boot time, before document ready.
  30606. */
  30607. name: 'Vml',
  30608. fn: function() {
  30609. var element = this.getTestElement(),
  30610. ret = false;
  30611. element.innerHTML = "<!--[if vml]><br><![endif]-->";
  30612. ret = (element.childNodes.length === 1);
  30613. element.innerHTML = "";
  30614. return ret;
  30615. }
  30616. },
  30617. {
  30618. /**
  30619. * @property {Boolean} Touch `true` if the browser supports touch input.
  30620. *
  30621. * This property is available at application boot time, before document ready.
  30622. */
  30623. name: 'Touch',
  30624. fn: function() {
  30625. // IE10 uses a vendor-prefixed maxTouchPoints property
  30626. var maxTouchPoints = navigator.msMaxTouchPoints || navigator.maxTouchPoints;
  30627. // if the browser has touch events we can be reasonably sure the device has
  30628. // a touch screen
  30629. // browsers that use pointer event have maxTouchPoints > 1 if the
  30630. // device supports touch input
  30631. // Chrome Desktop < 39 reports maxTouchPoints === 1 even if there is no
  30632. // touch support on the device
  30633. // http://www.w3.org/TR/pointerevents/#widl-Navigator-maxTouchPoints
  30634. // Chrome Desktop > 39 properly reports maxTouchPoints === 0 and
  30635. // Chrome Desktop Device Emulation mode reports maxTouchPoints === 1
  30636. if (Ext.browser.is.Chrome && Ext.browser.version.isLessThanOrEqual(39)) {
  30637. return (Ext.supports.TouchEvents && maxTouchPoints !== 1) || maxTouchPoints > 1;
  30638. } else {
  30639. return Ext.supports.TouchEvents || maxTouchPoints > 0;
  30640. }
  30641. }
  30642. },
  30643. {
  30644. /**
  30645. * @property {Boolean} PointerEvents
  30646. * @type {Boolean}
  30647. * @private
  30648. *
  30649. * `true` If the event system should use [pointer events](https://www.w3.org/TR/pointerevents/).
  30650. * Currently only set to true if the browser supports pointer events and does not
  30651. * also support touch events. Touch events are preferred since they allow run-time
  30652. * cancellation of browser default behavior such as scrolling by invoking
  30653. * `e.preventDefault()` whereas pointer events require such intentions to be declared
  30654. * in advance via CSS [touch-action](https://www.w3.org/TR/pointerevents/#h3_the-touch-action-css-property).
  30655. * This means that when pointer events are used, certain interactions are not possible
  30656. * such as long-press to drag within a scrollable element.
  30657. */
  30658. name: 'PointerEvents',
  30659. fn: function() {
  30660. var pointerEvent = window.PointerEvent,
  30661. nav = window.navigator,
  30662. pointerEnabled = !!(pointerEvent && (nav.pointerEnabled || !Ext.isIE));
  30663. return pointerEnabled && !Ext.supports.TouchEvents;
  30664. }
  30665. },
  30666. {
  30667. /**
  30668. * @property {Boolean} MSPointerEvents
  30669. * @private
  30670. */
  30671. name: 'MSPointerEvents',
  30672. fn: function() {
  30673. return Ext.isIE10;
  30674. }
  30675. },
  30676. {
  30677. /**
  30678. * @property {Boolean} TouchEvents
  30679. *
  30680. * `true` if the device supports touch events (`touchstart`, `touchmove`, `touchend`).
  30681. *
  30682. * This property is available at application boot time, before document ready.
  30683. */
  30684. name: 'TouchEvents',
  30685. fn: function() {
  30686. return this.isEventSupported('touchend');
  30687. }
  30688. },
  30689. {
  30690. /**
  30691. * @property {Boolean} TouchAction
  30692. * @private
  30693. *
  30694. * A bit flag representing which property values the browser recognizes as valid
  30695. * values of the CSS `touch-action` property.
  30696. *
  30697. * panX 1 "00000001"
  30698. * panY 2 "00000010"
  30699. * pinchZoom 4 "00000100"
  30700. * doubleTapZoom 8 "00001000"
  30701. */
  30702. name: 'TouchAction',
  30703. ready: true,
  30704. fn: function(doc, div) {
  30705. if (!window.getComputedStyle) {
  30706. return 0;
  30707. }
  30708. var values = [
  30709. 'pan-x',
  30710. 'pan-y',
  30711. 'pinch-zoom',
  30712. 'double-tap-zoom'
  30713. ],
  30714. flags = [
  30715. 1,
  30716. 2,
  30717. 4,
  30718. 8
  30719. ],
  30720. ln = values.length,
  30721. flag = 0,
  30722. i, value;
  30723. for (i = 0; i < ln; i++) {
  30724. value = values[i];
  30725. div.style.touchAction = value;
  30726. if (getComputedStyle(div).touchAction === value) {
  30727. flag |= flags[i];
  30728. }
  30729. }
  30730. return flag;
  30731. }
  30732. },
  30733. {
  30734. /**
  30735. * @property Orientation `true` if the device supports different orientations.
  30736. * @type {Boolean}
  30737. *
  30738. * This property is available at application boot time, before document ready.
  30739. */
  30740. name: 'Orientation',
  30741. fn: function() {
  30742. return ('orientation' in window) && this.isEventSupported('orientationchange');
  30743. }
  30744. },
  30745. {
  30746. /**
  30747. * @property OrientationChange `true` if the device supports the `orientationchange`
  30748. * event.
  30749. *
  30750. * This property is available at application boot time, before document ready.
  30751. * @type {Boolean}
  30752. */
  30753. name: 'OrientationChange',
  30754. fn: function() {
  30755. return this.isEventSupported('orientationchange');
  30756. }
  30757. },
  30758. {
  30759. /**
  30760. * @property DeviceMotion `true` if the device supports device motion (acceleration
  30761. * and rotation rate).
  30762. *
  30763. * This property is available at application boot time, before document ready.
  30764. * @type {Boolean}
  30765. */
  30766. name: 'DeviceMotion',
  30767. fn: function() {
  30768. return this.isEventSupported('devicemotion');
  30769. }
  30770. },
  30771. {
  30772. /**
  30773. * @property Geolocation `true` if the device supports GeoLocation.
  30774. * @type {Boolean}
  30775. *
  30776. * This property is available at application boot time, before document ready.
  30777. */
  30778. /**
  30779. * @property GeoLocation `true` if the device supports Geo-location.
  30780. * @type {Boolean}
  30781. * @deprecated 5.0.0 Use `Geolocation` instead (notice the lower-casing of 'L').
  30782. */
  30783. names: [
  30784. 'Geolocation',
  30785. 'GeoLocation'
  30786. ],
  30787. fn: function() {
  30788. return 'geolocation' in window.navigator;
  30789. }
  30790. },
  30791. {
  30792. name: 'SqlDatabase',
  30793. fn: function() {
  30794. return 'openDatabase' in window;
  30795. }
  30796. },
  30797. {
  30798. name: 'WebSockets',
  30799. fn: function() {
  30800. return 'WebSocket' in window;
  30801. }
  30802. },
  30803. {
  30804. /**
  30805. * @property Range `true` if browser support document.createRange native method.
  30806. * See https://developer.mozilla.org/en/DOM/range.
  30807. *
  30808. * This property is available at application boot time, before document ready.
  30809. * @type {Boolean}
  30810. */
  30811. name: 'Range',
  30812. fn: function() {
  30813. return !!document.createRange;
  30814. }
  30815. },
  30816. {
  30817. /**
  30818. * @property CreateContextualFragment `true` if browser support CreateContextualFragment
  30819. * range native methods.
  30820. * See https://developer.mozilla.org/en/DOM/range.createContextualFragment
  30821. *
  30822. * This property is available at application boot time, before document ready.
  30823. * @type {Boolean}
  30824. */
  30825. name: 'CreateContextualFragment',
  30826. fn: function() {
  30827. var range = !!document.createRange ? document.createRange() : false;
  30828. return range && !!range.createContextualFragment;
  30829. }
  30830. },
  30831. {
  30832. /**
  30833. * @property History `true` if the device supports HTML5 history. See
  30834. * https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history
  30835. *
  30836. * This property is available at application boot time, before document ready.
  30837. * @type {Boolean}
  30838. */
  30839. name: 'History',
  30840. fn: function() {
  30841. return ('history' in window && 'pushState' in window.history);
  30842. }
  30843. },
  30844. {
  30845. /**
  30846. * @property Css3DTransforms `true` if the device supports CSS3DTransform.
  30847. * @type {Boolean}
  30848. *
  30849. * This property is available at application boot time, before document ready.
  30850. */
  30851. name: 'Css3dTransforms',
  30852. fn: function() {
  30853. // See https://sencha.jira.com/browse/TOUCH-1544
  30854. return this.has('CssTransforms') && this.isStyleSupported('perspective');
  30855. }
  30856. },
  30857. // TODO - double check vs Ext JS flavor:
  30858. /* eslint-disable-next-line max-len */
  30859. // return (typeof WebKitCSSMatrix != 'undefined' && new WebKitCSSMatrix().hasOwnProperty('m41'));
  30860. {
  30861. // Important that this goes after Css3dTransforms, since tests are run in reverse order
  30862. name: 'CssTransforms',
  30863. fn: function() {
  30864. return this.isStyleSupported('transform');
  30865. }
  30866. },
  30867. {
  30868. name: 'CssTransformNoPrefix',
  30869. fn: function() {
  30870. return this.isStyleSupportedWithoutPrefix('transform');
  30871. }
  30872. },
  30873. {
  30874. name: 'CssAnimations',
  30875. fn: function() {
  30876. return this.isStyleSupported('animationName');
  30877. }
  30878. },
  30879. {
  30880. /**
  30881. * @property Transitions `true` if the device supports CSS3 Transitions.
  30882. *
  30883. * This property is available at application boot time, before document ready.
  30884. * @type {Boolean}
  30885. */
  30886. names: [
  30887. 'CssTransitions',
  30888. 'Transitions'
  30889. ],
  30890. fn: function() {
  30891. return this.isStyleSupported('transitionProperty');
  30892. }
  30893. },
  30894. {
  30895. /**
  30896. * @property Audio `true` if the device supports the HTML5 `audio` tag.
  30897. *
  30898. * This property is available at application boot time, before document ready.
  30899. * @type {Boolean}
  30900. */
  30901. /**
  30902. * @property AudioTag `true` if the device supports the HTML5 `audio` tag.
  30903. * @type {Boolean}
  30904. * @deprecated 5.0.0 Use `Audio` instead.
  30905. */
  30906. names: [
  30907. 'Audio',
  30908. 'AudioTag'
  30909. ],
  30910. fn: function() {
  30911. return !!this.getTestElement('audio').canPlayType;
  30912. }
  30913. },
  30914. {
  30915. /**
  30916. * @property Video `true` if the device supports the HTML5 `video` tag.
  30917. *
  30918. * This property is available at application boot time, before document ready.
  30919. * @type {Boolean}
  30920. */
  30921. name: 'Video',
  30922. fn: function() {
  30923. return !!this.getTestElement('video').canPlayType;
  30924. }
  30925. },
  30926. {
  30927. /**
  30928. * @property LocalStorage `true` if localStorage is supported.
  30929. *
  30930. * This property is available at application boot time, before document ready.
  30931. * @type {Boolean}
  30932. */
  30933. name: 'LocalStorage',
  30934. fn: function() {
  30935. try {
  30936. // IE10/Win8 throws "Access Denied" accessing window.localStorage, so
  30937. // this test needs to have a try/catch
  30938. /* eslint-disable-next-line dot-notation */
  30939. if ('localStorage' in window && window['localStorage'] !== null) {
  30940. // this should throw an error in private browsing mode in iOS as well
  30941. localStorage.setItem('sencha-localstorage-test', 'test success');
  30942. // clean up if setItem worked
  30943. localStorage.removeItem('sencha-localstorage-test');
  30944. return true;
  30945. }
  30946. } catch (e) {}
  30947. // ignore
  30948. return false;
  30949. }
  30950. },
  30951. {
  30952. /**
  30953. * @property {Boolean} XmlQuerySelector `true` if the browsers supports querySelector
  30954. * and querySelectorAll methods on XML nodes.
  30955. *
  30956. * This property is available at application boot time, before document ready.
  30957. */
  30958. name: 'XmlQuerySelector',
  30959. fn: function() {
  30960. var xmlString = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><root></root>',
  30961. xmlDoc;
  30962. // IE10 doesn't create IXMLDOMDocument via DOMParser
  30963. if (window.ActiveXObject) {
  30964. xmlDoc = new ActiveXObject("Microsoft.xmlDOM");
  30965. // eslint-disable-line no-undef
  30966. xmlDoc.async = false;
  30967. // eslint-disable-line id-blacklist
  30968. xmlDoc.loadXML(xmlString);
  30969. } else if (window.DOMParser) {
  30970. var parser = new DOMParser();
  30971. xmlDoc = parser.parseFromString(xmlString, 'text/xml');
  30972. }
  30973. return xmlDoc ? !!xmlDoc.lastChild.querySelector : false;
  30974. }
  30975. },
  30976. {
  30977. /**
  30978. * @property XHR2 `true` if the browser supports XMLHttpRequest
  30979. *
  30980. * This property is available at application boot time, before document ready.
  30981. * @type {Boolean}
  30982. */
  30983. name: 'XHR2',
  30984. fn: function() {
  30985. return window.ProgressEvent && window.FormData && window.XMLHttpRequest && ('withCredentials' in new XMLHttpRequest());
  30986. }
  30987. },
  30988. {
  30989. /**
  30990. * @property XHRUploadProgress `true` if the browser supports XMLHttpRequest
  30991. * upload progress info
  30992. *
  30993. * This property is available at application boot time, before document ready.
  30994. * @type {Boolean}
  30995. */
  30996. name: 'XHRUploadProgress',
  30997. fn: function() {
  30998. var xhr;
  30999. if (window.XMLHttpRequest && !Ext.browser.is.AndroidStock) {
  31000. xhr = new XMLHttpRequest();
  31001. return xhr && ('upload' in xhr) && ('onprogress' in xhr.upload);
  31002. }
  31003. return false;
  31004. }
  31005. },
  31006. {
  31007. /**
  31008. * @property NumericInputPlaceHolder `true` if the browser supports placeholders
  31009. * on numeric input fields
  31010. *
  31011. * This property is available at application boot time, before document ready.
  31012. * @type {Boolean}
  31013. */
  31014. name: 'NumericInputPlaceHolder',
  31015. fn: function() {
  31016. return !(Ext.browser.is.AndroidStock4 && Ext.os.version.getMinor() < 2);
  31017. }
  31018. },
  31019. {
  31020. /**
  31021. * @property {String} matchesSelector
  31022. * The method name which matches an element against a selector if implemented in this
  31023. * environment.
  31024. *
  31025. * This property is available at application boot time, before document ready.
  31026. */
  31027. name: 'matchesSelector',
  31028. fn: function() {
  31029. var el = document.documentElement,
  31030. w3 = 'matches',
  31031. wk = 'webkitMatchesSelector',
  31032. ms = 'msMatchesSelector',
  31033. mz = 'mozMatchesSelector';
  31034. return el[w3] ? w3 : el[wk] ? wk : el[ms] ? ms : el[mz] ? mz : null;
  31035. }
  31036. },
  31037. {
  31038. /**
  31039. * @property RightMargin `true` if the device supports right margin.
  31040. * See https://bugs.webkit.org/show_bug.cgi?id=13343 for why this is needed.
  31041. *
  31042. * This property is *NOT* available at application boot time. Only after the document
  31043. * ready event.
  31044. * @type {Boolean}
  31045. */
  31046. name: 'RightMargin',
  31047. ready: true,
  31048. fn: function(doc, div) {
  31049. var view = doc.defaultView;
  31050. /* eslint-disable-next-line max-len */
  31051. return !(view && view.getComputedStyle(div.firstChild.firstChild, null).marginRight !== '0px');
  31052. }
  31053. },
  31054. {
  31055. /**
  31056. * @property DisplayChangeInputSelectionBug `true` if INPUT elements lose their
  31057. * selection when their display style is changed. Essentially, if a text input
  31058. * has focus and its display style is changed, the I-beam disappears.
  31059. *
  31060. * This bug is encountered due to the work around in place for the {@link #RightMargin}
  31061. * bug. This has been observed in Safari 4.0.4 and older, and appears to be fixed
  31062. * in Safari 5. It's not clear if Safari 4.1 has the bug, but it has the same WebKit
  31063. * version number as Safari 5 (according to http://unixpapa.com/js/gecko.html).
  31064. *
  31065. * This property is available at application boot time, before document ready.
  31066. */
  31067. name: 'DisplayChangeInputSelectionBug',
  31068. fn: function() {
  31069. var webKitVersion = Ext.webKitVersion;
  31070. // WebKit but older than Safari 5 or Chrome 6:
  31071. return 0 < webKitVersion && webKitVersion < 533;
  31072. }
  31073. },
  31074. {
  31075. /**
  31076. * @property DisplayChangeTextAreaSelectionBug `true` if TEXTAREA elements lose their
  31077. * selection when their display style is changed. Essentially, if a text area has
  31078. * focus and its display style is changed, the I-beam disappears.
  31079. *
  31080. * This bug is encountered due to the work around in place for the {@link #RightMargin}
  31081. * bug. This has been observed in Chrome 10 and Safari 5 and older, and appears to
  31082. * be fixed in Chrome 11.
  31083. *
  31084. * This property is available at application boot time, before document ready.
  31085. */
  31086. name: 'DisplayChangeTextAreaSelectionBug',
  31087. fn: function() {
  31088. var webKitVersion = Ext.webKitVersion;
  31089. /*
  31090. Has bug w/textarea:
  31091. (Chrome) Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US)
  31092. AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.127
  31093. Safari/534.16
  31094. (Safari) Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us)
  31095. AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5
  31096. Safari/533.21.1
  31097. No bug:
  31098. (Chrome) Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7)
  31099. AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.57
  31100. Safari/534.24
  31101. */
  31102. return 0 < webKitVersion && webKitVersion < 534.24;
  31103. }
  31104. },
  31105. {
  31106. /**
  31107. * @property TransparentColor `true` if the device supports transparent color.
  31108. * @type {Boolean}
  31109. *
  31110. * This property is *NOT* available at application boot time. Only after the document
  31111. * ready event.
  31112. */
  31113. name: 'TransparentColor',
  31114. ready: true,
  31115. fn: function(doc, div, view) {
  31116. view = doc.defaultView;
  31117. /* eslint-disable-next-line max-len */
  31118. return !(view && view.getComputedStyle(div.lastChild, null).backgroundColor !== 'transparent');
  31119. }
  31120. },
  31121. {
  31122. /**
  31123. * @property ComputedStyle `true` if the browser supports
  31124. * document.defaultView.getComputedStyle().
  31125. * @type {Boolean}
  31126. *
  31127. * This property is *NOT* available at application boot time. Only after the document
  31128. * ready event.
  31129. */
  31130. name: 'ComputedStyle',
  31131. ready: true,
  31132. fn: function(doc, div, view) {
  31133. view = doc.defaultView;
  31134. return !!(view && view.getComputedStyle);
  31135. }
  31136. },
  31137. {
  31138. /**
  31139. * @property Float `true` if the device supports CSS float.
  31140. * @type {Boolean}
  31141. *
  31142. * This property is available at application boot time, before document ready.
  31143. */
  31144. name: 'Float',
  31145. fn: function(doc) {
  31146. return 'cssFloat' in doc.documentElement.style;
  31147. }
  31148. },
  31149. {
  31150. /**
  31151. * @property CSS3BorderRadius `true` if the device supports CSS3 border radius.
  31152. * @type {Boolean}
  31153. *
  31154. * This property is *NOT* available at application boot time. Only after the document
  31155. * ready event.
  31156. */
  31157. name: 'CSS3BorderRadius',
  31158. ready: true,
  31159. fn: function(doc) {
  31160. var domPrefixes = [
  31161. 'borderRadius',
  31162. 'BorderRadius',
  31163. 'MozBorderRadius',
  31164. 'WebkitBorderRadius',
  31165. 'OBorderRadius',
  31166. 'KhtmlBorderRadius'
  31167. ],
  31168. pass = false,
  31169. i;
  31170. for (i = 0; i < domPrefixes.length; i++) {
  31171. if (doc.documentElement.style[domPrefixes[i]] !== undefined) {
  31172. pass = true;
  31173. }
  31174. }
  31175. return pass && !Ext.isIE9;
  31176. }
  31177. },
  31178. {
  31179. /**
  31180. * @property CSS3LinearGradient `true` if the device supports CSS3 linear gradients.
  31181. * @type {Boolean}
  31182. *
  31183. * This property is available at application boot time, before document ready.
  31184. */
  31185. name: 'CSS3LinearGradient',
  31186. fn: function(doc, div) {
  31187. var property = 'background-image:',
  31188. webkit = '-webkit-gradient(linear, left top, right bottom, from(black), to(white))',
  31189. w3c = 'linear-gradient(left top, black, white)',
  31190. moz = '-moz-' + w3c,
  31191. ms = '-ms-' + w3c,
  31192. opera = '-o-' + w3c,
  31193. options = [
  31194. property + webkit,
  31195. property + w3c,
  31196. property + moz,
  31197. property + ms,
  31198. property + opera
  31199. ];
  31200. div.style.cssText = options.join(';');
  31201. return (("" + div.style.backgroundImage).indexOf('gradient') !== -1) && !Ext.isIE9;
  31202. }
  31203. },
  31204. {
  31205. /**
  31206. * @property MouseEnterLeave `true` if the browser supports mouseenter and mouseleave events
  31207. * @type {Boolean}
  31208. *
  31209. * This property is available at application boot time, before document ready.
  31210. */
  31211. name: 'MouseEnterLeave',
  31212. fn: function(doc) {
  31213. return ('onmouseenter' in doc.documentElement && 'onmouseleave' in doc.documentElement);
  31214. }
  31215. },
  31216. {
  31217. /**
  31218. * @property MouseWheel `true` if the browser supports the mousewheel event
  31219. * @type {Boolean}
  31220. *
  31221. * This property is available at application boot time, before document ready.
  31222. */
  31223. name: 'MouseWheel',
  31224. fn: function(doc) {
  31225. return ('onmousewheel' in doc.documentElement);
  31226. }
  31227. },
  31228. {
  31229. /**
  31230. * @property Opacity `true` if the browser supports normal css opacity
  31231. * @type {Boolean}
  31232. *
  31233. * This property is available at application boot time, before document ready.
  31234. */
  31235. name: 'Opacity',
  31236. fn: function(doc, div) {
  31237. // Not a strict equal comparison in case opacity can be converted to a number.
  31238. if (Ext.isIE8) {
  31239. return false;
  31240. }
  31241. div.firstChild.style.cssText = 'opacity:0.73';
  31242. return div.firstChild.style.opacity == '0.73';
  31243. }
  31244. },
  31245. // eslint-disable-line eqeqeq
  31246. {
  31247. /**
  31248. * @property Placeholder `true` if the browser supports the HTML5 placeholder attribute
  31249. * on inputs
  31250. * @type {Boolean}
  31251. *
  31252. * This property is available at application boot time, before document ready.
  31253. */
  31254. name: 'Placeholder',
  31255. fn: function(doc) {
  31256. return 'placeholder' in doc.createElement('input');
  31257. }
  31258. },
  31259. {
  31260. /**
  31261. * @property Direct2DBug `true` if when asking for an element's dimension via offsetWidth
  31262. * or offsetHeight, getBoundingClientRect, etc. the browser returns the subpixel width
  31263. * rounded to the nearest pixel.
  31264. *
  31265. * This property is available at application boot time, before document ready.
  31266. * @type {Boolean}
  31267. */
  31268. name: 'Direct2DBug',
  31269. fn: function(doc) {
  31270. return Ext.isString(doc.documentElement.style.msTransformOrigin) && Ext.isIE9m;
  31271. }
  31272. },
  31273. {
  31274. /**
  31275. * @property BoundingClientRect `true` if the browser supports the getBoundingClientRect
  31276. * method on elements
  31277. * @type {Boolean}
  31278. *
  31279. * This property is available at application boot time, before document ready.
  31280. */
  31281. name: 'BoundingClientRect',
  31282. fn: function(doc) {
  31283. return 'getBoundingClientRect' in doc.documentElement;
  31284. }
  31285. },
  31286. {
  31287. /**
  31288. * @property RotatedBoundingClientRect `true` if the BoundingClientRect is
  31289. * rotated when the element is rotated using a CSS transform.
  31290. * @type {Boolean}
  31291. *
  31292. * This property is *NOT* available at application boot time. Only after the document
  31293. * ready event.
  31294. */
  31295. name: 'RotatedBoundingClientRect',
  31296. ready: true,
  31297. fn: function(doc) {
  31298. var body = doc.body,
  31299. supports = false,
  31300. el = doc.createElement('div'),
  31301. style = el.style;
  31302. if (el.getBoundingClientRect) {
  31303. // If the document body already has child nodes (text nodes etc) we can end
  31304. // up with subpixel rounding errors in IE11 when measuring the height.
  31305. // Absolute positioning prevents this.
  31306. style.position = 'absolute';
  31307. style.top = "0";
  31308. style.WebkitTransform = style.MozTransform = style.msTransform = style.OTransform = style.transform = 'rotate(90deg)';
  31309. style.width = '100px';
  31310. style.height = '30px';
  31311. body.appendChild(el);
  31312. supports = el.getBoundingClientRect().height !== 100;
  31313. body.removeChild(el);
  31314. }
  31315. return supports;
  31316. }
  31317. },
  31318. {
  31319. /**
  31320. * @property ChildContentClearedWhenSettingInnerHTML `true` if created child elements
  31321. * lose their innerHTML when modifying the innerHTML of the parent element.
  31322. * @type {Boolean}
  31323. *
  31324. * This property is *NOT* available at application boot time. Only after the document
  31325. * ready event.
  31326. */
  31327. name: 'ChildContentClearedWhenSettingInnerHTML',
  31328. ready: true,
  31329. fn: function() {
  31330. var el = this.getTestElement(),
  31331. child;
  31332. el.innerHTML = '<div>a</div>';
  31333. child = el.firstChild;
  31334. el.innerHTML = '<div>b</div>';
  31335. return child.innerHTML !== 'a';
  31336. }
  31337. },
  31338. {
  31339. name: 'IncludePaddingInWidthCalculation',
  31340. ready: true,
  31341. fn: function(doc, div) {
  31342. return div.childNodes[1].firstChild.offsetWidth === 210;
  31343. }
  31344. },
  31345. {
  31346. name: 'IncludePaddingInHeightCalculation',
  31347. ready: true,
  31348. fn: function(doc, div) {
  31349. return div.childNodes[1].firstChild.offsetHeight === 210;
  31350. }
  31351. },
  31352. {
  31353. /**
  31354. * @property TextAreaMaxLength `true` if the browser supports maxlength on textareas.
  31355. * @type {Boolean}
  31356. *
  31357. * This property is available at application boot time, before document ready.
  31358. */
  31359. name: 'TextAreaMaxLength',
  31360. fn: function(doc) {
  31361. return ('maxlength' in doc.createElement('textarea'));
  31362. }
  31363. },
  31364. {
  31365. /**
  31366. * @property GetPositionPercentage `true` if the browser will return the
  31367. * left/top/right/bottom position as a percentage when explicitly set as a percentage value.
  31368. *
  31369. * This property is *NOT* available at application boot time. Only after the document
  31370. * ready event.
  31371. * @type {Boolean}
  31372. */
  31373. // Related bug: https://bugzilla.mozilla.org/show_bug.cgi?id=707691#c7
  31374. name: 'GetPositionPercentage',
  31375. ready: true,
  31376. fn: function(doc, div) {
  31377. return Ext.feature.getStyle(div.childNodes[2], 'left') === '10%';
  31378. }
  31379. },
  31380. {
  31381. /**
  31382. * @property {Boolean} PercentageHeightOverflowBug
  31383. * In some browsers (IE quirks, IE6, IE7, IE9, chrome, safari and opera at the time
  31384. * of this writing) a percentage-height element ignores the horizontal scrollbar
  31385. * of its parent element. This method returns true if the browser is affected
  31386. * by this bug.
  31387. *
  31388. * This property is *NOT* available at application boot time. Only after the document
  31389. * ready event.
  31390. * @private
  31391. */
  31392. name: 'PercentageHeightOverflowBug',
  31393. ready: true,
  31394. fn: function(doc) {
  31395. var hasBug = false,
  31396. style, el;
  31397. if (Ext.getScrollbarSize().height) {
  31398. // must have space-consuming scrollbars for bug to be possible
  31399. el = this.getTestElement('div', true);
  31400. style = el.style;
  31401. style.height = '50px';
  31402. style.width = '50px';
  31403. style.overflow = 'auto';
  31404. style.position = 'absolute';
  31405. /* eslint-disable indent */
  31406. el.innerHTML = [
  31407. '<div style="display:table;height:100%;">',
  31408. // The element that causes the horizontal overflow must be
  31409. // a child of the element with the 100% height, otherwise
  31410. // horizontal overflow is not triggered in webkit quirks mode
  31411. '<div style="width:51px;"></div>',
  31412. '</div>'
  31413. ].join('');
  31414. /* eslint-enable indent */
  31415. doc.body.appendChild(el);
  31416. if (el.firstChild.offsetHeight === 50) {
  31417. hasBug = true;
  31418. }
  31419. doc.body.removeChild(el);
  31420. }
  31421. return hasBug;
  31422. }
  31423. },
  31424. {
  31425. /**
  31426. * @property {Boolean} xOriginBug
  31427. * In Chrome 24.0, an RTL element which has vertical overflow positions its right X origin
  31428. * incorrectly. It skips a non-existent scrollbar which has been moved to the left edge
  31429. * due to the RTL setting.
  31430. *
  31431. * http://code.google.com/p/chromium/issues/detail?id=174656
  31432. *
  31433. * This method returns true if the browser is affected by this bug.
  31434. *
  31435. * This property is *NOT* available at application boot time. Only after the document
  31436. * ready event.
  31437. * @private
  31438. */
  31439. name: 'xOriginBug',
  31440. ready: true,
  31441. fn: function(doc, div) {
  31442. /* eslint-disable max-len */
  31443. div.innerHTML = '<div id="b1" style="height:100px;width:100px;direction:rtl;position:relative;overflow:scroll">' + '<div id="b2" style="position:relative;width:100%;height:20px;"></div>' + '<div id="b3" style="position:absolute;width:20px;height:20px;top:0px;right:0px"></div>' + '</div>';
  31444. /* eslint-enable max-len */
  31445. var outerBox = document.getElementById('b1').getBoundingClientRect(),
  31446. b2 = document.getElementById('b2').getBoundingClientRect(),
  31447. b3 = document.getElementById('b3').getBoundingClientRect();
  31448. return (b2.left !== outerBox.left && b3.right !== outerBox.right);
  31449. }
  31450. },
  31451. {
  31452. /**
  31453. * @property {Boolean} ScrollWidthInlinePaddingBug
  31454. * In some browsers the right padding of an overflowing element is not accounted
  31455. * for in its scrollWidth. The result can vary depending on whether or not
  31456. * The element contains block-level children. This method tests the effect
  31457. * of padding on scrollWidth when there are no block-level children inside the
  31458. * overflowing element.
  31459. *
  31460. * This method returns true if the browser is affected by this bug.
  31461. *
  31462. * This property is *NOT* available at application boot time. Only after the document
  31463. * ready event.
  31464. */
  31465. name: 'ScrollWidthInlinePaddingBug',
  31466. ready: true,
  31467. fn: function(doc) {
  31468. var hasBug = false,
  31469. style, el;
  31470. el = doc.createElement('div');
  31471. style = el.style;
  31472. style.height = '50px';
  31473. style.width = '50px';
  31474. style.padding = '10px';
  31475. style.overflow = 'hidden';
  31476. style.position = 'absolute';
  31477. el.innerHTML = '<span style="display:inline-block;zoom:1;height:60px;width:60px;"></span>';
  31478. doc.body.appendChild(el);
  31479. if (el.scrollWidth === 70) {
  31480. hasBug = true;
  31481. }
  31482. doc.body.removeChild(el);
  31483. return hasBug;
  31484. }
  31485. },
  31486. {
  31487. /**
  31488. * @property {Boolean} rtlVertScrollbarOnRight
  31489. * Safari, in RTL mode keeps the scrollbar at the right side.
  31490. * This means that when two elements must keep their left/right positions synched, if one
  31491. * has no vert scrollbar, it must have some extra padding.
  31492. * See https://sencha.jira.com/browse/EXTJSIV-11245
  31493. *
  31494. * This property is *NOT* available at application boot time. Only after the document
  31495. * ready event.
  31496. * @private
  31497. */
  31498. name: 'rtlVertScrollbarOnRight',
  31499. ready: true,
  31500. fn: function(doc, div) {
  31501. div.innerHTML = '<div style="height:100px;width:100px;direction:rtl;overflow:scroll">' + '<div style="width:20px;height:200px;"></div>' + '</div>';
  31502. var outerBox = div.firstChild,
  31503. innerBox = outerBox.firstChild;
  31504. /* eslint-disable-next-line max-len */
  31505. return (innerBox.offsetLeft + innerBox.offsetWidth !== outerBox.offsetLeft + outerBox.offsetWidth);
  31506. }
  31507. },
  31508. {
  31509. /**
  31510. * @property {Boolean} rtlVertScrollbarOverflowBug
  31511. * In Chrome, in RTL mode, horizontal overflow only into the vertical scrollbar does NOT
  31512. * trigger horizontal scrollability.
  31513. * See https://code.google.com/p/chromium/issues/detail?id=179332
  31514. * We need to detect this for when a grid header needs to have exactly the same horizontal
  31515. * scrolling range as its table view. See {@link Ext.grid.ColumnLayout#publishInnerCtSize}
  31516. * TODO: Remove this when all supported Chrome versions are fixed.
  31517. *
  31518. * This property is *NOT* available at application boot time. Only after the document
  31519. * ready event.
  31520. * @private
  31521. */
  31522. name: 'rtlVertScrollbarOverflowBug',
  31523. ready: true,
  31524. fn: function(doc, div) {
  31525. div.innerHTML = '<div style="height:100px;width:100px;direction:rtl;overflow:auto">' + '<div style="width:95px;height:200px;"></div>' + '</div>';
  31526. // If the bug is present, the 95 pixel wide inner div, encroaches into the
  31527. // vertical scrollbar, but does NOT trigger horizontal overflow, so the clientHeight
  31528. // remains equal to the offset height.
  31529. var outerBox = div.firstChild,
  31530. style = div.style,
  31531. pos = style.position;
  31532. // This issue seems to require a repaint to measure correctly
  31533. style.position = 'absolute';
  31534. // eslint-disable-next-line no-unused-expressions
  31535. outerBox.offsetHeight;
  31536. style.position = pos;
  31537. return outerBox.clientHeight === outerBox.offsetHeight;
  31538. }
  31539. },
  31540. {
  31541. identity: 'defineProperty',
  31542. fn: function() {
  31543. if (Ext.isIE8m) {
  31544. Ext.Object.defineProperty = Ext.emptyFn;
  31545. return false;
  31546. }
  31547. return true;
  31548. }
  31549. },
  31550. {
  31551. identify: 'nativeXhr',
  31552. fn: function() {
  31553. if (typeof XMLHttpRequest !== 'undefined') {
  31554. return true;
  31555. }
  31556. // Apply a polyfill:
  31557. XMLHttpRequest = function() {
  31558. // eslint-disable-line no-global-assign
  31559. try {
  31560. // eslint-disable-next-line no-undef
  31561. return new ActiveXObject('MSXML2.XMLHTTP.3.0');
  31562. } catch (ex) {
  31563. return null;
  31564. }
  31565. };
  31566. return false;
  31567. }
  31568. },
  31569. {
  31570. /**
  31571. * @property {Boolean} SpecialKeyDownRepeat
  31572. * True if the browser fires the keydown event on specialkey autorepeat
  31573. *
  31574. * note 1: IE fires ONLY the keydown event on specialkey autorepeat
  31575. * note 2: Safari < 3.1, Gecko (Mac/Linux) & Opera fire only the keypress event on
  31576. * specialkey autorepeat (research done by Jan Wolter at
  31577. * http://unixpapa.com/js/key.html)
  31578. * note 3: Opera 12 behaves like other modern browsers so this workaround does not
  31579. * work anymore
  31580. *
  31581. * This property is available at application boot time, before document ready.
  31582. */
  31583. name: 'SpecialKeyDownRepeat',
  31584. fn: function() {
  31585. return Ext.isWebKit ? parseInt(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1], 10) >= 525 : !(!(Ext.isGecko || Ext.isIE || Ext.isEdge) || (Ext.isOpera && Ext.operaVersion < 12));
  31586. }
  31587. },
  31588. // eslint-disable-line max-len
  31589. {
  31590. /**
  31591. * @property {Boolean} EmulatedMouseOver
  31592. * True if the browser emulates a mouseover event on tap (mobile safari)
  31593. *
  31594. * This property is available at application boot time, before document ready.
  31595. */
  31596. name: 'EmulatedMouseOver',
  31597. fn: function() {
  31598. // TODO: is it possible to feature detect this?
  31599. return Ext.os.is.iOS;
  31600. }
  31601. },
  31602. {
  31603. /**
  31604. * @property Hashchange True if the user agent supports the hashchange event
  31605. *
  31606. * This property is available at application boot time, before document ready.
  31607. * @type {Boolean}
  31608. */
  31609. // support Vector 12
  31610. name: 'Hashchange',
  31611. fn: function() {
  31612. // Note that IE8 in IE7 compatibility mode reports true for 'onhashchange' in window,
  31613. // so also test documentMode
  31614. var docMode = document.documentMode;
  31615. return 'onhashchange' in window && (docMode === undefined || docMode > 7);
  31616. }
  31617. },
  31618. {
  31619. /**
  31620. * @property FixedTableWidthBug
  31621. * @private
  31622. * @type {Boolean}
  31623. * `true` if the browser has this bug: https://bugs.webkit.org/show_bug.cgi?id=130239
  31624. *
  31625. * This property is *NOT* available at application boot time. Only after the document
  31626. * ready event.
  31627. */
  31628. name: 'FixedTableWidthBug',
  31629. ready: true,
  31630. fn: function() {
  31631. if (Ext.isIE8) {
  31632. // IE8 incorrectly detects that we have this bug.
  31633. return false;
  31634. }
  31635. var outer = document.createElement('div'),
  31636. inner = document.createElement('div'),
  31637. width;
  31638. outer.setAttribute('style', 'display:table;table-layout:fixed;');
  31639. inner.setAttribute('style', 'display:table-cell;min-width:50px;');
  31640. outer.appendChild(inner);
  31641. document.body.appendChild(outer);
  31642. // must poke offsetWidth to trigger a reflow before setting width
  31643. // eslint-disable-next-line no-unused-expressions
  31644. outer.offsetWidth;
  31645. outer.style.width = '25px';
  31646. width = outer.offsetWidth;
  31647. document.body.removeChild(outer);
  31648. return width === 50;
  31649. }
  31650. },
  31651. {
  31652. /**
  31653. * @property FocusinFocusoutEvents
  31654. * @private
  31655. * @type {Boolean}
  31656. * `true` if the browser supports focusin and focusout events:
  31657. * https://developer.mozilla.org/en-US/docs/Web/Events/focusin
  31658. * At this point, only Firefox does not, see this bug:
  31659. * https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  31660. *
  31661. * This property is available at application boot time, before document ready.
  31662. */
  31663. name: 'FocusinFocusoutEvents',
  31664. fn: function() {
  31665. // There is no reliable way to feature detect focusin/focusout event support.
  31666. // window.onfocusin will return undefined both in Chrome (where it is supported)
  31667. // and in Firefox (where it is not supported); adding an element and trying to
  31668. // focus it will fail when the browser window itself is not focused.
  31669. return !(Ext.isGecko && Ext.firefoxVersion < 52);
  31670. }
  31671. },
  31672. {
  31673. /**
  31674. * @property {Boolean} AsyncFocusEvents
  31675. * `true` if the browser fires focus events (focus, blur, focusin, focusout)
  31676. * asynchronously, i.e. in a separate event loop invocation. This is only true
  31677. * for all versions Internet Explorer; Microsoft Edge and other browsers fire
  31678. * focus events synchronously.
  31679. */
  31680. name: 'AsyncFocusEvents',
  31681. fn: function() {
  31682. // The sad part is that we can't feature detect this because the focus
  31683. // event won't be fired when the browser window itself is not focused.
  31684. // Private shortcut for brevity
  31685. return Ext.asyncFocus = !!Ext.isIE;
  31686. }
  31687. },
  31688. {
  31689. /**
  31690. * @property {Object} accessibility Accessibility features.
  31691. *
  31692. * @property {Boolean} accessibility.Images `true` if the browser is configured
  31693. * to display images.
  31694. *
  31695. * @property {Boolean} accessibility.BackgroundImages `true` if the browser
  31696. * is configured to display background images.
  31697. *
  31698. * @property {Boolean} accessibility.BorderColors `true` if the browser
  31699. * is configured to honor CSS styling for border colors.
  31700. *
  31701. * @property {Boolean} accessibility.LightOnDark `true` if the browser
  31702. * is currently using reverse colors in light-on-dark accessibility mode.
  31703. */
  31704. name: 'accessibility',
  31705. ready: true,
  31706. fn: function(doc) {
  31707. var body = doc.body,
  31708. div, img, style, supports, bgImg;
  31709. function getColor(colorTxt) {
  31710. var values = [],
  31711. colorValue = 0,
  31712. regex, match;
  31713. if (colorTxt.indexOf('rgb(') !== -1) {
  31714. values = colorTxt.replace('rgb(', '').replace(')', '').split(', ');
  31715. } else if (colorTxt.indexOf('#') !== -1) {
  31716. regex = colorTxt.length === 7 ? /^#(\S\S)(\S\S)(\S\S)$/ : /^#(\S)(\S)(\S)$/;
  31717. match = colorTxt.match(regex);
  31718. if (match) {
  31719. values = [
  31720. '0x' + match[1],
  31721. '0x' + match[2],
  31722. '0x' + match[3]
  31723. ];
  31724. }
  31725. }
  31726. for (var i = 0; i < values.length; i++) {
  31727. colorValue += parseInt(values[i]);
  31728. }
  31729. return colorValue;
  31730. }
  31731. div = doc.createElement('div');
  31732. img = doc.createElement('img');
  31733. style = div.style;
  31734. Ext.apply(style, {
  31735. width: '2px',
  31736. position: 'absolute',
  31737. clip: 'rect(1px,1px,1px,1px)',
  31738. borderWidth: '1px',
  31739. borderStyle: 'solid',
  31740. borderTopTolor: '#f00',
  31741. borderRightColor: '#ff0',
  31742. backgroundColor: '#fff',
  31743. backgroundImage: 'url(' + Ext.BLANK_IMAGE_URL + ')'
  31744. });
  31745. img.alt = '';
  31746. img.src = Ext.BLANK_IMAGE_URL;
  31747. div.appendChild(img);
  31748. body.appendChild(div);
  31749. // Now check if the styles were indeed honored
  31750. style = div.currentStyle || div.style;
  31751. bgImg = style.backgroundImage;
  31752. supports = {
  31753. // In IE it is possible to untick "Show pictures" option in Advanced
  31754. // settings; this will result in img element reporting its readyState
  31755. // as 'uninitialized'.
  31756. // See http://www.paciellogroup.com/blog/2011/10/detecting-if-images-are-disabled-in-browsers/
  31757. Images: img.offsetWidth === 1 && img.readyState !== 'uninitialized',
  31758. BackgroundImages: !(bgImg !== null && (bgImg === "none" || bgImg === "url(invalid-url:)")),
  31759. BorderColors: style.borderTopColor !== style.borderRightColor,
  31760. LightOnDark: getColor(style.color) - getColor(style.backgroundColor) > 0
  31761. };
  31762. Ext.supports.HighContrastMode = !supports.BackgroundImages;
  31763. body.removeChild(div);
  31764. div = img = null;
  31765. return supports;
  31766. }
  31767. },
  31768. {
  31769. /**
  31770. * @property ViewportUnits `true` if the device supports ViewportUnits.
  31771. * @type {Boolean}
  31772. *
  31773. */
  31774. name: 'ViewportUnits',
  31775. ready: true,
  31776. fn: function(doc) {
  31777. // Even attempting to detect the feature throws a fatal error on IE8
  31778. if (Ext.isIE8) {
  31779. return false;
  31780. }
  31781. var body = doc.body,
  31782. div = document.createElement('div'),
  31783. style = div.currentStyle || div.style,
  31784. width, divWidth;
  31785. body.appendChild(div);
  31786. Ext.apply(style, {
  31787. width: '50vw'
  31788. });
  31789. width = parseInt(window.innerWidth / 2, 10);
  31790. // eslint-disable-next-line max-len
  31791. divWidth = parseInt((window.getComputedStyle ? getComputedStyle(div, null) : div.currentStyle).width, 10);
  31792. body.removeChild(div);
  31793. div = null;
  31794. return width === divWidth;
  31795. }
  31796. },
  31797. {
  31798. name: 'CSSVariables',
  31799. ready: false,
  31800. fn: function() {
  31801. // Legacy browsers do not have this method.
  31802. if (!window.getComputedStyle) {
  31803. return false;
  31804. }
  31805. return window.CSS && window.CSS.supports && window.CSS.supports('--test-var', 0);
  31806. }
  31807. },
  31808. {
  31809. /**
  31810. * @property Selectors2 `true` if the browser supports the CSS selector API level 2.
  31811. * https://dev.w3.org/2006/webapi/selectors-api2/
  31812. * @type {Boolean}
  31813. *
  31814. */
  31815. name: 'Selectors2',
  31816. ready: false,
  31817. fn: function(doc) {
  31818. try {
  31819. return !!doc.querySelectorAll(':scope');
  31820. } catch (e) {
  31821. return false;
  31822. }
  31823. }
  31824. },
  31825. {
  31826. /**
  31827. * @property CSSScrollSnap
  31828. * @private
  31829. * @type {Boolean}
  31830. */
  31831. name: 'CSSScrollSnap',
  31832. ready: false,
  31833. fn: function(doc) {
  31834. var style = doc.documentElement.style;
  31835. return 'scrollSnapType' in style || 'webkitScrollSnapType' in style || 'msScrollSnapType' in style;
  31836. }
  31837. },
  31838. {
  31839. /**
  31840. * @property TranslateYCausesHorizontalScroll
  31841. * @private
  31842. * @type {Boolean}
  31843. *
  31844. * Bug for Edge logged here: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9743268/
  31845. */
  31846. name: 'TranslateYCausesHorizontalScroll',
  31847. ready: true,
  31848. fn: function(doc, div) {
  31849. div.innerHTML = '<div style="position: relative; overflow: auto; height: 200px; width: 200px;">' + // eslint-disable-line max-len
  31850. '<div>' + '<div style="transform: translateY(260px); width: 50px;">a</div>' + '</div>' + '</div>';
  31851. return div.firstChild.scrollWidth > div.firstChild.clientWidth;
  31852. }
  31853. },
  31854. {
  31855. /**
  31856. * @property FlexBoxBasisBug
  31857. * @private
  31858. * @type {Boolean}
  31859. * Allows align: stretch to align items to the height of the tallest item
  31860. * in an auto-heighted hbox layout.
  31861. * can't use flex-basis: auto everywhere because it breaks percentage-sized children
  31862. * https://bugs.chromium.org/p/chromium/issues/detail?id=680484
  31863. */
  31864. name: 'FlexBoxBasisBug',
  31865. ready: true,
  31866. fn: function() {
  31867. if (Ext.isIE11 || (Ext.os.is.iOS && Ext.os.version.major <= 10) || (Ext.isSafari && Ext.browser.version.isLessThan(11)) || (Ext.os.is.Android && Ext.os.version.isLessThan(6))) {
  31868. return true;
  31869. }
  31870. return false;
  31871. }
  31872. },
  31873. {
  31874. /**
  31875. * @property PercentageSizeFlexBug
  31876. * @private
  31877. * @type {Boolean}
  31878. *
  31879. * Detects https://bugs.webkit.org/show_bug.cgi?id=137730
  31880. */
  31881. name: 'PercentageSizeFlexBug',
  31882. ready: true,
  31883. fn: function(doc, div) {
  31884. if (Ext.isIE9m) {
  31885. return false;
  31886. }
  31887. var style = div.style;
  31888. style.display = 'flex';
  31889. style.flexDirection = 'column';
  31890. style.height = style.width = '100px';
  31891. div.innerHTML = '<div style="flex: 1 1;"><div style="height:50%"></div></div>';
  31892. return div.firstChild.firstChild.offsetHeight !== 50;
  31893. }
  31894. },
  31895. {
  31896. /**
  31897. * @property CannotScrollExactHeight
  31898. * @type {Boolean}
  31899. *
  31900. * Feature detect the support of browsers that are unable to scroll elements that are
  31901. * the same height as the native scrollbar height.
  31902. */
  31903. name: 'CannotScrollExactHeight',
  31904. fn: function() {
  31905. return Ext.isIE10p;
  31906. }
  31907. },
  31908. {
  31909. /**
  31910. * @property WebKitTextInputMarginBug
  31911. * @private
  31912. * @type {Boolean}
  31913. *
  31914. * Detects the following bug:
  31915. * https://bugs.webkit.org/show_bug.cgi?id=137693
  31916. *
  31917. * Feb 22, 2017: This bug used to affect chrome as well, but appears to be fixed in
  31918. * Chrome 56. The issue still exists in safari 10
  31919. */
  31920. name: 'WebKitInputTableBoxModelBug',
  31921. ready: true,
  31922. fn: function(doc, div) {
  31923. var table = document.createElement('div'),
  31924. cell = document.createElement('div'),
  31925. input = document.createElement('input'),
  31926. tableStyle = table.style,
  31927. cellStyle = cell.style,
  31928. inputStyle = input.style,
  31929. body = doc.body,
  31930. hasBug;
  31931. input.type = 'text';
  31932. tableStyle.display = 'table';
  31933. tableStyle.height = '100px';
  31934. cellStyle.display = 'table-cell';
  31935. inputStyle.border = '0';
  31936. inputStyle.padding = '10px';
  31937. inputStyle.boxSizing = 'border-box';
  31938. inputStyle.height = '100%';
  31939. cell.appendChild(input);
  31940. table.appendChild(cell);
  31941. body.appendChild(table);
  31942. hasBug = input.offsetHeight === 80;
  31943. body.removeChild(table);
  31944. return hasBug;
  31945. }
  31946. },
  31947. {
  31948. /**
  31949. * @property PassiveEventListener
  31950. * @private
  31951. * @type {Boolean}
  31952. *
  31953. * Detects support for the "passive" event listener option
  31954. */
  31955. name: 'PassiveEventListener',
  31956. fn: function(doc, div) {
  31957. var supportsPassive = false,
  31958. options;
  31959. try {
  31960. options = Object.defineProperty({}, 'passive', {
  31961. get: function() {
  31962. // eslint-disable-line getter-return
  31963. supportsPassive = true;
  31964. }
  31965. });
  31966. window.addEventListener('e', null, options);
  31967. window.removeEventListener('e', null, options);
  31968. } catch (e) {}
  31969. // ignore
  31970. return supportsPassive;
  31971. }
  31972. },
  31973. {
  31974. /**
  31975. * @property MinContent
  31976. * @private
  31977. * @type {Boolean}
  31978. *
  31979. * Detects support for CSS "min-content"
  31980. */
  31981. name: 'CSSMinContent',
  31982. ready: true,
  31983. fn: function(doc, div) {
  31984. // As of 3/24/2017 IE/Edge have no min-content support, and firefox has
  31985. // partial/buggy support: https://bugzilla.mozilla.org/show_bug.cgi?id=135015
  31986. // This feature detector is designed to return false if there is not "full" support.
  31987. // eslint-disable-next-line max-len
  31988. div.innerHTML = '<div style="height:4px;width:4px;min-height:-webkit-min-content;min-height:-moz-min-content;min-height:min-content"><div style="height:8px;width:8px"></div></div>';
  31989. return div.firstChild.offsetHeight === 8;
  31990. }
  31991. },
  31992. {
  31993. name: 'ComputedSizeIncludesPadding',
  31994. ready: true,
  31995. fn: function(doc, div) {
  31996. var ret = false,
  31997. bd = document.body,
  31998. el, w;
  31999. if (window.getComputedStyle) {
  32000. el = document.createElement('div');
  32001. el.style.cssText = 'width:10px;padding:2px;' + '-webkit-box-sizing:border-box;box-sizing:border-box;';
  32002. bd.appendChild(el);
  32003. w = window.getComputedStyle(el, null).width;
  32004. ret = w === '10px';
  32005. bd.removeChild(el);
  32006. }
  32007. return ret;
  32008. }
  32009. },
  32010. {
  32011. name: 'inputEventData',
  32012. ready: false,
  32013. fn: function() {
  32014. return !!(window.InputEvent && 'data' in new InputEvent('input'));
  32015. }
  32016. },
  32017. /* eslint-disable indent */
  32018. // placeholder so legacy browser detectors can come/go cleanly
  32019. 0
  32020. ]
  32021. };
  32022. /* eslint-enable indent */
  32023. Ext.feature.tests.pop();
  32024. // remove the placeholder
  32025. Ext.supports = {};
  32026. Ext.feature.detect();
  32027. /**
  32028. * This class manages ready detection and handling. Direct use of this class is not
  32029. * recommended. Instead use `Ext.onReady`:
  32030. *
  32031. * Ext.onReady(function () {
  32032. * // DOM and Framework are ready...
  32033. * });
  32034. *
  32035. * ## DOM Ready
  32036. *
  32037. * The lowest-level of readiness is DOM readiness. This level implies only that the document
  32038. * body exists. Many things require the DOM to be ready for manipulation. If that is all
  32039. * that is required, the `Ext.onDocumentReady` method can be called to register a callback
  32040. * to be called as soon as the DOM is ready:
  32041. *
  32042. * Ext.onDocumentReady(function () {
  32043. * // the document body is ready
  32044. * });
  32045. *
  32046. * ## Framework Ready
  32047. *
  32048. * In production builds of applications it is common to have all of the code loaded before
  32049. * DOM ready, so the need to wait for "onReady" is often confused with only that concern.
  32050. * This is easy to understand, at least in part because historically `Ext.onReady` only
  32051. * waited for DOM ready.
  32052. *
  32053. * With the introduction of `Ext.Loader`, however, it became common for DOM ready to occur
  32054. * in the middle of dynamically loading code. If application code were executed at that
  32055. * time, any use of the yet-to-be-loaded classes would throw errors. As a consequence of
  32056. * this, the `Ext.onReady` mechanism was extended to wait for both DOM ready *and* all of
  32057. * the required classes to be loaded.
  32058. *
  32059. * When the framework enters or leaves a state where it is not ready (for example, the
  32060. * first dynamic load is requested or last load completes), `Ext.env.Ready` is informed.
  32061. * For example:
  32062. *
  32063. * Ext.env.Ready.block();
  32064. *
  32065. * //...
  32066. *
  32067. * Ext.env.Ready.unblock();
  32068. *
  32069. * When there are no blocks and the DOM is ready, the Framework is ready and the "onReady"
  32070. * callbacks are called.
  32071. *
  32072. * Priority can be used to control the ordering of onReady listeners, for example:
  32073. *
  32074. * Ext.onReady(function() {
  32075. *
  32076. * }, null, {
  32077. * priority: 100
  32078. * });
  32079. *
  32080. * Ready listeners with higher priorities will run sooner than those with lower priorities,
  32081. * the default priority being `0`. Internally the framework reserves priorities of 1000
  32082. * or greater, and -1000 or lesser for onReady handlers that must run before or after
  32083. * any application code. Applications should stick to using priorities in the -999 - 999
  32084. * range. The following priorities are currently in use by the framework:
  32085. *
  32086. * - Element_scroll rtl override: `1001`
  32087. * - Event system initialization: `2000`
  32088. * - Ext.dom.Element: `1500`
  32089. *
  32090. * @class Ext.env.Ready
  32091. * @singleton
  32092. * @private
  32093. * @since 5.0.0
  32094. */
  32095. Ext.env.Ready = {
  32096. // @define Ext.env.Ready
  32097. // @require Ext.env.Browser
  32098. // @require Ext.env.OS
  32099. // @require Ext.env.Feature
  32100. /**
  32101. * @property {Number} blocks The number of Framework readiness blocks.
  32102. * @private
  32103. */
  32104. blocks: (location.search || '').indexOf('ext-pauseReadyFire') > 0 ? 1 : 0,
  32105. /**
  32106. * @property {Number} bound This property stores the state of event listeners bound
  32107. * to the document or window to detect ready state.
  32108. * @private
  32109. */
  32110. bound: 0,
  32111. /**
  32112. * @property {Number} [delay=1]
  32113. * This allows the DOM listener thread to complete (usually desirable with mobWebkit,
  32114. * Gecko) before firing the entire onReady chain (high stack load on Loader). For mobile
  32115. * devices when running from Home Screen, the splash screen will not disappear until
  32116. * all external resource requests finish. This delay clears the splash screen.
  32117. * @private
  32118. */
  32119. delay: 1,
  32120. /**
  32121. * @property {Event[]} events An array of events that have triggered ready state. This
  32122. * is for diagnostic purposes only and is only available in debug builds.
  32123. * An array
  32124. * @private
  32125. */
  32126. events: [],
  32127. /**
  32128. * @property {Boolean} firing This property is `true` when we currently calling the
  32129. * listeners.
  32130. * @private
  32131. */
  32132. firing: false,
  32133. /**
  32134. * @property {Number} generation A counter of the number of mutations of `listeners`.
  32135. * @private
  32136. */
  32137. generation: 0,
  32138. /**
  32139. * @property {Object[]} listeners The set of listeners waiting for ready.
  32140. * @private
  32141. */
  32142. listeners: [],
  32143. /**
  32144. * @property {Number} nextId A counter so we can assign listeners an `id` to keep
  32145. * them in FIFO order.
  32146. * @private
  32147. */
  32148. nextId: 0,
  32149. /**
  32150. * @property {Number} sortGeneration A captured value of `generation` that indicates
  32151. * when the `listeners` were last sorted.
  32152. * @private
  32153. */
  32154. sortGeneration: 0,
  32155. /**
  32156. * @property {Number} state
  32157. * Holds the current ready state as managed by this class. The values possible are:
  32158. *
  32159. * * 0 - Not ready.
  32160. * * 1 - Ready detected but listeners are not yet notified.
  32161. * * 2 - Ready detected and listeners are notified. See also `firing`.
  32162. *
  32163. * @private
  32164. */
  32165. state: 0,
  32166. /**
  32167. * @property {Object} timer The handle from `setTimeout` for the delayed notification
  32168. * of ready.
  32169. * @private
  32170. */
  32171. timer: null,
  32172. /**
  32173. * Binds the appropriate browser event for checking if the DOM has loaded.
  32174. * @private
  32175. */
  32176. bind: function() {
  32177. var me = Ext.env.Ready,
  32178. doc = document;
  32179. if (!me.bound) {
  32180. // Test scenario where load is dynamic AFTER window.load
  32181. if (doc.readyState === 'complete') {
  32182. // Firefox4+ got support for this state, others already do.
  32183. me.onReadyEvent({
  32184. type: doc.readyState || 'body'
  32185. });
  32186. } else {
  32187. me.bound = 1;
  32188. if (Ext.browser.is.PhoneGap && !Ext.os.is.Desktop) {
  32189. me.bound = 2;
  32190. doc.addEventListener('deviceready', me.onReadyEvent, false);
  32191. }
  32192. doc.addEventListener('DOMContentLoaded', me.onReadyEvent, false);
  32193. window.addEventListener('load', me.onReadyEvent, false);
  32194. }
  32195. }
  32196. },
  32197. block: function() {
  32198. ++this.blocks;
  32199. Ext.isReady = false;
  32200. },
  32201. /**
  32202. * This method starts the process of firing the ready event. This may be delayed based
  32203. * on the `delay` property.
  32204. * @private
  32205. */
  32206. fireReady: function() {
  32207. var me = Ext.env.Ready;
  32208. if (!me.state) {
  32209. Ext._readyTime = Ext.ticks();
  32210. Ext.isDomReady = true;
  32211. me.state = 1;
  32212. // As soon as we transition to domready, complete the feature detection:
  32213. Ext.feature.detect(true);
  32214. if (!me.delay) {
  32215. me.handleReady();
  32216. } else if (navigator.standalone) {
  32217. // When running from Home Screen, the splash screen will not disappear
  32218. // until all external resource requests finish.
  32219. // The first timeout clears the splash screen
  32220. // The second timeout allows inital HTML content to be displayed
  32221. me.timer = Ext.defer(function() {
  32222. me.timer = null;
  32223. me.handleReadySoon();
  32224. }, 1);
  32225. } else {
  32226. me.handleReadySoon();
  32227. }
  32228. }
  32229. },
  32230. /**
  32231. * This method iterates over the `listeners` and invokes them. This advances the
  32232. * `state` from 1 to 2 and ensure the proper subset of `listeners` are invoked.
  32233. * @private
  32234. */
  32235. handleReady: function() {
  32236. var me = this;
  32237. if (me.state === 1) {
  32238. me.state = 2;
  32239. Ext._beforeReadyTime = Ext.ticks();
  32240. me.invokeAll();
  32241. Ext._afterReadyTime = Ext.ticks();
  32242. }
  32243. },
  32244. /**
  32245. * This method is called to schedule a call to `handleReady` using a `setTimeout`. It
  32246. * ensures that only one timer is pending.
  32247. * @param {Number} [delay] If passed, this overrides the `delay` property.
  32248. * @private
  32249. */
  32250. handleReadySoon: function(delay) {
  32251. var me = this;
  32252. if (!me.timer) {
  32253. me.timer = Ext.defer(function() {
  32254. me.timer = null;
  32255. me.handleReady();
  32256. }, delay || me.delay);
  32257. }
  32258. },
  32259. /**
  32260. * This method invokes the given `listener` instance based on its options.
  32261. * @param {Object} listener
  32262. */
  32263. invoke: function(listener) {
  32264. var delay = listener.delay;
  32265. if (delay) {
  32266. Ext.defer(listener.fn, delay, listener.scope);
  32267. } else {
  32268. if (Ext.elevateFunction) {
  32269. Ext.elevateFunction(listener.fn, listener.scope);
  32270. } else {
  32271. listener.fn.call(listener.scope);
  32272. }
  32273. }
  32274. },
  32275. /**
  32276. * Invokes as many listeners as are appropriate given the current state. This should
  32277. * only be called when DOM ready is achieved. The remaining business of `blocks` is
  32278. * handled here.
  32279. */
  32280. invokeAll: function() {
  32281. if (Ext.elevateFunction) {
  32282. Ext.elevateFunction(this.doInvokeAll, this);
  32283. } else {
  32284. this.doInvokeAll();
  32285. }
  32286. },
  32287. doInvokeAll: function() {
  32288. var me = this,
  32289. listeners = me.listeners,
  32290. listener;
  32291. if (!me.blocks) {
  32292. // Since DOM is ready and we have no blocks, we mark the framework as ready.
  32293. Ext.isReady = true;
  32294. }
  32295. me.firing = true;
  32296. // NOTE: We cannot cache this length because each time through the loop a callback
  32297. // may have added new callbacks.
  32298. while (listeners.length) {
  32299. if (me.sortGeneration !== me.generation) {
  32300. me.sortGeneration = me.generation;
  32301. // This will happen just once on the first pass... if nothing is being
  32302. // added as we call the callbacks. This sorts the listeners such that the
  32303. // highest priority listener is at the *end* of the array ... so we can
  32304. // use pop (as opposed to shift) to extract it.
  32305. listeners.sort(me.sortFn);
  32306. }
  32307. listener = listeners.pop();
  32308. if (me.blocks && !listener.dom) {
  32309. // If we are blocked (i.e., only DOM ready) and this listener is not a
  32310. // DOM-ready listener we have reached the end of the line. The remaining
  32311. // listeners are Framework ready listeners.
  32312. listeners.push(listener);
  32313. break;
  32314. }
  32315. me.invoke(listener);
  32316. }
  32317. me.firing = false;
  32318. },
  32319. /**
  32320. * This method wraps the given listener pieces in a proper object for the `listeners`
  32321. * array and `invoke` methods.
  32322. * @param {Function} fn The method to call.
  32323. * @param {Object} [scope] The scope (`this` reference) in which the `fn` executes.
  32324. * Defaults to the browser window.
  32325. * @param {Object} [options] An object with extra options.
  32326. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  32327. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  32328. * number will result in the callback being sorted before the others. Priorities
  32329. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  32330. * @param {Boolean} [options.dom=false] Pass `true` to only wait for DOM ready, `false`
  32331. * means full Framework and DOM readiness.
  32332. * @return {Object} The listener instance.
  32333. * @private
  32334. */
  32335. makeListener: function(fn, scope, options) {
  32336. var ret = {
  32337. fn: fn,
  32338. id: ++this.nextId,
  32339. // so sortFn can respect FIFO
  32340. scope: scope,
  32341. dom: false,
  32342. priority: 0
  32343. };
  32344. if (options) {
  32345. Ext.apply(ret, options);
  32346. }
  32347. ret.phase = ret.dom ? 0 : 1;
  32348. // to simplify the sortFn
  32349. return ret;
  32350. },
  32351. /**
  32352. * Adds a listener to be notified when the document is ready (before onload and before
  32353. * images are loaded).
  32354. *
  32355. * @param {Function} fn The method to call.
  32356. * @param {Object} [scope] The scope (`this` reference) in which the `fn` executes.
  32357. * Defaults to the browser window.
  32358. * @param {Object} [options] An object with extra options.
  32359. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  32360. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  32361. * number will result in the callback being sorted before the others. Priorities
  32362. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  32363. * @param {Boolean} [options.dom=false] Pass `true` to only wait for DOM ready, `false`
  32364. * means full Framework and DOM readiness.
  32365. * @private
  32366. */
  32367. on: function(fn, scope, options) {
  32368. var me = Ext.env.Ready,
  32369. listener = me.makeListener(fn, scope, options);
  32370. if (me.state === 2 && !me.firing && (listener.dom || !me.blocks)) {
  32371. // If we are DOM ready (state === 2) and not currently in invokeAll (!firing)
  32372. // and this listener is ready to call (either a DOM ready listener or there
  32373. // are no blocks), then we need to invoke the listener now.
  32374. //
  32375. // Otherwise we can fall to the else block and push the listener. The eventual
  32376. // (or currently executing) call to handleReady or unblock will trigger its
  32377. // delivery in proper priority order.
  32378. me.invoke(listener);
  32379. } else {
  32380. me.listeners.push(listener);
  32381. ++me.generation;
  32382. if (!me.bound) {
  32383. // If we have never bound then bind the ready event now. If we have unbound
  32384. // the event then me.bound == -1 and we don't want to rebind it as the DOM
  32385. // is ready.
  32386. me.bind();
  32387. }
  32388. }
  32389. },
  32390. /**
  32391. * This is a generic event handler method attached to all of the various events that
  32392. * may indicate ready state. The first call to this method indicates ready state has
  32393. * been achieved.
  32394. * @param {Event} [ev] The event instance.
  32395. * @private
  32396. */
  32397. onReadyEvent: function(ev) {
  32398. var me = Ext.env.Ready;
  32399. if (Ext.elevateFunction) {
  32400. Ext.elevateFunction(me.doReadyEvent, me, arguments);
  32401. } else {
  32402. me.doReadyEvent(ev);
  32403. }
  32404. },
  32405. doReadyEvent: function(ev) {
  32406. var me = this;
  32407. if (ev && ev.type) {
  32408. me.events.push(ev);
  32409. }
  32410. if (me.bound > 0) {
  32411. me.unbind();
  32412. me.bound = -1;
  32413. }
  32414. // NOTE: *not* 0 or false - we never want to rebind!
  32415. if (!me.state) {
  32416. me.fireReady();
  32417. }
  32418. },
  32419. /**
  32420. * Sorts the `listeners` array by `phase` and `priority` such that the first listener
  32421. * to fire can be determined using `pop` on the `listeners` array.
  32422. * @private
  32423. */
  32424. sortFn: function(a, b) {
  32425. return -((a.phase - b.phase) || (b.priority - a.priority) || (a.id - b.id));
  32426. },
  32427. unblock: function() {
  32428. var me = this;
  32429. if (me.blocks) {
  32430. if (!--me.blocks) {
  32431. if (me.state === 2 && !me.firing) {
  32432. // We have already finished handleReady (the DOM ready handler) so
  32433. // this trigger just needs to dispatch all the remaining listeners.
  32434. me.invokeAll();
  32435. }
  32436. }
  32437. }
  32438. },
  32439. // if we are currently firing then invokeAll will pick up the Framework
  32440. // ready listeners automatically.
  32441. //
  32442. // If me.state < 2 then we are waiting for DOM ready so it will eventually
  32443. // call handleReady and invokeAll when everything is ready.
  32444. /**
  32445. * This method is called to remove all event listeners that may have been set up to
  32446. * detect ready state.
  32447. * @private
  32448. */
  32449. unbind: function() {
  32450. var me = this,
  32451. doc = document;
  32452. if (me.bound > 1) {
  32453. doc.removeEventListener('deviceready', me.onReadyEvent, false);
  32454. }
  32455. doc.removeEventListener('DOMContentLoaded', me.onReadyEvent, false);
  32456. window.removeEventListener('load', me.onReadyEvent, false);
  32457. }
  32458. };
  32459. (function() {
  32460. var Ready = Ext.env.Ready;
  32461. /*
  32462. * EXTJS-13522
  32463. * Although IE 9 has the DOMContentLoaded event available, usage of that causes
  32464. * timing issues when attempting to access document.namespaces (VmlCanvas.js).
  32465. * Consequently, even in IE 9 we need to use the legacy bind override for ready
  32466. * detection. This defers ready firing enough to allow access to the
  32467. * document.namespaces property.
  32468. *
  32469. * NOTE: this issue is very timing sensitive, and typically only displays itself
  32470. * when there is a large amount of latency between the browser and the server, and
  32471. * when testing against a built page (ext-all.js) and not a dev mode page.
  32472. */
  32473. if (Ext.isIE9m) {
  32474. /* Customized implementation for Legacy IE. The default implementation is
  32475. * configured for use with all other 'standards compliant' agents.
  32476. * References: http://javascript.nwbox.com/IEContentLoaded/
  32477. * licensed courtesy of http://developer.yahoo.com/yui/license.html
  32478. */
  32479. Ext.apply(Ready, {
  32480. /**
  32481. * Timer for doScroll polling
  32482. * @private
  32483. */
  32484. scrollTimer: null,
  32485. /**
  32486. * @private
  32487. */
  32488. readyStatesRe: /complete/i,
  32489. /**
  32490. * This strategy has minimal benefits for Sencha solutions that build
  32491. * themselves (ie. minimal initial page markup). However, progressively-enhanced
  32492. * pages (with image content and/or embedded frames) will benefit the most
  32493. * from it. Browser timer resolution is too poor to ensure a doScroll check
  32494. * more than once on a page loaded with minimal assets (the readystatechange
  32495. * event 'complete' usually beats the doScroll timer on a 'lightly-loaded'
  32496. * initial document).
  32497. * @private
  32498. */
  32499. pollScroll: function() {
  32500. var scrollable = true;
  32501. try {
  32502. document.documentElement.doScroll('left');
  32503. } catch (e) {
  32504. scrollable = false;
  32505. }
  32506. // on IE8, when running within an iFrame, document.body is not immediately
  32507. // available
  32508. if (scrollable && document.body) {
  32509. Ready.onReadyEvent({
  32510. type: 'doScroll'
  32511. });
  32512. } else {
  32513. // Minimize thrashing --
  32514. // adjusted for setTimeout's close-to-minimums (not too low),
  32515. // as this method SHOULD always be called once initially
  32516. Ready.scrollTimer = Ext.defer(Ready.pollScroll, 20);
  32517. }
  32518. return scrollable;
  32519. },
  32520. bind: function() {
  32521. var doc = document,
  32522. topContext;
  32523. if (Ready.bound) {
  32524. return;
  32525. }
  32526. // See if we are in an IFRAME? (doScroll ineffective here)
  32527. try {
  32528. topContext = window.frameElement === undefined;
  32529. } catch (e) {}
  32530. // If we throw an exception, it means we're probably getting access
  32531. // denied, which means we're in an iframe cross domain.
  32532. if (!topContext || !doc.documentElement.doScroll) {
  32533. Ready.pollScroll = Ext.emptyFn;
  32534. }
  32535. // then noop this test altogether
  32536. else if (Ready.pollScroll()) {
  32537. // starts scroll polling if necessary
  32538. return;
  32539. }
  32540. if (doc.readyState === 'complete') {
  32541. // Loaded AFTER initial document write/load...
  32542. Ready.onReadyEvent({
  32543. type: 'already ' + (doc.readyState || 'body')
  32544. });
  32545. } else {
  32546. doc.attachEvent('onreadystatechange', Ready.onReadyStateChange);
  32547. window.attachEvent('onload', Ready.onReadyEvent);
  32548. Ready.bound = 1;
  32549. }
  32550. },
  32551. unbind: function() {
  32552. document.detachEvent('onreadystatechange', Ready.onReadyStateChange);
  32553. window.detachEvent('onload', Ready.onReadyEvent);
  32554. if (Ext.isNumber(Ready.scrollTimer)) {
  32555. Ext.undefer(Ready.scrollTimer);
  32556. Ready.scrollTimer = null;
  32557. }
  32558. },
  32559. /**
  32560. * This event handler is called when the readyState changes.
  32561. * @private
  32562. */
  32563. onReadyStateChange: function() {
  32564. var state = document.readyState;
  32565. if (Ready.readyStatesRe.test(state)) {
  32566. Ready.onReadyEvent({
  32567. type: state
  32568. });
  32569. }
  32570. }
  32571. });
  32572. }
  32573. /**
  32574. * @property {Boolean} isDomReady
  32575. * `true` when the document body is ready for use.
  32576. * @member Ext
  32577. * @readonly
  32578. */
  32579. /**
  32580. * @property {Boolean} isReady
  32581. * `true` when `isDomReady` is true and the Framework is ready for use.
  32582. * @member Ext
  32583. * @readonly
  32584. */
  32585. /**
  32586. * @method onDocumentReady
  32587. * @member Ext
  32588. * Adds a listener to be notified when the document is ready (before onload and before
  32589. * images are loaded).
  32590. *
  32591. * @param {Function} fn The method to call.
  32592. * @param {Object} [scope] The scope (`this` reference) in which the handler function
  32593. * executes. Defaults to the browser window.
  32594. * @param {Object} [options] An object with extra options.
  32595. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  32596. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  32597. * number will result in the callback being sorted before the others. Priorities
  32598. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  32599. * @private
  32600. */
  32601. Ext.onDocumentReady = function(fn, scope, options) {
  32602. var opt = {
  32603. dom: true
  32604. };
  32605. if (options) {
  32606. Ext.apply(opt, options);
  32607. }
  32608. Ready.on(fn, scope, opt);
  32609. };
  32610. /**
  32611. * @method onReady
  32612. * @member Ext
  32613. * Adds a listener to be notified when the document is ready (before onload and before
  32614. * images are loaded).
  32615. *
  32616. * @param {Function} fn The method to call.
  32617. * @param {Object} [scope] The scope (`this` reference) in which the handler function
  32618. * executes. Defaults to the browser window.
  32619. * @param {Object} [options] An object with extra options.
  32620. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  32621. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  32622. * number will result in the callback being sorted before the others. Priorities
  32623. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  32624. * @param {Boolean} [options.dom=false] Pass `true` to only wait for DOM ready, `false`
  32625. * means full Framework and DOM readiness.
  32626. * numbers are reserved.
  32627. */
  32628. Ext.onReady = function(fn, scope, options) {
  32629. Ready.on(fn, scope, options);
  32630. };
  32631. // A shortcut method for onReady with a high priority
  32632. Ext.onInternalReady = function(fn, scope, options) {
  32633. Ready.on(fn, scope, Ext.apply({
  32634. priority: 1000
  32635. }, options));
  32636. };
  32637. Ready.bind();
  32638. }());
  32639. // @tag class
  32640. /**
  32641. * This class provides dynamic loading support for JavaScript classes. Application code
  32642. * does not typically need to call `Ext.Loader` except perhaps to configure path mappings
  32643. * when not using [Sencha Cmd](http://www.sencha.com/products/sencha-cmd/).
  32644. *
  32645. * Ext.Loader.setPath('MyApp', 'app');
  32646. *
  32647. * When using Sencha Cmd, this is handled by the "bootstrap" provided by the application
  32648. * build script and such configuration is not necessary.
  32649. *
  32650. * # Typical Usage
  32651. *
  32652. * The `Ext.Loader` is most often used behind the scenes to satisfy class references in
  32653. * class declarations. Like so:
  32654. *
  32655. * Ext.define('MyApp.view.Main', {
  32656. * extend: 'Ext.panel.Panel',
  32657. *
  32658. * mixins: [
  32659. * 'MyApp.util.Mixin'
  32660. * ],
  32661. *
  32662. * requires: [
  32663. * 'Ext.grid.Panel'
  32664. * ],
  32665. *
  32666. * uses: [
  32667. * 'MyApp.util.Stuff'
  32668. * ]
  32669. * });
  32670. *
  32671. * In all of these cases, `Ext.Loader` is used internally to resolve these class names
  32672. * and ensure that the necessary class files are loaded.
  32673. *
  32674. * During development, these files are loaded individually for optimal debugging. For a
  32675. * production use, [Sencha Cmd](http://www.sencha.com/products/sencha-cmd/) will replace
  32676. * all of these strings with the actual resolved class references because it ensures that
  32677. * the classes are all contained in the build in the correct order. In development, these
  32678. * files will not be loaded until the `MyApp.view.Main` class indicates they are needed
  32679. * as shown above.
  32680. *
  32681. * # Loading Classes
  32682. *
  32683. * You can also use `Ext.Loader` directly to load classes or files. The simplest form of
  32684. * use is `{@link Ext#require}`.
  32685. *
  32686. * For example:
  32687. *
  32688. * Ext.require('MyApp.view.Main', function () {
  32689. * // On callback, the MyApp.view.Main class is now loaded
  32690. *
  32691. * var view = new MyApp.view.Main();
  32692. * });
  32693. *
  32694. * You can alternatively require classes by alias or wildcard.
  32695. *
  32696. * Ext.require('widget.window');
  32697. *
  32698. * Ext.require(['widget.window', 'layout.border', 'Ext.data.Connection']);
  32699. *
  32700. * Ext.require(['widget.*', 'layout.*', 'Ext.data.*']);
  32701. *
  32702. * The callback function is optional.
  32703. *
  32704. * **Note** Using `Ext.require` at global scope will cause `{@link Ext#onReady}` and
  32705. * `{@link Ext.app.Application#launch}` methods to be deferred until the required classes
  32706. * are loaded. It is these cases where the callback function is most often unnecessary.
  32707. *
  32708. * ## Using Excludes
  32709. *
  32710. * Alternatively, you can exclude what you don't need:
  32711. *
  32712. * // Include everything except Ext.tree.*
  32713. * Ext.exclude('Ext.tree.*').require('*');
  32714. *
  32715. * // Include all widgets except widget.checkbox* (this will exclude
  32716. * // widget.checkbox, widget.checkboxfield, widget.checkboxgroup, etc.)
  32717. * Ext.exclude('widget.checkbox*').require('widget.*');
  32718. *
  32719. * # Dynamic Instantiation
  32720. *
  32721. * Another feature enabled by `Ext.Loader` is instantiation using class names or aliases.
  32722. *
  32723. * For example:
  32724. *
  32725. * var win = Ext.create({
  32726. * xtype: 'window',
  32727. *
  32728. * // or
  32729. * // xclass: 'Ext.window.Window'
  32730. *
  32731. * title: 'Hello'
  32732. * });
  32733. *
  32734. * This form of creation can be useful if the type to create (`window` in the above) is
  32735. * not known statically. Internally, `{@link Ext#method!create}` may need to *synchronously*
  32736. * load the desired class and its requirements. Doing this will generate a warning in
  32737. * the console:
  32738. *
  32739. * [Ext.Loader] Synchronously loading 'Ext.window.Window'...
  32740. *
  32741. * If you see these in your debug console, you should add the indicated class(es) to the
  32742. * appropriate `requires` array (as above) or make an `{@link Ext#require}` call.
  32743. *
  32744. *
  32745. * **Note** Using `{@link Ext#method!create}` has some performance overhead and is best reserved
  32746. * for cases where the target class is not known until run-time.
  32747. *
  32748. * @class Ext.Loader
  32749. * @singleton
  32750. */
  32751. Ext.Loader = (new function() {
  32752. // @define Ext.Loader
  32753. // @require Ext.Base
  32754. // @require Ext.Class
  32755. // @require Ext.ClassManager
  32756. // @require Ext.mixin.Watchable
  32757. // @require Ext.Function
  32758. // @require Ext.Array
  32759. // @require Ext.env.Ready
  32760. var Loader = this,
  32761. Manager = Ext.ClassManager,
  32762. // this is an instance of Ext.Inventory
  32763. Boot = Ext.Boot,
  32764. Class = Ext.Class,
  32765. Ready = Ext.env.Ready,
  32766. alias = Ext.Function.alias,
  32767. dependencyProperties = [
  32768. 'extend',
  32769. 'mixins',
  32770. 'requires'
  32771. ],
  32772. isInHistory = {},
  32773. history = [],
  32774. readyListeners = [],
  32775. usedClasses = [],
  32776. _requiresMap = {},
  32777. _config = {
  32778. /**
  32779. * @cfg {Boolean} [enabled=true]
  32780. * Whether or not to enable the dynamic dependency loading feature.
  32781. */
  32782. enabled: true,
  32783. /**
  32784. * @cfg {Boolean} [scriptChainDelay=false]
  32785. * millisecond delay between asynchronous script injection (prevents stack
  32786. * overflow on some user agents) 'false' disables delay but potentially
  32787. * increases stack load.
  32788. */
  32789. scriptChainDelay: false,
  32790. /**
  32791. * @cfg {Boolean} [disableCaching=true]
  32792. * Appends current timestamp to script files to prevent caching.
  32793. */
  32794. disableCaching: true,
  32795. /**
  32796. * @cfg {String} [disableCachingParam="_dc"]
  32797. * The get parameter name for the cache buster's timestamp.
  32798. */
  32799. disableCachingParam: '_dc',
  32800. /**
  32801. * @cfg {Object} paths
  32802. * The mapping from namespaces to file paths
  32803. *
  32804. * {
  32805. * 'Ext': '.', // This is set by default, Ext.layout.container.Container will be
  32806. * // loaded from ./layout/Container.js
  32807. *
  32808. * 'My': './src/my_own_folder' // My.layout.Container will be loaded from
  32809. * // ./src/my_own_folder/layout/Container.js
  32810. * }
  32811. *
  32812. * Note that all relative paths are relative to the current HTML document.
  32813. * If not being specified, for example, `Other.awesome.Class` will simply be
  32814. * loaded from `"./Other/awesome/Class.js"`.
  32815. */
  32816. paths: Manager.paths,
  32817. /**
  32818. * @cfg {Boolean} preserveScripts
  32819. * `false` to remove asynchronously loaded scripts, `true` to retain script
  32820. * element for browser debugger compatibility and improved load performance.
  32821. */
  32822. preserveScripts: true,
  32823. /**
  32824. * @cfg {String} scriptCharset
  32825. * Optional charset to specify encoding of dynamic script content.
  32826. */
  32827. scriptCharset: undefined
  32828. },
  32829. // These configs are delegated to Ext.Script and may need different names:
  32830. delegatedConfigs = {
  32831. disableCaching: true,
  32832. disableCachingParam: true,
  32833. preserveScripts: true,
  32834. scriptChainDelay: 'loadDelay'
  32835. };
  32836. Ext.apply(Loader, {
  32837. /**
  32838. * @private
  32839. */
  32840. isInHistory: isInHistory,
  32841. /**
  32842. * Flag indicating whether there are still files being loaded
  32843. * @private
  32844. */
  32845. isLoading: false,
  32846. /**
  32847. * An array of class names to keep track of the dependency loading order.
  32848. * This is not guaranteed to be the same everytime due to the asynchronous
  32849. * nature of the Loader.
  32850. *
  32851. * @property {Array} history
  32852. */
  32853. history: history,
  32854. /**
  32855. * Configuration
  32856. * @private
  32857. */
  32858. config: _config,
  32859. /**
  32860. * Maintain the list of listeners to execute when all required scripts are fully loaded
  32861. * @private
  32862. */
  32863. readyListeners: readyListeners,
  32864. /**
  32865. * Contains classes referenced in `uses` properties.
  32866. * @private
  32867. */
  32868. optionalRequires: usedClasses,
  32869. /**
  32870. * Map of fully qualified class names to an array of dependent classes.
  32871. * @private
  32872. */
  32873. requiresMap: _requiresMap,
  32874. /** @private */
  32875. hasFileLoadError: false,
  32876. /**
  32877. * The number of scripts loading via loadScript.
  32878. * @private
  32879. */
  32880. scriptsLoading: 0,
  32881. /**
  32882. * @private
  32883. */
  32884. classesLoading: {},
  32885. missingCount: 0,
  32886. missingQueue: {},
  32887. /**
  32888. * @private
  32889. */
  32890. syncModeEnabled: false,
  32891. init: function() {
  32892. // initalize the default path of the framework
  32893. var scripts = document.getElementsByTagName('script'),
  32894. src = scripts[scripts.length - 1].src,
  32895. path = src.substring(0, src.lastIndexOf('/') + 1),
  32896. meta = Ext._classPathMetadata,
  32897. microloader = Ext.Microloader,
  32898. manifest = Ext.manifest,
  32899. loadOrder, baseUrl, loadlen, l, loadItem;
  32900. if (src.indexOf("packages/core/src/") !== -1) {
  32901. path = path + "../../";
  32902. } else if (src.indexOf("/core/src/class/") !== -1) {
  32903. path = path + "../../../";
  32904. }
  32905. if (!Manager.getPath("Ext")) {
  32906. Manager.setPath('Ext', path + 'src');
  32907. }
  32908. // Pull in Cmd generated metadata if available.
  32909. if (meta) {
  32910. Ext._classPathMetadata = null;
  32911. Loader.addClassPathMappings(meta);
  32912. }
  32913. if (manifest) {
  32914. loadOrder = manifest.loadOrder;
  32915. // if the manifest paths were calculated as relative to the
  32916. // bootstrap file, then we need to prepend Boot.baseUrl to the
  32917. // paths before processing
  32918. baseUrl = Ext.Boot.baseUrl;
  32919. if (loadOrder && manifest.bootRelative) {
  32920. for (loadlen = loadOrder.length , l = 0; l < loadlen; l++) {
  32921. loadItem = loadOrder[l];
  32922. loadItem.path = baseUrl + loadItem.path;
  32923. loadItem.canonicalPath = true;
  32924. }
  32925. }
  32926. }
  32927. if (microloader) {
  32928. Ready.block();
  32929. microloader.onMicroloaderReady(function() {
  32930. Ready.unblock();
  32931. });
  32932. }
  32933. },
  32934. /**
  32935. * @method setConfig
  32936. * Set the configuration for the loader. This should be called right after ext-(debug).js
  32937. * is included in the page, and before Ext.onReady. i.e:
  32938. *
  32939. * <script type="text/javascript" src="ext-core-debug.js"></script>
  32940. * <script type="text/javascript">
  32941. * Ext.Loader.setConfig({
  32942. * enabled: true,
  32943. * paths: {
  32944. * 'My': 'my_own_path'
  32945. * }
  32946. * });
  32947. * </script>
  32948. * <script type="text/javascript">
  32949. * Ext.require(...);
  32950. *
  32951. * Ext.onReady(function() {
  32952. * // application code here
  32953. * });
  32954. * </script>
  32955. *
  32956. * Refer to config options of {@link Ext.Loader} for the list of possible properties
  32957. *
  32958. * @param {Object} config The config object to override the default values
  32959. * @return {Ext.Loader} this
  32960. */
  32961. setConfig: Ext.Function.flexSetter(function(name, value) {
  32962. var delegated = delegatedConfigs[name];
  32963. if (name === 'paths') {
  32964. Loader.setPath(value);
  32965. } else {
  32966. _config[name] = value;
  32967. if (delegated) {
  32968. Boot.setConfig((delegated === true) ? name : delegated, value);
  32969. }
  32970. }
  32971. return Loader;
  32972. }),
  32973. /**
  32974. * Get the config value corresponding to the specified name. If no name is given,
  32975. * will return the config object
  32976. *
  32977. * @param {String} name The config property name
  32978. * @return {Object}
  32979. */
  32980. getConfig: function(name) {
  32981. return name ? _config[name] : _config;
  32982. },
  32983. /**
  32984. * Sets the path of a namespace.
  32985. * For Example:
  32986. *
  32987. * Ext.Loader.setPath('Ext', '.');
  32988. *
  32989. * @param {String/Object} name See {@link Ext.Function#flexSetter flexSetter}
  32990. * @param {String} [path] See {@link Ext.Function#flexSetter flexSetter}
  32991. * @return {Ext.Loader} this
  32992. * @method
  32993. */
  32994. setPath: function() {
  32995. // Paths are an Ext.Inventory thing and ClassManager is an instance of that:
  32996. Manager.setPath.apply(Manager, arguments);
  32997. return Loader;
  32998. },
  32999. /**
  33000. * Sets a batch of path entries
  33001. *
  33002. * @param {Object} paths a set of className: path mappings
  33003. * @return {Ext.Loader} this
  33004. */
  33005. addClassPathMappings: function(paths) {
  33006. // Paths are an Ext.Inventory thing and ClassManager is an instance of that:
  33007. Manager.setPath(paths);
  33008. return Loader;
  33009. },
  33010. /**
  33011. * fixes up loader path configs by prepending Ext.Boot#baseUrl to the beginning
  33012. * of the path, then delegates to Ext.Loader#addClassPathMappings
  33013. * @param pathConfig
  33014. */
  33015. addBaseUrlClassPathMappings: function(pathConfig) {
  33016. var name;
  33017. for (name in pathConfig) {
  33018. pathConfig[name] = Boot.baseUrl + pathConfig[name];
  33019. }
  33020. Ext.Loader.addClassPathMappings(pathConfig);
  33021. },
  33022. /**
  33023. * Translates a className to a file path by adding the
  33024. * the proper prefix and converting the .'s to /'s. For example:
  33025. *
  33026. * Ext.Loader.setPath('My', '/path/to/My');
  33027. *
  33028. * // alerts '/path/to/My/awesome/Class.js'
  33029. * alert(Ext.Loader.getPath('My.awesome.Class'));
  33030. *
  33031. * Note that the deeper namespace levels, if explicitly set, are always resolved first.
  33032. * For example:
  33033. *
  33034. * Ext.Loader.setPath({
  33035. * 'My': '/path/to/lib',
  33036. * 'My.awesome': '/other/path/for/awesome/stuff',
  33037. * 'My.awesome.more': '/more/awesome/path'
  33038. * });
  33039. *
  33040. * // alerts '/other/path/for/awesome/stuff/Class.js'
  33041. * alert(Ext.Loader.getPath('My.awesome.Class'));
  33042. *
  33043. * // alerts '/more/awesome/path/Class.js'
  33044. * alert(Ext.Loader.getPath('My.awesome.more.Class'));
  33045. *
  33046. * // alerts '/path/to/lib/cool/Class.js'
  33047. * alert(Ext.Loader.getPath('My.cool.Class'));
  33048. *
  33049. * // alerts 'Unknown/strange/Stuff.js'
  33050. * alert(Ext.Loader.getPath('Unknown.strange.Stuff'));
  33051. *
  33052. * @param {String} className
  33053. * @return {String} path
  33054. */
  33055. getPath: function(className) {
  33056. // Paths are an Ext.Inventory thing and ClassManager is an instance of that:
  33057. return Manager.getPath(className);
  33058. },
  33059. require: function(expressions, fn, scope, excludes) {
  33060. var classNames;
  33061. if (excludes) {
  33062. return Loader.exclude(excludes).require(expressions, fn, scope);
  33063. }
  33064. classNames = Manager.getNamesByExpression(expressions);
  33065. return Loader.load(classNames, fn, scope);
  33066. },
  33067. syncRequire: function() {
  33068. var wasEnabled = Loader.syncModeEnabled,
  33069. ret;
  33070. Loader.syncModeEnabled = true;
  33071. ret = Loader.require.apply(Loader, arguments);
  33072. Loader.syncModeEnabled = wasEnabled;
  33073. return ret;
  33074. },
  33075. exclude: function(excludes) {
  33076. var selector = Manager.select({
  33077. require: function(classNames, fn, scope) {
  33078. return Loader.load(classNames, fn, scope);
  33079. },
  33080. syncRequire: function(classNames, fn, scope) {
  33081. var wasEnabled = Loader.syncModeEnabled,
  33082. ret;
  33083. Loader.syncModeEnabled = true;
  33084. ret = Loader.load(classNames, fn, scope);
  33085. Loader.syncModeEnabled = wasEnabled;
  33086. return ret;
  33087. }
  33088. });
  33089. selector.exclude(excludes);
  33090. return selector;
  33091. },
  33092. load: function(classNames, callback, scope) {
  33093. if (callback) {
  33094. if (callback.length) {
  33095. // If callback expects arguments, shim it with a function that will map
  33096. // the requires class(es) from the names we are given.
  33097. callback = Loader.makeLoadCallback(classNames, callback);
  33098. }
  33099. callback = callback.bind(scope || Ext.global);
  33100. }
  33101. /* eslint-disable-next-line vars-on-top */
  33102. var state = Manager.classState,
  33103. missingClassNames = [],
  33104. urls = [],
  33105. urlByClass = {},
  33106. numClasses = classNames.length,
  33107. className, i, numMissing;
  33108. for (i = 0; i < numClasses; ++i) {
  33109. className = Manager.resolveName(classNames[i]);
  33110. if (!Manager.isCreated(className)) {
  33111. missingClassNames.push(className);
  33112. if (!state[className]) {
  33113. urlByClass[className] = Loader.getPath(className);
  33114. urls.push(urlByClass[className]);
  33115. }
  33116. }
  33117. }
  33118. // If the dynamic dependency feature is not being used, throw an error
  33119. // if the dependencies are not defined
  33120. numMissing = missingClassNames.length;
  33121. if (numMissing) {
  33122. Loader.missingCount += numMissing;
  33123. Manager.onCreated(function() {
  33124. if (callback) {
  33125. Ext.callback(callback, scope, arguments);
  33126. }
  33127. Loader.checkReady();
  33128. }, Loader, missingClassNames);
  33129. if (!_config.enabled) {
  33130. Ext.raise("Ext.Loader is not enabled, so dependencies cannot be resolved " + "dynamically. Missing required class" + ((missingClassNames.length > 1) ? "es" : "") + ": " + missingClassNames.join(', '));
  33131. }
  33132. if (urls.length) {
  33133. Loader.loadScripts({
  33134. url: urls,
  33135. // scope will be this options object so we can pass these along:
  33136. _classNames: missingClassNames,
  33137. _urlByClass: urlByClass
  33138. });
  33139. } else {
  33140. // need to call checkReady here, as the _missingCoun
  33141. // may have transitioned from 0 to > 0, meaning we
  33142. // need to block ready
  33143. Loader.checkReady();
  33144. }
  33145. } else {
  33146. if (callback) {
  33147. callback.call(scope);
  33148. }
  33149. // need to call checkReady here, as the _missingCoun
  33150. // may have transitioned from 0 to > 0, meaning we
  33151. // need to block ready
  33152. Loader.checkReady();
  33153. }
  33154. if (Loader.syncModeEnabled) {
  33155. // Class may have been just loaded or was already loaded
  33156. if (numClasses === 1) {
  33157. return Manager.get(classNames[0]);
  33158. }
  33159. }
  33160. return Loader;
  33161. },
  33162. makeLoadCallback: function(classNames, callback) {
  33163. return function() {
  33164. var classes = [],
  33165. i = classNames.length;
  33166. while (i-- > 0) {
  33167. classes[i] = Manager.get(classNames[i]);
  33168. }
  33169. return callback.apply(this, classes);
  33170. };
  33171. },
  33172. onLoadFailure: function(request) {
  33173. var options = this,
  33174. entries = request.entries || [],
  33175. onError = options.onError,
  33176. error, entry, i;
  33177. Loader.hasFileLoadError = true;
  33178. --Loader.scriptsLoading;
  33179. if (onError) {
  33180. for (i = 0; i < entries.length; i++) {
  33181. entry = entries[i];
  33182. if (entry.error) {
  33183. error = new Error('Failed to load: ' + entry.url);
  33184. break;
  33185. }
  33186. }
  33187. error = error || new Error('Failed to load');
  33188. onError.call(options.userScope, options, error, request);
  33189. } else {
  33190. Ext.log.error("[Ext.Loader] Some requested files failed to load.");
  33191. }
  33192. Loader.checkReady();
  33193. },
  33194. onLoadSuccess: function() {
  33195. var options = this,
  33196. onLoad = options.onLoad,
  33197. classNames = options._classNames,
  33198. urlByClass = options._urlByClass,
  33199. state = Manager.classState,
  33200. missingQueue = Loader.missingQueue,
  33201. className, i, len;
  33202. --Loader.scriptsLoading;
  33203. if (onLoad) {
  33204. // TODO: need an adapter to convert to v4 onLoad signatures
  33205. onLoad.call(options.userScope, options);
  33206. }
  33207. // onLoad can cause more loads to start, so it must run first
  33208. // classNames is the array of *all* classes that load() was asked to load,
  33209. // including those that might have been already loaded but not yet created.
  33210. // urlByClass is a map of only those classes that we asked Boot to load.
  33211. for (i = 0 , len = classNames.length; i < len; i++) {
  33212. className = classNames[i];
  33213. // When a script is loaded and executed, we should have Ext.define() called
  33214. // for at least one of the classes in the list, which will set the state
  33215. // for that class. That by itself does not mean that the class is available
  33216. // *now* but it means that ClassManager is tracking it and will fire the
  33217. // onCreated callback that we set back in load().
  33218. // However if there is no state for the class, that may mean two things:
  33219. // either it is not a Ext class, or it is truly missing. In any case we need
  33220. // to watch for that thing ourselves, which we will do every checkReady().
  33221. if (!state[className]) {
  33222. missingQueue[className] = urlByClass[className];
  33223. }
  33224. }
  33225. Loader.checkReady();
  33226. },
  33227. // TODO: this timing of this needs to be deferred until all classes have had
  33228. // a chance to be created
  33229. reportMissingClasses: function() {
  33230. var missingQueue = Loader.missingQueue,
  33231. missingClasses = [],
  33232. missingPaths = [],
  33233. missingClassName;
  33234. if (!Loader.syncModeEnabled && !Loader.scriptsLoading && Loader.isLoading && !Loader.hasFileLoadError) {
  33235. for (missingClassName in missingQueue) {
  33236. missingClasses.push(missingClassName);
  33237. missingPaths.push(missingQueue[missingClassName]);
  33238. }
  33239. if (missingClasses.length) {
  33240. throw new Error("The following classes are not declared even if their files " + "have been loaded: '" + missingClasses.join("', '") + "'. Please check the source code of their " + "corresponding files for possible typos: '" + missingPaths.join("', '"));
  33241. }
  33242. }
  33243. },
  33244. /**
  33245. * Add a new listener to be executed when all required scripts are fully loaded
  33246. *
  33247. * @param {Function} fn The function callback to be executed
  33248. * @param {Object} scope The execution scope (`this`) of the callback function.
  33249. * @param {Boolean} [withDomReady=true] Pass `false` to not also wait for document
  33250. * dom ready.
  33251. * @param {Object} [options] Additional callback options.
  33252. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  33253. * @param {Number} [options.priority=0] Relative priority of this callback. Negative
  33254. * numbers are reserved.
  33255. */
  33256. onReady: function(fn, scope, withDomReady, options) {
  33257. var listener;
  33258. if (withDomReady) {
  33259. Ready.on(fn, scope, options);
  33260. } else {
  33261. listener = Ready.makeListener(fn, scope, options);
  33262. if (Loader.isLoading) {
  33263. readyListeners.push(listener);
  33264. } else {
  33265. Ready.invoke(listener);
  33266. }
  33267. }
  33268. },
  33269. /**
  33270. * @private
  33271. * Ensure that any classes referenced in the `uses` property are loaded.
  33272. */
  33273. addUsedClasses: function(classes) {
  33274. var cls, i, ln;
  33275. if (classes) {
  33276. classes = (typeof classes === 'string') ? [
  33277. classes
  33278. ] : classes;
  33279. for (i = 0 , ln = classes.length; i < ln; i++) {
  33280. cls = classes[i];
  33281. if (typeof cls === 'string' && !Ext.Array.contains(usedClasses, cls)) {
  33282. usedClasses.push(cls);
  33283. }
  33284. }
  33285. }
  33286. return Loader;
  33287. },
  33288. /**
  33289. * @private
  33290. */
  33291. triggerReady: function() {
  33292. var listener,
  33293. refClasses = usedClasses;
  33294. if (Loader.isLoading && refClasses.length) {
  33295. // Empty the array to eliminate potential recursive loop issue
  33296. usedClasses = [];
  33297. // this may immediately call us back if all 'uses' classes
  33298. // have been loaded
  33299. Loader.require(refClasses);
  33300. } else {
  33301. // Must clear this before calling callbacks. This will cause any new loads
  33302. // to call Ready.block() again. See below for more on this.
  33303. Loader.isLoading = false;
  33304. // These listeners are just those attached directly to Loader to wait for
  33305. // class loading only.
  33306. readyListeners.sort(Ready.sortFn);
  33307. // this method can be called with Loader.isLoading either true or false
  33308. // (can be called with false when all 'uses' classes are already loaded)
  33309. // this may bypass the above if condition
  33310. while (readyListeners.length && !Loader.isLoading) {
  33311. // we may re-enter triggerReady so we cannot necessarily iterate the
  33312. // readyListeners array
  33313. listener = readyListeners.pop();
  33314. Ready.invoke(listener);
  33315. }
  33316. // If the DOM is also ready, this will fire the normal onReady listeners.
  33317. // An astute observer would note that we may now be back to isLoading and
  33318. // so ask "Why you call unblock?". The reason is that we must match the
  33319. // calls to block and since we transitioned from isLoading to !isLoading
  33320. // here we must call unblock. If we have transitioned back to isLoading in
  33321. // the above loop it will have called block again so the counter will be
  33322. // increased and this call will not reduce the block count to 0. This is
  33323. // done by loadScripts.
  33324. Ready.unblock();
  33325. }
  33326. },
  33327. /**
  33328. * @private
  33329. * @param {String} className
  33330. */
  33331. historyPush: function(className) {
  33332. if (className && !isInHistory[className] && !Manager.overrideMap[className]) {
  33333. isInHistory[className] = true;
  33334. history.push(className);
  33335. }
  33336. return Loader;
  33337. },
  33338. /**
  33339. * This is an internal method that delegate content loading to the
  33340. * bootstrap layer.
  33341. * @private
  33342. * @param params
  33343. */
  33344. loadScripts: function(params) {
  33345. var manifest = Ext.manifest,
  33346. loadOrder = manifest && manifest.loadOrder,
  33347. loadOrderMap = manifest && manifest.loadOrderMap,
  33348. options;
  33349. ++Loader.scriptsLoading;
  33350. // if the load order map hasn't been created, create it now
  33351. // and cache on the manifest
  33352. if (loadOrder && !loadOrderMap) {
  33353. manifest.loadOrderMap = loadOrderMap = Boot.createLoadOrderMap(loadOrder);
  33354. }
  33355. // verify the loading state, as this may have transitioned us from
  33356. // not loading to loading
  33357. Loader.checkReady();
  33358. options = Ext.apply({
  33359. loadOrder: loadOrder,
  33360. loadOrderMap: loadOrderMap,
  33361. charset: _config.scriptCharset,
  33362. success: Loader.onLoadSuccess,
  33363. failure: Loader.onLoadFailure,
  33364. sync: Loader.syncModeEnabled,
  33365. _classNames: []
  33366. }, params);
  33367. options.userScope = options.scope;
  33368. options.scope = options;
  33369. Boot.load(options);
  33370. },
  33371. /**
  33372. * This method is provide for use by the bootstrap layer.
  33373. * @private
  33374. * @param {String[]} urls
  33375. */
  33376. loadScriptsSync: function(urls) {
  33377. var syncwas = Loader.syncModeEnabled;
  33378. Loader.syncModeEnabled = true;
  33379. Loader.loadScripts({
  33380. url: urls
  33381. });
  33382. Loader.syncModeEnabled = syncwas;
  33383. },
  33384. /**
  33385. * This method is provide for use by the bootstrap layer.
  33386. * @private
  33387. * @param {String[]} urls
  33388. */
  33389. loadScriptsSyncBasePrefix: function(urls) {
  33390. var syncwas = Loader.syncModeEnabled;
  33391. Loader.syncModeEnabled = true;
  33392. Loader.loadScripts({
  33393. url: urls,
  33394. prependBaseUrl: true
  33395. });
  33396. Loader.syncModeEnabled = syncwas;
  33397. },
  33398. /**
  33399. * Loads the specified script URL and calls the supplied callbacks. If this method
  33400. * is called before {@link Ext#isReady}, the script's load will delay the transition
  33401. * to ready. This can be used to load arbitrary scripts that may contain further
  33402. * {@link Ext#require Ext.require} calls.
  33403. *
  33404. * @param {Object/String/String[]} options The options object or simply the URL(s) to load.
  33405. * @param {String} options.url The URL from which to load the script.
  33406. * @param {Function} [options.onLoad] The callback to call on successful load.
  33407. * @param {Function} [options.onError] The callback to call on failure to load.
  33408. * @param {Object} [options.scope] The scope (`this`) for the supplied callbacks.
  33409. */
  33410. loadScript: function(options) {
  33411. var isString = typeof options === 'string',
  33412. isArray = options instanceof Array,
  33413. isObject = !isArray && !isString,
  33414. url = isObject ? options.url : options,
  33415. onError = isObject && options.onError,
  33416. onLoad = isObject && options.onLoad,
  33417. scope = isObject && options.scope,
  33418. request = {
  33419. url: url,
  33420. scope: scope,
  33421. onLoad: onLoad,
  33422. onError: onError,
  33423. _classNames: []
  33424. };
  33425. Loader.loadScripts(request);
  33426. },
  33427. /**
  33428. * @private
  33429. */
  33430. checkMissingQueue: function() {
  33431. var missingQueue = Loader.missingQueue,
  33432. newQueue = {},
  33433. missing = 0,
  33434. name;
  33435. for (name in missingQueue) {
  33436. // If class state is available for the name, that means ClassManager
  33437. // is tracking it and will fire callback when it is created.
  33438. // We only need to track non-class things in the Loader.
  33439. if (!(Manager.classState[name] || Manager.isCreated(name))) {
  33440. newQueue[name] = missingQueue[name];
  33441. missing++;
  33442. }
  33443. }
  33444. Loader.missingCount = missing;
  33445. Loader.missingQueue = newQueue;
  33446. },
  33447. /**
  33448. * @private
  33449. */
  33450. checkReady: function() {
  33451. var wasLoading = Loader.isLoading,
  33452. isLoading;
  33453. Loader.checkMissingQueue();
  33454. isLoading = Loader.missingCount + Loader.scriptsLoading;
  33455. if (isLoading && !wasLoading) {
  33456. Ready.block();
  33457. Loader.isLoading = !!isLoading;
  33458. } else if (!isLoading && wasLoading) {
  33459. Loader.triggerReady();
  33460. }
  33461. if (!Loader.scriptsLoading && Loader.missingCount) {
  33462. // Things look bad, but since load requests may come later, defer this
  33463. // for a bit then check if things are still stuck.
  33464. Ext.defer(function() {
  33465. var name;
  33466. if (!Loader.scriptsLoading && Loader.missingCount) {
  33467. Ext.log.error('[Loader] The following classes failed to load:');
  33468. for (name in Loader.missingQueue) {
  33469. Ext.log.error('[Loader] ' + name + ' from ' + Loader.missingQueue[name]);
  33470. }
  33471. }
  33472. }, 1000);
  33473. }
  33474. }
  33475. });
  33476. /**
  33477. * Loads all classes by the given names and all their direct dependencies; optionally
  33478. * executes the given callback function when finishes, within the optional scope.
  33479. *
  33480. * @param {String/String[]} expressions The class, classes or wildcards to load.
  33481. * @param {Function} [fn] The callback function.
  33482. * @param {Object} [scope] The execution scope (`this`) of the callback function.
  33483. * @member Ext
  33484. * @method require
  33485. */
  33486. Ext.require = alias(Loader, 'require');
  33487. /**
  33488. * Synchronously loads all classes by the given names and all their direct dependencies;
  33489. * optionally executes the given callback function when finishes, within the optional scope.
  33490. *
  33491. * @param {String/String[]} expressions The class, classes or wildcards to load.
  33492. * @param {Function} [fn] The callback function.
  33493. * @param {Object} [scope] The execution scope (`this`) of the callback function.
  33494. * @member Ext
  33495. * @method syncRequire
  33496. */
  33497. Ext.syncRequire = alias(Loader, 'syncRequire');
  33498. /**
  33499. * Explicitly exclude files from being loaded. Useful when used in conjunction with a
  33500. * broad include expression. Can be chained with more `require` and `exclude` methods,
  33501. * for example:
  33502. *
  33503. * Ext.exclude('Ext.data.*').require('*');
  33504. *
  33505. * Ext.exclude('widget.button*').require('widget.*');
  33506. *
  33507. * @param {String/String[]} excludes
  33508. * @return {Object} Contains `exclude`, `require` and `syncRequire` methods for chaining.
  33509. * @member Ext
  33510. * @method exclude
  33511. */
  33512. Ext.exclude = alias(Loader, 'exclude');
  33513. /**
  33514. * @cfg {String[]} requires
  33515. * @member Ext.Class
  33516. * List of classes that have to be loaded before instantiating this class.
  33517. * For example:
  33518. *
  33519. * Ext.define('Mother', {
  33520. * requires: ['Child'],
  33521. * giveBirth: function() {
  33522. * // we can be sure that child class is available.
  33523. * return new Child();
  33524. * }
  33525. * });
  33526. */
  33527. Class.registerPreprocessor('loader', function(cls, data, hooks, continueFn) {
  33528. if (Ext.classSystemMonitor) {
  33529. Ext.classSystemMonitor(cls, 'Ext.Loader#loaderPreprocessor', arguments);
  33530. }
  33531. /* eslint-disable-next-line vars-on-top */
  33532. var me = this,
  33533. dependencies = [],
  33534. dependency,
  33535. className = Manager.getName(cls),
  33536. i, j, ln, subLn, value, propertyName, propertyValue, requiredMap;
  33537. /*
  33538. Loop through the dependencyProperties, look for string class names and push
  33539. them into a stack, regardless of whether the property's value is a string, array or object.
  33540. For example:
  33541. {
  33542. extend: 'Ext.MyClass',
  33543. requires: ['Ext.some.OtherClass'],
  33544. mixins: {
  33545. thing: 'Foo.bar.Thing';
  33546. }
  33547. }
  33548. which will later be transformed into:
  33549. {
  33550. extend: Ext.MyClass,
  33551. requires: [Ext.some.OtherClass],
  33552. mixins: {
  33553. thing: Foo.bar.Thing;
  33554. }
  33555. }
  33556. */
  33557. for (i = 0 , ln = dependencyProperties.length; i < ln; i++) {
  33558. propertyName = dependencyProperties[i];
  33559. if (data.hasOwnProperty(propertyName)) {
  33560. propertyValue = data[propertyName];
  33561. if (typeof propertyValue === 'string') {
  33562. dependencies.push(propertyValue);
  33563. } else if (propertyValue instanceof Array) {
  33564. for (j = 0 , subLn = propertyValue.length; j < subLn; j++) {
  33565. value = propertyValue[j];
  33566. if (typeof value === 'string') {
  33567. dependencies.push(value);
  33568. }
  33569. }
  33570. } else if (typeof propertyValue !== 'function') {
  33571. for (j in propertyValue) {
  33572. if (propertyValue.hasOwnProperty(j)) {
  33573. value = propertyValue[j];
  33574. if (typeof value === 'string') {
  33575. dependencies.push(value);
  33576. }
  33577. }
  33578. }
  33579. }
  33580. }
  33581. }
  33582. if (dependencies.length === 0) {
  33583. return;
  33584. }
  33585. if (className) {
  33586. _requiresMap[className] = dependencies;
  33587. }
  33588. /* eslint-disable-next-line vars-on-top */
  33589. var manifestClasses = Ext.manifest && Ext.manifest.classes,
  33590. deadlockPath = [],
  33591. detectDeadlock;
  33592. /*
  33593. * Automatically detect deadlocks before-hand,
  33594. * will throw an error with detailed path for ease of debugging. Examples
  33595. * of deadlock cases:
  33596. *
  33597. * - A extends B, then B extends A
  33598. * - A requires B, B requires C, then C requires A
  33599. *
  33600. * The detectDeadlock function will recursively transverse till the leaf, hence
  33601. * it can detect deadlocks no matter how deep the path is. However we don't need
  33602. * to run this check if the class name is in the manifest: that means Cmd has
  33603. * already resolved all dependencies for this class with no deadlocks.
  33604. */
  33605. if (className && (!manifestClasses || !manifestClasses[className])) {
  33606. requiredMap = Loader.requiredByMap || (Loader.requiredByMap = {});
  33607. for (i = 0 , ln = dependencies.length; i < ln; i++) {
  33608. dependency = dependencies[i];
  33609. (requiredMap[dependency] || (requiredMap[dependency] = [])).push(className);
  33610. }
  33611. detectDeadlock = function(cls) {
  33612. var requires = _requiresMap[cls],
  33613. dep, i, ln;
  33614. deadlockPath.push(cls);
  33615. if (requires) {
  33616. if (Ext.Array.contains(requires, className)) {
  33617. Ext.Error.raise("Circular requirement detected! '" + className + "' and '" + deadlockPath[1] + "' mutually require each other. " + "Path: " + deadlockPath.join(' -> ') + " -> " + deadlockPath[0]);
  33618. }
  33619. for (i = 0 , ln = requires.length; i < ln; i++) {
  33620. dep = requires[i];
  33621. if (!isInHistory[dep]) {
  33622. detectDeadlock(requires[i]);
  33623. }
  33624. }
  33625. }
  33626. };
  33627. detectDeadlock(className);
  33628. }
  33629. (className ? Loader.exclude(className) : Loader).require(dependencies, function() {
  33630. var i, ln, j, subLn, k;
  33631. for (i = 0 , ln = dependencyProperties.length; i < ln; i++) {
  33632. propertyName = dependencyProperties[i];
  33633. if (data.hasOwnProperty(propertyName)) {
  33634. propertyValue = data[propertyName];
  33635. if (typeof propertyValue === 'string') {
  33636. data[propertyName] = Manager.get(propertyValue);
  33637. } else if (propertyValue instanceof Array) {
  33638. for (j = 0 , subLn = propertyValue.length; j < subLn; j++) {
  33639. value = propertyValue[j];
  33640. if (typeof value === 'string') {
  33641. data[propertyName][j] = Manager.get(value);
  33642. }
  33643. }
  33644. } else if (typeof propertyValue !== 'function') {
  33645. for (k in propertyValue) {
  33646. if (propertyValue.hasOwnProperty(k)) {
  33647. value = propertyValue[k];
  33648. if (typeof value === 'string') {
  33649. data[propertyName][k] = Manager.get(value);
  33650. }
  33651. }
  33652. }
  33653. }
  33654. }
  33655. }
  33656. continueFn.call(me, cls, data, hooks);
  33657. });
  33658. return false;
  33659. }, true, 'after', 'className');
  33660. /**
  33661. * @cfg {String[]} uses
  33662. * @member Ext.Class
  33663. * List of optional classes to load together with this class. These aren't neccessarily loaded
  33664. * before this class is created, but are guaranteed to be available before Ext.onReady
  33665. * listeners are invoked. For example:
  33666. *
  33667. * Ext.define('Mother', {
  33668. * uses: ['Child'],
  33669. * giveBirth: function() {
  33670. * // This code might, or might not work:
  33671. * // return new Child();
  33672. *
  33673. * // Instead use Ext.create() to load the class at the spot if not loaded already:
  33674. * return Ext.create('Child');
  33675. * }
  33676. * });
  33677. */
  33678. Manager.registerPostprocessor('uses', function(name, cls, data) {
  33679. var uses = data.uses,
  33680. classNames;
  33681. if (Ext.classSystemMonitor) {
  33682. Ext.classSystemMonitor(cls, 'Ext.Loader#usesPostprocessor', arguments);
  33683. }
  33684. if (uses) {
  33685. classNames = Manager.getNamesByExpression(data.uses);
  33686. Loader.addUsedClasses(classNames);
  33687. }
  33688. });
  33689. Manager.onCreated(Loader.historyPush);
  33690. Loader.init();
  33691. }());
  33692. //-----------------------------------------------------------------------------
  33693. // Use performance.now when available to keep timestamps consistent.
  33694. Ext._endTime = Ext.ticks();
  33695. // This hook is to allow tools like DynaTrace to deterministically detect the availability
  33696. // of Ext.onReady. Since Loader takes over Ext.onReady this must be done here and not in
  33697. // Ext.env.Ready.
  33698. if (Ext._beforereadyhandler) {
  33699. Ext._beforereadyhandler();
  33700. }
  33701. /**
  33702. * @class Ext.util.Positionable
  33703. */
  33704. Ext.define('Ext.overrides.util.Positionable', {
  33705. override: 'Ext.util.Positionable',
  33706. /**
  33707. * @method alignTo
  33708. * @param {Ext.util.Positionable/HTMLElement/String} anchorToEl The Positionable,
  33709. * HTMLElement, or id of the element to align to.
  33710. * @param {String} [alignment="tl-bl?"] The position to align to
  33711. * @param {Number[]} [offsets] Offset the positioning by [x, y]
  33712. * @param {Boolean/Object} [animate] true for the default animation or a standard
  33713. * Element animation config object
  33714. * @return {Ext.util.Positionable} this
  33715. */
  33716. /**
  33717. * @method anchorTo
  33718. * Anchors an element to another element and realigns it when the window is resized.
  33719. * @param {Ext.util.Positionable/HTMLElement/String} anchorToEl The Positionable,
  33720. * HTMLElement, or id of the element to align to.
  33721. * @param {String} [alignment="tl-bl?"] The position to align to
  33722. * @param {Number[]} [offsets] Offset the positioning by [x, y]
  33723. * @param {Boolean/Object} [animate] true for the default animation or a standard
  33724. * Element animation config object
  33725. * @param {Boolean/Number} [monitorScroll=50] True to monitor body scroll and
  33726. * reposition. If this parameter is a number, it is used as the buffer delay in
  33727. * milliseconds.
  33728. * @param {Function} [callback] The function to call after the animation finishes
  33729. * @return {Ext.util.Positionable} this
  33730. */
  33731. anchorTo: function(anchorToEl, alignment, offsets, animate, monitorScroll, callback) {
  33732. var me = this,
  33733. scroll = !Ext.isEmpty(monitorScroll),
  33734. action = function() {
  33735. me.mixins.positionable.alignTo.call(me, anchorToEl, alignment, offsets, animate);
  33736. Ext.callback(callback, me);
  33737. },
  33738. anchor = me.getAnchor();
  33739. // previous listener anchor, remove it
  33740. me.removeAnchor();
  33741. Ext.apply(anchor, {
  33742. fn: action,
  33743. scroll: scroll
  33744. });
  33745. Ext.on('resize', action, null);
  33746. if (scroll) {
  33747. Ext.getWin().on('scroll', action, null, {
  33748. buffer: !isNaN(monitorScroll) ? monitorScroll : 50
  33749. });
  33750. }
  33751. action();
  33752. // align immediately
  33753. return me;
  33754. },
  33755. getAnchor: function() {
  33756. var el = this.el,
  33757. data, anchor;
  33758. if (!el || !el.dom) {
  33759. return;
  33760. }
  33761. data = el.getData();
  33762. anchor = data._anchor;
  33763. if (!anchor) {
  33764. anchor = data._anchor = {};
  33765. }
  33766. return anchor;
  33767. },
  33768. alignTo: function(element, position, offsets, /* private (documented in ext) */
  33769. animate) {
  33770. var me = this,
  33771. el = me.el,
  33772. newMaxHeight, newRegion;
  33773. // Release any height constraint prior to aligning if we are shrinkwrap height.
  33774. if (me.isComponent && me.getSizeModel().height.shrinkWrap) {
  33775. if (me.maxHeight) {
  33776. me.setMaxHeight(null);
  33777. }
  33778. newMaxHeight = true;
  33779. }
  33780. newRegion = me.getAlignToRegion(element, position, offsets, me.minHeight || 150);
  33781. me.setXY([
  33782. newRegion.x,
  33783. newRegion.y
  33784. ], el.anim && !!animate ? el.anim(animate) : false);
  33785. // Impose calculated height constraint.
  33786. if (newMaxHeight && (newMaxHeight = newRegion.getHeight()) !== me.getHeight()) {
  33787. me.setMaxHeight(newMaxHeight);
  33788. }
  33789. return me;
  33790. },
  33791. /**
  33792. * @method move
  33793. * Move the element relative to its current position.
  33794. * @param {String} direction Possible values are:
  33795. *
  33796. * - `"l"` (or `"left"`)
  33797. * - `"r"` (or `"right"`)
  33798. * - `"t"` (or `"top"`, or `"up"`)
  33799. * - `"b"` (or `"bottom"`, or `"down"`)
  33800. *
  33801. * @param {Number} distance How far to move the element in pixels
  33802. * @param {Boolean/Object} [animate] true for the default animation or a standard
  33803. * Element animation config object
  33804. */
  33805. /**
  33806. * Remove any anchor to this element. See {@link #anchorTo}.
  33807. * @return {Ext.util.Positionable} this
  33808. */
  33809. removeAnchor: function() {
  33810. var anchor = this.getAnchor();
  33811. if (anchor && anchor.fn) {
  33812. Ext.un('resize', anchor.fn);
  33813. if (anchor.scroll) {
  33814. Ext.getWin().on('scroll', anchor.fn);
  33815. }
  33816. delete anchor.fn;
  33817. }
  33818. return this;
  33819. },
  33820. /**
  33821. * @method setBox
  33822. * Sets the element's box. If animate is true then x, y, width, and height will be
  33823. * animated concurrently.
  33824. * @param {Object} box The box to fill {x, y, width, height}
  33825. * @param {Boolean/Object} [animate] true for the default animation or a standard
  33826. * Element animation config object
  33827. * @return {Ext.util.Positionable} this
  33828. */
  33829. setBox: function(box, animate) {
  33830. var me = this;
  33831. if (box.isRegion) {
  33832. box = {
  33833. x: box.left,
  33834. y: box.top,
  33835. width: box.right - box.left,
  33836. height: box.bottom - box.top
  33837. };
  33838. }
  33839. if (animate) {
  33840. me.constrainBox(box);
  33841. me.animate(Ext.applyIf({
  33842. to: box,
  33843. listeners: {
  33844. afteranimate: Ext.Function.bind(me.afterSetPosition, me, [
  33845. box.x,
  33846. box.y
  33847. ])
  33848. }
  33849. }, animate));
  33850. } else {
  33851. me.callParent([
  33852. box
  33853. ]);
  33854. }
  33855. return me;
  33856. }
  33857. });
  33858. /**
  33859. * @method setX
  33860. * Sets the X position of the DOM element based on page coordinates.
  33861. * @param {Number} x The X position
  33862. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  33863. * Element animation config object
  33864. * @return {Ext.util.Positionable} this
  33865. */
  33866. /**
  33867. * @method setXY
  33868. * Sets the position of the DOM element in page coordinates.
  33869. * @param {Number[]} pos Contains X & Y [x, y] values for new position (coordinates
  33870. * are page-based)
  33871. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  33872. * Element animation config object
  33873. * @return {Ext.util.Positionable} this
  33874. */
  33875. /**
  33876. * @method setY
  33877. * Sets the Y position of the DOM element based on page coordinates.
  33878. * @param {Number} y The Y position
  33879. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  33880. * Element animation config object
  33881. * @return {Ext.util.Positionable} this
  33882. */
  33883. /**
  33884. * @class Ext.event.Event
  33885. */
  33886. Ext.define('Ext.overrides.event.Event', {
  33887. override: 'Ext.event.Event',
  33888. /**
  33889. * @method injectEvent
  33890. * @member Ext.event.Event
  33891. * Injects a DOM event using the data in this object and (optionally) a new target.
  33892. * This is a low-level technique and not likely to be used by application code. The
  33893. * currently supported event types are:
  33894. * <p><b>HTMLEvents</b></p>
  33895. * <ul>
  33896. * <li>load</li>
  33897. * <li>unload</li>
  33898. * <li>select</li>
  33899. * <li>change</li>
  33900. * <li>submit</li>
  33901. * <li>reset</li>
  33902. * <li>resize</li>
  33903. * <li>scroll</li>
  33904. * </ul>
  33905. * <p><b>MouseEvents</b></p>
  33906. * <ul>
  33907. * <li>click</li>
  33908. * <li>dblclick</li>
  33909. * <li>mousedown</li>
  33910. * <li>mouseup</li>
  33911. * <li>mouseover</li>
  33912. * <li>mousemove</li>
  33913. * <li>mouseout</li>
  33914. * </ul>
  33915. * <p><b>UIEvents</b></p>
  33916. * <ul>
  33917. * <li>focusin</li>
  33918. * <li>focusout</li>
  33919. * <li>activate</li>
  33920. * <li>focus</li>
  33921. * <li>blur</li>
  33922. * </ul>
  33923. * @param {Ext.Element/HTMLElement} target (optional) If specified, the target for the event.
  33924. * This is likely to be used when relaying a DOM event. If not specified, {@link #getTarget}
  33925. * is used to determine the target.
  33926. */
  33927. injectEvent: (function() {
  33928. var API,
  33929. dispatchers = {},
  33930. // keyed by event type (e.g., 'mousedown')
  33931. crazyIEButtons;
  33932. // Good reference: http://developer.yahoo.com/yui/docs/UserAction.js.html
  33933. // IE9 has createEvent, but this code causes major problems with htmleditor (it
  33934. // blocks all mouse events and maybe more). TODO
  33935. if (!Ext.isIE9m && document.createEvent) {
  33936. // if (DOM compliant)
  33937. API = {
  33938. createHtmlEvent: function(doc, type, bubbles, cancelable) {
  33939. var event = doc.createEvent('HTMLEvents');
  33940. event.initEvent(type, bubbles, cancelable);
  33941. return event;
  33942. },
  33943. createMouseEvent: function(doc, type, bubbles, cancelable, detail, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) {
  33944. var event = doc.createEvent('MouseEvents'),
  33945. view = doc.defaultView || window;
  33946. if (event.initMouseEvent) {
  33947. event.initMouseEvent(type, bubbles, cancelable, view, detail, clientX, clientY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget);
  33948. } else {
  33949. // old Safari
  33950. event = doc.createEvent('UIEvents');
  33951. event.initEvent(type, bubbles, cancelable);
  33952. event.view = view;
  33953. event.detail = detail;
  33954. event.screenX = clientX;
  33955. event.screenY = clientY;
  33956. event.clientX = clientX;
  33957. event.clientY = clientY;
  33958. event.ctrlKey = ctrlKey;
  33959. event.altKey = altKey;
  33960. event.metaKey = metaKey;
  33961. event.shiftKey = shiftKey;
  33962. event.button = button;
  33963. event.relatedTarget = relatedTarget;
  33964. }
  33965. return event;
  33966. },
  33967. createUIEvent: function(doc, type, bubbles, cancelable, detail) {
  33968. var event = doc.createEvent('UIEvents'),
  33969. view = doc.defaultView || window;
  33970. event.initUIEvent(type, bubbles, cancelable, view, detail);
  33971. return event;
  33972. },
  33973. fireEvent: function(target, type, event) {
  33974. target.dispatchEvent(event);
  33975. }
  33976. };
  33977. } else if (document.createEventObject) {
  33978. // else if (IE)
  33979. crazyIEButtons = {
  33980. 0: 1,
  33981. 1: 4,
  33982. 2: 2
  33983. };
  33984. API = {
  33985. createHtmlEvent: function(doc, type, bubbles, cancelable) {
  33986. var event = doc.createEventObject();
  33987. event.bubbles = bubbles;
  33988. event.cancelable = cancelable;
  33989. return event;
  33990. },
  33991. createMouseEvent: function(doc, type, bubbles, cancelable, detail, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) {
  33992. var event = doc.createEventObject();
  33993. event.bubbles = bubbles;
  33994. event.cancelable = cancelable;
  33995. event.detail = detail;
  33996. event.screenX = clientX;
  33997. event.screenY = clientY;
  33998. event.clientX = clientX;
  33999. event.clientY = clientY;
  34000. event.ctrlKey = ctrlKey;
  34001. event.altKey = altKey;
  34002. event.shiftKey = shiftKey;
  34003. event.metaKey = metaKey;
  34004. event.button = crazyIEButtons[button] || button;
  34005. event.relatedTarget = relatedTarget;
  34006. // cannot assign to/fromElement
  34007. return event;
  34008. },
  34009. createUIEvent: function(doc, type, bubbles, cancelable, detail) {
  34010. var event = doc.createEventObject();
  34011. event.bubbles = bubbles;
  34012. event.cancelable = cancelable;
  34013. return event;
  34014. },
  34015. fireEvent: function(target, type, event) {
  34016. target.fireEvent('on' + type, event);
  34017. }
  34018. };
  34019. }
  34020. //----------------
  34021. // HTMLEvents
  34022. Ext.Object.each({
  34023. load: [
  34024. false,
  34025. false
  34026. ],
  34027. unload: [
  34028. false,
  34029. false
  34030. ],
  34031. select: [
  34032. true,
  34033. false
  34034. ],
  34035. change: [
  34036. true,
  34037. false
  34038. ],
  34039. submit: [
  34040. true,
  34041. true
  34042. ],
  34043. reset: [
  34044. true,
  34045. false
  34046. ],
  34047. resize: [
  34048. true,
  34049. false
  34050. ],
  34051. scroll: [
  34052. true,
  34053. false
  34054. ]
  34055. }, function(name, value) {
  34056. var bubbles = value[0],
  34057. cancelable = value[1];
  34058. dispatchers[name] = function(targetEl, srcEvent) {
  34059. var e = API.createHtmlEvent(name, bubbles, cancelable);
  34060. API.fireEvent(targetEl, name, e);
  34061. };
  34062. });
  34063. //----------------
  34064. // MouseEvents
  34065. function createMouseEventDispatcher(type, detail) {
  34066. var cancelable = (type !== 'mousemove');
  34067. return function(targetEl, srcEvent) {
  34068. var xy = srcEvent.getXY(),
  34069. e;
  34070. e = API.createMouseEvent(targetEl.ownerDocument, type, true, cancelable, detail, xy[0], xy[1], srcEvent.ctrlKey, srcEvent.altKey, srcEvent.shiftKey, srcEvent.metaKey, srcEvent.button, srcEvent.relatedTarget);
  34071. API.fireEvent(targetEl, type, e);
  34072. };
  34073. }
  34074. Ext.each([
  34075. 'click',
  34076. 'dblclick',
  34077. 'mousedown',
  34078. 'mouseup',
  34079. 'mouseover',
  34080. 'mousemove',
  34081. 'mouseout'
  34082. ], function(eventName) {
  34083. dispatchers[eventName] = createMouseEventDispatcher(eventName, 1);
  34084. });
  34085. //----------------
  34086. // UIEvents
  34087. Ext.Object.each({
  34088. focusin: [
  34089. true,
  34090. false
  34091. ],
  34092. focusout: [
  34093. true,
  34094. false
  34095. ],
  34096. activate: [
  34097. true,
  34098. true
  34099. ],
  34100. focus: [
  34101. false,
  34102. false
  34103. ],
  34104. blur: [
  34105. false,
  34106. false
  34107. ]
  34108. }, function(name, value) {
  34109. var bubbles = value[0],
  34110. cancelable = value[1];
  34111. dispatchers[name] = function(targetEl, srcEvent) {
  34112. var e = API.createUIEvent(targetEl.ownerDocument, name, bubbles, cancelable, 1);
  34113. API.fireEvent(targetEl, name, e);
  34114. };
  34115. });
  34116. //---------
  34117. if (!API) {
  34118. // not even sure what ancient browsers fall into this category...
  34119. dispatchers = {};
  34120. // never mind all those we just built :P
  34121. API = {};
  34122. }
  34123. function cannotInject(target, srcEvent) {}
  34124. // TODO log something
  34125. return function(target) {
  34126. var me = this,
  34127. dispatcher = dispatchers[me.type] || cannotInject,
  34128. t = target ? (target.dom || target) : me.getTarget();
  34129. dispatcher(t, me);
  34130. };
  34131. }()),
  34132. // call to produce method
  34133. preventDefault: function(browserOnly) {
  34134. var me = this,
  34135. event = me.browserEvent,
  34136. parentEvent = me.parentEvent,
  34137. unselectable, target, fn;
  34138. // This check is for IE8/9. The event object may have been
  34139. // invalidated, so we can't delve into the details of it. If so,
  34140. // just fall out gracefully and don't attempt to do anything.
  34141. // eslint-disable-next-line valid-typeof
  34142. if (typeof event.type !== 'unknown') {
  34143. // In some cases we want to prevent default on the browser event
  34144. // but keep propagating it through our event system. For example,
  34145. // in Checkbox selection where the cells with checkboxes should
  34146. // prevent focusing on mousedown but still fire the click event.
  34147. if (!browserOnly) {
  34148. me.defaultPrevented = true;
  34149. }
  34150. // if the event was created by prototype-chaining a new object to an existing event
  34151. // instance, we need to make sure the parent event is defaultPrevented as well.
  34152. if (parentEvent) {
  34153. parentEvent.defaultPrevented = true;
  34154. }
  34155. if (event.preventDefault) {
  34156. event.preventDefault();
  34157. } else {
  34158. // The purpose of the code below is for preventDefault to stop focus from
  34159. // occurring like it does in other modern browsers. This only happens in
  34160. // IE8/9 when using attachEvent. The use of unselectable seems the most reliable
  34161. // way to prevent this from happening. We need to use a timeout to restore the
  34162. // unselectable state because if we don't setting it has no effect. It's important
  34163. // to set the atrribute to 'on' as opposed to just setting the property on the
  34164. // DOM element. See the link below for a discussion on the issue:
  34165. // http://bugs.jquery.com/ticket/10345
  34166. if (event.type === 'mousedown') {
  34167. target = event.target;
  34168. unselectable = target.getAttribute('unselectable');
  34169. if (unselectable !== 'on') {
  34170. target.setAttribute('unselectable', 'on');
  34171. fn = function() {
  34172. target.setAttribute('unselectable', unselectable);
  34173. };
  34174. // This function is hard to track, with a potential to be called
  34175. // for any HtmlElement in the document. It may be a Fly, it may
  34176. // not belong to any Component, and it may even be created by
  34177. // 3rd party code that we have no control over and cannot intercept
  34178. // the element being destroyed.
  34179. // On the other hand, the function is pretty simple, cannot lead
  34180. // to memory leaks and is only fired once. So, no harm no foul.
  34181. fn.$skipTimerCheck = true;
  34182. Ext.defer(fn, 1);
  34183. }
  34184. }
  34185. // IE9 and earlier do not support preventDefault
  34186. event.returnValue = false;
  34187. // Some keys events require setting the keyCode to -1 to be prevented
  34188. // all ctrl + X and F1 -> F12
  34189. if (event.ctrlKey || event.keyCode > 111 && event.keyCode < 124) {
  34190. event.keyCode = -1;
  34191. }
  34192. }
  34193. }
  34194. return me;
  34195. },
  34196. deprecated: {
  34197. '5.0': {
  34198. methods: {
  34199. /**
  34200. * @method clone
  34201. * @member Ext.event.Event
  34202. * Clones this event.
  34203. * @return {Ext.event.Event} The cloned copy
  34204. * @deprecated 5.0.0 This method is deprecated.
  34205. */
  34206. clone: function() {
  34207. return new this.self(this.browserEvent, this);
  34208. }
  34209. }
  34210. }
  34211. }
  34212. }, function() {
  34213. var Event = this,
  34214. btnMap;
  34215. if (Ext.isIE9m) {
  34216. btnMap = {
  34217. 0: 0,
  34218. 1: 0,
  34219. 4: 1,
  34220. 2: 2
  34221. };
  34222. Event.override({
  34223. statics: {
  34224. /**
  34225. * @member Ext.event.Event
  34226. * When events are attached using IE's attachEvent API instead of
  34227. * addEventListener accessing any members of an event object asynchronously
  34228. * results in "Member not found" error. To work around this we fabricate
  34229. * our own event object by copying all of its members to a new object.
  34230. * @param {Event} browserEvent The native browser event object
  34231. * @private
  34232. * @static
  34233. */
  34234. enableIEAsync: function(browserEvent) {
  34235. var name,
  34236. fakeEvent = {};
  34237. for (name in browserEvent) {
  34238. fakeEvent[name] = browserEvent[name];
  34239. }
  34240. return fakeEvent;
  34241. }
  34242. },
  34243. constructor: function(event, info, touchesMap, identifiers) {
  34244. var me = this;
  34245. me.callParent([
  34246. event,
  34247. info,
  34248. touchesMap,
  34249. identifiers
  34250. ]);
  34251. me.button = btnMap[event.button];
  34252. if (event.type === 'contextmenu') {
  34253. // IE8/9 reports click as 0, so we can at least attempt to infer here
  34254. me.button = 2;
  34255. }
  34256. // IE8 can throw an error when trying to access properties on a browserEvent
  34257. // object when the event has been buffered or delayed. Cache them here
  34258. // so we can access them later.
  34259. me.toElement = event.toElement;
  34260. me.fromElement = event.fromElement;
  34261. },
  34262. mouseLeaveRe: /(mouseout|mouseleave)/,
  34263. mouseEnterRe: /(mouseover|mouseenter)/,
  34264. /**
  34265. * @method enableIEAsync
  34266. * @member Ext.event.Event
  34267. * @inheritdoc Ext.event.Event#static-method-enableIEAsync
  34268. * @private
  34269. */
  34270. enableIEAsync: function(browserEvent) {
  34271. this.browserEvent = this.self.enableIEAsync(browserEvent);
  34272. },
  34273. getRelatedTarget: function(selector, maxDepth, returnEl) {
  34274. var me = this,
  34275. type, target;
  34276. if (!me.relatedTarget) {
  34277. type = me.type;
  34278. if (me.mouseLeaveRe.test(type)) {
  34279. target = me.toElement;
  34280. } else if (me.mouseEnterRe.test(type)) {
  34281. target = me.fromElement;
  34282. }
  34283. if (target) {
  34284. me.relatedTarget = me.self.resolveTextNode(target);
  34285. }
  34286. }
  34287. return me.callParent([
  34288. selector,
  34289. maxDepth,
  34290. returnEl
  34291. ]);
  34292. }
  34293. });
  34294. // We place these listeners to capture Tab and Shift-Tab key strokes
  34295. // and pass this information in the focus/blur event if it happens
  34296. // between keydown/keyup pair.
  34297. document.attachEvent('onkeydown', Ext.event.Event.globalTabKeyDown);
  34298. document.attachEvent('onkeyup', Ext.event.Event.globalTabKeyUp);
  34299. window.attachEvent('onunload', function() {
  34300. document.detachEvent('onkeydown', Ext.event.Event.globalTabKeyDown);
  34301. document.detachEvent('onkeyup', Ext.event.Event.globalTabKeyUp);
  34302. });
  34303. }
  34304. });
  34305. Ext.define('Ext.overrides.event.publisher.Dom', {
  34306. override: 'Ext.event.publisher.Dom'
  34307. }, function(DomPublisher) {
  34308. var focusEvents = {
  34309. focus: true,
  34310. focusin: true,
  34311. focusout: true,
  34312. blur: true
  34313. };
  34314. if (Ext.isIE10m) {
  34315. DomPublisher.override({
  34316. isEventBlocked: function(e) {
  34317. if (!focusEvents[e.type]) {
  34318. return this.callParent([
  34319. e
  34320. ]);
  34321. }
  34322. // eslint-disable-next-line vars-on-top
  34323. var body = document.body,
  34324. ev = e.browserEvent,
  34325. el = Ext.synchronouslyFocusing;
  34326. /* eslint-disable max-len, brace-style */
  34327. // This horrid hack is necessary to work around the issue with input elements
  34328. // in IE10m that can fail to focus under certain conditions. See comment in
  34329. // Ext.dom.Element override.
  34330. if (el && ((ev.type === 'focusout' && (ev.srcElement === el || ev.srcElement === window) && ev.toElement === body) || (ev.type === 'focusin' && (ev.srcElement === body || ev.srcElement === window) && ev.fromElement === el && ev.toElement === null))) {
  34331. return true;
  34332. }
  34333. /* eslint-enable max-len, brace-style */
  34334. return false;
  34335. }
  34336. });
  34337. }
  34338. if (Ext.isIE9m) {
  34339. // eslint-disable-next-line vars-on-top
  34340. var docElement = document.documentElement,
  34341. docBody = document.body,
  34342. prototype = DomPublisher.prototype,
  34343. onDirectEvent, onDirectCaptureEvent;
  34344. // eslint-disable-line no-unused-vars
  34345. prototype.target = document;
  34346. prototype.directBoundListeners = {};
  34347. // This method gets bound to the element scope in addDirectListener so that
  34348. // the currentTarget can be captured using "this".
  34349. onDirectEvent = function(e, publisher, capture) {
  34350. e.target = e.srcElement || window;
  34351. e.currentTarget = this;
  34352. if (capture) {
  34353. // Although directly attached capture listeners are not supported in IE9m
  34354. // we still need to call the handler so at least the event fires.
  34355. publisher.onDirectCaptureEvent(e);
  34356. } else {
  34357. publisher.onDirectEvent(e);
  34358. }
  34359. };
  34360. onDirectCaptureEvent = function(e, publisher) {
  34361. e.target = e.srcElement || window;
  34362. e.currentTarget = this;
  34363. // this, not DomPublisher
  34364. publisher.onDirectCaptureEvent(e);
  34365. };
  34366. DomPublisher.override({
  34367. addDelegatedListener: function(eventName) {
  34368. this.delegatedListeners[eventName] = 1;
  34369. // Use attachEvent for IE9 and below. Even though IE9 strict supports
  34370. // addEventListener, it has issues with using synthetic events.
  34371. this.target.attachEvent('on' + eventName, this.onDelegatedEvent);
  34372. },
  34373. removeDelegatedListener: function(eventName) {
  34374. delete this.delegatedListeners[eventName];
  34375. this.target.detachEvent('on' + eventName, this.onDelegatedEvent);
  34376. },
  34377. addDirectListener: function(eventName, element, capture) {
  34378. var me = this,
  34379. dom = element.dom,
  34380. // binding the listener to the element allows us to capture the
  34381. // "currentTarget" (see onDirectEvent)
  34382. boundFn = Ext.Function.bind(onDirectEvent, dom, [
  34383. me,
  34384. capture
  34385. ], true),
  34386. directBoundListeners = me.directBoundListeners,
  34387. handlers = directBoundListeners[eventName] || (directBoundListeners[eventName] = {});
  34388. handlers[dom.id] = boundFn;
  34389. // may be called with an SVG element here, which
  34390. // does not have the attachEvent method on IE 9 strict
  34391. if (dom.attachEvent) {
  34392. dom.attachEvent('on' + eventName, boundFn);
  34393. } else {
  34394. me.callParent([
  34395. eventName,
  34396. element,
  34397. capture
  34398. ]);
  34399. }
  34400. },
  34401. removeDirectListener: function(eventName, element, capture) {
  34402. var dom = element.dom;
  34403. if (dom.detachEvent) {
  34404. dom.detachEvent('on' + eventName, this.directBoundListeners[eventName][dom.id]);
  34405. } else {
  34406. this.callParent([
  34407. eventName,
  34408. element,
  34409. capture
  34410. ]);
  34411. }
  34412. },
  34413. doDelegatedEvent: function(e) {
  34414. e.target = e.srcElement || window;
  34415. if (e.type === 'focusin') {
  34416. // IE8 sometimes happen to focus <html> element instead of the body
  34417. // eslint-disable-next-line max-len
  34418. e.relatedTarget = e.fromElement === docBody || e.fromElement === docElement ? null : e.fromElement;
  34419. } else if (e.type === 'focusout') {
  34420. // eslint-disable-next-line max-len
  34421. e.relatedTarget = e.toElement === docBody || e.toElement === docElement ? null : e.toElement;
  34422. }
  34423. return this.callParent([
  34424. e
  34425. ]);
  34426. }
  34427. });
  34428. // can't capture any events without addEventListener. Have to have direct
  34429. // listeners for every event that does not bubble.
  34430. Ext.apply(prototype.directEvents, prototype.captureEvents);
  34431. // These do not bubble in IE9m so have to attach direct listeners as well.
  34432. Ext.apply(prototype.directEvents, {
  34433. change: 1,
  34434. input: 1,
  34435. paste: 1
  34436. });
  34437. prototype.captureEvents = {};
  34438. }
  34439. });
  34440. Ext.define('Ext.overrides.event.publisher.Gesture', {
  34441. override: 'Ext.event.publisher.Gesture'
  34442. }, function() {
  34443. if (Ext.isIE9m) {
  34444. this.override({
  34445. updateTouches: function(e, isEnd) {
  34446. var browserEvent = e.browserEvent,
  34447. xy = e.getXY();
  34448. // I don't always set pageX and pageY on the event object, but when I do
  34449. // it's because the Gesture publisher expects an event object that has them.
  34450. browserEvent.pageX = xy[0];
  34451. browserEvent.pageY = xy[1];
  34452. this.callParent([
  34453. e,
  34454. isEnd
  34455. ]);
  34456. },
  34457. doDelegatedEvent: function(e) {
  34458. // Workaround IE's "Member not found" errors when accessing an event
  34459. // object asynchronously. Needed for all gesture handlers because
  34460. // they use requestAnimationFrame (see enableIEAsync for more details)
  34461. this.callParent([
  34462. Ext.event.Event.enableIEAsync(e)
  34463. ]);
  34464. }
  34465. });
  34466. }
  34467. });
  34468. /**
  34469. * @class Ext.dom.Element
  34470. * @override Ext.dom.Element
  34471. */
  34472. Ext.define('Ext.overrides.dom.Element', (function() {
  34473. var Element,
  34474. // we cannot do this yet "= Ext.dom.Element"
  34475. WIN = window,
  34476. DOC = document,
  34477. HIDDEN = 'hidden',
  34478. ISCLIPPED = 'isClipped',
  34479. OVERFLOW = 'overflow',
  34480. OVERFLOWX = 'overflow-x',
  34481. OVERFLOWY = 'overflow-y',
  34482. ORIGINALCLIP = 'originalClip',
  34483. HEIGHT = 'height',
  34484. WIDTH = 'width',
  34485. VISIBILITY = 'visibility',
  34486. DISPLAY = 'display',
  34487. NONE = 'none',
  34488. OFFSETS = 'offsets',
  34489. CLIP = 'clip',
  34490. ORIGINALDISPLAY = 'originalDisplay',
  34491. VISMODE = 'visibilityMode',
  34492. ISVISIBLE = 'isVisible',
  34493. OFFSETCLASS = Ext.baseCSSPrefix + 'hidden-offsets',
  34494. CLIPCLASS = Ext.baseCSSPrefix + 'hidden-clip',
  34495. /* eslint-disable indent */
  34496. boxMarkup = [
  34497. '<div class="{0}-tl" role="presentation">',
  34498. '<div class="{0}-tr" role="presentation">',
  34499. '<div class="{0}-tc" role="presentation"></div>',
  34500. '</div>',
  34501. '</div>',
  34502. '<div class="{0}-ml" role="presentation">',
  34503. '<div class="{0}-mr" role="presentation">',
  34504. '<div class="{0}-mc" role="presentation"></div>',
  34505. '</div>',
  34506. '</div>',
  34507. '<div class="{0}-bl" role="presentation">',
  34508. '<div class="{0}-br" role="presentation">',
  34509. '<div class="{0}-bc" role="presentation"></div>',
  34510. '</div>',
  34511. '</div>'
  34512. ].join(''),
  34513. /* eslint-enable indent */
  34514. scriptTagRe = /(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,
  34515. replaceScriptTagRe = /(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,
  34516. srcRe = /\ssrc=(['"])(.*?)\1/i,
  34517. nonSpaceRe = /\S/,
  34518. typeRe = /\stype=(['"])(.*?)\1/i,
  34519. adjustDirect2DTableRe = /table-row|table-.*-group/,
  34520. msRe = /^-ms-/,
  34521. camelRe = /(-[a-z])/gi,
  34522. camelReplaceFn = function(m, a) {
  34523. return a.charAt(1).toUpperCase();
  34524. },
  34525. XMASKED = Ext.baseCSSPrefix + "masked",
  34526. XMASKEDRELATIVE = Ext.baseCSSPrefix + "masked-relative",
  34527. EXTELMASKMSG = Ext.baseCSSPrefix + "mask-msg",
  34528. bodyRe = /^body/i,
  34529. propertyCache = {},
  34530. getVisMode = function(el) {
  34531. var data = el.getData(),
  34532. visMode = data[VISMODE];
  34533. if (visMode === undefined) {
  34534. data[VISMODE] = visMode = Element.VISIBILITY;
  34535. }
  34536. return visMode;
  34537. },
  34538. emptyRange = DOC.createRange ? DOC.createRange() : null,
  34539. syncContentFly;
  34540. if (Ext.isIE8) {
  34541. // eslint-disable-next-line vars-on-top
  34542. var garbageBin = DOC.createElement('div'),
  34543. destroyQueue = [],
  34544. // prevent memory leaks in IE8
  34545. // see http://social.msdn.microsoft.com/Forums/ie/en-US/c76967f0-dcf8-47d0-8984-8fe1282a94f5/ie-appendchildremovechild-memory-problem?forum=iewebdevelopment
  34546. // This function is called to fully destroy an element on a timer so that code
  34547. // following the remove call can still access the element.
  34548. clearGarbage,
  34549. clearGarbageFn = function() {
  34550. var len = destroyQueue.length,
  34551. i;
  34552. for (i = 0; i < len; i++) {
  34553. garbageBin.appendChild(destroyQueue[i]);
  34554. }
  34555. garbageBin.innerHTML = '';
  34556. destroyQueue.length = 0;
  34557. };
  34558. clearGarbageFn.$skipTimerCheck = true;
  34559. clearGarbage = Ext.Function.createBuffered(clearGarbageFn, 10);
  34560. }
  34561. return {
  34562. override: 'Ext.dom.Element',
  34563. mixins: [
  34564. 'Ext.util.Animate'
  34565. ],
  34566. uses: [
  34567. 'Ext.dom.GarbageCollector',
  34568. 'Ext.dom.Fly',
  34569. 'Ext.event.publisher.MouseEnterLeave',
  34570. 'Ext.fx.Manager',
  34571. 'Ext.fx.Anim'
  34572. ],
  34573. skipGarbageCollection: false,
  34574. _init: function(E) {
  34575. Element = E;
  34576. // now we can poke this into closure scope
  34577. // We want to expose destroyQueue on the prototype for testing purposes
  34578. if (WIN.__UNIT_TESTING__) {
  34579. E.destroyQueue = destroyQueue;
  34580. }
  34581. },
  34582. statics: {
  34583. normalize: function(prop) {
  34584. if (prop === 'float') {
  34585. prop = Ext.supports.Float ? 'cssFloat' : 'styleFloat';
  34586. }
  34587. // For '-ms-foo' we need msFoo
  34588. return propertyCache[prop] || (propertyCache[prop] = prop.replace(msRe, 'ms-').replace(camelRe, camelReplaceFn));
  34589. }
  34590. },
  34591. /**
  34592. * Convenience method for constructing a KeyMap
  34593. * @param {String/Number/Number[]/Object} key Either a string with the keys to listen for,
  34594. * the numeric key code, array of key codes or an object with the following options:
  34595. * @param {Number/Array} key.key
  34596. * @param {Boolean} key.shift
  34597. * @param {Boolean} key.ctrl
  34598. * @param {Boolean} key.alt
  34599. * @param {Function} fn The function to call
  34600. * @param {Object} [scope] The scope (`this` reference) in which the specified function
  34601. * is executed. Defaults to this Element.
  34602. * @return {Ext.util.KeyMap} The KeyMap created
  34603. */
  34604. addKeyListener: function(key, fn, scope) {
  34605. var config;
  34606. if (typeof key !== 'object' || Ext.isArray(key)) {
  34607. config = {
  34608. target: this,
  34609. key: key,
  34610. fn: fn,
  34611. scope: scope
  34612. };
  34613. } else {
  34614. config = {
  34615. target: this,
  34616. key: key.key,
  34617. shift: key.shift,
  34618. ctrl: key.ctrl,
  34619. alt: key.alt,
  34620. fn: fn,
  34621. scope: scope
  34622. };
  34623. }
  34624. return new Ext.util.KeyMap(config);
  34625. },
  34626. /**
  34627. * Creates a KeyMap for this element
  34628. * @param {Object} config The KeyMap config. See {@link Ext.util.KeyMap} for more details
  34629. * @return {Ext.util.KeyMap} The KeyMap created
  34630. */
  34631. addKeyMap: function(config) {
  34632. return new Ext.util.KeyMap(Ext.apply({
  34633. target: this
  34634. }, config));
  34635. },
  34636. /**
  34637. * @private
  34638. * Returns the fractional portion of this element's measurement in the given dimension.
  34639. * (IE9+ only)
  34640. * @return {Number}
  34641. */
  34642. adjustDirect2DDimension: function(dimension) {
  34643. var me = this,
  34644. dom = me.dom,
  34645. display = me.getStyle('display'),
  34646. inlineDisplay = dom.style.display,
  34647. inlinePosition = dom.style.position,
  34648. originIndex = dimension === WIDTH ? 0 : 1,
  34649. currentStyle = dom.currentStyle,
  34650. floating;
  34651. if (display === 'inline') {
  34652. dom.style.display = 'inline-block';
  34653. }
  34654. dom.style.position = display.match(adjustDirect2DTableRe) ? 'absolute' : 'static';
  34655. // floating will contain digits that appears after the decimal point
  34656. // if height or width are set to auto we fallback to msTransformOrigin calculation
  34657. // Use currentStyle here instead of getStyle. In some difficult to reproduce
  34658. // instances it resets the scrollWidth of the element
  34659. floating = (parseFloat(currentStyle[dimension]) || parseFloat(currentStyle.msTransformOrigin.split(' ')[originIndex]) * 2) % 1;
  34660. dom.style.position = inlinePosition;
  34661. if (display === 'inline') {
  34662. dom.style.display = inlineDisplay;
  34663. }
  34664. return floating;
  34665. },
  34666. /**
  34667. * @private
  34668. */
  34669. afterAnimate: function() {
  34670. var shadow = this.shadow;
  34671. if (shadow && !shadow.disabled && !shadow.animate) {
  34672. shadow.show();
  34673. }
  34674. },
  34675. /**
  34676. * @private
  34677. */
  34678. anchorAnimX: function(anchor) {
  34679. var xName = (anchor === 'l') ? 'right' : 'left';
  34680. this.dom.style[xName] = '0px';
  34681. },
  34682. /**
  34683. * @private
  34684. * process the passed fx configuration.
  34685. */
  34686. anim: function(config) {
  34687. if (!Ext.isObject(config)) {
  34688. return (config) ? {} : false;
  34689. }
  34690. // eslint-disable-next-line vars-on-top
  34691. var me = this,
  34692. duration = config.duration || Ext.fx.Anim.prototype.duration,
  34693. easing = config.easing || 'ease',
  34694. animConfig;
  34695. if (config.stopAnimation) {
  34696. me.stopAnimation();
  34697. }
  34698. Ext.applyIf(config, Ext.fx.Manager.getFxDefaults(me.id));
  34699. // Clear any 'paused' defaults.
  34700. Ext.fx.Manager.setFxDefaults(me.id, {
  34701. delay: 0
  34702. });
  34703. animConfig = {
  34704. // Pass the DOM reference. That's tested first so will be converted
  34705. // to an Ext.fx.Target fastest.
  34706. target: me.dom,
  34707. remove: config.remove,
  34708. alternate: config.alternate || false,
  34709. duration: duration,
  34710. easing: easing,
  34711. callback: config.callback,
  34712. listeners: config.listeners,
  34713. iterations: config.iterations || 1,
  34714. scope: config.scope,
  34715. block: config.block,
  34716. concurrent: config.concurrent,
  34717. delay: config.delay || 0,
  34718. paused: true,
  34719. keyframes: config.keyframes,
  34720. from: config.from || {},
  34721. to: Ext.apply({}, config),
  34722. userConfig: config
  34723. };
  34724. Ext.apply(animConfig.to, config.to);
  34725. // Anim API properties - backward compat
  34726. delete animConfig.to.to;
  34727. delete animConfig.to.from;
  34728. delete animConfig.to.remove;
  34729. delete animConfig.to.alternate;
  34730. delete animConfig.to.keyframes;
  34731. delete animConfig.to.iterations;
  34732. delete animConfig.to.listeners;
  34733. delete animConfig.to.target;
  34734. delete animConfig.to.paused;
  34735. delete animConfig.to.callback;
  34736. delete animConfig.to.scope;
  34737. delete animConfig.to.duration;
  34738. delete animConfig.to.easing;
  34739. delete animConfig.to.concurrent;
  34740. delete animConfig.to.block;
  34741. delete animConfig.to.stopAnimation;
  34742. delete animConfig.to.delay;
  34743. return animConfig;
  34744. },
  34745. /**
  34746. * Calls `{@link #addAnimation}` and returns this Element (for call chaining). For
  34747. * details, see `{@link #addAnimation}`.
  34748. *
  34749. * @param {Object} config Configuration for {@link Ext.fx.Anim}.
  34750. * Note that the {@link Ext.fx.Anim#to to} config is required.
  34751. * @return {Ext.dom.Element} this
  34752. */
  34753. animate: function(config) {
  34754. this.addAnimation(config);
  34755. return this;
  34756. },
  34757. /**
  34758. * Starts a custom animation on this Element.
  34759. *
  34760. * The following properties may be specified in `from`, `to`, and `keyframe` objects:
  34761. *
  34762. * - `x` - The page X position in pixels.
  34763. * - `y` - The page Y position in pixels
  34764. * - `left` - The element's CSS `left` value. Units must be supplied.
  34765. * - `top` - The element's CSS `top` value. Units must be supplied.
  34766. * - `width` - The element's CSS `width` value. Units must be supplied.
  34767. * - `height` - The element's CSS `height` value. Units must be supplied.
  34768. * - `scrollLeft` - The element's `scrollLeft` value.
  34769. * - `scrollTop` - The element's `scrollTop` value.
  34770. * - `opacity` - The element's `opacity` value (between `0` and `1`).
  34771. *
  34772. * **Be aware** that animating an Element which is being used by an Ext Component
  34773. * without in some way informing the Component about the changed element state will
  34774. * result in incorrect Component behaviour. This is because the Component will be
  34775. * using the old state of the element. To avoid this problem, it is now possible
  34776. * to directly animate certain properties of Components.
  34777. *
  34778. * @param {Object} config Configuration for {@link Ext.fx.Anim}.
  34779. * Note that the {@link Ext.fx.Anim#to to} config is required.
  34780. * @return {Ext.fx.Anim} The new animation.
  34781. */
  34782. addAnimation: function(config) {
  34783. var me = this,
  34784. animId = me.dom.id || Ext.id(me.dom),
  34785. listeners, anim, end;
  34786. if (!Ext.fx.Manager.hasFxBlock(animId)) {
  34787. // Bit of gymnastics here to ensure our internal listeners get bound first
  34788. if (config.listeners) {
  34789. listeners = config.listeners;
  34790. delete config.listeners;
  34791. }
  34792. if (config.internalListeners) {
  34793. config.listeners = config.internalListeners;
  34794. delete config.internalListeners;
  34795. }
  34796. end = config.autoEnd;
  34797. delete config.autoEnd;
  34798. anim = new Ext.fx.Anim(me.anim(config));
  34799. anim.on({
  34800. afteranimate: 'afterAnimate',
  34801. beforeanimate: 'beforeAnimate',
  34802. scope: me,
  34803. single: true
  34804. });
  34805. if (listeners) {
  34806. anim.on(listeners);
  34807. }
  34808. Ext.fx.Manager.queueFx(anim);
  34809. if (end) {
  34810. anim.jumpToEnd();
  34811. }
  34812. }
  34813. return anim;
  34814. },
  34815. /**
  34816. * @private
  34817. */
  34818. beforeAnimate: function() {
  34819. var shadow = this.shadow;
  34820. if (shadow && !shadow.disabled && !shadow.animate) {
  34821. shadow.hide();
  34822. }
  34823. },
  34824. /**
  34825. * Wraps the specified element with a special 9 element markup/CSS block that renders
  34826. * by default as a gray container with a gradient background, rounded corners
  34827. * and a 4-way shadow.
  34828. *
  34829. * This special markup is used throughout Ext when box wrapping elements
  34830. * ({@link Ext.button.Button}, {@link Ext.panel.Panel} when
  34831. * {@link Ext.panel.Panel#frame frame=true}, {@link Ext.window.Window}).
  34832. * The markup is of this form:
  34833. *
  34834. * <div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div>
  34835. * <div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div>
  34836. * <div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>
  34837. *
  34838. * Example usage:
  34839. *
  34840. * // Basic box wrap
  34841. * Ext.get("foo").boxWrap();
  34842. *
  34843. * // You can also add a custom class and use CSS inheritance rules to customize
  34844. * // the box look.
  34845. * // 'x-box-blue' is a built-in alternative -- look at the related CSS definitions
  34846. * // as an example for how to create a custom box wrap style.
  34847. * Ext.get("foo").boxWrap().addCls("x-box-blue");
  34848. *
  34849. * @param {String} [cls='x-box'] A base CSS class to apply to the containing wrapper
  34850. * element. Note that there are a number of CSS rules that are dependent on this name
  34851. * to make the overall effect work, so if you supply an alternate base class, make sure
  34852. * you also supply all of the necessary rules.
  34853. * @return {Ext.dom.Element} The outermost wrapping element of the created box structure.
  34854. */
  34855. boxWrap: function(cls) {
  34856. var el;
  34857. cls = cls || Ext.baseCSSPrefix + 'box';
  34858. el = Ext.get(this.insertHtml("beforeBegin", "<div class='" + cls + "' role='presentation'>" + Ext.String.format(boxMarkup, cls) + "</div>"));
  34859. el.selectNode('.' + cls + '-mc').appendChild(this.dom);
  34860. return el;
  34861. },
  34862. /**
  34863. * Removes Empty, or whitespace filled text nodes. Combines adjacent text nodes.
  34864. * @param {Boolean} [forceReclean=false] By default the element keeps track if it has been
  34865. * cleaned already so you can call this over and over. However, if you update the element
  34866. * and need to force a re-clean, you can pass true.
  34867. */
  34868. clean: function(forceReclean) {
  34869. var me = this,
  34870. dom = me.dom,
  34871. data = me.getData(),
  34872. n = dom.firstChild,
  34873. ni = -1,
  34874. nx;
  34875. if (data.isCleaned && forceReclean !== true) {
  34876. return me;
  34877. }
  34878. while (n) {
  34879. nx = n.nextSibling;
  34880. if (n.nodeType === 3) {
  34881. // Remove empty/whitespace text nodes
  34882. if (!(nonSpaceRe.test(n.nodeValue))) {
  34883. dom.removeChild(n);
  34884. }
  34885. // Combine adjacent text nodes
  34886. else if (nx && nx.nodeType === 3) {
  34887. n.appendData(Ext.String.trim(nx.data));
  34888. dom.removeChild(nx);
  34889. nx = n.nextSibling;
  34890. n.nodeIndex = ++ni;
  34891. }
  34892. } else {
  34893. // Recursively clean
  34894. Ext.fly(n, '_clean').clean();
  34895. n.nodeIndex = ++ni;
  34896. }
  34897. n = nx;
  34898. }
  34899. data.isCleaned = true;
  34900. return me;
  34901. },
  34902. /**
  34903. * @method
  34904. * Empties this element. Removes all child nodes.
  34905. */
  34906. empty: emptyRange ? function() {
  34907. var dom = this.dom;
  34908. if (dom.firstChild) {
  34909. emptyRange.setStartBefore(dom.firstChild);
  34910. emptyRange.setEndAfter(dom.lastChild);
  34911. emptyRange.deleteContents();
  34912. }
  34913. } : function() {
  34914. var dom = this.dom;
  34915. while (dom.lastChild) {
  34916. dom.removeChild(dom.lastChild);
  34917. }
  34918. },
  34919. clearListeners: function() {
  34920. this.removeAnchor();
  34921. this.callParent();
  34922. },
  34923. /**
  34924. * Clears positioning back to the default when the document was loaded.
  34925. * @param {String} [value=''] The value to use for the left, right, top, bottom.
  34926. * You could use 'auto'.
  34927. * @return {Ext.dom.Element} this
  34928. */
  34929. clearPositioning: function(value) {
  34930. value = value || '';
  34931. return this.setStyle({
  34932. left: value,
  34933. right: value,
  34934. top: value,
  34935. bottom: value,
  34936. 'z-index': '',
  34937. position: 'static'
  34938. });
  34939. },
  34940. /**
  34941. * Creates a proxy element of this element
  34942. * @param {String/Object} config The class name of the proxy element or a DomHelper config
  34943. * object
  34944. * @param {String/HTMLElement} [renderTo] The element or element id to render the proxy to.
  34945. * Defaults to: document.body.
  34946. * @param {Boolean} [matchBox=false] True to align and size the proxy to this element now.
  34947. * @return {Ext.dom.Element} The new proxy element
  34948. */
  34949. createProxy: function(config, renderTo, matchBox) {
  34950. config = (typeof config === 'object') ? config : {
  34951. tag: "div",
  34952. role: 'presentation',
  34953. cls: config
  34954. };
  34955. // eslint-disable-next-line vars-on-top
  34956. var me = this,
  34957. proxy = renderTo ? Ext.DomHelper.append(renderTo, config, true) : Ext.DomHelper.insertBefore(me.dom, config, true);
  34958. proxy.setVisibilityMode(Element.DISPLAY);
  34959. proxy.hide();
  34960. // check to make sure Element_position.js is loaded
  34961. if (matchBox && me.setBox && me.getBox) {
  34962. proxy.setBox(me.getBox());
  34963. }
  34964. return proxy;
  34965. },
  34966. /**
  34967. * Clears any opacity settings from this element. Required in some cases for IE.
  34968. * @return {Ext.dom.Element} this
  34969. */
  34970. clearOpacity: function() {
  34971. return this.setOpacity('');
  34972. },
  34973. /**
  34974. * Store the current overflow setting and clip overflow on the element - use {@link #unclip}
  34975. * to remove
  34976. * @return {Ext.dom.Element} this
  34977. */
  34978. clip: function() {
  34979. var me = this,
  34980. data = me.getData(),
  34981. style;
  34982. if (!data[ISCLIPPED]) {
  34983. data[ISCLIPPED] = true;
  34984. style = me.getStyle([
  34985. OVERFLOW,
  34986. OVERFLOWX,
  34987. OVERFLOWY
  34988. ]);
  34989. data[ORIGINALCLIP] = {
  34990. o: style[OVERFLOW],
  34991. x: style[OVERFLOWX],
  34992. y: style[OVERFLOWY]
  34993. };
  34994. me.setStyle(OVERFLOW, HIDDEN);
  34995. me.setStyle(OVERFLOWX, HIDDEN);
  34996. me.setStyle(OVERFLOWY, HIDDEN);
  34997. }
  34998. return me;
  34999. },
  35000. destroy: function() {
  35001. var me = this,
  35002. dom = me.dom,
  35003. data = me.peekData(),
  35004. maskEl, maskMsg;
  35005. if (dom) {
  35006. if (me.isAnimate) {
  35007. me.stopAnimation(true);
  35008. }
  35009. me.removeAnchor();
  35010. }
  35011. if (me.deferredFocusTimer) {
  35012. Ext.undefer(me.deferredFocusTimer);
  35013. me.deferredFocusTimer = null;
  35014. }
  35015. me.callParent();
  35016. // prevent memory leaks in IE8
  35017. // see http://social.msdn.microsoft.com/Forums/ie/en-US/c76967f0-dcf8-47d0-8984-8fe1282a94f5/ie-appendchildremovechild-memory-problem?forum=iewebdevelopment
  35018. // must not be document, documentElement, body or window object
  35019. // Have to use != instead of !== for IE8 or it will not recognize that the window
  35020. // objects are equal
  35021. // eslint-disable-next-line eqeqeq
  35022. if (dom && Ext.isIE8 && (dom.window != dom) && (dom.nodeType !== 9) && (dom.tagName !== 'BODY') && (dom.tagName !== 'HTML')) {
  35023. destroyQueue[destroyQueue.length] = dom;
  35024. // Will perform extra IE8 cleanup in 10 milliseconds
  35025. // see http://social.msdn.microsoft.com/Forums/ie/en-US/c76967f0-dcf8-47d0-8984-8fe1282a94f5/ie-appendchildremovechild-memory-problem?forum=iewebdevelopment
  35026. clearGarbage();
  35027. }
  35028. if (data) {
  35029. maskEl = data.maskEl;
  35030. maskMsg = data.maskMsg;
  35031. if (maskEl) {
  35032. maskEl.destroy();
  35033. }
  35034. if (maskMsg) {
  35035. maskMsg.destroy();
  35036. }
  35037. }
  35038. },
  35039. /**
  35040. * Convenience method for setVisibilityMode(Element.DISPLAY).
  35041. * @param {String} [display] What to set display to when visible
  35042. * @return {Ext.dom.Element} this
  35043. */
  35044. enableDisplayMode: function(display) {
  35045. var me = this;
  35046. me.setVisibilityMode(Element.DISPLAY);
  35047. if (display !== undefined) {
  35048. me.getData()[ORIGINALDISPLAY] = display;
  35049. }
  35050. return me;
  35051. },
  35052. /**
  35053. * Fade an element in (from transparent to opaque). The ending opacity can be specified
  35054. * using the `opacity` config option. Usage:
  35055. *
  35056. * // default: fade in from opacity 0 to 100%
  35057. * el.fadeIn();
  35058. *
  35059. * // custom: fade in from opacity 0 to 75% over 2 seconds
  35060. * el.fadeIn({ opacity: .75, duration: 2000});
  35061. *
  35062. * // common config options shown with default values
  35063. * el.fadeIn({
  35064. * opacity: 1, //can be any value between 0 and 1 (e.g. .5)
  35065. * easing: 'easeOut',
  35066. * duration: 500
  35067. * });
  35068. *
  35069. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim}
  35070. * config options
  35071. * @return {Ext.dom.Element} The Element
  35072. */
  35073. fadeIn: function(options) {
  35074. var me = this,
  35075. dom = me.dom,
  35076. animFly = new Ext.dom.Fly();
  35077. me.animate(Ext.apply({}, options, {
  35078. opacity: 1,
  35079. internalListeners: {
  35080. beforeanimate: function(anim) {
  35081. // Reattach to the DOM in case the caller animated a Fly
  35082. // in which case the dom reference will have changed by now.
  35083. animFly.attach(dom);
  35084. // restore any visibility/display that may have
  35085. // been applied by a fadeout animation
  35086. if (animFly.isStyle('display', 'none')) {
  35087. animFly.setDisplayed('');
  35088. } else {
  35089. animFly.show();
  35090. }
  35091. }
  35092. }
  35093. }));
  35094. return this;
  35095. },
  35096. /**
  35097. * Fade an element out (from opaque to transparent). The ending opacity can be specified
  35098. * using the `opacity` config option. Note that IE may require `useDisplay: true` in order
  35099. * to redisplay correctly. Usage:
  35100. *
  35101. * // default: fade out from the element's current opacity to 0
  35102. * el.fadeOut();
  35103. *
  35104. * // custom: fade out from the element's current opacity to 25% over 2 seconds
  35105. * el.fadeOut({ opacity: .25, duration: 2000});
  35106. *
  35107. * // common config options shown with default values
  35108. * el.fadeOut({
  35109. * opacity: 0, //can be any value between 0 and 1 (e.g. .5)
  35110. * easing: 'easeOut',
  35111. * duration: 500,
  35112. * remove: false,
  35113. * useDisplay: false
  35114. * });
  35115. *
  35116. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim}
  35117. * config options
  35118. * @return {Ext.dom.Element} The Element
  35119. */
  35120. fadeOut: function(options) {
  35121. var me = this,
  35122. dom = me.dom,
  35123. animFly = new Ext.dom.Fly();
  35124. options = Ext.apply({
  35125. opacity: 0,
  35126. internalListeners: {
  35127. afteranimate: function(anim) {
  35128. if (anim.to.opacity === 0) {
  35129. // Reattach to the DOM in case the caller animated a Fly
  35130. // in which case the dom reference will have changed by now.
  35131. animFly.attach(dom);
  35132. // Reattach to the DOM in case the caller animated a Fly
  35133. // in which case the dom reference will have changed by now.
  35134. animFly.attach(dom);
  35135. if (options.useDisplay) {
  35136. animFly.setDisplayed(false);
  35137. } else {
  35138. animFly.hide();
  35139. }
  35140. }
  35141. }
  35142. }
  35143. }, options);
  35144. me.animate(options);
  35145. return me;
  35146. },
  35147. /**
  35148. * @private
  35149. */
  35150. fixDisplay: function() {
  35151. var me = this;
  35152. if (me.isStyle(DISPLAY, NONE)) {
  35153. me.setStyle(VISIBILITY, HIDDEN);
  35154. me.setStyle(DISPLAY, me._getDisplay());
  35155. // first try reverting to default
  35156. if (me.isStyle(DISPLAY, NONE)) {
  35157. // if that fails, default to block
  35158. me.setStyle(DISPLAY, "block");
  35159. }
  35160. }
  35161. },
  35162. /**
  35163. * Shows a ripple of exploding, attenuating borders to draw attention to an Element. Usage:
  35164. *
  35165. * // default: a single light blue ripple
  35166. * el.frame();
  35167. *
  35168. * // custom: 3 red ripples lasting 3 seconds total
  35169. * el.frame("#ff0000", 3, { duration: 3000 });
  35170. *
  35171. * // common config options shown with default values
  35172. * el.frame("#C3DAF9", 1, {
  35173. * duration: 1000 // duration of each individual ripple.
  35174. * // Note: Easing is not configurable and will be ignored if included
  35175. * });
  35176. *
  35177. * @param {String} [color='#C3DAF9'] The hex color value for the border.
  35178. * @param {Number} [count=1] The number of ripples to display.
  35179. * @param {Object} [obj] Object literal with any of the {@link Ext.fx.Anim} config options
  35180. * @return {Ext.dom.Element} The Element
  35181. */
  35182. frame: function(color, count, obj) {
  35183. var me = this,
  35184. dom = me.dom,
  35185. animFly = new Ext.dom.Fly(),
  35186. beforeAnim;
  35187. color = color || '#C3DAF9';
  35188. count = count || 1;
  35189. obj = obj || {};
  35190. beforeAnim = function() {
  35191. var animScope = this,
  35192. box, proxy, proxyAnim;
  35193. // Reattach to the DOM in case the caller animated a Fly
  35194. // in which case the dom reference will have changed by now.
  35195. animFly.attach(dom);
  35196. animFly.show();
  35197. box = animFly.getBox();
  35198. proxy = Ext.getBody().createChild({
  35199. role: 'presentation',
  35200. id: animFly.dom.id + '-anim-proxy',
  35201. style: {
  35202. position: 'absolute',
  35203. 'pointer-events': 'none',
  35204. 'z-index': 35000,
  35205. border: '0px solid ' + color
  35206. }
  35207. });
  35208. proxyAnim = new Ext.fx.Anim({
  35209. target: proxy,
  35210. duration: obj.duration || 1000,
  35211. iterations: count,
  35212. from: {
  35213. top: box.y,
  35214. left: box.x,
  35215. borderWidth: 0,
  35216. opacity: 1,
  35217. height: box.height,
  35218. width: box.width
  35219. },
  35220. to: {
  35221. top: box.y - 20,
  35222. left: box.x - 20,
  35223. borderWidth: 10,
  35224. opacity: 0,
  35225. height: box.height + 40,
  35226. width: box.width + 40
  35227. }
  35228. });
  35229. proxyAnim.on('afteranimate', function() {
  35230. proxy.destroy();
  35231. // kill the no-op element animation created below
  35232. animScope.end();
  35233. });
  35234. };
  35235. me.animate({
  35236. // See "A Note About Wrapped Animations" at the top of this class:
  35237. duration: (Math.max(obj.duration, 500) * 2) || 2000,
  35238. listeners: {
  35239. beforeanimate: {
  35240. fn: beforeAnim
  35241. }
  35242. },
  35243. callback: obj.callback,
  35244. scope: obj.scope
  35245. });
  35246. return me;
  35247. },
  35248. /**
  35249. * Return the CSS color for the specified CSS attribute. rgb, 3 digit (like `#fff`)
  35250. * and valid values are convert to standard 6 digit hex color.
  35251. * @param {String} attr The css attribute
  35252. * @param {String} defaultValue The default value to use when a valid color isn't found
  35253. * @param {String} [prefix] defaults to #. Use an empty string when working with
  35254. * color anims.
  35255. * @private
  35256. */
  35257. getColor: function(attr, defaultValue, prefix) {
  35258. var v = this.getStyle(attr),
  35259. color = prefix || prefix === '' ? prefix : '#',
  35260. h, len, i;
  35261. if (!v || (/transparent|inherit/.test(v))) {
  35262. return defaultValue;
  35263. }
  35264. if (/^r/.test(v)) {
  35265. v = v.slice(4, v.length - 1).split(',');
  35266. len = v.length;
  35267. for (i = 0; i < len; i++) {
  35268. h = parseInt(v[i], 10);
  35269. color += (h < 16 ? '0' : '') + h.toString(16);
  35270. }
  35271. } else {
  35272. v = v.replace('#', '');
  35273. color += v.length === 3 ? v.replace(/^(\w)(\w)(\w)$/, '$1$1$2$2$3$3') : v;
  35274. }
  35275. return (color.length > 5 ? color.toLowerCase() : defaultValue);
  35276. },
  35277. /**
  35278. * Gets this element's {@link Ext.ElementLoader ElementLoader}
  35279. * @return {Ext.ElementLoader} The loader
  35280. */
  35281. getLoader: function() {
  35282. var me = this,
  35283. data = me.getData(),
  35284. loader = data.loader;
  35285. if (!loader) {
  35286. data.loader = loader = new Ext.ElementLoader({
  35287. target: me
  35288. });
  35289. }
  35290. return loader;
  35291. },
  35292. /**
  35293. * Gets an object with all CSS positioning properties. Useful along with
  35294. * `setPositioning` to get snapshot before performing an update and then restoring
  35295. * the element.
  35296. * @param {Boolean} [autoPx=false] true to return pixel values for "auto" styles.
  35297. * @return {Object}
  35298. */
  35299. getPositioning: function(autoPx) {
  35300. var styles = this.getStyle([
  35301. 'left',
  35302. 'top',
  35303. 'position',
  35304. 'z-index'
  35305. ]),
  35306. dom = this.dom;
  35307. if (autoPx) {
  35308. if (styles.left === 'auto') {
  35309. styles.left = dom.offsetLeft + 'px';
  35310. }
  35311. if (styles.top === 'auto') {
  35312. styles.top = dom.offsetTop + 'px';
  35313. }
  35314. }
  35315. return styles;
  35316. },
  35317. /**
  35318. * Slides the element while fading it out of view. An anchor point can be optionally passed
  35319. * to set the ending point of the effect. Usage:
  35320. *
  35321. * // default: slide the element downward while fading out
  35322. * el.ghost();
  35323. *
  35324. * // custom: slide the element out to the right with a 2-second duration
  35325. * el.ghost('r', { duration: 2000 });
  35326. *
  35327. * // common config options shown with default values
  35328. * el.ghost('b', {
  35329. * easing: 'easeOut',
  35330. * duration: 500
  35331. * });
  35332. *
  35333. * @param {String} [anchor] One of the valid {@link Ext.fx.Anim} anchor positions
  35334. * (defaults to bottom: 'b')
  35335. * @param {Object} [options] Object literal with any of the {@link Ext.fx.Anim}
  35336. * config options
  35337. * @return {Ext.dom.Element} The Element
  35338. */
  35339. ghost: function(anchor, options) {
  35340. var me = this,
  35341. dom = me.dom,
  35342. animFly = new Ext.dom.Fly(),
  35343. beforeAnim;
  35344. anchor = anchor || "b";
  35345. beforeAnim = function() {
  35346. // Reattach to the DOM in case the caller animated a Fly
  35347. // in which case the dom reference will have changed by now.
  35348. animFly.attach(dom);
  35349. // eslint-disable-next-line vars-on-top
  35350. var width = animFly.getWidth(),
  35351. height = animFly.getHeight(),
  35352. xy = animFly.getXY(),
  35353. position = animFly.getPositioning(),
  35354. to = {
  35355. opacity: 0
  35356. };
  35357. switch (anchor) {
  35358. case 't':
  35359. to.y = xy[1] - height;
  35360. break;
  35361. case 'l':
  35362. to.x = xy[0] - width;
  35363. break;
  35364. case 'r':
  35365. to.x = xy[0] + width;
  35366. break;
  35367. case 'b':
  35368. to.y = xy[1] + height;
  35369. break;
  35370. case 'tl':
  35371. to.x = xy[0] - width;
  35372. to.y = xy[1] - height;
  35373. break;
  35374. case 'bl':
  35375. to.x = xy[0] - width;
  35376. to.y = xy[1] + height;
  35377. break;
  35378. case 'br':
  35379. to.x = xy[0] + width;
  35380. to.y = xy[1] + height;
  35381. break;
  35382. case 'tr':
  35383. to.x = xy[0] + width;
  35384. to.y = xy[1] - height;
  35385. break;
  35386. }
  35387. this.to = to;
  35388. this.on('afteranimate', function() {
  35389. // Reattach to the DOM in case the caller animated a Fly
  35390. // in which case the dom reference will have changed by now.
  35391. animFly.attach(dom);
  35392. if (animFly) {
  35393. animFly.hide();
  35394. animFly.clearOpacity();
  35395. animFly.setPositioning(position);
  35396. }
  35397. });
  35398. };
  35399. me.animate(Ext.applyIf(options || {}, {
  35400. duration: 500,
  35401. easing: 'ease-out',
  35402. listeners: {
  35403. beforeanimate: beforeAnim
  35404. }
  35405. }));
  35406. return me;
  35407. },
  35408. getTextSelection: function() {
  35409. var ret, dom, doc, range, textRange;
  35410. ret = this.callParent();
  35411. if (typeof ret[0] !== 'number') {
  35412. dom = this.dom;
  35413. doc = dom.ownerDocument;
  35414. range = doc.selection.createRange();
  35415. textRange = dom.createTextRange();
  35416. textRange.setEndPoint('EndToStart', range);
  35417. ret[0] = textRange.text.length;
  35418. ret[1] = ret[0] + range.text.length;
  35419. }
  35420. return ret;
  35421. },
  35422. /**
  35423. * Hide this element - Uses display mode to determine whether to use "display",
  35424. * "visibility", "offsets", or "clip". See {@link #setVisible}.
  35425. * @param {Boolean/Object} [animate] true for the default animation or a standard
  35426. * Element animation config object
  35427. * @return {Ext.dom.Element} this
  35428. */
  35429. hide: function(animate) {
  35430. // hideMode override
  35431. if (typeof animate === 'string') {
  35432. this.setVisible(false, animate);
  35433. return this;
  35434. }
  35435. this.setVisible(false, this.anim(animate));
  35436. return this;
  35437. },
  35438. /**
  35439. * Highlights the Element by setting a color (applies to the background-color by default,
  35440. * but can be changed using the "attr" config option) and then fading back to the original
  35441. * color. If no original color is available, you should provide the "endColor" config option
  35442. * which will be cleared after the animation. Usage:
  35443. *
  35444. * // default: highlight background to yellow
  35445. * el.highlight();
  35446. *
  35447. * // custom: highlight foreground text to blue for 2 seconds
  35448. * el.highlight("0000ff", { attr: 'color', duration: 2000 });
  35449. *
  35450. * // common config options shown with default values
  35451. * el.highlight("ffff9c", {
  35452. * // can be any valid CSS property (attribute) that supports a color value
  35453. * attr: "backgroundColor",
  35454. * endColor: (current color) or "ffffff",
  35455. * easing: 'easeIn',
  35456. * duration: 1000
  35457. * });
  35458. *
  35459. * @param {String} color (optional) The highlight color. Should be a 6 char hex color
  35460. * without the leading # (defaults to yellow: 'ffff9c')
  35461. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim}
  35462. * config options
  35463. * @return {Ext.dom.Element} The Element
  35464. */
  35465. highlight: function(color, options) {
  35466. var me = this,
  35467. dom = me.dom,
  35468. from = {},
  35469. animFly = new Ext.dom.Fly(),
  35470. restore, to, attr, lns, event, fn;
  35471. options = options || {};
  35472. lns = options.listeners || {};
  35473. attr = options.attr || 'backgroundColor';
  35474. from[attr] = color || 'ffff9c';
  35475. if (!options.to) {
  35476. to = {};
  35477. to[attr] = options.endColor || me.getColor(attr, 'ffffff', '');
  35478. } else {
  35479. to = options.to;
  35480. }
  35481. // Don't apply directly on lns, since we reference it in our own callbacks below
  35482. options.listeners = Ext.apply(Ext.apply({}, lns), {
  35483. beforeanimate: function() {
  35484. // Reattach to the DOM in case the caller animated a Fly
  35485. // in which case the dom reference will have changed by now.
  35486. animFly.attach(dom);
  35487. restore = dom.style[attr];
  35488. animFly.clearOpacity();
  35489. animFly.show();
  35490. event = lns.beforeanimate;
  35491. if (event) {
  35492. fn = event.fn || event;
  35493. return fn.apply(event.scope || lns.scope || WIN, arguments);
  35494. }
  35495. },
  35496. afteranimate: function() {
  35497. if (dom) {
  35498. dom.style[attr] = restore;
  35499. }
  35500. event = lns.afteranimate;
  35501. if (event) {
  35502. fn = event.fn || event;
  35503. fn.apply(event.scope || lns.scope || WIN, arguments);
  35504. }
  35505. }
  35506. });
  35507. me.animate(Ext.apply({}, options, {
  35508. duration: 1000,
  35509. easing: 'ease-in',
  35510. from: from,
  35511. to: to
  35512. }));
  35513. return me;
  35514. },
  35515. /**
  35516. * Initializes a {@link Ext.dd.DD} drag drop object for this element.
  35517. * @param {String} group The group the DD object is member of
  35518. * @param {Object} config The DD config object
  35519. * @param {Object} overrides An object containing methods to override/implement
  35520. * on the DD object
  35521. * @return {Ext.dd.DD} The DD object
  35522. */
  35523. initDD: function(group, config, overrides) {
  35524. var dd = new Ext.dd.DD(Ext.id(this.dom), group, config);
  35525. return Ext.apply(dd, overrides);
  35526. },
  35527. /**
  35528. * Initializes a {@link Ext.dd.DDProxy} object for this element.
  35529. * @param {String} group The group the DDProxy object is member of
  35530. * @param {Object} config The DDProxy config object
  35531. * @param {Object} overrides An object containing methods to override/implement
  35532. * on the DDProxy object
  35533. * @return {Ext.dd.DDProxy} The DDProxy object
  35534. */
  35535. initDDProxy: function(group, config, overrides) {
  35536. var dd = new Ext.dd.DDProxy(Ext.id(this.dom), group, config);
  35537. return Ext.apply(dd, overrides);
  35538. },
  35539. /**
  35540. * Initializes a {@link Ext.dd.DDTarget} object for this element.
  35541. * @param {String} group The group the DDTarget object is member of
  35542. * @param {Object} config The DDTarget config object
  35543. * @param {Object} overrides An object containing methods to override/implement
  35544. * on the DDTarget object
  35545. * @return {Ext.dd.DDTarget} The DDTarget object
  35546. */
  35547. initDDTarget: function(group, config, overrides) {
  35548. var dd = new Ext.dd.DDTarget(Ext.id(this.dom), group, config);
  35549. return Ext.apply(dd, overrides);
  35550. },
  35551. /**
  35552. * Returns true if this element is masked. Also re-centers any displayed message
  35553. * within the mask.
  35554. *
  35555. * @param {Boolean} [deep] Go up the DOM hierarchy to determine if any parent
  35556. * element is masked.
  35557. *
  35558. * @return {Boolean}
  35559. */
  35560. isMasked: function(deep) {
  35561. var me = this,
  35562. data = me.getData(),
  35563. maskEl = data.maskEl,
  35564. maskMsg = data.maskMsg,
  35565. hasMask = false,
  35566. parent;
  35567. if (maskEl && maskEl.isVisible()) {
  35568. if (maskMsg) {
  35569. maskMsg.center(me);
  35570. }
  35571. hasMask = true;
  35572. } else if (deep) {
  35573. parent = me.findParentNode();
  35574. if (parent) {
  35575. return Ext.fly(parent).isMasked(deep);
  35576. }
  35577. }
  35578. return hasMask;
  35579. },
  35580. /**
  35581. * Direct access to the Ext.ElementLoader {@link Ext.ElementLoader#method-load} method.
  35582. * The method takes the same object parameter as {@link Ext.ElementLoader#method-load}
  35583. * @param {Object} options a options object for Ext.ElementLoader
  35584. * {@link Ext.ElementLoader#method-load}
  35585. * @return {Ext.dom.Element} this
  35586. */
  35587. load: function(options) {
  35588. this.getLoader().load(options);
  35589. return this;
  35590. },
  35591. /**
  35592. * Puts a mask over this element to disable user interaction.
  35593. * This method can only be applied to elements which accept child nodes. Use
  35594. * {@link #unmask} to remove the mask.
  35595. *
  35596. * @param {String} [msg] A message to display in the mask
  35597. * @param {String} [msgCls] A css class to apply to the msg element
  35598. * @param {Number} elHeight (private) Passed by AbstractComponent.mask to avoid the need
  35599. * to interrogate the DOM to get the height
  35600. * @return {Ext.dom.Element} The mask element
  35601. */
  35602. mask: function(msg, msgCls, elHeight) {
  35603. var me = this,
  35604. dom = me.dom,
  35605. data = me.getData(),
  35606. maskEl = data.maskEl,
  35607. maskMsg;
  35608. if (!(bodyRe.test(dom.tagName) && me.getStyle('position') === 'static')) {
  35609. me.addCls(XMASKEDRELATIVE);
  35610. }
  35611. // We always needs to recreate the mask since the DOM element may have been re-created
  35612. if (maskEl) {
  35613. maskEl.destroy();
  35614. }
  35615. maskEl = Ext.DomHelper.append(dom, {
  35616. role: 'presentation',
  35617. cls: Ext.baseCSSPrefix + "mask " + Ext.baseCSSPrefix + "border-box",
  35618. children: {
  35619. role: 'presentation',
  35620. cls: msgCls ? EXTELMASKMSG + " " + msgCls : EXTELMASKMSG,
  35621. cn: {
  35622. tag: 'div',
  35623. role: 'presentation',
  35624. cls: Ext.baseCSSPrefix + 'mask-msg-inner',
  35625. cn: {
  35626. tag: 'div',
  35627. role: 'presentation',
  35628. cls: Ext.baseCSSPrefix + 'mask-msg-text',
  35629. html: msg || ''
  35630. }
  35631. }
  35632. }
  35633. }, true);
  35634. maskMsg = Ext.fly(maskEl.dom.firstChild);
  35635. data.maskEl = maskEl;
  35636. me.addCls(XMASKED);
  35637. maskEl.setDisplayed(true);
  35638. if (typeof msg === 'string') {
  35639. maskMsg.setDisplayed(true);
  35640. maskMsg.center(me);
  35641. } else {
  35642. maskMsg.setDisplayed(false);
  35643. }
  35644. if (dom === DOC.body) {
  35645. maskEl.addCls(Ext.baseCSSPrefix + 'mask-fixed');
  35646. }
  35647. // When masking the body, don't touch its tabbable state
  35648. me.saveTabbableState({
  35649. skipSelf: dom === DOC.body
  35650. });
  35651. // ie will not expand full height automatically
  35652. if (Ext.isIE9m && dom !== DOC.body && me.isStyle('height', 'auto')) {
  35653. maskEl.setSize(undefined, elHeight || me.getHeight());
  35654. }
  35655. return maskEl;
  35656. },
  35657. /**
  35658. * Fades the element out while slowly expanding it in all directions. When the effect
  35659. * is completed, the element will be hidden (visibility = 'hidden') but block elements
  35660. * will still take up space in the document. Usage:
  35661. *
  35662. * // default
  35663. * el.puff();
  35664. *
  35665. * // common config options shown with default values
  35666. * el.puff({
  35667. * easing: 'easeOut',
  35668. * duration: 500,
  35669. * useDisplay: false
  35670. * });
  35671. *
  35672. * @param {Object} obj (optional) Object literal with any of the {@link Ext.fx.Anim}
  35673. * config options
  35674. * @return {Ext.dom.Element} The Element
  35675. */
  35676. puff: function(obj) {
  35677. var me = this,
  35678. dom = me.dom,
  35679. animFly = new Ext.dom.Fly(),
  35680. beforeAnim,
  35681. box = me.getBox(),
  35682. originalStyles;
  35683. originalStyles = me.getStyle([
  35684. 'width',
  35685. 'height',
  35686. 'left',
  35687. 'right',
  35688. 'top',
  35689. 'bottom',
  35690. 'position',
  35691. 'z-index',
  35692. 'font-size',
  35693. 'opacity'
  35694. ], true);
  35695. obj = Ext.applyIf(obj || {}, {
  35696. easing: 'ease-out',
  35697. duration: 500,
  35698. useDisplay: false
  35699. });
  35700. beforeAnim = function() {
  35701. // Reattach to the DOM in case the caller animated a Fly
  35702. // in which case the dom reference will have changed by now.
  35703. animFly.attach(dom);
  35704. animFly.clearOpacity();
  35705. animFly.show();
  35706. this.to = {
  35707. width: box.width * 2,
  35708. height: box.height * 2,
  35709. x: box.x - (box.width / 2),
  35710. y: box.y - (box.height / 2),
  35711. opacity: 0,
  35712. fontSize: '200%'
  35713. };
  35714. this.on('afteranimate', function() {
  35715. // Reattach to the DOM in case the caller animated a Fly
  35716. // in which case the dom reference will have changed by now.
  35717. animFly.attach(dom);
  35718. if (obj.useDisplay) {
  35719. animFly.setDisplayed(false);
  35720. } else {
  35721. animFly.hide();
  35722. }
  35723. animFly.setStyle(originalStyles);
  35724. Ext.callback(obj.callback, obj.scope);
  35725. });
  35726. };
  35727. me.animate({
  35728. duration: obj.duration,
  35729. easing: obj.easing,
  35730. listeners: {
  35731. beforeanimate: {
  35732. fn: beforeAnim
  35733. }
  35734. }
  35735. });
  35736. return me;
  35737. },
  35738. // private
  35739. // used to ensure the mouseup event is captured if it occurs outside of the
  35740. // window in IE9m. The only reason this method exists, (vs just calling
  35741. // el.dom.setCapture() directly) is so that we can override it to emptyFn
  35742. // during testing because setCapture() can wreak havoc on emulated mouse events
  35743. // http://msdn.microsoft.com/en-us/library/windows/desktop/ms646262(v=vs.85).aspx
  35744. setCapture: function() {
  35745. var dom = this.dom;
  35746. if (Ext.isIE9m && dom.setCapture) {
  35747. dom.setCapture();
  35748. }
  35749. },
  35750. /**
  35751. * Set the height of this Element.
  35752. *
  35753. * // change the height to 200px and animate with default configuration
  35754. * Ext.fly('elementId').setHeight(200, true);
  35755. *
  35756. * // change the height to 150px and animate with a custom configuration
  35757. * Ext.fly('elId').setHeight(150, {
  35758. * duration : 500, // animation will have a duration of .5 seconds
  35759. * // will change the content to "finished"
  35760. * callback: function(){ this.setHtml("finished"); }
  35761. * });
  35762. *
  35763. * @param {Number/String} height The new height. This may be one of:
  35764. *
  35765. * - A Number specifying the new height in pixels.
  35766. * - A String used to set the CSS height style. Animation may **not** be used.
  35767. *
  35768. * @param {Boolean/Object} [animate] a standard Element animation config object or `true`
  35769. * for the default animation (`{duration: 350, easing: 'ease-in'}`)
  35770. * @return {Ext.dom.Element} this
  35771. */
  35772. setHeight: function(height, animate) {
  35773. var me = this;
  35774. if (!animate || !me.anim) {
  35775. me.callParent(arguments);
  35776. } else {
  35777. if (!Ext.isObject(animate)) {
  35778. animate = {};
  35779. }
  35780. me.animate(Ext.applyIf({
  35781. to: {
  35782. height: height
  35783. }
  35784. }, animate));
  35785. }
  35786. return me;
  35787. },
  35788. /**
  35789. * Removes "vertical" state from this element (reverses everything done
  35790. * by {@link #setVertical}).
  35791. * @private
  35792. */
  35793. setHorizontal: function() {
  35794. var me = this,
  35795. cls = me.verticalCls;
  35796. delete me.vertical;
  35797. if (cls) {
  35798. delete me.verticalCls;
  35799. me.removeCls(cls);
  35800. }
  35801. // delete the inverted methods and revert to inheriting from the prototype
  35802. delete me.setWidth;
  35803. delete me.setHeight;
  35804. if (!Ext.isIE8) {
  35805. delete me.getWidth;
  35806. delete me.getHeight;
  35807. }
  35808. // revert to inheriting styleHooks from the prototype
  35809. delete me.styleHooks;
  35810. },
  35811. /**
  35812. * Updates the *text* value of this element.
  35813. * Replaces the content of this element with a *single text node* containing
  35814. * the passed text.
  35815. * @param {String} text The text to display in this Element.
  35816. */
  35817. updateText: function(text) {
  35818. var me = this,
  35819. dom, textNode;
  35820. if (dom) {
  35821. textNode = dom.firstChild;
  35822. if (!textNode || (textNode.nodeType !== 3 || textNode.nextSibling)) {
  35823. textNode = DOC.createTextNode();
  35824. me.empty();
  35825. dom.appendChild(textNode);
  35826. }
  35827. if (text) {
  35828. textNode.data = text;
  35829. }
  35830. }
  35831. },
  35832. /**
  35833. * Updates the innerHTML of this element, optionally searching for and processing scripts.
  35834. * @param {String} html The new HTML
  35835. * @param {Boolean} [loadScripts] Pass `true` to look for and process scripts.
  35836. * @param {Function} [callback] For async script loading you can be notified
  35837. * when the update completes.
  35838. * @param {Object} [scope=`this`] The scope (`this` reference) in which to execute
  35839. * the callback.
  35840. *
  35841. * Also used as the scope for any *inline* script source if the `loadScripts` parameter
  35842. * is `true`. Scripts with a `src` attribute cannot be executed in this scope.
  35843. *
  35844. * Defaults to this Element.
  35845. * @return {Ext.dom.Element} this
  35846. */
  35847. setHtml: function(html, loadScripts, callback, scope) {
  35848. var me = this,
  35849. id, dom, interval;
  35850. if (!me.dom) {
  35851. return me;
  35852. }
  35853. html = html || '';
  35854. dom = me.dom;
  35855. if (loadScripts !== true) {
  35856. // Setting innerHtml changes the DOM and replace all dom nodes
  35857. // with the new html. For IE specifically, all dom child nodes get
  35858. // destroyed when removed from DOM tree even if DOM is referenced
  35859. // within some JS file. Thus, before setting innerHTML, remove the
  35860. // children so that they are not destroyed/removed from DOM tree.
  35861. if (Ext.isIE) {
  35862. while (dom.firstChild) {
  35863. dom.removeChild(dom.firstChild);
  35864. }
  35865. }
  35866. dom.innerHTML = html;
  35867. Ext.callback(callback, me);
  35868. return me;
  35869. }
  35870. id = Ext.id();
  35871. html += '<span id="' + id + '" role="presentation"></span>';
  35872. interval = Ext.interval(function() {
  35873. var hd, match, attrs, srcMatch, typeMatch, el, s;
  35874. if (!(el = DOC.getElementById(id))) {
  35875. return false;
  35876. }
  35877. Ext.uninterval(interval);
  35878. Ext.removeNode(el);
  35879. hd = Ext.getHead().dom;
  35880. while ((match = scriptTagRe.exec(html))) {
  35881. attrs = match[1];
  35882. srcMatch = attrs ? attrs.match(srcRe) : false;
  35883. if (srcMatch && srcMatch[2]) {
  35884. s = DOC.createElement("script");
  35885. s.src = srcMatch[2];
  35886. typeMatch = attrs.match(typeRe);
  35887. if (typeMatch && typeMatch[2]) {
  35888. s.type = typeMatch[2];
  35889. }
  35890. hd.appendChild(s);
  35891. } else if (match[2] && match[2].length > 0) {
  35892. if (scope) {
  35893. Ext.functionFactory(match[2]).call(scope);
  35894. } else {
  35895. Ext.globalEval(match[2]);
  35896. }
  35897. }
  35898. }
  35899. Ext.callback(callback, scope || me);
  35900. }, 20);
  35901. dom.innerHTML = html.replace(replaceScriptTagRe, '');
  35902. return me;
  35903. },
  35904. /**
  35905. * Set the opacity of the element
  35906. * @param {Number} opacity The new opacity. 0 = transparent, .5 = 50% visible,
  35907. * 1 = fully visible, etc
  35908. * @param {Boolean/Object} [animate] a standard Element animation config object or `true`
  35909. * for the default animation (`{duration: 350, easing: 'ease-in'}`)
  35910. * @return {Ext.dom.Element} this
  35911. */
  35912. setOpacity: function(opacity, animate) {
  35913. var me = this;
  35914. if (!me.dom) {
  35915. return me;
  35916. }
  35917. if (!animate || !me.anim) {
  35918. me.setStyle('opacity', opacity);
  35919. } else {
  35920. if (typeof animate !== 'object') {
  35921. animate = {
  35922. duration: 350,
  35923. easing: 'ease-in'
  35924. };
  35925. }
  35926. me.animate(Ext.applyIf({
  35927. to: {
  35928. opacity: opacity
  35929. }
  35930. }, animate));
  35931. }
  35932. return me;
  35933. },
  35934. /**
  35935. * Set positioning with an object returned by `getPositioning`.
  35936. * @param {Object} pc
  35937. * @return {Ext.dom.Element} this
  35938. */
  35939. setPositioning: function(pc) {
  35940. return this.setStyle(pc);
  35941. },
  35942. /**
  35943. * Changes this Element's state to "vertical" (rotated 90 or 270 degrees).
  35944. * This involves inverting the getters and setters for height and width,
  35945. * and applying hooks for rotating getters and setters for border/margin/padding.
  35946. * (getWidth becomes getHeight and vice versa), setStyle and getStyle will
  35947. * also return the inverse when height or width are being operated on.
  35948. *
  35949. * @param {Number} angle the angle of rotation - either 90 or 270
  35950. * @param {String} cls an optional css class that contains the required
  35951. * styles for switching the element to vertical orientation. Omit this if
  35952. * the element already contains vertical styling. If cls is provided,
  35953. * it will be removed from the element when {@link #setHorizontal} is called.
  35954. * @private
  35955. */
  35956. setVertical: function(angle, cls) {
  35957. var me = this,
  35958. proto = Element.prototype;
  35959. me.vertical = true;
  35960. if (cls) {
  35961. me.addCls(me.verticalCls = cls);
  35962. }
  35963. me.setWidth = proto.setHeight;
  35964. me.setHeight = proto.setWidth;
  35965. if (!Ext.isIE8) {
  35966. // In browsers that use CSS3 transforms we must invert getHeight and
  35967. // get Width. In IE8 no adjustment is needed because we use
  35968. // a BasicImage filter to rotate the element and the element's
  35969. // offsetWidth and offsetHeight are automatically inverted.
  35970. me.getWidth = proto.getHeight;
  35971. me.getHeight = proto.getWidth;
  35972. }
  35973. // Switch to using the appropriate vertical style hooks
  35974. me.styleHooks = (angle === 270) ? proto.verticalStyleHooks270 : proto.verticalStyleHooks90;
  35975. },
  35976. /**
  35977. * Set the size of this Element. If animation is true, both width and height will be
  35978. * animated concurrently.
  35979. * @param {Number/String} width The new width. This may be one of:
  35980. *
  35981. * - A Number specifying the new width in pixels.
  35982. * - A String used to set the CSS width style. Animation may **not** be used.
  35983. * - A size object in the format `{width: widthValue, height: heightValue}`.
  35984. *
  35985. * @param {Number/String} height The new height. This may be one of:
  35986. *
  35987. * - A Number specifying the new height in pixels.
  35988. * - A String used to set the CSS height style. Animation may **not** be used.
  35989. *
  35990. * @param {Boolean/Object} [animate] a standard Element animation config object or `true`
  35991. * for the default animation (`{duration: 350, easing: 'ease-in'}`)
  35992. *
  35993. * @return {Ext.dom.Element} this
  35994. */
  35995. setSize: function(width, height, animate) {
  35996. var me = this;
  35997. if (Ext.isObject(width)) {
  35998. // in case of object from getSize()
  35999. animate = height;
  36000. height = width.height;
  36001. width = width.width;
  36002. }
  36003. if (!animate || !me.anim) {
  36004. me.dom.style.width = Element.addUnits(width);
  36005. me.dom.style.height = Element.addUnits(height);
  36006. if (me.shadow || me.shim) {
  36007. me.syncUnderlays();
  36008. }
  36009. } else {
  36010. if (animate === true) {
  36011. animate = {};
  36012. }
  36013. me.animate(Ext.applyIf({
  36014. to: {
  36015. width: width,
  36016. height: height
  36017. }
  36018. }, animate));
  36019. }
  36020. return me;
  36021. },
  36022. /**
  36023. * Sets the visibility of the element (see details). If the visibilityMode is set
  36024. * to Element.DISPLAY, it will use the display property to hide the element,
  36025. * otherwise it uses visibility. The default is to hide and show using the
  36026. * visibility property.
  36027. *
  36028. * @param {Boolean} visible Whether the element is visible
  36029. * @param {Boolean/Object} [animate] True for the default animation,
  36030. * or a standard Element animation config object.
  36031. *
  36032. * @return {Ext.dom.Element} this
  36033. */
  36034. setVisible: function(visible, animate) {
  36035. var me = this,
  36036. dom = me.dom,
  36037. animFly,
  36038. visMode = getVisMode(me);
  36039. // hideMode string override
  36040. if (typeof animate === 'string') {
  36041. switch (animate) {
  36042. case DISPLAY:
  36043. visMode = Element.DISPLAY;
  36044. break;
  36045. case VISIBILITY:
  36046. visMode = Element.VISIBILITY;
  36047. break;
  36048. case OFFSETS:
  36049. visMode = Element.OFFSETS;
  36050. break;
  36051. case CLIP:
  36052. visMode = Element.CLIP;
  36053. break;
  36054. }
  36055. me.setVisibilityMode(visMode);
  36056. animate = false;
  36057. }
  36058. if (!animate || !me.anim) {
  36059. if (visMode === Element.DISPLAY) {
  36060. return me.setDisplayed(visible);
  36061. } else if (visMode === Element.OFFSETS) {
  36062. me[visible ? 'removeCls' : 'addCls'](OFFSETCLASS);
  36063. } else if (visMode === Element.CLIP) {
  36064. me[visible ? 'removeCls' : 'addCls'](CLIPCLASS);
  36065. } else if (visMode === Element.VISIBILITY) {
  36066. me.fixDisplay();
  36067. // Show by clearing visibility style.
  36068. // Explicitly setting to "visible" overrides parent visibility setting
  36069. dom.style.visibility = visible ? '' : HIDDEN;
  36070. }
  36071. } else {
  36072. // closure for composites
  36073. if (visible) {
  36074. me.setOpacity(0.01);
  36075. me.setVisible(true);
  36076. }
  36077. if (!Ext.isObject(animate)) {
  36078. animate = {
  36079. duration: 350,
  36080. easing: 'ease-in'
  36081. };
  36082. }
  36083. animFly = new Ext.dom.Fly();
  36084. me.animate(Ext.applyIf({
  36085. callback: function() {
  36086. if (!visible) {
  36087. // Grab the dom again, since the reference may have changed
  36088. // if we use fly
  36089. animFly.attach(dom).setVisible(false).setOpacity(1);
  36090. }
  36091. },
  36092. to: {
  36093. opacity: (visible) ? 1 : 0
  36094. }
  36095. }, animate));
  36096. }
  36097. me.getData()[ISVISIBLE] = visible;
  36098. if (me.shadow || me.shim) {
  36099. me.setUnderlaysVisible(visible);
  36100. }
  36101. return me;
  36102. },
  36103. /**
  36104. * Set the width of this Element.
  36105. *
  36106. * // change the width to 200px and animate with default configuration
  36107. * Ext.fly('elementId').setWidth(200, true);
  36108. *
  36109. * // change the width to 150px and animate with a custom configuration
  36110. * Ext.fly('elId').setWidth(150, {
  36111. * duration : 500, // animation will have a duration of .5 seconds
  36112. * // will change the content to "finished"
  36113. * callback: function(){ this.setHtml("finished"); }
  36114. * });
  36115. *
  36116. * @param {Number/String} width The new width. This may be one of:
  36117. *
  36118. * - A Number specifying the new width in pixels.
  36119. * - A String used to set the CSS width style. Animation may **not** be used.
  36120. *
  36121. * @param {Boolean/Object} [animate] a standard Element animation config object or `true`
  36122. * for the default animation (`{duration: 350, easing: 'ease-in'}`)
  36123. * @return {Ext.dom.Element} this
  36124. */
  36125. setWidth: function(width, animate) {
  36126. var me = this;
  36127. if (!animate || !me.anim) {
  36128. me.callParent(arguments);
  36129. } else {
  36130. if (!Ext.isObject(animate)) {
  36131. animate = {};
  36132. }
  36133. me.animate(Ext.applyIf({
  36134. to: {
  36135. width: width
  36136. }
  36137. }, animate));
  36138. }
  36139. return me;
  36140. },
  36141. setX: function(x, animate) {
  36142. return this.setXY([
  36143. x,
  36144. this.getY()
  36145. ], animate);
  36146. },
  36147. setXY: function(xy, animate) {
  36148. var me = this;
  36149. if (!animate || !me.anim) {
  36150. me.callParent([
  36151. xy
  36152. ]);
  36153. } else {
  36154. if (!Ext.isObject(animate)) {
  36155. animate = {};
  36156. }
  36157. me.animate(Ext.applyIf({
  36158. to: {
  36159. x: xy[0],
  36160. y: xy[1]
  36161. }
  36162. }, animate));
  36163. }
  36164. return this;
  36165. },
  36166. setY: function(y, animate) {
  36167. return this.setXY([
  36168. this.getX(),
  36169. y
  36170. ], animate);
  36171. },
  36172. /**
  36173. * Show this element - Uses display mode to determine whether to use "display",
  36174. * "visibility", "offsets", or "clip". See {@link #setVisible}.
  36175. *
  36176. * @param {Boolean/Object} [animate] true for the default animation or a standard
  36177. * Element animation config object.
  36178. *
  36179. * @return {Ext.dom.Element} this
  36180. */
  36181. show: function(animate) {
  36182. // hideMode override
  36183. if (typeof animate === 'string') {
  36184. this.setVisible(true, animate);
  36185. return this;
  36186. }
  36187. this.setVisible(true, this.anim(animate));
  36188. return this;
  36189. },
  36190. /**
  36191. * Slides the element into view. An anchor point can be optionally passed to set the point
  36192. * of origin for the slide effect. This function automatically handles wrapping the element
  36193. * with a fixed-size container if needed. See the {@link Ext.fx.Anim} class overview
  36194. * for valid anchor point options. Usage:
  36195. *
  36196. * // default: slide the element in from the top
  36197. * el.slideIn();
  36198. *
  36199. * // custom: slide the element in from the right with a 2-second duration
  36200. * el.slideIn('r', { duration: 2000 });
  36201. *
  36202. * // common config options shown with default values
  36203. * el.slideIn('t', {
  36204. * easing: 'easeOut',
  36205. * duration: 500
  36206. * });
  36207. *
  36208. * @param {String} [anchor] One of the valid {@link Ext.fx.Anim} anchor positions
  36209. * (defaults to top: 't')
  36210. * @param {Object} [options] Object literal with any of the {@link Ext.fx.Anim}
  36211. * config options
  36212. * @param {Boolean} options.preserveScroll Set to true if preservation of any descendant
  36213. * elements' `scrollTop` values is required. By default the DOM wrapping operation
  36214. * performed by `slideIn` and `slideOut` causes the browser to lose all scroll positions.
  36215. * @param {Boolean} slideOut
  36216. * @return {Ext.dom.Element} The Element
  36217. */
  36218. slideIn: function(anchor, options, slideOut) {
  36219. var me = this,
  36220. dom = me.dom,
  36221. elStyle = dom.style,
  36222. animFly = new Ext.dom.Fly(),
  36223. beforeAnim, wrapAnim, restoreScroll, wrapDomParentNode;
  36224. anchor = anchor || "t";
  36225. options = options || {};
  36226. beforeAnim = function() {
  36227. var animScope = this,
  36228. listeners = options.listeners,
  36229. box, originalStyles, anim, wrap;
  36230. // Reattach to the DOM in case the caller animated a Fly
  36231. // in which case the dom reference will have changed by now.
  36232. animFly.attach(dom);
  36233. if (!slideOut) {
  36234. animFly.fixDisplay();
  36235. }
  36236. box = animFly.getBox();
  36237. if ((anchor === 't' || anchor === 'b') && box.height === 0) {
  36238. box.height = dom.scrollHeight;
  36239. } else if ((anchor === 'l' || anchor === 'r') && box.width === 0) {
  36240. box.width = dom.scrollWidth;
  36241. }
  36242. originalStyles = animFly.getStyle([
  36243. 'width',
  36244. 'height',
  36245. 'left',
  36246. 'right',
  36247. 'top',
  36248. 'bottom',
  36249. 'position',
  36250. 'z-index'
  36251. ], true);
  36252. animFly.setSize(box.width, box.height);
  36253. // Cache all descendants' scrollTop & scrollLeft values
  36254. // if configured to preserve scroll.
  36255. if (options.preserveScroll) {
  36256. restoreScroll = animFly.cacheScrollValues();
  36257. }
  36258. wrap = animFly.wrap({
  36259. role: 'presentation',
  36260. id: Ext.id() + '-anim-wrap-for-' + dom.id,
  36261. style: {
  36262. visibility: slideOut ? 'visible' : 'hidden'
  36263. }
  36264. });
  36265. wrapDomParentNode = wrap.dom.parentNode;
  36266. wrap.setPositioning(animFly.getPositioning());
  36267. if (wrap.isStyle('position', 'static')) {
  36268. wrap.position('relative');
  36269. }
  36270. animFly.clearPositioning('auto');
  36271. wrap.clip();
  36272. // The wrap will have reset all descendant scrollTops.
  36273. // Restore them if we cached them.
  36274. if (restoreScroll) {
  36275. restoreScroll();
  36276. }
  36277. // This element is temporarily positioned absolute within its wrapper.
  36278. // Restore to its default, CSS-inherited visibility setting.
  36279. // We cannot explicitly poke visibility:visible into its style
  36280. // because that overrides the visibility of the wrap.
  36281. animFly.setStyle({
  36282. visibility: '',
  36283. position: 'absolute'
  36284. });
  36285. if (slideOut) {
  36286. wrap.setSize(box.width, box.height);
  36287. }
  36288. switch (anchor) {
  36289. case 't':
  36290. anim = {
  36291. from: {
  36292. width: box.width + 'px',
  36293. height: '0px'
  36294. },
  36295. to: {
  36296. width: box.width + 'px',
  36297. height: box.height + 'px'
  36298. }
  36299. };
  36300. elStyle.bottom = '0px';
  36301. break;
  36302. case 'l':
  36303. anim = {
  36304. from: {
  36305. width: '0px',
  36306. height: box.height + 'px'
  36307. },
  36308. to: {
  36309. width: box.width + 'px',
  36310. height: box.height + 'px'
  36311. }
  36312. };
  36313. me.anchorAnimX(anchor);
  36314. break;
  36315. case 'r':
  36316. anim = {
  36317. from: {
  36318. x: box.x + box.width,
  36319. width: '0px',
  36320. height: box.height + 'px'
  36321. },
  36322. to: {
  36323. x: box.x,
  36324. width: box.width + 'px',
  36325. height: box.height + 'px'
  36326. }
  36327. };
  36328. me.anchorAnimX(anchor);
  36329. break;
  36330. case 'b':
  36331. anim = {
  36332. from: {
  36333. y: box.y + box.height,
  36334. width: box.width + 'px',
  36335. height: '0px'
  36336. },
  36337. to: {
  36338. y: box.y,
  36339. width: box.width + 'px',
  36340. height: box.height + 'px'
  36341. }
  36342. };
  36343. break;
  36344. case 'tl':
  36345. anim = {
  36346. from: {
  36347. x: box.x,
  36348. y: box.y,
  36349. width: '0px',
  36350. height: '0px'
  36351. },
  36352. to: {
  36353. width: box.width + 'px',
  36354. height: box.height + 'px'
  36355. }
  36356. };
  36357. elStyle.bottom = '0px';
  36358. me.anchorAnimX('l');
  36359. break;
  36360. case 'bl':
  36361. anim = {
  36362. from: {
  36363. y: box.y + box.height,
  36364. width: '0px',
  36365. height: '0px'
  36366. },
  36367. to: {
  36368. y: box.y,
  36369. width: box.width + 'px',
  36370. height: box.height + 'px'
  36371. }
  36372. };
  36373. me.anchorAnimX('l');
  36374. break;
  36375. case 'br':
  36376. anim = {
  36377. from: {
  36378. x: box.x + box.width,
  36379. y: box.y + box.height,
  36380. width: '0px',
  36381. height: '0px'
  36382. },
  36383. to: {
  36384. x: box.x,
  36385. y: box.y,
  36386. width: box.width + 'px',
  36387. height: box.height + 'px'
  36388. }
  36389. };
  36390. me.anchorAnimX('r');
  36391. break;
  36392. case 'tr':
  36393. anim = {
  36394. from: {
  36395. x: box.x + box.width,
  36396. width: '0px',
  36397. height: '0px'
  36398. },
  36399. to: {
  36400. x: box.x,
  36401. width: box.width + 'px',
  36402. height: box.height + 'px'
  36403. }
  36404. };
  36405. elStyle.bottom = '0px';
  36406. me.anchorAnimX('r');
  36407. break;
  36408. }
  36409. wrap.show();
  36410. wrapAnim = Ext.apply({}, options);
  36411. delete wrapAnim.listeners;
  36412. wrapAnim = new Ext.fx.Anim(Ext.applyIf(wrapAnim, {
  36413. target: wrap,
  36414. duration: 500,
  36415. easing: 'ease-out',
  36416. from: slideOut ? anim.to : anim.from,
  36417. to: slideOut ? anim.from : anim.to
  36418. }));
  36419. // In the absence of a callback, this listener MUST be added first
  36420. wrapAnim.on('afteranimate', function() {
  36421. // Reattach to the DOM in case the caller animated a Fly
  36422. // in which case the dom reference will have changed by now.
  36423. animFly.attach(dom);
  36424. animFly.setStyle(originalStyles);
  36425. if (slideOut) {
  36426. if (options.useDisplay) {
  36427. animFly.setDisplayed(false);
  36428. } else {
  36429. animFly.hide();
  36430. }
  36431. }
  36432. if (wrap.dom) {
  36433. if (wrap.dom.parentNode) {
  36434. wrap.dom.parentNode.insertBefore(dom, wrap.dom);
  36435. } else {
  36436. wrapDomParentNode.appendChild(dom);
  36437. }
  36438. wrap.destroy();
  36439. }
  36440. // The unwrap will have reset all descendant scrollTops.
  36441. // Restore them if we cached them.
  36442. if (restoreScroll) {
  36443. restoreScroll();
  36444. }
  36445. // kill the no-op element animation created below
  36446. animScope.end();
  36447. });
  36448. // Add configured listeners after
  36449. if (listeners) {
  36450. wrapAnim.on(listeners);
  36451. }
  36452. };
  36453. me.animate({
  36454. // See "A Note About Wrapped Animations" at the top of this class:
  36455. duration: options.duration ? Math.max(options.duration, 500) * 2 : 1000,
  36456. listeners: {
  36457. beforeanimate: beforeAnim
  36458. }
  36459. });
  36460. // kick off the wrap animation
  36461. return me;
  36462. },
  36463. /**
  36464. * Slides the element out of view. An anchor point can be optionally passed to set the end
  36465. * point for the slide effect. When the effect is completed, the element will be hidden
  36466. * (visibility = 'hidden') but block elements will still take up space in the document.
  36467. * The element must be removed from the DOM using the 'remove' config option if
  36468. * desired. This function automatically handles wrapping the element with a fixed-size
  36469. * container if needed. See the {@link Ext.fx.Anim} class overview for valid anchor point
  36470. * options. Usage:
  36471. *
  36472. * // default: slide the element out to the top
  36473. * el.slideOut();
  36474. *
  36475. * // custom: slide the element out to the right with a 2-second duration
  36476. * el.slideOut('r', { duration: 2000 });
  36477. *
  36478. * // common config options shown with default values
  36479. * el.slideOut('t', {
  36480. * easing: 'easeOut',
  36481. * duration: 500,
  36482. * remove: false,
  36483. * useDisplay: false
  36484. * });
  36485. *
  36486. * @param {String} anchor (optional) One of the valid {@link Ext.fx.Anim} anchor positions
  36487. * (defaults to top: 't')
  36488. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim}
  36489. * config options
  36490. * @return {Ext.dom.Element} The Element
  36491. */
  36492. slideOut: function(anchor, options) {
  36493. return this.slideIn(anchor, options, true);
  36494. },
  36495. /**
  36496. * Blinks the element as if it was clicked and then collapses on its center (similar to
  36497. * switching off a television). When the effect is completed, the element will be hidden
  36498. * (visibility = 'hidden') but block elements will still take up space in the document.
  36499. * The element must be removed from the DOM using the 'remove' config option if desired.
  36500. * Usage:
  36501. *
  36502. * // default
  36503. * el.switchOff();
  36504. *
  36505. * // all config options shown with default values
  36506. * el.switchOff({
  36507. * easing: 'easeIn',
  36508. * duration: .3,
  36509. * remove: false,
  36510. * useDisplay: false
  36511. * });
  36512. *
  36513. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim}
  36514. * config options
  36515. * @return {Ext.dom.Element} The Element
  36516. */
  36517. switchOff: function(options) {
  36518. var me = this,
  36519. dom = me.dom,
  36520. animFly = new Ext.dom.Fly(),
  36521. beforeAnim;
  36522. options = Ext.applyIf(options || {}, {
  36523. easing: 'ease-in',
  36524. duration: 500,
  36525. remove: false,
  36526. useDisplay: false
  36527. });
  36528. beforeAnim = function() {
  36529. // Reattach to the DOM in case the caller animated a Fly
  36530. // in which case the dom reference will have changed by now.
  36531. animFly.attach(dom);
  36532. // eslint-disable-next-line vars-on-top
  36533. var animScope = this,
  36534. size = animFly.getSize(),
  36535. xy = animFly.getXY(),
  36536. keyframe, position;
  36537. animFly.clearOpacity();
  36538. animFly.clip();
  36539. position = animFly.getPositioning();
  36540. keyframe = new Ext.fx.Animator({
  36541. target: dom,
  36542. duration: options.duration,
  36543. easing: options.easing,
  36544. keyframes: {
  36545. 33: {
  36546. opacity: 0.3
  36547. },
  36548. 66: {
  36549. height: 1,
  36550. y: xy[1] + size.height / 2
  36551. },
  36552. 100: {
  36553. width: 1,
  36554. x: xy[0] + size.width / 2
  36555. }
  36556. }
  36557. });
  36558. keyframe.on('afteranimate', function() {
  36559. // Reattach to the DOM in case the caller animated a Fly
  36560. // in which case the dom reference will have changed by now.
  36561. animFly.attach(dom);
  36562. if (options.useDisplay) {
  36563. animFly.setDisplayed(false);
  36564. } else {
  36565. animFly.hide();
  36566. }
  36567. animFly.clearOpacity();
  36568. animFly.setPositioning(position);
  36569. animFly.setSize(size);
  36570. // kill the no-op element animation created below
  36571. animScope.end();
  36572. });
  36573. };
  36574. me.animate({
  36575. // See "A Note About Wrapped Animations" at the top of this class:
  36576. duration: (Math.max(options.duration, 500) * 2),
  36577. listeners: {
  36578. beforeanimate: {
  36579. fn: beforeAnim
  36580. }
  36581. },
  36582. callback: options.callback,
  36583. scope: options.scope
  36584. });
  36585. return me;
  36586. },
  36587. /**
  36588. * @private
  36589. * Currently used for updating grid cells without modifying DOM structure
  36590. *
  36591. * Synchronizes content of this Element with the content of the passed element.
  36592. *
  36593. * Style and CSS class are copied from source into this Element, and contents are synced
  36594. * recursively. If a child node is a text node, the textual data is copied.
  36595. */
  36596. syncContent: function(source) {
  36597. source = Ext.getDom(source);
  36598. // eslint-disable-next-line vars-on-top
  36599. var sourceNodes = source.childNodes,
  36600. sourceLen = sourceNodes.length,
  36601. dest = this.dom,
  36602. destNodes = dest.childNodes,
  36603. destLen = destNodes.length,
  36604. i, destNode, sourceNode, sourceStyle, nodeType, newAttrs, attLen, attName, value,
  36605. elData = dest._extData;
  36606. if (!syncContentFly) {
  36607. syncContentFly = new Ext.dom.Fly();
  36608. }
  36609. // Update any attributes who's values have changed..
  36610. newAttrs = source.attributes;
  36611. attLen = newAttrs.length;
  36612. for (i = 0; i < attLen; i++) {
  36613. attName = newAttrs[i].name;
  36614. value = newAttrs[i].value;
  36615. if (attName !== 'id' && dest.getAttribute(attName) !== value) {
  36616. dest.setAttribute(attName, newAttrs[i].value);
  36617. }
  36618. }
  36619. // The element's data is no longer synchronized. We just overwrite it in the DOM
  36620. if (elData) {
  36621. elData.isSynchronized = false;
  36622. }
  36623. // If the number of child nodes does not match, fall back to replacing innerHTML
  36624. if (sourceLen !== destLen) {
  36625. dest.innerHTML = source.innerHTML;
  36626. return;
  36627. }
  36628. // Loop through source nodes.
  36629. // If there are fewer, we must remove excess
  36630. for (i = 0; i < sourceLen; i++) {
  36631. sourceNode = sourceNodes[i];
  36632. destNode = destNodes[i];
  36633. nodeType = sourceNode.nodeType;
  36634. sourceStyle = sourceNode.style;
  36635. // If node structure is out of sync, just drop innerHTML in and return
  36636. if (nodeType !== destNode.nodeType || (nodeType === 1 && sourceNode.tagName !== destNode.tagName)) {
  36637. dest.innerHTML = source.innerHTML;
  36638. return;
  36639. }
  36640. // Update non-Element node (text, comment)
  36641. if (!sourceStyle) {
  36642. destNode.data = sourceNode.data;
  36643. } else // Sync element content
  36644. {
  36645. if (sourceNode.id && destNode.id !== sourceNode.id) {
  36646. destNode.id = sourceNode.id;
  36647. }
  36648. destNode.style.cssText = sourceStyle.cssText;
  36649. destNode.className = sourceNode.className;
  36650. syncContentFly.attach(destNode).syncContent(sourceNode);
  36651. }
  36652. }
  36653. },
  36654. /**
  36655. * Toggles the element's visibility, depending on visibility mode.
  36656. * @param {Boolean/Object} [animate] True for the default animation, or a standard Element
  36657. * animation config object
  36658. * @return {Ext.dom.Element} this
  36659. */
  36660. toggle: function(animate) {
  36661. var me = this;
  36662. me.setVisible(!me.isVisible(), me.anim(animate));
  36663. return me;
  36664. },
  36665. /**
  36666. * Hides a previously applied mask.
  36667. */
  36668. unmask: function() {
  36669. var me = this,
  36670. data = me.getData(),
  36671. maskEl = data.maskEl,
  36672. style;
  36673. if (maskEl) {
  36674. style = maskEl.dom.style;
  36675. // Remove resource-intensive CSS expressions as soon as they are not required.
  36676. if (style.clearExpression) {
  36677. style.clearExpression('width');
  36678. style.clearExpression('height');
  36679. }
  36680. if (maskEl) {
  36681. maskEl.destroy();
  36682. delete data.maskEl;
  36683. }
  36684. me.removeCls([
  36685. XMASKED,
  36686. XMASKEDRELATIVE
  36687. ]);
  36688. }
  36689. me.restoreTabbableState(me.dom === DOC.body);
  36690. },
  36691. /**
  36692. * Return clipping (overflow) to original clipping before {@link #clip} was called
  36693. * @return {Ext.dom.Element} this
  36694. */
  36695. unclip: function() {
  36696. var me = this,
  36697. data = me.getData(),
  36698. clip;
  36699. if (data[ISCLIPPED]) {
  36700. data[ISCLIPPED] = false;
  36701. clip = data[ORIGINALCLIP];
  36702. if (clip.o) {
  36703. me.setStyle(OVERFLOW, clip.o);
  36704. }
  36705. if (clip.x) {
  36706. me.setStyle(OVERFLOWX, clip.x);
  36707. }
  36708. if (clip.y) {
  36709. me.setStyle(OVERFLOWY, clip.y);
  36710. }
  36711. }
  36712. return me;
  36713. },
  36714. translate: function(x, y, z) {
  36715. if (Ext.supports.CssTransforms && !Ext.isIE9m) {
  36716. this.callParent(arguments);
  36717. } else {
  36718. if (x != null) {
  36719. this.dom.style.left = x + 'px';
  36720. }
  36721. if (y != null) {
  36722. this.dom.style.top = y + 'px';
  36723. }
  36724. }
  36725. },
  36726. deprecated: {
  36727. '4.0': {
  36728. methods: {
  36729. /**
  36730. * @method pause
  36731. * Creates a pause before any subsequent queued effects begin. If there are
  36732. * no effects queued after the pause it will have no effect. Usage:
  36733. *
  36734. * el.pause(1);
  36735. *
  36736. * @deprecated 4.0 Use the `delay` config to {@link #animate} instead.
  36737. * @param {Number} ms The length of time to pause (in milliseconds)
  36738. * @return {Ext.dom.Element} The Element
  36739. */
  36740. pause: function(ms) {
  36741. var me = this;
  36742. Ext.fx.Manager.setFxDefaults(me.id, {
  36743. delay: ms
  36744. });
  36745. return me;
  36746. },
  36747. /**
  36748. * @method scale
  36749. * Animates the transition of an element's dimensions from a starting
  36750. * height/width to an ending height/width. This method is a convenience
  36751. * implementation of {@link #shift}. Usage:
  36752. *
  36753. * // change height and width to 100x100 pixels
  36754. * el.scale(100, 100);
  36755. *
  36756. * // common config options shown with default values.
  36757. * // The height and width will default to the element's existing values
  36758. * // if passed as null.
  36759. * el.scale(
  36760. * [element's width],
  36761. * [element's height], {
  36762. * easing: 'easeOut',
  36763. * duration: 350
  36764. * }
  36765. * );
  36766. *
  36767. * @deprecated 4.0 Just use {@link #animate} instead.
  36768. * @param {Number} width The new width (pass undefined to keep the original
  36769. * width)
  36770. * @param {Number} height The new height (pass undefined to keep the original
  36771. * height)
  36772. * @param {Object} options (optional) Object literal with any of the
  36773. * {@link Ext.fx.Anim} config options
  36774. * @return {Ext.dom.Element} The Element
  36775. */
  36776. scale: function(width, height, options) {
  36777. this.animate(Ext.apply({}, options, {
  36778. width: width,
  36779. height: height
  36780. }));
  36781. return this;
  36782. },
  36783. /**
  36784. * @method shift
  36785. * Animates the transition of any combination of an element's dimensions,
  36786. * xy position and/or opacity. Any of these properties not specified in the
  36787. * config object will not be changed. This effect requires that at least one new
  36788. * dimension, position or opacity setting must be passed in on the config object
  36789. * in order for the function to have any effect. Usage:
  36790. *
  36791. * // slide the element horizontally to x position 200
  36792. * // while changing the height and opacity
  36793. * el.shift({ x: 200, height: 50, opacity: .8 });
  36794. *
  36795. * // common config options shown with default values.
  36796. * el.shift({
  36797. * width: [element's width],
  36798. * height: [element's height],
  36799. * x: [element's x position],
  36800. * y: [element's y position],
  36801. * opacity: [element's opacity],
  36802. * easing: 'easeOut',
  36803. * duration: 350
  36804. * });
  36805. *
  36806. * @deprecated 4.0 Just use {@link #animate} instead.
  36807. * @param {Object} options Object literal with any of the {@link Ext.fx.Anim}
  36808. * config options
  36809. * @return {Ext.dom.Element} The Element
  36810. */
  36811. shift: function(options) {
  36812. this.animate(options);
  36813. return this;
  36814. }
  36815. }
  36816. },
  36817. '4.2': {
  36818. methods: {
  36819. /**
  36820. * @method moveTo
  36821. * Sets the position of the element in page coordinates.
  36822. * @param {Number} x X value for new position (coordinates are page-based)
  36823. * @param {Number} y Y value for new position (coordinates are page-based)
  36824. * @param {Boolean/Object} [animate] True for the default animation,
  36825. * or a standard Element animation config object
  36826. * @return {Ext.dom.Element} this
  36827. * @deprecated 4.2.0 Use {@link Ext.dom.Element#setXY} instead.
  36828. */
  36829. moveTo: function(x, y, animate) {
  36830. return this.setXY([
  36831. x,
  36832. y
  36833. ], animate);
  36834. },
  36835. /**
  36836. * @method setBounds
  36837. * Sets the element's position and size in one shot. If animation is true then
  36838. * width, height, x and y will be animated concurrently.
  36839. *
  36840. * @param {Number} x X value for new position (coordinates are page-based)
  36841. * @param {Number} y Y value for new position (coordinates are page-based)
  36842. * @param {Number/String} width The new width. This may be one of:
  36843. *
  36844. * - A Number specifying the new width in pixels
  36845. * - A String used to set the CSS width style. Animation may **not** be used.
  36846. *
  36847. * @param {Number/String} height The new height. This may be one of:
  36848. *
  36849. * - A Number specifying the new height in pixels
  36850. * - A String used to set the CSS height style. Animation may **not** be used.
  36851. *
  36852. * @param {Boolean/Object} [animate] true for the default animation or
  36853. * a standard Element animation config object
  36854. *
  36855. * @return {Ext.dom.Element} this
  36856. * @deprecated 4.2.0 Use {@link Ext.util.Positionable#setBox} instead.
  36857. */
  36858. setBounds: function(x, y, width, height, animate) {
  36859. return this.setBox({
  36860. x: x,
  36861. y: y,
  36862. width: width,
  36863. height: height
  36864. }, animate);
  36865. },
  36866. /**
  36867. * @method setLeftTop
  36868. * Sets the element's left and top positions directly using CSS style
  36869. * @param {Number/String} left Number of pixels or CSS string value to
  36870. * set as the left CSS property value
  36871. * @param {Number/String} top Number of pixels or CSS string value to
  36872. * set as the top CSS property value
  36873. * @return {Ext.dom.Element} this
  36874. * @deprecated 4.2.0 Use {@link Ext.dom.Element#setLocalXY} instead
  36875. */
  36876. setLeftTop: function(left, top) {
  36877. var me = this,
  36878. style = me.dom.style;
  36879. style.left = Element.addUnits(left);
  36880. style.top = Element.addUnits(top);
  36881. if (me.shadow || me.shim) {
  36882. me.syncUnderlays();
  36883. }
  36884. return me;
  36885. },
  36886. /**
  36887. * @method setLocation
  36888. * Sets the position of the element in page coordinates.
  36889. * @param {Number} x X value for new position
  36890. * @param {Number} y Y value for new position
  36891. * @param {Boolean/Object} [animate] True for the default animation,
  36892. * or a standard Element animation config object
  36893. * @return {Ext.dom.Element} this
  36894. * @deprecated 4.2.0 Use {@link Ext.dom.Element#setXY} instead.
  36895. */
  36896. setLocation: function(x, y, animate) {
  36897. return this.setXY([
  36898. x,
  36899. y
  36900. ], animate);
  36901. }
  36902. }
  36903. },
  36904. '5.0': {
  36905. methods: {
  36906. /**
  36907. * @method getAttributeNS
  36908. * Returns the value of a namespaced attribute from the element's underlying
  36909. * DOM node.
  36910. * @param {String} namespace The namespace in which to look for the attribute
  36911. * @param {String} name The attribute name
  36912. * @return {String} The attribute value
  36913. * @deprecated 5.0.0 Please use {@link Ext.dom.Element#getAttribute} instead.
  36914. */
  36915. getAttributeNS: function(namespace, name) {
  36916. return this.getAttribute(name, namespace);
  36917. },
  36918. /**
  36919. * @method getCenterXY
  36920. * Calculates the x, y to center this element on the screen
  36921. * @return {Number[]} The x, y values [x, y]
  36922. * @deprecated 5.0.0 Use {@link Ext.dom.Element#getAlignToXY} instead.
  36923. * el.getAlignToXY(document, 'c-c');
  36924. */
  36925. getCenterXY: function() {
  36926. return this.getAlignToXY(DOC, 'c-c');
  36927. },
  36928. /**
  36929. * @method getComputedHeight
  36930. * Returns either the offsetHeight or the height of this element based on CSS
  36931. * height adjusted by padding or borders when needed to simulate offsetHeight
  36932. * when offsets aren't available. This may not work on display:none elements
  36933. * if a height has not been set using CSS.
  36934. * @return {Number}
  36935. * @deprecated 5.0.0 use {@link Ext.dom.Element#getHeight} instead
  36936. */
  36937. getComputedHeight: function() {
  36938. return Math.max(this.dom.offsetHeight, this.dom.clientHeight) || parseFloat(this.getStyle(HEIGHT)) || 0;
  36939. },
  36940. /**
  36941. * @method getComputedWidth
  36942. * Returns either the offsetWidth or the width of this element based on CSS
  36943. * width adjusted by padding or borders when needed to simulate offsetWidth
  36944. * when offsets aren't available. This may not work on display:none elements
  36945. * if a width has not been set using CSS.
  36946. * @return {Number}
  36947. * @deprecated 5.0.0 use {@link Ext.dom.Element#getWidth} instead.
  36948. */
  36949. getComputedWidth: function() {
  36950. return Math.max(this.dom.offsetWidth, this.dom.clientWidth) || parseFloat(this.getStyle(WIDTH)) || 0;
  36951. },
  36952. /**
  36953. * @method getStyleSize
  36954. * Returns the dimensions of the element available to lay content out in.
  36955. *
  36956. * getStyleSize utilizes prefers style sizing if present, otherwise it chooses
  36957. * the larger of offsetHeight/clientHeight and offsetWidth/clientWidth.
  36958. * To obtain the size excluding scrollbars, use getViewSize.
  36959. *
  36960. * Sizing of the document body is handled at the adapter level which handles
  36961. * special cases for IE and strict modes, etc.
  36962. *
  36963. * @return {Object} Object describing width and height.
  36964. * @return {Number} return.width
  36965. * @return {Number} return.height
  36966. * @deprecated 5.0.0 Use {@link Ext.dom.Element#getSize} instead.
  36967. */
  36968. getStyleSize: function() {
  36969. var me = this,
  36970. d = this.dom,
  36971. isDoc = (d === DOC || d === DOC.body),
  36972. s, w, h;
  36973. // If the body, use static methods
  36974. if (isDoc) {
  36975. return {
  36976. width: Element.getViewportWidth(),
  36977. height: Element.getViewportHeight()
  36978. };
  36979. }
  36980. s = me.getStyle([
  36981. 'height',
  36982. 'width'
  36983. ], true);
  36984. // seek inline
  36985. // Use Styles if they are set
  36986. if (s.width && s.width !== 'auto') {
  36987. w = parseFloat(s.width);
  36988. }
  36989. // Use Styles if they are set
  36990. if (s.height && s.height !== 'auto') {
  36991. h = parseFloat(s.height);
  36992. }
  36993. // Use getWidth/getHeight if style not set.
  36994. return {
  36995. width: w || me.getWidth(true),
  36996. height: h || me.getHeight(true)
  36997. };
  36998. },
  36999. /**
  37000. * @method isBorderBox
  37001. * Returns true if this element uses the border-box-sizing model.
  37002. * This method is deprecated as of version 5.0 because border-box sizing
  37003. * is forced upon all elements via a style sheet rule, and the browsers
  37004. * that do not support border-box (IE6/7 strict mode) are no longer supported.
  37005. * @deprecated 5.0.0 This method is deprecated. Browsers that do not
  37006. * support border-box (IE6/7 strict mode) are no longer supported.
  37007. * @return {Boolean}
  37008. */
  37009. isBorderBox: function() {
  37010. return true;
  37011. },
  37012. /**
  37013. * @method isDisplayed
  37014. * Returns true if display is not "none"
  37015. * @return {Boolean}
  37016. * @deprecated 5.0.0 use element.isStyle('display', 'none');
  37017. */
  37018. isDisplayed: function() {
  37019. return !this.isStyle('display', 'none');
  37020. },
  37021. /**
  37022. * @method focusable
  37023. * Checks whether this element can be focused.
  37024. * @return {Boolean} True if the element is focusable
  37025. * @deprecated 5.0.0 use {@link #isFocusable} instead
  37026. */
  37027. focusable: 'isFocusable'
  37028. }
  37029. }
  37030. }
  37031. };
  37032. })(), function() {
  37033. var Element = Ext.dom.Element,
  37034. proto = Element.prototype,
  37035. useDocForId = !Ext.isIE8,
  37036. DOC = document,
  37037. view = DOC.defaultView,
  37038. opacityRe = /alpha\(opacity=(.*)\)/i,
  37039. trimRe = /^\s+|\s+$/g,
  37040. styleHooks = proto.styleHooks,
  37041. supports = Ext.supports,
  37042. verticalStyleHooks90, verticalStyleHooks270, edges, k, edge, borderWidth, getBorderWidth;
  37043. proto._init(Element);
  37044. delete proto._init;
  37045. Ext.plainTableCls = Ext.baseCSSPrefix + 'table-plain';
  37046. Ext.plainListCls = Ext.baseCSSPrefix + 'list-plain';
  37047. // ensure that any methods added by this override are also added to Ext.CompositeElementLite
  37048. if (Ext.CompositeElementLite) {
  37049. Ext.CompositeElementLite.importElementMethods();
  37050. }
  37051. if (!supports.Opacity && Ext.isIE) {
  37052. Ext.apply(styleHooks.opacity, {
  37053. get: function(dom) {
  37054. var filter = dom.style.filter,
  37055. match, opacity;
  37056. if (filter.match) {
  37057. match = filter.match(opacityRe);
  37058. if (match) {
  37059. opacity = parseFloat(match[1]);
  37060. if (!isNaN(opacity)) {
  37061. return opacity ? opacity / 100 : 0;
  37062. }
  37063. }
  37064. }
  37065. return 1;
  37066. },
  37067. set: function(dom, value) {
  37068. var style = dom.style,
  37069. val = style.filter.replace(opacityRe, '').replace(trimRe, '');
  37070. style.zoom = 1;
  37071. // ensure dom.hasLayout
  37072. // value can be a number or '' or null... so treat falsey as no opacity
  37073. if (typeof (value) === 'number' && value >= 0 && value < 1) {
  37074. value *= 100;
  37075. style.filter = val + (val.length ? ' ' : '') + 'alpha(opacity=' + value + ')';
  37076. } else {
  37077. style.filter = val;
  37078. }
  37079. }
  37080. });
  37081. }
  37082. if (!supports.matchesSelector) {
  37083. // Match basic tagName.ClassName selector syntax for is implementation
  37084. // eslint-disable-next-line vars-on-top
  37085. var simpleSelectorRe = /^([a-z]+|\*)?(?:\.([a-z][a-z\-_0-9]*))?$/i,
  37086. dashRe = /-/g,
  37087. fragment,
  37088. classMatcher = function(tag, cls) {
  37089. var classRe = new RegExp('(?:^|\\s+)' + cls.replace(dashRe, '\\-') + '(?:\\s+|$)');
  37090. if (tag && tag !== '*') {
  37091. tag = tag.toUpperCase();
  37092. return function(el) {
  37093. return el.tagName === tag && classRe.test(el.className);
  37094. };
  37095. }
  37096. return function(el) {
  37097. return classRe.test(el.className);
  37098. };
  37099. },
  37100. tagMatcher = function(tag) {
  37101. tag = tag.toUpperCase();
  37102. return function(el) {
  37103. return el.tagName === tag;
  37104. };
  37105. },
  37106. cache = {};
  37107. proto.matcherCache = cache;
  37108. proto.is = function(selector) {
  37109. var dom = this.dom,
  37110. cls, match, testFn, root, isOrphan, is, tag;
  37111. // Empty selector always matches
  37112. if (!selector) {
  37113. return true;
  37114. }
  37115. // Only Element node types can be matched.
  37116. if (dom.nodeType !== 1) {
  37117. return false;
  37118. }
  37119. // eslint-disable-next-line no-cond-assign
  37120. if (!(testFn = Ext.isFunction(selector) ? selector : cache[selector])) {
  37121. // eslint-disable-next-line no-cond-assign
  37122. if (!(match = selector.match(simpleSelectorRe))) {
  37123. // Not a simple tagName.className selector, do it the hard way
  37124. root = dom.parentNode;
  37125. if (!root) {
  37126. isOrphan = true;
  37127. root = fragment || (fragment = DOC.createDocumentFragment());
  37128. fragment.appendChild(dom);
  37129. }
  37130. is = Ext.Array.indexOf(Ext.fly(root, '_is').query(selector), dom) !== -1;
  37131. if (isOrphan) {
  37132. fragment.removeChild(dom);
  37133. }
  37134. return is;
  37135. }
  37136. tag = match[1];
  37137. cls = match[2];
  37138. cache[selector] = testFn = cls ? classMatcher(tag, cls) : tagMatcher(tag);
  37139. }
  37140. return testFn(dom);
  37141. };
  37142. }
  37143. // IE8 needs its own implementation of getStyle because it doesn't support getComputedStyle
  37144. if (!view || !view.getComputedStyle) {
  37145. proto.getStyle = function(property, inline) {
  37146. var me = this,
  37147. dom = me.dom,
  37148. multiple = typeof property !== 'string',
  37149. prop = property,
  37150. props = prop,
  37151. len = 1,
  37152. isInline = inline,
  37153. styleHooks = me.styleHooks,
  37154. camel, domStyle, values, hook, out, style, i;
  37155. if (multiple) {
  37156. values = {};
  37157. prop = props[0];
  37158. i = 0;
  37159. if (!(len = props.length)) {
  37160. return values;
  37161. }
  37162. }
  37163. if (!dom || dom.documentElement) {
  37164. return values || '';
  37165. }
  37166. domStyle = dom.style;
  37167. if (inline) {
  37168. style = domStyle;
  37169. } else {
  37170. style = dom.currentStyle;
  37171. // fallback to inline style if rendering context not available
  37172. if (!style) {
  37173. isInline = true;
  37174. style = domStyle;
  37175. }
  37176. }
  37177. do {
  37178. hook = styleHooks[prop];
  37179. if (!hook) {
  37180. styleHooks[prop] = hook = {
  37181. name: Element.normalize(prop)
  37182. };
  37183. }
  37184. if (hook.get) {
  37185. out = hook.get(dom, me, isInline, style);
  37186. } else {
  37187. camel = hook.name;
  37188. out = style[camel];
  37189. }
  37190. if (!multiple) {
  37191. return out;
  37192. }
  37193. values[prop] = out;
  37194. prop = props[++i];
  37195. } while (i < len);
  37196. return values;
  37197. };
  37198. }
  37199. // override getStyle for border-*-width
  37200. if (Ext.isIE8) {
  37201. getBorderWidth = function(dom, el, inline, style) {
  37202. if (style[this.styleName] === 'none') {
  37203. return '0px';
  37204. }
  37205. return style[this.name];
  37206. };
  37207. edges = [
  37208. 'Top',
  37209. 'Right',
  37210. 'Bottom',
  37211. 'Left'
  37212. ];
  37213. k = edges.length;
  37214. while (k--) {
  37215. edge = edges[k];
  37216. borderWidth = 'border' + edge + 'Width';
  37217. styleHooks['border-' + edge.toLowerCase() + '-width'] = styleHooks[borderWidth] = {
  37218. name: borderWidth,
  37219. styleName: 'border' + edge + 'Style',
  37220. get: getBorderWidth
  37221. };
  37222. }
  37223. // IE8 has an odd bug with handling font icons in pseudo elements;
  37224. // it will render the icon once and not update it when something
  37225. // like text color is changed via style addition or removal.
  37226. // We have to force icon repaint by adding a style with forced empty
  37227. // pseudo element content, (x-sync-repaint) and removing it back to work
  37228. // around this issue.
  37229. // See this: https://github.com/FortAwesome/Font-Awesome/issues/954
  37230. // and this: https://github.com/twbs/bootstrap/issues/13863
  37231. // eslint-disable-next-line vars-on-top
  37232. var syncRepaintCls = Ext.baseCSSPrefix + 'sync-repaint';
  37233. proto.syncRepaint = function() {
  37234. this.addCls(syncRepaintCls);
  37235. // Measuring element width will make the browser to repaint it
  37236. this.getWidth();
  37237. // Removing empty content makes the icon to appear again and be redrawn
  37238. this.removeCls(syncRepaintCls);
  37239. };
  37240. }
  37241. if (Ext.isIE10m) {
  37242. Ext.override(Element, {
  37243. focus: function(defer, dom) {
  37244. var me = this,
  37245. ex;
  37246. dom = dom || me.dom;
  37247. if (me.deferredFocusTimer) {
  37248. Ext.undefer(me.deferredFocusTimer);
  37249. }
  37250. me.deferredFocusTimer = null;
  37251. if (Number(defer)) {
  37252. me.deferredFocusTimer = Ext.defer(me.focus, defer, me, [
  37253. null,
  37254. dom
  37255. ]);
  37256. } else {
  37257. Ext.GlobalEvents.fireEvent('beforefocus', dom);
  37258. // IE10m has an acute problem with focusing input elements;
  37259. // when the element was just shown and did not have enough
  37260. // time to initialize, focusing it might fail. The problem
  37261. // is somewhat random in nature; most of the time focusing
  37262. // an input element will succeed, failing only occasionally.
  37263. // When it fails, the focus will be thrown to the document
  37264. // body element, with subsequent focusout/focusin event pair
  37265. // on the body, which throws off our focusenter/focusleave
  37266. // processing.
  37267. // Fortunately for us, when this focus failure happens, the
  37268. // resulting focusout event will happen *synchronously*
  37269. // unlike the normal focusing events which IE will fire
  37270. // asynchronously. Also fortunately for us, in most cases
  37271. // trying to focus the given element the second time
  37272. // immediately after it failed to focus the first time
  37273. // seems to do the trick; however when second focus attempt
  37274. // succeeds, it will result in focusout on the body and
  37275. // focusin on the given element, which again wreaks havoc
  37276. // on our focusenter/focusleave handling.
  37277. // The only workable solution we have is to pretend that
  37278. // focus never went to the document body and ignore the
  37279. // focusout and focusin caused by failed first focus attempt.
  37280. // To this end, we fudge the event stream in Focus publisher
  37281. // override.
  37282. if (dom && (dom.tagName === 'INPUT' || dom.tagname === 'TEXTAREA')) {
  37283. Ext.synchronouslyFocusing = document.activeElement;
  37284. }
  37285. // Also note that trying to focus an unfocusable element
  37286. // might throw an exception in IE8. What a cute idea, MS. :(
  37287. try {
  37288. dom.focus();
  37289. } catch (xcpt) {
  37290. ex = xcpt;
  37291. }
  37292. // Ok so now we have this situation when we tried to focus
  37293. // the first time but did not succeed. Let's try again but
  37294. // not if there was an exception the first time - when the
  37295. // "focus failure" happens it does so silently. :(
  37296. if (Ext.synchronouslyFocusing && document.activeElement !== dom && !ex) {
  37297. dom.focus();
  37298. }
  37299. Ext.synchronouslyFocusing = null;
  37300. }
  37301. return me;
  37302. }
  37303. });
  37304. }
  37305. Ext.apply(Ext, {
  37306. /**
  37307. * `true` to automatically uncache orphaned Ext.Elements periodically. If set to
  37308. * `false`, the application will be required to clean up orphaned Ext.Elements and
  37309. * it's listeners as to not cause memory leakage.
  37310. * @member Ext
  37311. */
  37312. enableGarbageCollector: true,
  37313. // In sencha v5 isBorderBox is no longer needed since all supported browsers
  37314. // support border-box, but it is hard coded to true for backward compatibility
  37315. isBorderBox: true,
  37316. /**
  37317. * @property {Boolean} useShims
  37318. * @member Ext
  37319. * Set to `true` to use a {@link Ext.util.Floating#shim shim} on all floating Components
  37320. * and {@link Ext.LoadMask LoadMasks}
  37321. */
  37322. useShims: false,
  37323. getElementById: function(id) {
  37324. var el = DOC.getElementById(id),
  37325. detachedBodyEl;
  37326. if (!el && (detachedBodyEl = Ext.detachedBodyEl)) {
  37327. el = detachedBodyEl.dom.querySelector(Ext.makeIdSelector(id));
  37328. }
  37329. return el;
  37330. },
  37331. /**
  37332. * Applies event listeners to elements by selectors when the document is ready.
  37333. * The event name is specified with an `@` suffix.
  37334. *
  37335. * Ext.addBehaviors({
  37336. * // add a listener for click on all anchors in element with id foo
  37337. * '#foo a@click': function(e, t){
  37338. * // do something
  37339. * },
  37340. *
  37341. * // add the same listener to multiple selectors (separated by comma BEFORE the @)
  37342. * '#foo a, #bar span.some-class@mouseover': function(){
  37343. * // do something
  37344. * }
  37345. * });
  37346. *
  37347. * @param {Object} obj The list of behaviors to apply
  37348. * @member Ext
  37349. */
  37350. addBehaviors: function(obj) {
  37351. // simple cache for applying multiple behaviors to same selector
  37352. // does query multiple times
  37353. var cache = {},
  37354. parts, b, s;
  37355. if (!Ext.isReady) {
  37356. Ext.onInternalReady(function() {
  37357. Ext.addBehaviors(obj);
  37358. });
  37359. } else {
  37360. for (b in obj) {
  37361. if ((parts = b.split('@'))[1]) {
  37362. // for Object prototype breakers
  37363. s = parts[0];
  37364. if (!cache[s]) {
  37365. cache[s] = Ext.fly(document).select(s, true);
  37366. }
  37367. cache[s].on(parts[1], obj[b]);
  37368. }
  37369. }
  37370. cache = null;
  37371. }
  37372. }
  37373. });
  37374. if (Ext.isIE9m) {
  37375. Ext.getElementById = function(id) {
  37376. var el = DOC.getElementById(id),
  37377. detachedBodyEl;
  37378. if (!el && (detachedBodyEl = Ext.detachedBodyEl)) {
  37379. el = detachedBodyEl.dom.all[id];
  37380. }
  37381. return el;
  37382. };
  37383. proto.getById = function(id, asDom) {
  37384. var dom = this.dom,
  37385. ret = null,
  37386. entry, el;
  37387. if (dom) {
  37388. // for normal elements getElementById is the best solution, but if the el is
  37389. // not part of the document.body, we need to use all[]
  37390. el = (useDocForId && DOC.getElementById(id)) || dom.all[id];
  37391. if (el) {
  37392. if (asDom) {
  37393. ret = el;
  37394. } else {
  37395. // calling Element.get here is a real hit (2x slower) because it has to
  37396. // redetermine that we are giving it a dom el.
  37397. entry = Ext.cache[id];
  37398. if (entry) {
  37399. if (entry.skipGarbageCollection || !Ext.isGarbage(entry.dom)) {
  37400. ret = entry;
  37401. } else {
  37402. Ext.raise("Stale Element with id '" + el.id + "' found in Element cache. " + "Make sure to clean up Element instances using destroy()");
  37403. entry.destroy();
  37404. }
  37405. }
  37406. ret = ret || new Ext.Element(el);
  37407. }
  37408. }
  37409. }
  37410. return ret;
  37411. };
  37412. } else if (!DOC.querySelector) {
  37413. Ext.getDetachedBody = Ext.getBody;
  37414. Ext.getElementById = function(id) {
  37415. return DOC.getElementById(id);
  37416. };
  37417. proto.getById = function(id, asDom) {
  37418. var dom = DOC.getElementById(id);
  37419. return asDom ? dom : (dom ? Ext.get(dom) : null);
  37420. };
  37421. }
  37422. if (Ext.isIE && !(Ext.isIE9p && DOC.documentMode >= 9)) {
  37423. // Essentially all web browsers (Firefox, Internet Explorer, recent versions of Opera,
  37424. // Safari, Konqueror, and iCab, as a non-exhaustive list) return null when the specified
  37425. // attribute does not exist on the specified element.
  37426. // The DOM specification says that the correct return value in this case is actually
  37427. // the empty string, and some DOM implementations implement this behavior.
  37428. // The implementation of getAttribute in XUL (Gecko) actually follows the specification
  37429. // and returns an empty string. Consequently, you should use hasAttribute to check
  37430. // for an attribute's existence prior to calling getAttribute() if it is possible that
  37431. // the requested attribute does not exist on the specified element.
  37432. //
  37433. // https://developer.mozilla.org/en-US/docs/DOM/element.getAttribute
  37434. // http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614
  37435. proto.getAttribute = function(name, ns) {
  37436. var d = this.dom,
  37437. type;
  37438. if (ns) {
  37439. type = typeof d[ns + ":" + name];
  37440. if (type !== 'undefined' && type !== 'unknown') {
  37441. return d[ns + ":" + name] || null;
  37442. }
  37443. return null;
  37444. }
  37445. if (name === "for") {
  37446. name = "htmlFor";
  37447. }
  37448. return d[name] || null;
  37449. };
  37450. }
  37451. Ext.onInternalReady(function() {
  37452. var transparentRe = /^(?:transparent|(?:rgba[(](?:\s*\d+\s*[,]){3}\s*0\s*[)]))$/i,
  37453. origSetWidth = proto.setWidth,
  37454. origSetHeight = proto.setHeight,
  37455. origSetSize = proto.setSize,
  37456. origUnselectable = proto.unselectable,
  37457. pxRe = /^\d+(?:\.\d*)?px$/i,
  37458. colorStyles, i, name, camel;
  37459. if (supports.FixedTableWidthBug) {
  37460. // EXTJSIV-12665
  37461. // https://bugs.webkit.org/show_bug.cgi?id=130239
  37462. // Webkit browsers fail to layout correctly when a form field's width is less
  37463. // than the min-width of the body element. The only way to fix it seems to be
  37464. // to toggle the display style of the field's element before and after setting
  37465. // the width. Note: once the bug has been corrected by toggling the element's
  37466. // display, successive calls to setWidth will work without the hack. It's only
  37467. // when going from naturally widthed to having an explicit width that the bug
  37468. // occurs.
  37469. styleHooks.width = {
  37470. name: 'width',
  37471. set: function(dom, value, el) {
  37472. var style = dom.style,
  37473. needsFix = el._needsTableWidthFix,
  37474. origDisplay = style.display;
  37475. if (needsFix) {
  37476. style.display = 'none';
  37477. }
  37478. style.width = value;
  37479. if (needsFix) {
  37480. // repaint
  37481. // eslint-disable-next-line no-unused-expressions
  37482. dom.scrollWidth;
  37483. style.display = origDisplay;
  37484. }
  37485. }
  37486. };
  37487. proto.setWidth = function(width, animate) {
  37488. var me = this,
  37489. dom = me.dom,
  37490. style = dom.style,
  37491. needsFix = me._needsTableWidthFix,
  37492. origDisplay = style.display;
  37493. if (needsFix && !animate) {
  37494. style.display = 'none';
  37495. }
  37496. origSetWidth.call(me, width, animate);
  37497. if (needsFix && !animate) {
  37498. // repaint
  37499. // eslint-disable-next-line no-unused-expressions
  37500. dom.scrollWidth;
  37501. style.display = origDisplay;
  37502. }
  37503. return me;
  37504. };
  37505. proto.setSize = function(width, height, animate) {
  37506. var me = this,
  37507. dom = me.dom,
  37508. style = dom.style,
  37509. needsFix = me._needsTableWidthFix,
  37510. origDisplay = style.display;
  37511. if (needsFix && !animate) {
  37512. style.display = 'none';
  37513. }
  37514. origSetSize.call(me, width, height, animate);
  37515. if (needsFix && !animate) {
  37516. // repaint
  37517. // eslint-disable-next-line no-unused-expressions
  37518. dom.scrollWidth;
  37519. style.display = origDisplay;
  37520. }
  37521. return me;
  37522. };
  37523. }
  37524. if (Ext.isIE8) {
  37525. styleHooks.height = {
  37526. name: 'height',
  37527. set: function(dom, value, el) {
  37528. var component = el.component,
  37529. frameInfo, frameBodyStyle;
  37530. if (component && component._syncFrameHeight && el === component.el) {
  37531. frameBodyStyle = component.frameBody.dom.style;
  37532. if (pxRe.test(value)) {
  37533. frameInfo = component.getFrameInfo();
  37534. if (frameInfo) {
  37535. frameBodyStyle.height = (parseInt(value, 10) - frameInfo.height) + 'px';
  37536. }
  37537. } else if (!value || value === 'auto') {
  37538. frameBodyStyle.height = '';
  37539. }
  37540. }
  37541. dom.style.height = value;
  37542. }
  37543. };
  37544. proto.setHeight = function(height, animate) {
  37545. var component = this.component,
  37546. frameInfo, frameBodyStyle;
  37547. if (component && component._syncFrameHeight && this === component.el) {
  37548. frameBodyStyle = component.frameBody.dom.style;
  37549. if (!height || height === 'auto') {
  37550. frameBodyStyle.height = '';
  37551. } else {
  37552. frameInfo = component.getFrameInfo();
  37553. if (frameInfo) {
  37554. frameBodyStyle.height = (height - frameInfo.height) + 'px';
  37555. }
  37556. }
  37557. }
  37558. return origSetHeight.call(this, height, animate);
  37559. };
  37560. proto.setSize = function(width, height, animate) {
  37561. var component = this.component,
  37562. frameInfo, frameBodyStyle;
  37563. if (component && component._syncFrameHeight && this === component.el) {
  37564. frameBodyStyle = component.frameBody.dom.style;
  37565. if (!height || height === 'auto') {
  37566. frameBodyStyle.height = '';
  37567. } else {
  37568. frameInfo = component.getFrameInfo();
  37569. if (frameInfo) {
  37570. frameBodyStyle.height = (height - frameInfo.height) + 'px';
  37571. }
  37572. }
  37573. }
  37574. return origSetSize.call(this, width, height, animate);
  37575. };
  37576. // Override for IE8 which throws an error setting innerHTML when inside
  37577. // an event handler invoked from that element.
  37578. proto.setText = function(text) {
  37579. var dom = this.dom;
  37580. // Remove all child nodes, leave only a single textNode
  37581. if (!(dom.childNodes.length === 1 && dom.firstChild.nodeType === 3)) {
  37582. while (dom.lastChild && dom.lastChild.nodeType !== 3) {
  37583. dom.removeChild(dom.lastChild);
  37584. }
  37585. dom.appendChild(document.createTextNode());
  37586. }
  37587. // Set the data of the textNode
  37588. dom.firstChild.data = text;
  37589. };
  37590. proto.unselectable = function() {
  37591. origUnselectable.call(this);
  37592. this.dom.onselectstart = function() {
  37593. return false;
  37594. };
  37595. };
  37596. }
  37597. function fixTransparent(dom, el, inline, style) {
  37598. var value = style[this.name] || '';
  37599. return transparentRe.test(value) ? 'transparent' : value;
  37600. }
  37601. /*
  37602. * Helper function to create the function that will restore the selection.
  37603. */
  37604. function makeSelectionRestoreFn(activeEl, start, end) {
  37605. return function() {
  37606. activeEl.selectionStart = start;
  37607. activeEl.selectionEnd = end;
  37608. };
  37609. }
  37610. /*
  37611. * Creates a function to call to clean up problems with the work-around for the
  37612. * WebKit RightMargin bug. The work-around is to add "display: 'inline-block'" to
  37613. * the element before calling getComputedStyle and then to restore its original
  37614. * display value. The problem with this is that it corrupts the selection of an
  37615. * INPUT or TEXTAREA element (as in the "I-beam" goes away but the focus remains).
  37616. * To cleanup after this, we need to capture the selection of any such element and
  37617. * then restore it after we have restored the display style.
  37618. *
  37619. * @param {HTMLElement} target The top-most element being adjusted.
  37620. * @private
  37621. */
  37622. function getRightMarginFixCleaner(target) {
  37623. var hasInputBug = supports.DisplayChangeInputSelectionBug,
  37624. hasTextAreaBug = supports.DisplayChangeTextAreaSelectionBug,
  37625. activeEl, tag, start, end;
  37626. if (hasInputBug || hasTextAreaBug) {
  37627. activeEl = Element.getActiveElement();
  37628. tag = activeEl && activeEl.tagName;
  37629. if ((hasTextAreaBug && tag === 'TEXTAREA') || (hasInputBug && tag === 'INPUT' && activeEl.type === 'text')) {
  37630. if (Ext.fly(target).isAncestor(activeEl)) {
  37631. start = activeEl.selectionStart;
  37632. end = activeEl.selectionEnd;
  37633. if (Ext.isNumber(start) && Ext.isNumber(end)) {
  37634. // to be safe...
  37635. // We don't create the raw closure here inline because that
  37636. // will be costly even if we don't want to return it (nested
  37637. // function decls and exprs are often instantiated on entry
  37638. // regardless of whether execution ever reaches them):
  37639. return makeSelectionRestoreFn(activeEl, start, end);
  37640. }
  37641. }
  37642. }
  37643. }
  37644. return Ext.emptyFn;
  37645. }
  37646. // avoid special cases, just return a nop
  37647. function fixRightMargin(dom, el, inline, style) {
  37648. var result = style.marginRight,
  37649. domStyle, display;
  37650. // Ignore cases when the margin is correctly reported as 0, the bug only shows
  37651. // numbers larger.
  37652. if (result !== '0px') {
  37653. domStyle = dom.style;
  37654. display = domStyle.display;
  37655. domStyle.display = 'inline-block';
  37656. // eslint-disable-next-line max-len
  37657. result = (inline ? style : dom.ownerDocument.defaultView.getComputedStyle(dom, null)).marginRight;
  37658. domStyle.display = display;
  37659. }
  37660. return result;
  37661. }
  37662. function fixRightMarginAndInputFocus(dom, el, inline, style) {
  37663. var result = style.marginRight,
  37664. domStyle, cleaner, display;
  37665. if (result !== '0px') {
  37666. domStyle = dom.style;
  37667. cleaner = getRightMarginFixCleaner(dom);
  37668. display = domStyle.display;
  37669. domStyle.display = 'inline-block';
  37670. // eslint-disable-next-line max-len
  37671. result = (inline ? style : dom.ownerDocument.defaultView.getComputedStyle(dom, '')).marginRight;
  37672. domStyle.display = display;
  37673. cleaner();
  37674. }
  37675. return result;
  37676. }
  37677. // TODO - this was fixed in Safari 3 - verify if this is still an issue
  37678. // Fix bug caused by this: https://bugs.webkit.org/show_bug.cgi?id=13343
  37679. if (!supports.RightMargin) {
  37680. styleHooks.marginRight = styleHooks['margin-right'] = {
  37681. name: 'marginRight',
  37682. // TODO - Touch should use conditional compilation here or ensure that the
  37683. // underlying Ext.supports flags are set correctly...
  37684. // eslint-disable-next-line max-len
  37685. get: (supports.DisplayChangeInputSelectionBug || supports.DisplayChangeTextAreaSelectionBug) ? fixRightMarginAndInputFocus : fixRightMargin
  37686. };
  37687. }
  37688. if (!supports.TransparentColor) {
  37689. colorStyles = [
  37690. 'background-color',
  37691. 'border-color',
  37692. 'color',
  37693. 'outline-color'
  37694. ];
  37695. for (i = colorStyles.length; i--; ) {
  37696. name = colorStyles[i];
  37697. camel = Element.normalize(name);
  37698. styleHooks[name] = styleHooks[camel] = {
  37699. name: camel,
  37700. get: fixTransparent
  37701. };
  37702. }
  37703. }
  37704. // When elements are rotated 80 or 270 degrees, their border, margin and padding hooks
  37705. // need to be rotated as well.
  37706. proto.verticalStyleHooks90 = verticalStyleHooks90 = Ext.Object.chain(styleHooks);
  37707. proto.verticalStyleHooks270 = verticalStyleHooks270 = Ext.Object.chain(styleHooks);
  37708. verticalStyleHooks90.width = styleHooks.height || {
  37709. name: 'height'
  37710. };
  37711. verticalStyleHooks90.height = styleHooks.width || {
  37712. name: 'width'
  37713. };
  37714. verticalStyleHooks90['margin-top'] = {
  37715. name: 'marginLeft'
  37716. };
  37717. verticalStyleHooks90['margin-right'] = {
  37718. name: 'marginTop'
  37719. };
  37720. verticalStyleHooks90['margin-bottom'] = {
  37721. name: 'marginRight'
  37722. };
  37723. verticalStyleHooks90['margin-left'] = {
  37724. name: 'marginBottom'
  37725. };
  37726. verticalStyleHooks90['padding-top'] = {
  37727. name: 'paddingLeft'
  37728. };
  37729. verticalStyleHooks90['padding-right'] = {
  37730. name: 'paddingTop'
  37731. };
  37732. verticalStyleHooks90['padding-bottom'] = {
  37733. name: 'paddingRight'
  37734. };
  37735. verticalStyleHooks90['padding-left'] = {
  37736. name: 'paddingBottom'
  37737. };
  37738. verticalStyleHooks90['border-top'] = {
  37739. name: 'borderLeft'
  37740. };
  37741. verticalStyleHooks90['border-right'] = {
  37742. name: 'borderTop'
  37743. };
  37744. verticalStyleHooks90['border-bottom'] = {
  37745. name: 'borderRight'
  37746. };
  37747. verticalStyleHooks90['border-left'] = {
  37748. name: 'borderBottom'
  37749. };
  37750. verticalStyleHooks270.width = styleHooks.height || {
  37751. name: 'height'
  37752. };
  37753. verticalStyleHooks270.height = styleHooks.width || {
  37754. name: 'width'
  37755. };
  37756. verticalStyleHooks270['margin-top'] = {
  37757. name: 'marginRight'
  37758. };
  37759. verticalStyleHooks270['margin-right'] = {
  37760. name: 'marginBottom'
  37761. };
  37762. verticalStyleHooks270['margin-bottom'] = {
  37763. name: 'marginLeft'
  37764. };
  37765. verticalStyleHooks270['margin-left'] = {
  37766. name: 'marginTop'
  37767. };
  37768. verticalStyleHooks270['padding-top'] = {
  37769. name: 'paddingRight'
  37770. };
  37771. verticalStyleHooks270['padding-right'] = {
  37772. name: 'paddingBottom'
  37773. };
  37774. verticalStyleHooks270['padding-bottom'] = {
  37775. name: 'paddingLeft'
  37776. };
  37777. verticalStyleHooks270['padding-left'] = {
  37778. name: 'paddingTop'
  37779. };
  37780. verticalStyleHooks270['border-top'] = {
  37781. name: 'borderRight'
  37782. };
  37783. verticalStyleHooks270['border-right'] = {
  37784. name: 'borderBottom'
  37785. };
  37786. verticalStyleHooks270['border-bottom'] = {
  37787. name: 'borderLeft'
  37788. };
  37789. verticalStyleHooks270['border-left'] = {
  37790. name: 'borderTop'
  37791. };
  37792. /**
  37793. * @property {Boolean} scopeCss
  37794. * @member Ext
  37795. * Set this to true before onReady to prevent any styling from being added to
  37796. * the body element. By default a few styles such as font-family, and color
  37797. * are added to the body element via a "x-body" class. When this is set to
  37798. * `true` the "x-body" class is not added to the body element, but is added
  37799. * to the elements of root-level containers instead.
  37800. */
  37801. if (!Ext.scopeCss) {
  37802. Ext.getBody().addCls(Ext.baseCSSPrefix + 'body');
  37803. }
  37804. }, null, {
  37805. priority: 1500
  37806. });
  37807. });
  37808. // onReady
  37809. // @tag core
  37810. /**
  37811. * @class Ext.GlobalEvents
  37812. */
  37813. Ext.define('Ext.overrides.GlobalEvents', {
  37814. override: 'Ext.GlobalEvents',
  37815. /**
  37816. * @event resumelayouts
  37817. * Fires after global layout processing has been resumed in {@link
  37818. * Ext.Component#resumeLayouts}.
  37819. */
  37820. attachListeners: function() {
  37821. var me = this,
  37822. docElement, bufferedFn;
  37823. // In IE9- when using legacy onresize event via attachEvent or onresize property,
  37824. // the event may fire for *content size changes* as well as actual document view
  37825. // size changes. See this: https://msdn.microsoft.com/en-us/library/ms536959(v=vs.85).aspx
  37826. // and this: http://stackoverflow.com/questions/1852751/window-resize-event-firing-in-internet-explorer
  37827. // The amount of these events firing all at once can be entirely staggering, and they
  37828. // often happen during layouts so we have to be über careful to execute as few JavaScript
  37829. // statements as possible to improve overall framework performance.
  37830. if (Ext.isIE8) {
  37831. docElement = Ext.getDoc().dom.documentElement;
  37832. bufferedFn = Ext.Function.createBuffered(me.fireResize, me.resizeBuffer, me);
  37833. Ext.getWin().dom.attachEvent('onresize', function() {
  37834. if (docElement.clientWidth !== Ext.GlobalEvents.curWidth || docElement.clientHeight !== Ext.GlobalEvents.curHeight) {
  37835. bufferedFn();
  37836. }
  37837. });
  37838. }
  37839. me.callParent();
  37840. },
  37841. deprecated: {
  37842. 5: {
  37843. methods: {
  37844. addListener: function(ename, fn, scope, options, order, caller, eventOptions) {
  37845. var name, readyFn;
  37846. // The "ready" event was removed from Ext.globalEvents in 5.0 in favor of
  37847. // Ext.onReady(). This function adds compatibility for the ready event
  37848. if (ename === 'ready') {
  37849. readyFn = fn;
  37850. } else if (typeof ename !== 'string') {
  37851. for (name in ename) {
  37852. if (name === 'ready') {
  37853. readyFn = ename[name];
  37854. }
  37855. }
  37856. }
  37857. if (readyFn) {
  37858. Ext.log.warn("Ext.on('ready', fn) is deprecated. " + "Please use Ext.onReady(fn) instead.");
  37859. Ext.onReady(readyFn);
  37860. }
  37861. this.callParent([
  37862. ename,
  37863. fn,
  37864. scope,
  37865. options,
  37866. order,
  37867. caller,
  37868. eventOptions
  37869. ]);
  37870. }
  37871. }
  37872. }
  37873. }
  37874. });
  37875. /**
  37876. * @class Ext.plugin.Abstract
  37877. */
  37878. Ext.define('Ext.overrides.plugin.Abstract', {
  37879. override: 'Ext.plugin.Abstract',
  37880. $configStrict: false,
  37881. $configPrefixed: false,
  37882. disabled: false,
  37883. /**
  37884. * @cfg {String|Array} stateEvents
  37885. * The configured list of stateEvents used to (optionally) participate in Owner Component's
  37886. * state management.
  37887. * @member Ext.plugin.Abstract
  37888. */
  37889. /**
  37890. * @method
  37891. * The getState method is invoked by the client Component's State mixin when one or more of the
  37892. * specified {@link #stateEvents} are raised.
  37893. *
  37894. * The supplied implementation is empty. If plugin Subclasses are to (optionally) participate
  37895. * in the client Component's state management, implementers should provide a suitable method
  37896. * which returns a state object.
  37897. * @return {Object} state
  37898. * @member Ext.plugin.Abstract
  37899. */
  37900. getState: null,
  37901. /**
  37902. * @method
  37903. * The applyState method is invoked by the client Component's State mixin after initComponent
  37904. * method has been run for the client.
  37905. *
  37906. * The supplied implementation is empty. If plugin Subclasses are to (optionally) participate
  37907. * in the client Component's state management, implementers should provide a suitable method
  37908. * to utilize it.
  37909. * @param {Object} state The current plugin state object to be applied.
  37910. * @param {Object} allState The current aggregate state of the Component and all plugins.
  37911. * @member Ext.plugin.Abstract
  37912. */
  37913. applyState: null,
  37914. /**
  37915. * The base implementation just sets the plugin's `disabled` flag to `false`
  37916. *
  37917. * Plugin subclasses which need more complex processing may implement an overriding
  37918. * implementation.
  37919. * @member Ext.plugin.Abstract
  37920. */
  37921. enable: function() {
  37922. this.disabled = false;
  37923. },
  37924. /**
  37925. * The base implementation just sets the plugin's `disabled` flag to `true`
  37926. *
  37927. * Plugin subclasses which need more complex processing may implement an overriding
  37928. * implementation.
  37929. * @member Ext.plugin.Abstract
  37930. */
  37931. disable: function() {
  37932. this.disabled = true;
  37933. }
  37934. });
  37935. /**
  37936. * @class Ext.Widget
  37937. */
  37938. Ext.define('Ext.overrides.Widget', {
  37939. override: 'Ext.Widget',
  37940. uses: [
  37941. 'Ext.Component',
  37942. 'Ext.layout.component.Auto'
  37943. ],
  37944. $configStrict: false,
  37945. isComponent: true,
  37946. liquidLayout: true,
  37947. // in Ext JS the rendered flag is set as soon as a component has its element. Since
  37948. // widgets always have an element when constructed, they are always considered to be
  37949. // "rendered"
  37950. rendered: true,
  37951. rendering: true,
  37952. config: {
  37953. renderTo: null
  37954. },
  37955. constructor: function(config) {
  37956. var me = this,
  37957. renderTo;
  37958. me.callParent([
  37959. config
  37960. ]);
  37961. // initialize the component layout
  37962. me.getComponentLayout();
  37963. renderTo = me.getRenderTo();
  37964. if (renderTo) {
  37965. me.render(renderTo);
  37966. }
  37967. },
  37968. addClsWithUI: function(cls) {
  37969. this.el.addCls(cls);
  37970. },
  37971. afterComponentLayout: Ext.emptyFn,
  37972. updateLayout: function() {
  37973. var owner = this.getRefOwner();
  37974. if (owner) {
  37975. owner.updateLayout();
  37976. }
  37977. },
  37978. destroy: function() {
  37979. var me = this,
  37980. ownerCt = me.ownerCt;
  37981. if (ownerCt && ownerCt.remove) {
  37982. ownerCt.remove(me, false);
  37983. }
  37984. me.callParent();
  37985. },
  37986. finishRender: function() {
  37987. this.rendering = false;
  37988. this.initBindable();
  37989. this.initKeyMap();
  37990. },
  37991. getAnimationProps: function() {
  37992. // see Ext.util.Animate mixin
  37993. return {};
  37994. },
  37995. getComponentLayout: function() {
  37996. var me = this,
  37997. layout = me.componentLayout;
  37998. if (!layout) {
  37999. layout = me.componentLayout = new Ext.layout.component.Auto();
  38000. layout.setOwner(me);
  38001. }
  38002. return layout;
  38003. },
  38004. getEl: function() {
  38005. return this.element;
  38006. },
  38007. /**
  38008. * @private
  38009. * Needed for when widget is rendered into a grid cell. The class to add to the cell element.
  38010. * @member Ext.Widget
  38011. */
  38012. getTdCls: function() {
  38013. return Ext.baseCSSPrefix + this.getTdType() + '-' + (this.ui || 'default') + '-cell';
  38014. },
  38015. /**
  38016. * @private
  38017. * Partner method to {@link #getTdCls}.
  38018. *
  38019. * Returns the base type for the component. Defaults to return `this.xtype`, but
  38020. * All derived classes of {@link Ext.form.field.Text TextField} can return the type 'textfield',
  38021. * and all derived classes of {@link Ext.button.Button Button} can return the type 'button'
  38022. * @member Ext.Widget
  38023. */
  38024. getTdType: function() {
  38025. return this.xtype;
  38026. },
  38027. getItemId: function() {
  38028. // needed by ComponentQuery
  38029. return this.itemId || this.id;
  38030. },
  38031. getSizeModel: function() {
  38032. return Ext.Component.prototype.getSizeModel.apply(this, arguments);
  38033. },
  38034. onAdded: function(container, pos, instanced) {
  38035. var me = this;
  38036. me.ownerCt = container;
  38037. me.onInheritedAdd(me, instanced);
  38038. // this component is no longer detached from the body
  38039. me.isDetached = false;
  38040. },
  38041. onRemoved: function(destroying) {
  38042. this.onInheritedRemove(destroying);
  38043. this.ownerCt = this.ownerLayout = null;
  38044. },
  38045. parseBox: function(box) {
  38046. return Ext.Element.parseBox(box);
  38047. },
  38048. removeClsWithUI: function(cls) {
  38049. this.el.removeCls(cls);
  38050. },
  38051. render: function(container, position) {
  38052. var me = this,
  38053. element = me.element,
  38054. proto = Ext.Component.prototype,
  38055. nextSibling;
  38056. if (!me.ownerCt || me.floating) {
  38057. if (Ext.scopeCss) {
  38058. element.addCls(proto.rootCls);
  38059. }
  38060. element.addCls(proto.borderBoxCls);
  38061. }
  38062. if (position) {
  38063. nextSibling = container.childNodes[position];
  38064. if (nextSibling) {
  38065. Ext.fly(container).insertBefore(element, nextSibling);
  38066. return;
  38067. }
  38068. }
  38069. Ext.fly(container).appendChild(element);
  38070. me.finishRender();
  38071. },
  38072. setPosition: function(x, y) {
  38073. this.el.setLocalXY(x, y);
  38074. },
  38075. up: function() {
  38076. return Ext.Component.prototype.up.apply(this, arguments);
  38077. },
  38078. isAncestor: function() {
  38079. return Ext.Component.prototype.isAncestor.apply(this, arguments);
  38080. },
  38081. onFocusEnter: function() {
  38082. return Ext.Component.prototype.onFocusEnter.apply(this, arguments);
  38083. },
  38084. onFocusLeave: function() {
  38085. return Ext.Component.prototype.onFocusLeave.apply(this, arguments);
  38086. },
  38087. isLayoutChild: function(candidate) {
  38088. var ownerCt = this.ownerCt;
  38089. return ownerCt ? (ownerCt === candidate || ownerCt.isLayoutChild(candidate)) : false;
  38090. },
  38091. privates: {
  38092. doAddListener: function(name, fn, scope, options, order, caller, manager) {
  38093. if (name === 'painted' || name === 'resize') {
  38094. this.element.doAddListener(name, fn, scope || this, options, order);
  38095. }
  38096. this.callParent([
  38097. name,
  38098. fn,
  38099. scope,
  38100. options,
  38101. order,
  38102. caller,
  38103. manager
  38104. ]);
  38105. },
  38106. doRemoveListener: function(name, fn, scope) {
  38107. if (name === 'painted' || name === 'resize') {
  38108. this.element.doRemoveListener(name, fn, scope);
  38109. }
  38110. this.callParent([
  38111. name,
  38112. fn,
  38113. scope
  38114. ]);
  38115. }
  38116. }
  38117. }, function(Cls) {
  38118. var prototype = Cls.prototype;
  38119. if (Ext.isIE9m) {
  38120. // Since IE8/9 don't not support Object.defineProperty correctly we can't add the reference
  38121. // nodes on demand, so we just fall back to adding all references up front.
  38122. prototype.addElementReferenceOnDemand = prototype.addElementReference;
  38123. }
  38124. });
  38125. /**
  38126. * @class Ext.Progress
  38127. *
  38128. * @example
  38129. * Ext.create({
  38130. * xtype: 'grid',
  38131. * title: 'Simpsons',
  38132. * store: {
  38133. * data: [
  38134. * { name: 'Lisa', progress: .159 },
  38135. * { name: 'Bart', progress: .216 },
  38136. * { name: 'Homer', progress: .55 },
  38137. * { name: 'Maggie', progress: .167 },
  38138. * { name: 'Marge', progress: .145 }
  38139. * ]
  38140. * },
  38141. * columns: [
  38142. * { text: 'Name', dataIndex: 'name' },
  38143. * {
  38144. * text: 'Progress',
  38145. * xtype: 'widgetcolumn',
  38146. * width: 120,
  38147. * dataIndex: 'progress',
  38148. * widget: {
  38149. * xtype: 'progress'
  38150. * }
  38151. * }
  38152. * ],
  38153. * height: 200,
  38154. * width: 400,
  38155. * renderTo: Ext.getBody()
  38156. * });
  38157. */
  38158. Ext.define('Ext.overrides.Progress', {
  38159. override: 'Ext.Progress',
  38160. config: {
  38161. ui: 'default'
  38162. },
  38163. updateWidth: function(width, oldWidth) {
  38164. var me = this;
  38165. me.callParent([
  38166. width,
  38167. oldWidth
  38168. ]);
  38169. width -= me.element.getBorderWidth('lr');
  38170. me.backgroundEl.setWidth(width);
  38171. me.textEl.setWidth(width);
  38172. },
  38173. privates: {
  38174. startBarAnimation: function(o) {
  38175. this.barEl.animate(o);
  38176. },
  38177. stopBarAnimation: function() {
  38178. this.barEl.stopAnimation();
  38179. }
  38180. }
  38181. });
  38182. /**
  38183. * @class Ext.mixin.Focusable
  38184. */
  38185. Ext.define('Ext.overrides.mixin.Focusable', {
  38186. override: 'Ext.Component',
  38187. /**
  38188. * @cfg {String} [focusCls='focus'] CSS class suffix that will be used to
  38189. * compose the CSS class name that will be added to Component's {@link #focusClsEl},
  38190. * and removed when Component blurs.
  38191. *
  38192. * **Note** that this is not a full CSS class name; this suffix will be combined
  38193. * with component's UI class via {@link #addClsWithUI} and {@link #removeClsWithUI} methods.
  38194. */
  38195. focusCls: 'focus',
  38196. /**
  38197. * Try to focus this component.
  38198. *
  38199. * If this component is disabled, a close relation will be targeted for focus instead
  38200. * to keep focus localized for keyboard users.
  38201. * @param {Mixed} [selectText] If applicable, `true` to also select all the text in this
  38202. * component, or an array consisting of start and end (defaults to start) position of selection.
  38203. * @param {Boolean/Number} [delay] Delay the focus this number of milliseconds (true for
  38204. * 10 milliseconds).
  38205. * @param {Function} [callback] Only needed if the `delay` parameter is used. A function to call
  38206. * upon focus.
  38207. * @param {Function} [scope] Only needed if the `delay` parameter is used. The scope (`this`
  38208. * reference) in which to execute the callback.
  38209. * @return {Ext.Component} The focused Component. Usually `this` Component. Some Containers may
  38210. * delegate focus to a descendant Component ({@link Ext.window.Window Window}s can do this
  38211. * through their {@link Ext.window.Window#defaultFocus defaultFocus} config option. If this
  38212. * component is disabled, a closely related component will be focused and that will be returned.
  38213. */
  38214. focus: function(selectText, delay, callback, scope) {
  38215. var me = this,
  38216. containerScrollTop;
  38217. if ((!me.focusable && !me.isContainer) || me.destroyed || me.destroying) {
  38218. return me;
  38219. }
  38220. // If delay is wanted, queue a call to this function.
  38221. if (delay) {
  38222. me.getFocusTask().delay(Ext.isNumber(delay) ? delay : 10, me.focus, me, [
  38223. selectText,
  38224. false,
  38225. callback,
  38226. scope
  38227. ]);
  38228. return me;
  38229. }
  38230. // An immediate focus call must cancel any outstanding delayed focus calls.
  38231. me.cancelFocus();
  38232. if (me.floating && me.container && me.container.dom) {
  38233. containerScrollTop = me.container.dom.scrollTop;
  38234. }
  38235. // Core Focusable method will return true if focusing was attempted
  38236. if (me.mixins.focusable.focus.apply(me, arguments) !== false) {
  38237. if (callback) {
  38238. Ext.callback(callback, scope);
  38239. }
  38240. // Focusing a floating Component brings it to the front of its stack.
  38241. // this is performed by its zIndexManager. Pass preventFocus true to avoid recursion.
  38242. if (me.floating && containerScrollTop !== undefined) {
  38243. me.container.dom.scrollTop = containerScrollTop;
  38244. }
  38245. }
  38246. return me;
  38247. },
  38248. /**
  38249. * Cancel any deferred focus on this component
  38250. * @protected
  38251. */
  38252. cancelFocus: function() {
  38253. var me = this,
  38254. task = me.getFocusTask();
  38255. if (task) {
  38256. task.cancel();
  38257. }
  38258. },
  38259. /**
  38260. * @method
  38261. * Template method to do any pre-blur processing.
  38262. * @protected
  38263. * @param {Ext.event.Event} e The event object
  38264. */
  38265. beforeBlur: Ext.emptyFn,
  38266. /**
  38267. * @method
  38268. * Template method to do any post-blur processing.
  38269. * @protected
  38270. * @param {Ext.event.Event} e The event object
  38271. */
  38272. postBlur: Ext.emptyFn,
  38273. /**
  38274. * @method
  38275. * Template method to do any pre-focus processing.
  38276. * @protected
  38277. * @param {Ext.event.Event} e The event object
  38278. */
  38279. beforeFocus: Ext.emptyFn,
  38280. /**
  38281. * @method
  38282. * Template method to do any post-focus processing.
  38283. * @protected
  38284. * @param {Ext.event.Event} e The event object
  38285. */
  38286. postFocus: Ext.emptyFn,
  38287. onFocusEnter: function(e) {
  38288. var me = this;
  38289. if (me.destroying || me.destroyed) {
  38290. return;
  38291. }
  38292. // Focusing must being a floating component to the front.
  38293. // Only bring to front if this component is not the manager's
  38294. // topmost component (may be a result of focusOnToFront).
  38295. if (me.floating && me !== me.zIndexManager.getActive()) {
  38296. me.toFront(true);
  38297. }
  38298. me.callParent([
  38299. e
  38300. ]);
  38301. },
  38302. destroyFocusable: function() {
  38303. var me = this;
  38304. // Calling cancelFocus() will assign focusTask property,
  38305. // which we don't want during destruction
  38306. if (me.focusTask) {
  38307. me.focusTask.stop(me.focus, me);
  38308. }
  38309. me.callParent();
  38310. },
  38311. privates: {
  38312. addFocusCls: function(e) {
  38313. var me = this,
  38314. focusCls = me.focusCls,
  38315. el;
  38316. if (focusCls) {
  38317. el = me.getFocusClsEl(e);
  38318. if (el) {
  38319. el.addCls(me.addClsWithUI(focusCls, true));
  38320. }
  38321. }
  38322. },
  38323. removeFocusCls: function(e) {
  38324. var me = this,
  38325. focusCls = me.focusCls,
  38326. el;
  38327. if (focusCls) {
  38328. el = me.getFocusClsEl(e);
  38329. if (el) {
  38330. el.removeCls(me.removeClsWithUI(focusCls, true));
  38331. }
  38332. }
  38333. },
  38334. /**
  38335. * @private
  38336. */
  38337. getFocusTask: function() {
  38338. if (!this.focusTask) {
  38339. this.focusTask = Ext.focusTask;
  38340. }
  38341. return this.focusTask;
  38342. },
  38343. updateMaskState: function(state, mask) {
  38344. var me = this,
  38345. ariaEl = me.ariaEl.dom,
  38346. skipMask = me.getInherited().disabled && me.getInherited().disableMask,
  38347. value;
  38348. if (state) {
  38349. me.disableTabbing();
  38350. if (!skipMask) {
  38351. me.setMasked(true);
  38352. }
  38353. if (ariaEl) {
  38354. ariaEl.setAttribute('aria-busy', 'true');
  38355. // It is possible that ariaEl already has aria-describedby attribute;
  38356. // in that case we need to save it to restore later.
  38357. value = ariaEl.getAttribute('aria-describedby');
  38358. if (value) {
  38359. me._savedAriaDescribedBy = value;
  38360. }
  38361. ariaEl.setAttribute('aria-describedby', mask.ariaEl.id);
  38362. }
  38363. } else {
  38364. me.enableTabbing();
  38365. if (!skipMask) {
  38366. me.setMasked(false);
  38367. }
  38368. if (ariaEl) {
  38369. ariaEl.removeAttribute('aria-busy');
  38370. value = ariaEl.getAttribute('aria-describedby');
  38371. ariaEl.removeAttribute('aria-describedby');
  38372. if (value === mask.ariaEl.id && me._savedAriaDescribedBy) {
  38373. ariaEl.setAttribute('aria-describedby', me._savedAriaDescribedBy);
  38374. delete me._savedAriaDescribedBy;
  38375. }
  38376. }
  38377. }
  38378. }
  38379. }
  38380. }, function() {
  38381. // One global DelayedTask to assign focus
  38382. // So that the last focus call wins.
  38383. if (!Ext.focusTask) {
  38384. Ext.focusTask = new Ext.util.DelayedTask();
  38385. }
  38386. });
  38387. Ext.define('Ext.overrides.app.domain.Component', {
  38388. override: 'Ext.app.domain.Component',
  38389. requires: [
  38390. 'Ext.Component'
  38391. ]
  38392. }, function(ComponentDomain) {
  38393. // The core Component domain monitors events on the Ext.Widget class
  38394. // in Ext Components are not widgets so we need to monitor Ext.Component as well.
  38395. ComponentDomain.monitor(Ext.Component);
  38396. });
  38397. // This is an override because it must be loaded very early, possibly before Ext.app.Application
  38398. // in dev mode so that Ext.application() can be called.
  38399. // Being an override also ensures that it is only included in a built app if Ext.app.Application
  38400. // is present.
  38401. //
  38402. // @override Ext.app.Application
  38403. /**
  38404. * @method application
  38405. * @member Ext
  38406. * Loads Ext.app.Application class and starts it up with given configuration after the
  38407. * page is ready.
  38408. *
  38409. * See `Ext.app.Application` for details.
  38410. *
  38411. * @param {Object/String} config Application config object or name of a class derived
  38412. * from Ext.app.Application.
  38413. */
  38414. Ext.application = function(config) {
  38415. var createApp = function(App) {
  38416. // This won't be called until App class has been created.
  38417. Ext.onReady(function() {
  38418. var Viewport = Ext.viewport;
  38419. // eslint-disable-next-line dot-notation
  38420. Viewport = Viewport && Viewport['Viewport'];
  38421. if (Viewport && Viewport.setup) {
  38422. Viewport.setup(App.prototype.config.viewport);
  38423. }
  38424. Ext.app.Application.instance = new App();
  38425. });
  38426. };
  38427. if (typeof config === "string") {
  38428. Ext.require(config, function() {
  38429. createApp(Ext.ClassManager.get(config));
  38430. });
  38431. } else {
  38432. config = Ext.apply({
  38433. extend: 'Ext.app.Application'
  38434. }, // can be replaced by config!
  38435. config);
  38436. // We have to process "paths" before creating Application class,
  38437. // or `requires` won't work.
  38438. Ext.app.setupPaths(config.name, config.appFolder, config.paths);
  38439. config['paths processed'] = true;
  38440. // Let Ext.define do the hard work but don't assign a class name.
  38441. Ext.define(config.name + ".$application", config, function() {
  38442. createApp(this);
  38443. });
  38444. }
  38445. };
  38446. /**
  38447. * @class Ext.app.Application
  38448. */
  38449. Ext.define('Ext.overrides.app.Application', {
  38450. override: 'Ext.app.Application',
  38451. uses: [
  38452. 'Ext.tip.QuickTipManager'
  38453. ],
  38454. // @cmd-auto-dependency {aliasPrefix: "view.", mvc: true, requires: ["Ext.plugin.Viewport"]}
  38455. /**
  38456. * @cfg {Boolean/String} [autoCreateViewport=false]
  38457. * @deprecated 5.1 Instead use {@link #mainView}
  38458. * @member Ext.app.Application
  38459. */
  38460. autoCreateViewport: false,
  38461. config: {
  38462. /**
  38463. * @cfg {Boolean} enableQuickTips
  38464. * @deprecated 6.2.0 Use {@link #quickTips}.
  38465. */
  38466. enableQuickTips: null
  38467. },
  38468. /**
  38469. * @cfg {Boolean} quickTips
  38470. * True to automatically set up Ext.tip.QuickTip support.
  38471. *
  38472. * @since 6.2.0
  38473. */
  38474. quickTips: true,
  38475. updateEnableQuickTips: function(enableQuickTips) {
  38476. this.setQuickTips(enableQuickTips);
  38477. },
  38478. applyMainView: function(mainView) {
  38479. var view, proto, config, protoPlugins, configPlugins;
  38480. if (typeof mainView === 'string') {
  38481. view = this.getView(mainView);
  38482. config = {};
  38483. } else {
  38484. config = mainView;
  38485. view = Ext.ClassManager.getByConfig(mainView);
  38486. }
  38487. proto = view.prototype;
  38488. if (!proto.isViewport) {
  38489. // Need to copy over any plugins defined on the prototype and on the config.
  38490. protoPlugins = Ext.Array.from(proto.plugins);
  38491. configPlugins = Ext.Array.from(config.plugins);
  38492. config = Ext.apply({}, config);
  38493. config.plugins = [
  38494. 'viewport'
  38495. ].concat(protoPlugins, configPlugins);
  38496. }
  38497. return view.create(config);
  38498. },
  38499. getDependencies: function(cls, data, requires) {
  38500. var Controller = Ext.app.Controller,
  38501. proto = cls.prototype,
  38502. namespace = data.$namespace,
  38503. viewportClass = data.autoCreateViewport;
  38504. if (viewportClass) {
  38505. if (!namespace) {
  38506. Ext.raise("[Ext.app.Application] Can't resolve namespace for " + data.$className + ", did you forget to specify 'name' property?");
  38507. }
  38508. if (viewportClass === true) {
  38509. viewportClass = 'Viewport';
  38510. } else {
  38511. requires.push('Ext.plugin.Viewport');
  38512. }
  38513. Controller.processDependencies(proto, requires, namespace, 'view', viewportClass);
  38514. }
  38515. },
  38516. onBeforeLaunch: function() {
  38517. var me = this,
  38518. autoCreateViewport = me.autoCreateViewport;
  38519. if (me.getQuickTips()) {
  38520. me.initQuickTips();
  38521. }
  38522. if (autoCreateViewport) {
  38523. me.initViewport();
  38524. }
  38525. this.callParent(arguments);
  38526. },
  38527. getViewportName: function() {
  38528. var name = null,
  38529. autoCreate = this.autoCreateViewport;
  38530. if (autoCreate) {
  38531. name = (autoCreate === true) ? 'Viewport' : autoCreate;
  38532. }
  38533. return name;
  38534. },
  38535. initViewport: function() {
  38536. this.setMainView(this.getViewportName());
  38537. },
  38538. initQuickTips: function() {
  38539. Ext.tip.QuickTipManager.init();
  38540. }
  38541. });
  38542. Ext.define('Ext.overrides.app.domain.View', {
  38543. override: 'Ext.app.domain.View',
  38544. requires: [
  38545. 'Ext.Component'
  38546. ],
  38547. constructor: function(controller) {
  38548. this.callParent([
  38549. controller
  38550. ]);
  38551. // The base class handles Ext.Widget, which encompasses
  38552. // component for modern, so we only need the override here.
  38553. this.monitoredClasses.push(Ext.Component);
  38554. }
  38555. });
  38556. /**
  38557. * @class Ext.dom.Helper
  38558. */
  38559. Ext.define('Ext.overrides.dom.Helper', (function() {
  38560. var tableRe = /^(?:table|thead|tbody|tr|td)$/i,
  38561. tableElRe = /td|tr|tbody|thead/i,
  38562. ts = '<table>',
  38563. te = '</table>',
  38564. tbs = ts + '<tbody>',
  38565. tbe = '</tbody>' + te,
  38566. trs = tbs + '<tr>',
  38567. tre = '</tr>' + tbe;
  38568. return {
  38569. override: 'Ext.dom.Helper',
  38570. ieInsertHtml: function(where, el, html) {
  38571. var frag = null;
  38572. // IE's incomplete table implementation: http://www.ericvasilik.com/2006/07/code-karma.html
  38573. if (Ext.isIE9m && tableRe.test(el.tagName)) {
  38574. frag = this.insertIntoTable(el.tagName.toLowerCase(), where, el, html);
  38575. }
  38576. return frag;
  38577. },
  38578. ieOverwrite: function(el, html) {
  38579. // IE Inserting HTML into a table/tbody/tr requires extra processing:
  38580. // http://www.ericvasilik.com/2006/07/code-karma.html
  38581. if (Ext.isIE9m && tableRe.test(el.tagName)) {
  38582. // Clearing table elements requires removal of all elements.
  38583. while (el.firstChild) {
  38584. el.removeChild(el.firstChild);
  38585. }
  38586. if (html) {
  38587. return this.insertHtml('afterbegin', el, html);
  38588. }
  38589. }
  38590. },
  38591. ieTable: function(depth, openingTags, htmlContent, closingTags) {
  38592. var i = -1,
  38593. el = this.detachedDiv,
  38594. ns, nx;
  38595. el.innerHTML = [
  38596. openingTags,
  38597. htmlContent,
  38598. closingTags
  38599. ].join('');
  38600. while (++i < depth) {
  38601. el = el.firstChild;
  38602. }
  38603. // If the result is multiple siblings, then encapsulate them into one fragment.
  38604. ns = el.nextSibling;
  38605. if (ns) {
  38606. ns = el;
  38607. el = document.createDocumentFragment();
  38608. while (ns) {
  38609. nx = ns.nextSibling;
  38610. el.appendChild(ns);
  38611. ns = nx;
  38612. }
  38613. }
  38614. return el;
  38615. },
  38616. /**
  38617. * @private
  38618. * @method insertIntoTable
  38619. * @member Ext.dom.Helper
  38620. * workaround for broken table implementation in IE9m
  38621. * http://www.ericvasilik.com/2006/07/code-karma.html
  38622. */
  38623. insertIntoTable: function(tag, where, destinationEl, html) {
  38624. var node, before,
  38625. bb = where === 'beforebegin',
  38626. ab = where === 'afterbegin',
  38627. be = where === 'beforeend',
  38628. ae = where === 'afterend';
  38629. if (tag === 'td' && (ab || be) || !tableElRe.test(tag) && (bb || ae)) {
  38630. return null;
  38631. }
  38632. /* eslint-disable indent, multiline-ternary, no-multi-spaces */
  38633. before = bb ? destinationEl : ae ? destinationEl.nextSibling : ab ? destinationEl.firstChild : null;
  38634. /* eslint-enable indent, multiline-ternary, no-multi-spaces */
  38635. if (bb || ae) {
  38636. destinationEl = destinationEl.parentNode;
  38637. }
  38638. if (tag === 'td' || (tag === 'tr' && (be || ab))) {
  38639. node = this.ieTable(4, trs, html, tre);
  38640. } else if (((tag === 'tbody' || tag === 'thead') && (be || ab)) || (tag === 'tr' && (bb || ae))) {
  38641. node = this.ieTable(3, tbs, html, tbe);
  38642. } else {
  38643. node = this.ieTable(2, ts, html, te);
  38644. }
  38645. destinationEl.insertBefore(node, before);
  38646. return node;
  38647. }
  38648. };
  38649. })());
  38650. /**
  38651. * @class Ext.list.AbstractTreeItem
  38652. */
  38653. Ext.define('Ext.overrides.list.AbstractTreeItem', {
  38654. override: 'Ext.list.AbstractTreeItem',
  38655. // This config is used by TreeIten, however to support the generic API (RootItem),
  38656. // we need this up here.
  38657. config: {
  38658. floated: null
  38659. }
  38660. });
  38661. /**
  38662. * @class Ext.list.TreeItem
  38663. */
  38664. Ext.define('Ext.overrides.list.TreeItem', {
  38665. override: 'Ext.list.TreeItem',
  38666. // Implement a setter.
  38667. // There *is* no "floated" config in Classic.
  38668. // We're still an inner item, we just get put inside a Container.
  38669. setFloated: function(floated) {
  38670. var me = this,
  38671. el = me.element,
  38672. placeholder = me.placeholder,
  38673. node, wasExpanded;
  38674. if (me.treeItemFloated !== floated) {
  38675. if (floated) {
  38676. placeholder = el.clone(false, true);
  38677. // shallow, asDom
  38678. placeholder.id += '-placeholder';
  38679. // avoid duplicate id
  38680. me.placeholder = Ext.get(placeholder);
  38681. me.wasExpanded = me.getExpanded();
  38682. me.setExpanded(true);
  38683. el.addCls(me.floatedCls);
  38684. el.dom.parentNode.insertBefore(placeholder, el.dom);
  38685. me.floater = me.createFloater();
  38686. }
  38687. // toolkit-specific
  38688. else if (placeholder) {
  38689. wasExpanded = me.wasExpanded;
  38690. node = me.getNode();
  38691. me.setExpanded(wasExpanded);
  38692. if (!wasExpanded && node.isExpanded()) {
  38693. // If we have been floating and expanded a child, we may have been
  38694. // expanded as part of the ancestors. Attempt to restore state.
  38695. me.preventAnimation = true;
  38696. node.collapse();
  38697. me.preventAnimation = false;
  38698. }
  38699. me.floater.remove(me, false);
  38700. // don't destroy
  38701. el.removeCls(me.floatedCls);
  38702. placeholder.dom.parentNode.insertBefore(el.dom, placeholder.dom);
  38703. placeholder.destroy();
  38704. me.floater.destroy();
  38705. me.placeholder = me.floater = null;
  38706. }
  38707. // Use an internal property name. We are NOT really floated
  38708. me.treeItemFloated = floated;
  38709. }
  38710. },
  38711. getFloated: function() {
  38712. return this.treeItemFloated;
  38713. },
  38714. runAnimation: function(animation) {
  38715. return this.itemContainer.addAnimation(animation);
  38716. },
  38717. stopAnimation: function(animation) {
  38718. animation.jumpToEnd();
  38719. },
  38720. privates: {
  38721. createFloater: function() {
  38722. var me = this,
  38723. owner = me.getOwner(),
  38724. ownerTree = me.up('treelist'),
  38725. floater,
  38726. toolElement = me.getToolElement(),
  38727. expandedWidth = ownerTree.expandedWidth,
  38728. defaultListWidth = ownerTree.defaultListWidth;
  38729. if (expandedWidth === null) {
  38730. expandedWidth = defaultListWidth;
  38731. }
  38732. me.floater = floater = new Ext.container.Container({
  38733. cls: ownerTree.self.prototype.element.cls + ' ' + ownerTree.uiPrefix + ownerTree.getUi() + ' ' + Ext.baseCSSPrefix + 'treelist-floater',
  38734. floating: true,
  38735. // We do not get element resize events on IE8
  38736. // so fall back to 6.0.1 sizing to 200 wide.
  38737. width: Ext.isIE8 ? defaultListWidth : (expandedWidth - toolElement.getWidth()),
  38738. shadow: false,
  38739. hidden: true,
  38740. renderTo: Ext.getBody(),
  38741. listeners: {
  38742. element: 'el',
  38743. click: function(e) {
  38744. return owner.onClick(e);
  38745. }
  38746. }
  38747. });
  38748. floater.add(me);
  38749. floater.show();
  38750. floater.el.alignTo(toolElement, 'tr?');
  38751. return floater;
  38752. }
  38753. }
  38754. });
  38755. /**
  38756. * @class Ext.list.Tree
  38757. */
  38758. Ext.define('Ext.overrides.list.Tree', {
  38759. override: 'Ext.list.Tree',
  38760. canMeasure: true,
  38761. constructor: function(config) {
  38762. this.callParent([
  38763. config
  38764. ]);
  38765. // Track size so that we can track the expanded size
  38766. // for use by the floated state of items when in micro mode.
  38767. // Browsers where this event is not supported, fall back to a width
  38768. // of 200px for floated tree items.
  38769. if (!Ext.isIE8) {
  38770. this.element.on('resize', 'onElResize', this);
  38771. }
  38772. },
  38773. beforeLayout: function() {
  38774. this.syncIconSize();
  38775. },
  38776. onElResize: function(el, details) {
  38777. if (!this.getMicro() && this.canMeasure) {
  38778. this.expandedWidth = details.width;
  38779. }
  38780. },
  38781. privates: {
  38782. defaultListWidth: 200,
  38783. expandedWidth: null
  38784. }
  38785. });
  38786. /**
  38787. * @class Ext.sparkline.Base
  38788. */
  38789. Ext.define('Ext.override.sparkline.Base', {
  38790. override: 'Ext.sparkline.Base',
  38791. statics: {
  38792. constructTip: function() {
  38793. // eslint-disable-next-line dot-notation
  38794. return new Ext.tip['ToolTip']({
  38795. id: 'sparklines-tooltip',
  38796. showDelay: 0,
  38797. dismissDelay: 0,
  38798. hideDelay: 400
  38799. });
  38800. }
  38801. },
  38802. onMouseMove: function(e) {
  38803. this.getSharedTooltip().triggerEvent = e;
  38804. this.callParent([
  38805. e
  38806. ]);
  38807. },
  38808. onMouseLeave: function(e) {
  38809. this.callParent([
  38810. e
  38811. ]);
  38812. this.getSharedTooltip().target = null;
  38813. },
  38814. privates: {
  38815. hideTip: function() {
  38816. var tip = this.getSharedTooltip();
  38817. tip.target = null;
  38818. tip.hide();
  38819. },
  38820. showTip: function() {
  38821. var tip = this.getSharedTooltip();
  38822. tip.target = this.el;
  38823. tip.onTargetOver(tip.triggerEvent);
  38824. }
  38825. }
  38826. }, function(Cls) {
  38827. // If we are on a VML platform (IE8 - TODO: remove this when that retires)...
  38828. if (!Ext.supports.Canvas) {
  38829. Cls.prototype.element = {
  38830. tag: 'span',
  38831. reference: 'element',
  38832. listeners: {
  38833. mouseenter: 'onMouseEnter',
  38834. mouseleave: 'onMouseLeave',
  38835. mousemove: 'onMouseMove'
  38836. },
  38837. style: {
  38838. display: 'inline-block',
  38839. position: 'relative',
  38840. overflow: 'hidden',
  38841. margin: '0px',
  38842. padding: '0px',
  38843. verticalAlign: 'top',
  38844. cursor: 'default'
  38845. },
  38846. children: [
  38847. {
  38848. tag: 'svml:group',
  38849. reference: 'groupEl',
  38850. coordorigin: '0 0',
  38851. coordsize: '0 0',
  38852. style: 'position:absolute;width:0;height:0;pointer-events:none'
  38853. }
  38854. ]
  38855. };
  38856. }
  38857. });
  38858. /**
  38859. * @class Ext.app.ViewController
  38860. */
  38861. /**
  38862. * @method beforeRender
  38863. * @template
  38864. * Template method called by the owning component's
  38865. * {@link Ext.Component#method-beforeRender beforeRender} method.
  38866. * @param {Ext.Component} component The owner component attached to the
  38867. * ViewController
  38868. */
  38869. /**
  38870. * @method afterRender
  38871. * @template
  38872. * Template method called by the owning component's
  38873. * {@link Ext.Component#method-afterRender afterRender} method.
  38874. * @param {Ext.Component} component The owner component attached to the
  38875. * ViewController
  38876. */
  38877. /**
  38878. * @method boxReady
  38879. * @template
  38880. * Template method called by the owning component's
  38881. * {@link Ext.Component#method-onBoxReady onBoxReady} method.
  38882. * @param {Ext.Component} component The owner component attached to the
  38883. * ViewController
  38884. */
  38885. /**
  38886. * @class Ext.form.field.Checkbox
  38887. */
  38888. Ext.define(null, {
  38889. override: 'Ext.form.field.Checkbox',
  38890. compatibility: Ext.isIE8,
  38891. // IE8 does not support change event but it has propertychange which is even better
  38892. changeEventName: 'propertychange',
  38893. onChangeEvent: function(e) {
  38894. // IE8 propertychange fires for *any* property change but we're only interested in checked
  38895. // We also don't want to react to propertychange fired as the result of assigning
  38896. // checked property in setRawValue().
  38897. if (this.duringSetRawValue || e.browserEvent.propertyName !== 'checked') {
  38898. return;
  38899. }
  38900. this.callParent([
  38901. e
  38902. ]);
  38903. },
  38904. updateCheckedCls: function(checked) {
  38905. var me = this,
  38906. displayEl = me.displayEl;
  38907. me.callParent([
  38908. checked
  38909. ]);
  38910. // IE8 has a bug with font icons and pseudo-elements
  38911. if (displayEl && checked !== me.lastValue) {
  38912. displayEl.repaint();
  38913. }
  38914. }
  38915. });
  38916. /**
  38917. * @class Ext.form.field.Radio
  38918. */
  38919. Ext.define(null, {
  38920. override: 'Ext.form.field.Radio',
  38921. compatibility: Ext.isIE8,
  38922. getSubTplData: function(fieldData) {
  38923. var data = this.callParent([
  38924. fieldData
  38925. ]);
  38926. // Rendering a radio button with checked attribute
  38927. // will have a curious side effect in IE8: the DOM
  38928. // node will have checked property set to `true` but
  38929. // radio group (radios with the same name attribute)
  38930. // will behave as if no radio is checked in the group;
  38931. // tabbing into the group will select first or last
  38932. // button instead of the checked one.
  38933. // So instead of rendering the attribute we will set
  38934. // checked value in the DOM after rendering. Apparently
  38935. // such a tiny nudge is enough for the browser to behave.
  38936. delete data.checked;
  38937. return data;
  38938. },
  38939. afterRender: function() {
  38940. this.callParent();
  38941. if (this.checked) {
  38942. this.inputEl.dom.checked = true;
  38943. }
  38944. },
  38945. onChange: function(newValue, oldValue) {
  38946. // We don't need to bother updating other radio buttons in IE8
  38947. // since it will fire propertychange event on any change, not only false -> true.
  38948. // This is unlike standard compliant browsers, see main class.
  38949. this.callSuper([
  38950. newValue,
  38951. oldValue
  38952. ]);
  38953. }
  38954. });
  38955. /**
  38956. * @class Ext.scroll.Scroller
  38957. */
  38958. Ext.define(null, {
  38959. override: 'Ext.scroll.Scroller',
  38960. compatibility: Ext.isIE8,
  38961. privates: {
  38962. // Important note: this code had to be copied as a whole
  38963. // because the scrollLeft assignment trickery only works
  38964. // reliably when it is done within the same function context.
  38965. doScrollTo: function(x, y, animate) {
  38966. var me = this,
  38967. element = me.getScrollElement(),
  38968. maxPosition, dom, to, xInf, yInf, ret, deferred, callback;
  38969. if (element && !element.destroyed) {
  38970. dom = element.dom;
  38971. xInf = (x === Infinity);
  38972. yInf = (y === Infinity);
  38973. if (xInf || yInf) {
  38974. maxPosition = me.getMaxPosition();
  38975. if (xInf) {
  38976. x = maxPosition.x;
  38977. }
  38978. if (yInf) {
  38979. y = maxPosition.y;
  38980. }
  38981. }
  38982. if (x !== null) {
  38983. x = me.convertX(x);
  38984. }
  38985. if (animate) {
  38986. to = {};
  38987. if (y != null) {
  38988. to.scrollTop = y;
  38989. }
  38990. if (x != null) {
  38991. to.scrollLeft = x;
  38992. }
  38993. animate = Ext.mergeIf({
  38994. to: {
  38995. scrollTop: y,
  38996. scrollLeft: x
  38997. }
  38998. }, animate);
  38999. deferred = new Ext.Deferred();
  39000. callback = animate.callback;
  39001. animate.callback = function() {
  39002. if (callback) {
  39003. callback.call(animate.scope || Ext.global, arguments);
  39004. }
  39005. // The callback will be called if the element is destroyed
  39006. if (me.destroyed) {
  39007. deferred.reject();
  39008. } else {
  39009. deferred.resolve();
  39010. }
  39011. };
  39012. element.animate(animate);
  39013. ret = deferred.promise;
  39014. } else {
  39015. // When we need to assign both scrollTop and scrollLeft,
  39016. // IE8 might fire scroll event on the first assignment
  39017. // but not on the second; that behavior is unlike the other
  39018. // browsers which will wait for the second assignment
  39019. // to happen before firing the event. This leads to our
  39020. // scrollstart event firing prematurely, when the scrolling
  39021. // has not actually finished yet.
  39022. // To work around that, we ignore the first event and then
  39023. // force another one by assigning scrollLeft the second time.
  39024. if ((x != null && x !== 0) && y != null) {
  39025. me.deferDomScroll = true;
  39026. }
  39027. if (y != null) {
  39028. dom.scrollTop = y;
  39029. }
  39030. if (x != null) {
  39031. dom.scrollLeft = x;
  39032. }
  39033. if (me.deferDomScroll) {
  39034. me.deferDomScroll = false;
  39035. // Reading the DOM makes sure the second assignment will fire the event.
  39036. // eslint-disable-next-line no-unused-expressions
  39037. +dom.scrollLeft;
  39038. dom.scrollLeft = x;
  39039. // eslint-disable-next-line no-unused-expressions
  39040. +dom.scrollTop;
  39041. dom.scrollTop = y;
  39042. }
  39043. ret = Ext.Deferred.getCachedResolved();
  39044. }
  39045. // Our position object will need refreshing before returning.
  39046. me.positionDirty = true;
  39047. } else {
  39048. ret = Ext.Deferred.getCachedRejected();
  39049. }
  39050. return ret;
  39051. },
  39052. onDomScroll: function() {
  39053. var me = this;
  39054. if (me.deferDomScroll) {
  39055. return;
  39056. }
  39057. me.callParent();
  39058. }
  39059. }
  39060. });