plugin.js 879 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950
  1. /*---------------------------------------------------------------------
  2. File Name: plugin.js
  3. ---------------------------------------------------------------------*/
  4. /* Avoid `console` errors in browsers that lack a console.
  5. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  6. (function() {
  7. var method;
  8. var noop = function () {};
  9. var methods = [
  10. 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
  11. 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
  12. 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
  13. 'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
  14. ];
  15. var length = methods.length;
  16. var console = (window.console = window.console || {});
  17. while (length--) {
  18. method = methods[length];
  19. // Only stub undefined methods.
  20. if (!console[method]) {
  21. console[method] = noop;
  22. }
  23. }
  24. }());
  25. /* JQuery meanMenu v2.0.8
  26. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  27. /*!
  28. * jQuery meanMenu v2.0.8
  29. * @Copyright (C) 2012-2014 Chris Wharton @ MeanThemes (https://github.com/meanthemes/meanMenu)
  30. *
  31. */
  32. /*
  33. * This program is free software: you can redistribute it and/or modify
  34. * it under the terms of the GNU General Public License as published by
  35. * the Free Software Foundation, either version 3 of the License, or
  36. * (at your option) any later version.
  37. *
  38. * THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
  39. * HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
  40. * INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR
  41. * FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE
  42. * OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS,
  43. * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.COPYRIGHT HOLDERS WILL NOT
  44. * BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL
  45. * DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
  46. *
  47. * You should have received a copy of the GNU General Public License
  48. * along with this program. If not, see <http://gnu.org/licenses/>.
  49. *
  50. * Find more information at http://www.meanthemes.com/plugins/meanmenu/
  51. *
  52. */
  53. (function ($) {
  54. "use strict";
  55. $.fn.meanmenu = function (options) {
  56. var defaults = {
  57. meanMenuTarget: jQuery(this), // Target the current HTML markup you wish to replace
  58. meanMenuContainer: '.menu-area', // Choose where meanmenu will be placed within the HTML
  59. meanMenuClose: "X", // single character you want to represent the close menu button
  60. meanMenuCloseSize: "25px", // set font size of close button
  61. meanMenuOpen: "<span /><span /><span />", // text/markup you want when menu is closed
  62. meanRevealPosition: "", // left right or center positions
  63. meanRevealPositionDistance: "0", // Tweak the position of the menu
  64. meanRevealColour: "", // override CSS colours for the reveal background
  65. meanScreenWidth: "767", // set the screen width you want meanmenu to kick in at
  66. meanNavPush: "", // set a height here in px, em or % if you want to budge your layout now the navigation is missing.
  67. meanShowChildren: true, // true to show children in the menu, false to hide them
  68. meanExpandableChildren: true, // true to allow expand/collapse children
  69. meanExpand: "+", // single character you want to represent the expand for ULs
  70. meanContract: "-", // single character you want to represent the contract for ULs
  71. meanRemoveAttrs: false, // true to remove classes and IDs, false to keep them
  72. onePage: false, // set to true for one page sites
  73. meanDisplay: "block", // override display method for table cell based layouts e.g. table-cell
  74. removeElements: "" // set to hide page elements
  75. };
  76. options = $.extend(defaults, options);
  77. // get browser width
  78. var currentWidth = window.innerWidth || document.documentElement.clientWidth;
  79. return this.each(function () {
  80. var meanMenu = options.meanMenuTarget;
  81. var meanContainer = options.meanMenuContainer;
  82. var meanMenuClose = options.meanMenuClose;
  83. var meanMenuCloseSize = options.meanMenuCloseSize;
  84. var meanMenuOpen = options.meanMenuOpen;
  85. var meanRevealPosition = options.meanRevealPosition;
  86. var meanRevealPositionDistance = options.meanRevealPositionDistance;
  87. var meanRevealColour = options.meanRevealColour;
  88. var meanScreenWidth = options.meanScreenWidth;
  89. var meanNavPush = options.meanNavPush;
  90. var meanRevealClass = ".meanmenu-reveal";
  91. var meanShowChildren = options.meanShowChildren;
  92. var meanExpandableChildren = options.meanExpandableChildren;
  93. var meanExpand = options.meanExpand;
  94. var meanContract = options.meanContract;
  95. var meanRemoveAttrs = options.meanRemoveAttrs;
  96. var onePage = options.onePage;
  97. var meanDisplay = options.meanDisplay;
  98. var removeElements = options.removeElements;
  99. //detect known mobile/tablet usage
  100. var isMobile = false;
  101. if ( (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)) || (navigator.userAgent.match(/Android/i)) || (navigator.userAgent.match(/Blackberry/i)) || (navigator.userAgent.match(/Windows Phone/i)) ) {
  102. isMobile = true;
  103. }
  104. if ( (navigator.userAgent.match(/MSIE 8/i)) || (navigator.userAgent.match(/MSIE 7/i)) ) {
  105. // add scrollbar for IE7 & 8 to stop breaking resize function on small content sites
  106. jQuery('html').css("overflow-y" , "scroll");
  107. }
  108. var meanRevealPos = "";
  109. var meanCentered = function() {
  110. if (meanRevealPosition === "center") {
  111. var newWidth = window.innerWidth || document.documentElement.clientWidth;
  112. var meanCenter = ( (newWidth/2)-22 )+"px";
  113. meanRevealPos = "left:" + meanCenter + ";right:auto;";
  114. if (!isMobile) {
  115. jQuery('.meanmenu-reveal').css("left",meanCenter);
  116. } else {
  117. jQuery('.meanmenu-reveal').animate({
  118. left: meanCenter
  119. });
  120. }
  121. }
  122. };
  123. var menuOn = false;
  124. var meanMenuExist = false;
  125. if (meanRevealPosition === "right") {
  126. meanRevealPos = "right:" + meanRevealPositionDistance + ";left:auto;";
  127. }
  128. if (meanRevealPosition === "left") {
  129. meanRevealPos = "left:" + meanRevealPositionDistance + ";right:auto;";
  130. }
  131. // run center function
  132. meanCentered();
  133. // set all styles for mean-reveal
  134. var $navreveal = "";
  135. var meanInner = function() {
  136. // get last class name
  137. if (jQuery($navreveal).is(".meanmenu-reveal.meanclose")) {
  138. $navreveal.html(meanMenuClose);
  139. } else {
  140. $navreveal.html(meanMenuOpen);
  141. }
  142. };
  143. // re-instate original nav (and call this on window.width functions)
  144. var meanOriginal = function() {
  145. jQuery('.mean-bar,.mean-push').remove();
  146. jQuery(meanContainer).removeClass("mean-container");
  147. jQuery(meanMenu).css('display', meanDisplay);
  148. menuOn = false;
  149. meanMenuExist = false;
  150. jQuery(removeElements).removeClass('mean-remove');
  151. };
  152. // navigation reveal
  153. var showMeanMenu = function() {
  154. var meanStyles = "background:"+meanRevealColour+";color:"+meanRevealColour+";"+meanRevealPos;
  155. if (currentWidth <= meanScreenWidth) {
  156. jQuery(removeElements).addClass('mean-remove');
  157. meanMenuExist = true;
  158. // add class to body so we don't need to worry about media queries here, all CSS is wrapped in '.mean-container'
  159. jQuery(meanContainer).addClass("mean-container");
  160. jQuery('.mean-container').prepend('<div class="mean-bar"><a href="#nav" class="meanmenu-reveal" style="'+meanStyles+'">Show Navigation</a><nav class="mean-nav"></nav></div>');
  161. //push meanMenu navigation into .mean-nav
  162. var meanMenuContents = jQuery(meanMenu).html();
  163. jQuery('.mean-nav').html(meanMenuContents);
  164. // remove all classes from EVERYTHING inside meanmenu nav
  165. if(meanRemoveAttrs) {
  166. jQuery('nav.mean-nav ul, nav.mean-nav ul *').each(function() {
  167. // First check if this has mean-remove class
  168. if (jQuery(this).is('.mean-remove')) {
  169. jQuery(this).attr('class', 'mean-remove');
  170. } else {
  171. jQuery(this).removeAttr("class");
  172. }
  173. jQuery(this).removeAttr("id");
  174. });
  175. }
  176. // push in a holder div (this can be used if removal of nav is causing layout issues)
  177. jQuery(meanMenu).before('<div class="mean-push" />');
  178. jQuery('.mean-push').css("margin-top",meanNavPush);
  179. // hide current navigation and reveal mean nav link
  180. jQuery(meanMenu).hide();
  181. jQuery(".meanmenu-reveal").show();
  182. // turn 'X' on or off
  183. jQuery(meanRevealClass).html(meanMenuOpen);
  184. $navreveal = jQuery(meanRevealClass);
  185. //hide mean-nav ul
  186. jQuery('.mean-nav ul').hide();
  187. // hide sub nav
  188. if(meanShowChildren) {
  189. // allow expandable sub nav(s)
  190. if(meanExpandableChildren){
  191. jQuery('.mean-nav ul ul').each(function() {
  192. if(jQuery(this).children().length){
  193. jQuery(this,'li:first').parent().append('<a class="mean-expand" href="#" style="font-size: '+ meanMenuCloseSize +'">'+ meanExpand +'</a>');
  194. }
  195. });
  196. jQuery('.mean-expand').on("click",function(e){
  197. e.preventDefault();
  198. if (jQuery(this).hasClass("mean-clicked")) {
  199. jQuery(this).text(meanExpand);
  200. jQuery(this).prev('ul').slideUp(300, function(){});
  201. } else {
  202. jQuery(this).text(meanContract);
  203. jQuery(this).prev('ul').slideDown(300, function(){});
  204. }
  205. jQuery(this).toggleClass("mean-clicked");
  206. });
  207. } else {
  208. jQuery('.mean-nav ul ul').show();
  209. }
  210. } else {
  211. jQuery('.mean-nav ul ul').hide();
  212. }
  213. // add last class to tidy up borders
  214. jQuery('.mean-nav ul li').last().addClass('mean-last');
  215. $navreveal.removeClass("meanclose");
  216. jQuery($navreveal).click(function(e){
  217. e.preventDefault();
  218. if( menuOn === false ) {
  219. $navreveal.css("text-align", "center");
  220. $navreveal.css("text-indent", "0");
  221. $navreveal.css("font-size", meanMenuCloseSize);
  222. jQuery('.mean-nav ul:first').slideDown();
  223. menuOn = true;
  224. } else {
  225. jQuery('.mean-nav ul:first').slideUp();
  226. menuOn = false;
  227. }
  228. $navreveal.toggleClass("meanclose");
  229. meanInner();
  230. jQuery(removeElements).addClass('mean-remove');
  231. });
  232. // for one page websites, reset all variables...
  233. if ( onePage ) {
  234. jQuery('.mean-nav ul > li > a:first-child').on( "click" , function () {
  235. jQuery('.mean-nav ul:first').slideUp();
  236. menuOn = false;
  237. jQuery($navreveal).toggleClass("meanclose").html(meanMenuOpen);
  238. });
  239. }
  240. } else {
  241. meanOriginal();
  242. }
  243. };
  244. if (!isMobile) {
  245. // reset menu on resize above meanScreenWidth
  246. jQuery(window).resize(function () {
  247. currentWidth = window.innerWidth || document.documentElement.clientWidth;
  248. if (currentWidth > meanScreenWidth) {
  249. meanOriginal();
  250. } else {
  251. meanOriginal();
  252. }
  253. if (currentWidth <= meanScreenWidth) {
  254. showMeanMenu();
  255. meanCentered();
  256. } else {
  257. meanOriginal();
  258. }
  259. });
  260. }
  261. jQuery(window).resize(function () {
  262. // get browser width
  263. currentWidth = window.innerWidth || document.documentElement.clientWidth;
  264. if (!isMobile) {
  265. meanOriginal();
  266. if (currentWidth <= meanScreenWidth) {
  267. showMeanMenu();
  268. meanCentered();
  269. }
  270. } else {
  271. meanCentered();
  272. if (currentWidth <= meanScreenWidth) {
  273. if (meanMenuExist === false) {
  274. showMeanMenu();
  275. }
  276. } else {
  277. meanOriginal();
  278. }
  279. }
  280. });
  281. // run main menuMenu function on load
  282. showMeanMenu();
  283. });
  284. };
  285. })(jQuery);
  286. /* MapIt
  287. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  288. /**
  289. * MapIt
  290. *
  291. * @copyright Copyright 2013, Dimitris Krestos
  292. * @license Apache License, Version 2.0 (http://www.opensource.org/licenses/apache2.0.php)
  293. * @link http://vdw.staytuned.gr
  294. * @version v0.3.0
  295. */
  296. !function($,window,undefined){"use strict";$.fn.mapit=function(options){var defaults={latitude:37.970996,longitude:23.730542,zoom:16,type:"ROADMAP",scrollwheel:!1,marker:{latitude:37.970996,longitude:23.730542,icon:"",title:"",open:!1,center:!0},address:"",styles:"GRAYSCALE",locations:[],origins:[]},options=$.extend(defaults,options);$(this).each(function(){var $this=$(this),directionsDisplay=new google.maps.DirectionsRenderer,mapOptions={scrollwheel:options.scrollwheel,scaleControl:!1,center:options.marker.center?new google.maps.LatLng(options.marker.latitude,options.marker.longitude):new google.maps.LatLng(options.latitude,options.longitude),zoom:options.zoom,mapTypeId:eval("google.maps.MapTypeId."+options.type)},map=new google.maps.Map(document.getElementById($this.attr("id")),mapOptions);if(directionsDisplay.setMap(map),options.styles){var GRAYSCALE_style=[{featureType:"all",elementType:"all",stylers:[{saturation:-100}]}],MIDNIGHT_style=[{featureType:"water",stylers:[{color:"#021019"}]},{featureType:"landscape",stylers:[{color:"#08304b"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#0c4152"},{lightness:5}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#000000"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#0b434f"},{lightness:25}]},{featureType:"road.arterial",elementType:"geometry.fill",stylers:[{color:"#000000"}]},{featureType:"road.arterial",elementType:"geometry.stroke",stylers:[{color:"#0b3d51"},{lightness:16}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#000000"}]},{elementType:"labels.text.fill",stylers:[{color:"#ffffff"}]},{elementType:"labels.text.stroke",stylers:[{color:"#000000"},{lightness:13}]},{featureType:"transit",stylers:[{color:"#146474"}]},{featureType:"administrative",elementType:"geometry.fill",stylers:[{color:"#000000"}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#144b53"},{lightness:14},{weight:1.4}]}],BLUE_style=[{featureType:"water",stylers:[{color:"#46bcec"},{visibility:"on"}]},{featureType:"landscape",stylers:[{color:"#f2f2f2"}]},{featureType:"road",stylers:[{saturation:-100},{lightness:45}]},{featureType:"road.highway",stylers:[{visibility:"simplified"}]},{featureType:"road.arterial",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"administrative",elementType:"labels.text.fill",stylers:[{color:"#444444"}]},{featureType:"transit",stylers:[{visibility:"off"}]},{featureType:"poi",stylers:[{visibility:"off"}]}],mapType=new google.maps.StyledMapType(eval(options.styles+"_style"),{name:options.styles});map.mapTypes.set(options.styles,mapType),map.setMapTypeId(options.styles)}var home=new google.maps.Marker({map:map,position:new google.maps.LatLng(options.marker.latitude,options.marker.longitude),icon:new google.maps.MarkerImage(options.marker.icon),title:options.marker.title}),info=new google.maps.InfoWindow({content:options.address});options.marker.open?info.open(map,home):google.maps.event.addListener(home,"click",function(){info.open(map,home)});var infowindow=new google.maps.InfoWindow,marker,i,markers=[];for(i=0;i<options.locations.length;i++)marker=new google.maps.Marker({position:new google.maps.LatLng(options.locations[i][0],options.locations[i][1]),map:map,icon:new google.maps.MarkerImage(options.locations[i][2]||options.marker.icon),title:options.locations[i][3]}),markers.push(marker),google.maps.event.addListener(marker,"click",function(e,o){return function(){infowindow.setContent(options.locations[o][4]),infowindow.open(map,e)}}(marker,i));var directionsService=new google.maps.DirectionsService;$this.on("route",function(e,o){var t={origin:new google.maps.LatLng(options.origins[o][0],options.origins[o][1]),destination:new google.maps.LatLng(options.marker.latitude,options.marker.longitude),travelMode:google.maps.TravelMode.DRIVING};directionsService.route(t,function(e,o){o==google.maps.DirectionsStatus.OK&&directionsDisplay.setDirections(e)})}),$this.on("hide_all",function(){for(var e=0;e<options.locations.length;e++)markers[e].setVisible(!1)}),$this.on("show",function(e,o){$this.trigger("hide_all"),$this.trigger("reset");for(var t=new google.maps.LatLngBounds,i=0;i<options.locations.length;i++)options.locations[i][6]==o&&markers[i].setVisible(!0),t.extend(markers[i].position);map.fitBounds(t)}),$this.on("hide",function(e,o){for(var t=0;t<options.locations.length;t++)options.locations[t][6]==o&&markers[t].setVisible(!1)}),$this.on("clear",function(){if(markers)for(var e=0;e<markers.length;e++)markers[e].setMap(null)}),$this.on("reset",function(){map.setCenter(new google.maps.LatLng(options.latitude,options.longitude),options.zoom)}),$this.trigger("hide_all")})},$(document).ready(function(){$('[data-toggle="mapit"]').mapit()})}(jQuery);
  297. /* Owl Carousel v2.3.3
  298. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  299. /**
  300. * Owl Carousel v2.3.3
  301. * Copyright 2013-2018 David Deutsch
  302. * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
  303. */
  304. !function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},a.each(["onResize","onThrottledResize"],a.proxy(function(b,c){this._handlers[c]=a.proxy(this[c],this)},this)),a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a.charAt(0).toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Workers,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}e.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,fallbackEasing:"swing",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Type={Event:"event",State:"state"},e.Plugins={},e.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(a){var b=this.settings.margin||"",c=!this.settings.autoWidth,d=this.settings.rtl,e={width:"auto","margin-left":d?b:"","margin-right":d?"":b};!c&&this.$stage.children().css(e),a.css=e}},{filter:["width","items","settings"],run:function(a){var b=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,c=null,d=this._items.length,e=!this.settings.autoWidth,f=[];for(a.items={merge:!1,width:b};d--;)c=this._mergers[d],c=this.settings.mergeFit&&Math.min(c,this.settings.items)||c,a.items.merge=c>1||a.items.merge,f[d]=e?b*c:this._items[d].width();this._widths=f}},{filter:["items","settings"],run:function(){var b=[],c=this._items,d=this.settings,e=Math.max(2*d.items,4),f=2*Math.ceil(c.length/2),g=d.loop&&c.length?d.rewind?e:Math.max(e,f):0,h="",i="";for(g/=2;g>0;)b.push(this.normalize(b.length/2,!0)),h+=c[b[b.length-1]][0].outerHTML,b.push(this.normalize(c.length-1-(b.length-1)/2,!0)),i=c[b[b.length-1]][0].outerHTML+i,g-=1;this._clones=b,a(h).addClass("cloned").appendTo(this.$stage),a(i).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var a=this.settings.rtl?1:-1,b=this._clones.length+this._items.length,c=-1,d=0,e=0,f=[];++c<b;)d=f[c-1]||0,e=this._widths[this.relative(c)]+this.settings.margin,f.push(d+e*a);this._coordinates=f}},{filter:["width","items","settings"],run:function(){var a=this.settings.stagePadding,b=this._coordinates,c={width:Math.ceil(Math.abs(b[b.length-1]))+2*a,"padding-left":a||"","padding-right":a||""};this.$stage.css(c)}},{filter:["width","items","settings"],run:function(a){var b=this._coordinates.length,c=!this.settings.autoWidth,d=this.$stage.children();if(c&&a.items.merge)for(;b--;)a.css.width=this._widths[this.relative(b)],d.eq(b).css(a.css);else c&&(a.css.width=a.items.width,d.css(a.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(a){a.current=a.current?this.$stage.children().index(a.current):0,a.current=Math.max(this.minimum(),Math.min(this.maximum(),a.current)),this.reset(a.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;c<d;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}}],e.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=a("<"+this.settings.stageElement+' class="'+this.settings.stageClass+'"/>').wrap('<div class="'+this.settings.stageOuterClass+'"/>'),this.$element.append(this.$stage.parent()))},e.prototype.initializeItems=function(){var b=this.$element.find(".owl-item");if(b.length)return this._items=b.get().map(function(b){return a(b)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},e.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")){var a,b,c;a=this.$element.find("img"),b=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,c=this.$element.children(b).width(),a.length&&c<=0&&this.preloadAutoWidthImages(a)}this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},e.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){a<=b&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),"function"==typeof e.stagePadding&&(e.stagePadding=e.stagePadding()),delete e.responsive,e.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+d))):e=a.extend({},this.options),this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},e.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.prepare=function(b){var c=this.trigger("prepare",{content:b});return c.data||(c.data=a("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};b<c;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={},!this.is("valid")&&this.enter("valid")},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.isVisible()&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},e.prototype.registerEventHandlers=function(){a.support.transition&&this.$stage.on(a.support.transition.end+".owl.core",a.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(b,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",a.proxy(this.onDragEnd,this)))},e.prototype.onDragStart=function(b){var d=null;3!==b.which&&(a.support.transform?(d=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","),d={x:d[16===d.length?12:4],y:d[16===d.length?13:5]}):(d=this.$stage.position(),d={x:this.settings.rtl?d.left+this.$stage.width()-this.width()+this.settings.margin:d.left,y:d.top}),this.is("animating")&&(a.support.transform?this.animate(d.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===b.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=a(b.target),this._drag.stage.start=d,this._drag.stage.current=d,this._drag.pointer=this.pointer(b),a(c).on("mouseup.owl.core touchend.owl.core",a.proxy(this.onDragEnd,this)),a(c).one("mousemove.owl.core touchmove.owl.core",a.proxy(function(b){var d=this.difference(this._drag.pointer,this.pointer(b));a(c).on("mousemove.owl.core touchmove.owl.core",a.proxy(this.onDragMove,this)),Math.abs(d.x)<Math.abs(d.y)&&this.is("valid")||(b.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},e.prototype.onDragMove=function(a){var b=null,c=null,d=null,e=this.difference(this._drag.pointer,this.pointer(a)),f=this.difference(this._drag.stage.start,e);this.is("dragging")&&(a.preventDefault(),this.settings.loop?(b=this.coordinates(this.minimum()),c=this.coordinates(this.maximum()+1)-b,f.x=((f.x-b)%c+c)%c+b):(b=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),c=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),d=this.settings.pullDrag?-1*e.x/5:0,f.x=Math.max(Math.min(f.x,b+d),c+d)),this._drag.stage.current=f,this.animate(f.x))},e.prototype.onDragEnd=function(b){var d=this.difference(this._drag.pointer,this.pointer(b)),e=this._drag.stage.current,f=d.x>0^this.settings.rtl?"left":"right";a(c).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==d.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(e.x,0!==d.x?f:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=f,(Math.abs(d.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},e.prototype.closest=function(b,c){var e=-1,f=30,g=this.width(),h=this.coordinates();return this.settings.freeDrag||a.each(h,a.proxy(function(a,i){return"left"===c&&b>i-f&&b<i+f?e=a:"right"===c&&b>i-g-f&&b<i-g+f?e=a+1:this.op(b,"<",i)&&this.op(b,">",h[a+1]!==d?h[a+1]:i-g)&&(e="left"===c?a+1:a),-1===e},this)),this.settings.loop||(this.op(b,">",h[this.minimum()])?e=b=this.minimum():this.op(b,"<",h[this.maximum()])&&(e=b=this.maximum())),e},e.prototype.animate=function(b){var c=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),c&&(this.enter("animating"),this.trigger("translate")),a.support.transform3d&&a.support.transition?this.$stage.css({transform:"translate3d("+b+"px,0px,0px)",transition:this.speed()/1e3+"s"}):c?this.$stage.animate({left:b+"px"},this.speed(),this.settings.fallbackEasing,a.proxy(this.onTransitionEnd,this)):this.$stage.css({left:b+"px"})},e.prototype.is=function(a){return this._states.current[a]&&this._states.current[a]>0},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(b){return"string"===a.type(b)&&(this._invalidated[b]=!0,this.is("valid")&&this.leave("valid")),a.map(this._invalidated,function(a,b){return b})},e.prototype.reset=function(a){(a=this.normalize(a))!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(a,b){var c=this._items.length,e=b?0:this._clones.length;return!this.isNumeric(a)||c<1?a=d:(a<0||a>=c+e)&&(a=((a-e/2)%c+c)%c+e/2),a},e.prototype.relative=function(a){return a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=this.settings,f=this._coordinates.length;if(e.loop)f=this._clones.length/2+this._items.length-1;else if(e.autoWidth||e.merge){if(b=this._items.length)for(c=this._items[--b].width(),d=this.$element.width();b--&&!((c+=this._items[b].width()+this.settings.margin)>d););f=b+1}else f=e.center?this._items.length-1:this._items.length-e.items;return a&&(f-=this._clones.length/2),Math.max(f,0)},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2==0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c,e=1,f=b-1;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(this.settings.rtl&&(e=-1,f=b+1),c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[f]||0))/2*e):c=this._coordinates[f]||0,c=Math.ceil(c))},e.prototype.duration=function(a,b,c){return 0===c?0:Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(a,b){var c=this.current(),d=null,e=a-this.relative(c),f=(e>0)-(e<0),g=this._items.length,h=this.minimum(),i=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(e)>g/2&&(e+=-1*f*g),a=c+e,(d=((a-h)%g+g)%g+h)!==a&&d-e<=i&&d-e>0&&(c=d-e,a=d,this.reset(c))):this.settings.rewind?(i+=1,a=(a%i+i)%i):a=Math.max(h,Math.min(i,a)),this.speed(this.duration(c,a,b)),this.current(a),this.isVisible()&&this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.onTransitionEnd=function(a){if(a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},e.prototype.viewport=function(){var d;return this.options.responsiveBaseElement!==b?d=a(this.options.responsiveBaseElement).width():b.innerWidth?d=b.innerWidth:c.documentElement&&c.documentElement.clientWidth?d=c.documentElement.clientWidth:console.warn("Can not detect viewport width."),d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(b,c){var e=this.relative(this._current);c=c===d?this._items.length:this.normalize(c,!0),b=b instanceof jQuery?b:a(b),this.trigger("add",{content:b,position:c}),b=this.prepare(b),0===this._items.length||c===this._items.length?(0===this._items.length&&this.$stage.append(b),0!==this._items.length&&this._items[c-1].after(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[c].before(b),this._items.splice(c,0,b),this._mergers.splice(c,0,1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[e]&&this.reset(this._items[e].index()),this.invalidate("items"),this.trigger("added",{content:b,position:c})},e.prototype.remove=function(a){(a=this.normalize(a,!0))!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.preloadAutoWidthImages=function(b){b.each(a.proxy(function(b,c){this.enter("pre-loading"),c=a(c),a(new Image).one("load",a.proxy(function(a){c.attr("src",a.target.src),c.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",c.attr("src")||c.attr("data-src")||c.attr("data-src-retina"))},this))},e.prototype.destroy=function(){this.$element.off(".owl.core"),this.$stage.off(".owl.core"),a(c).off(".owl.core"),!1!==this.settings.responsive&&(b.clearTimeout(this.resizeTimer),this.off(b,"resize",this._handlers.onThrottledResize));for(var d in this._plugins)this._plugins[d].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:a<c;case">":return d?a<c:a>c;case">=":return d?a<=c:a>=c;case"<=":return d?a>=c:a<=c}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d,f,g){var h={item:{count:this._items.length,index:this.current()}},i=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),j=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},h,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(j)}),this.register({type:e.Type.Event,name:b}),this.$element.trigger(j),this.settings&&"function"==typeof this.settings[i]&&this.settings[i].call(this,j)),j},e.prototype.enter=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]===d&&(this._states.current[b]=0),this._states.current[b]++},this))},e.prototype.leave=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]--},this))},e.prototype.register=function(b){if(b.type===e.Type.Event){if(a.event.special[b.name]||(a.event.special[b.name]={}),!a.event.special[b.name].owl){var c=a.event.special[b.name]._default;a.event.special[b.name]._default=function(a){return!c||!c.apply||a.namespace&&-1!==a.namespace.indexOf("owl")?a.namespace&&a.namespace.indexOf("owl")>-1:c.apply(this,arguments)},a.event.special[b.name].owl=!0}}else b.type===e.Type.State&&(this._states.tags[b.name]?this._states.tags[b.name]=this._states.tags[b.name].concat(b.tags):this._states.tags[b.name]=b.tags,this._states.tags[b.name]=a.grep(this._states.tags[b.name],a.proxy(function(c,d){return a.inArray(c,this._states.tags[b.name])===d},this)))},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.pointer=function(a){var c={x:null,y:null};return a=a.originalEvent||a||b.event,a=a.touches&&a.touches.length?a.touches[0]:a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,a.pageX?(c.x=a.pageX,c.y=a.pageY):(c.x=a.clientX,c.y=a.clientY),c},e.prototype.isNumeric=function(a){return!isNaN(parseFloat(a))},e.prototype.difference=function(a,b){return{x:a.x-b.x,y:a.y-b.y}},a.fn.owlCarousel=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),f=d.data("owl.carousel");f||(f=new e(this,"object"==typeof b&&b),d.data("owl.carousel",f),a.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(b,c){f.register({type:e.Type.Event,name:c}),f.$element.on(c+".owl.carousel.core",a.proxy(function(a){a.namespace&&a.relatedTarget!==this&&(this.suppress([c]),f[c].apply(this,[].slice.call(arguments,1)),this.release([c]))},f))})),"string"==typeof b&&"_"!==b.charAt(0)&&f[b].apply(f,c)})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoRefresh:!0,autoRefreshInterval:500},e.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=b.setInterval(a.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},e.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},e.prototype.destroy=function(){var a,c;b.clearInterval(this._interval);for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoRefresh=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type))for(var c=this._core.settings,e=c.center&&Math.ceil(c.items/2)||c.items,f=c.center&&-1*e||0,g=(b.property&&b.property.value!==d?b.property.value:this._core.current())+f,h=this._core.clones().length,i=a.proxy(function(a,b){this.load(b)},this);f++<e;)this.load(h/2+this._core.relative(g)),h&&a.each(this._core.clones(this._core.relative(g)),i),g++},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={lazyLoad:!1},e.prototype.load=function(c){var d=this._core.$stage.children().eq(c),e=d&&d.find(".owl-lazy");!e||a.inArray(d.get(0),this._loaded)>-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src")||f.attr("data-srcset");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):f.is("source")?f.one("load.owl.lazy",a.proxy(function(){this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("srcset",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":'url("'+g+'")',opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(c){this._core=c,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&"position"===a.property.name&&(console.log("update called"),this.update())},this),"loaded.owl.lazy":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var d=this;a(b).on("load",function(){d._core.settings.autoHeight&&d.update()}),a(b).resize(function(){d._core.settings.autoHeight&&(null!=d._intervalId&&clearTimeout(d._intervalId),d._intervalId=setTimeout(function(){d.update()},250))})};e.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},e.prototype.update=function(){var b=this._core._current,c=b+this._core.settings.items,d=this._core.$stage.children().toArray().slice(b,c),e=[],f=0;a.each(d,function(b,c){e.push(a(c).height())}),f=Math.max.apply(null,e),this._core.$stage.parent().height(f).addClass(this._core.settings.autoHeightClass)},e.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.video&&this.isInFullScreen()&&a.preventDefault()},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"===a.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};e.Defaults={video:!1,videoHeight:!1,videoWidth:!1},e.prototype.fetch=function(a,b){var c=function(){return a.attr("data-vimeo-id")?"vimeo":a.attr("data-vzaar-id")?"vzaar":"youtube"}(),d=a.attr("data-vimeo-id")||a.attr("data-youtube-id")||a.attr("data-vzaar-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else if(d[3].indexOf("vimeo")>-1)c="vimeo";else{if(!(d[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");c="vzaar"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},e.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?'style="width:'+c.width+"px;height:"+c.height+'px;"':"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(a){e='<div class="owl-video-play-icon"></div>',d=k.lazyLoad?'<div class="owl-video-tn '+j+'" '+i+'="'+a+'"></div>':'<div class="owl-video-tn" style="opacity:1;background-image:url('+a+')"></div>',b.after(d),b.after(e)};if(b.wrap('<div class="owl-video-wrapper"'+g+"></div>"),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length)return l(h.attr(i)),h.remove(),!1;"youtube"===c.type?(f="//img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type?a.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}):"vzaar"===c.type&&a.ajax({type:"GET",url:"//vzaar.com/api/videos/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a.framegrab_url,l(f)}})},e.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},e.prototype.play=function(b){var c,d=a(b.target),e=d.closest("."+this._core.settings.itemClass),f=this._videos[e.attr("data-video")],g=f.width||"100%",h=f.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),e=this._core.items(this._core.relative(e.index())),this._core.reset(e.index()),"youtube"===f.type?c='<iframe width="'+g+'" height="'+h+'" src="//www.youtube.com/embed/'+f.id+"?autoplay=1&rel=0&v="+f.id+'" frameborder="0" allowfullscreen></iframe>':"vimeo"===f.type?c='<iframe src="//player.vimeo.com/video/'+f.id+'?autoplay=1" width="'+g+'" height="'+h+'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>':"vzaar"===f.type&&(c='<iframe frameborder="0"height="'+h+'"width="'+g+'" allowfullscreen mozallowfullscreen webkitAllowFullScreen src="//view.vzaar.com/'+f.id+'/player?autoplay=true"></iframe>'),a('<div class="owl-video-frame">'+c+"</div>").insertAfter(e.find(".owl-video")),this._playing=e.addClass("owl-video-playing"))},e.prototype.isInFullScreen=function(){var b=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return b&&a(b).parent().hasClass("owl-video-frame")},e.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){a.namespace&&(this.swapping="translated"==a.type)},this),"translate.owl.carousel":a.proxy(function(a){a.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){
  305. this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g)),f&&e.one(a.support.animation.end,c).addClass("animated owl-animated-in").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":a.proxy(function(a){a.namespace&&"settings"===a.property.name?this._core.settings.autoplay?this.play():this.stop():a.namespace&&"position"===a.property.name&&this._paused&&(this._time=0)},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(a){a.namespace&&this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype._next=function(d){this._call=b.setTimeout(a.proxy(this._next,this,d),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||c.hidden||this._core.next(d||this._core.settings.autoplaySpeed)},e.prototype.read=function(){return(new Date).getTime()-this._time},e.prototype.play=function(c,d){var e;this._core.is("rotating")||this._core.enter("rotating"),c=c||this._core.settings.autoplayTimeout,e=Math.min(this._time%(this._timeout||c),c),this._paused?(this._time=this.read(),this._paused=!1):b.clearTimeout(this._call),this._time+=this.read()%c-e,this._timeout=c,this._call=b.setTimeout(a.proxy(this._next,this,d),c-e)},e.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,b.clearTimeout(this._call),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,b.clearTimeout(this._call))},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(b){this._core=b,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+a(b.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),"remove.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&this.draw()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:['<span aria-label="Previous">&#x2039;</span>','<span aria-label="Next">&#x203a;</span>'],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var b,c=this._core.settings;this._controls.$relative=(c.navContainer?a(c.navContainer):a("<div>").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=a("<"+c.navElement+">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click",a.proxy(function(a){this.prev(c.navSpeed)},this)),this._controls.$next=a("<"+c.navElement+">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click",a.proxy(function(a){this.next(c.navSpeed)},this)),c.dotsData||(this._templates=[a('<button role="button">').addClass(c.dotClass).append(a("<span>")).prop("outerHTML")]),this._controls.$absolute=(c.dotsContainer?a(c.dotsContainer):a("<div>").addClass(c.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","button",a.proxy(function(b){var d=a(b.target).parent().is(this._controls.$absolute)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(d,c.dotsSpeed)},this));for(b in this._overrides)this._core[b]=a.proxy(this[b],this)},e.prototype.destroy=function(){var a,b,c,d,e;e=this._core.settings;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)"$relative"===b&&e.navContainer?this._controls[b].html(""):this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},e.prototype.update=function(){var a,b,c,d=this._core.clones().length/2,e=d+this._core.items().length,f=this._core.maximum(!0),g=this._core.settings,h=g.center||g.autoWidth||g.dotsData?1:g.dotsEach||g.items;if("page"!==g.slideBy&&(g.slideBy=Math.min(g.slideBy,g.items)),g.dots||"page"==g.slideBy)for(this._pages=[],a=d,b=0,c=0;a<e;a++){if(b>=h||0===b){if(this._pages.push({start:Math.min(f,a-d),end:a-d+h-1}),Math.min(f,a-d)===f)break;b=0,++c}b+=this._core.mergers(this._core.relative(a))}},e.prototype.draw=function(){var b,c=this._core.settings,d=this._core.items().length<=c.items,e=this._core.relative(this._core.current()),f=c.loop||c.rewind;this._controls.$relative.toggleClass("disabled",!c.nav||d),c.nav&&(this._controls.$previous.toggleClass("disabled",!f&&e<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!f&&e>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!c.dots||d),c.dots&&(b=this._pages.length-this._controls.$absolute.children().length,c.dotsData&&0!==b?this._controls.$absolute.html(this._templates.join("")):b>0?this._controls.$absolute.append(new Array(b+1).join(this._templates[0])):b<0&&this._controls.$absolute.children().slice(b).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(a.inArray(this.current(),this._pages)).addClass("active"))},e.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotsData?1:c.dotsEach||c.items)}},e.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,a.proxy(function(a,c){return a.start<=b&&a.end>=b},this)).pop()},e.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},e.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},e.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},e.prototype.to=function(b,c,d){var e;!d&&this._pages.length?(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c)):a.proxy(this._overrides.to,this._core)(b,c)},a.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(c){this._core=c,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(c){c.namespace&&"URLHash"===this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!c)return;this._hashes[c]=b.content}},this),"changed.owl.carousel":a.proxy(function(c){if(c.namespace&&"position"===c.property.name){var d=this._core.items(this._core.relative(this._core.current())),e=a.map(this._hashes,function(a,b){return a===d?b:null}).join();if(!e||b.location.hash.slice(1)===e)return;b.location.hash=e}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(a){var c=b.location.hash.substring(1),e=this._core.$stage.children(),f=this._hashes[c]&&e.index(this._hashes[c]);f!==d&&f!==this._core.current()&&this._core.to(this._core.relative(f),!1,!0)},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){function e(b,c){var e=!1,f=b.charAt(0).toUpperCase()+b.slice(1);return a.each((b+" "+h.join(f+" ")+f).split(" "),function(a,b){if(g[b]!==d)return e=!c||b,!1}),e}function f(a){return e(a,!0)}var g=a("<support>").get(0).style,h="Webkit Moz O ms".split(" "),i={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},j={csstransforms:function(){return!!e("transform")},csstransforms3d:function(){return!!e("perspective")},csstransitions:function(){return!!e("transition")},cssanimations:function(){return!!e("animation")}};j.csstransitions()&&(a.support.transition=new String(f("transition")),a.support.transition.end=i.transition.end[a.support.transition]),j.cssanimations()&&(a.support.animation=new String(f("animation")),a.support.animation.end=i.animation.end[a.support.animation]),j.csstransforms()&&(a.support.transform=new String(f("transform")),a.support.transform3d=j.csstransforms3d())}(window.Zepto||window.jQuery,window,document);
  306. /* Swiper 4.2.2
  307. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  308. /**
  309. * Swiper 4.2.2
  310. * Most modern mobile touch slider and framework with hardware accelerated transitions
  311. * http://www.idangero.us/swiper/
  312. *
  313. * Copyright 2014-2018 Vladimir Kharlampidi
  314. *
  315. * Released under the MIT License
  316. *
  317. * Released on: April 1, 2018
  318. */
  319. !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Swiper=t()}(this,function(){"use strict";var e="undefined"==typeof document?{body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},location:{hash:""}}:document,t="undefined"==typeof window?{document:e,navigator:{userAgent:""},location:{},history:{},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){}}:window,i=function(e){for(var t=0;t<e.length;t+=1)this[t]=e[t];return this.length=e.length,this};function s(s,a){var r=[],n=0;if(s&&!a&&s instanceof i)return s;if(s)if("string"==typeof s){var o,l,d=s.trim();if(d.indexOf("<")>=0&&d.indexOf(">")>=0){var h="div";for(0===d.indexOf("<li")&&(h="ul"),0===d.indexOf("<tr")&&(h="tbody"),0!==d.indexOf("<td")&&0!==d.indexOf("<th")||(h="tr"),0===d.indexOf("<tbody")&&(h="table"),0===d.indexOf("<option")&&(h="select"),(l=e.createElement(h)).innerHTML=d,n=0;n<l.childNodes.length;n+=1)r.push(l.childNodes[n])}else for(o=a||"#"!==s[0]||s.match(/[ .<>:~]/)?(a||e).querySelectorAll(s.trim()):[e.getElementById(s.trim().split("#")[1])],n=0;n<o.length;n+=1)o[n]&&r.push(o[n])}else if(s.nodeType||s===t||s===e)r.push(s);else if(s.length>0&&s[0].nodeType)for(n=0;n<s.length;n+=1)r.push(s[n]);return new i(r)}function a(e){for(var t=[],i=0;i<e.length;i+=1)-1===t.indexOf(e[i])&&t.push(e[i]);return t}s.fn=i.prototype,s.Class=i,s.Dom7=i;var r={addClass:function(e){if(void 0===e)return this;for(var t=e.split(" "),i=0;i<t.length;i+=1)for(var s=0;s<this.length;s+=1)void 0!==this[s].classList&&this[s].classList.add(t[i]);return this},removeClass:function(e){for(var t=e.split(" "),i=0;i<t.length;i+=1)for(var s=0;s<this.length;s+=1)void 0!==this[s].classList&&this[s].classList.remove(t[i]);return this},hasClass:function(e){return!!this[0]&&this[0].classList.contains(e)},toggleClass:function(e){for(var t=e.split(" "),i=0;i<t.length;i+=1)for(var s=0;s<this.length;s+=1)void 0!==this[s].classList&&this[s].classList.toggle(t[i]);return this},attr:function(e,t){var i=arguments;if(1===arguments.length&&"string"==typeof e)return this[0]?this[0].getAttribute(e):void 0;for(var s=0;s<this.length;s+=1)if(2===i.length)this[s].setAttribute(e,t);else for(var a in e)this[s][a]=e[a],this[s].setAttribute(a,e[a]);return this},removeAttr:function(e){for(var t=0;t<this.length;t+=1)this[t].removeAttribute(e);return this},data:function(e,t){var i;if(void 0!==t){for(var s=0;s<this.length;s+=1)(i=this[s]).dom7ElementDataStorage||(i.dom7ElementDataStorage={}),i.dom7ElementDataStorage[e]=t;return this}if(i=this[0]){if(i.dom7ElementDataStorage&&e in i.dom7ElementDataStorage)return i.dom7ElementDataStorage[e];var a=i.getAttribute("data-"+e);return a||void 0}},transform:function(e){for(var t=0;t<this.length;t+=1){var i=this[t].style;i.webkitTransform=e,i.transform=e}return this},transition:function(e){"string"!=typeof e&&(e+="ms");for(var t=0;t<this.length;t+=1){var i=this[t].style;i.webkitTransitionDuration=e,i.transitionDuration=e}return this},on:function(){for(var e,t=[],i=arguments.length;i--;)t[i]=arguments[i];var a=t[0],r=t[1],n=t[2],o=t[3];function l(e){var t=e.target;if(t){var i=e.target.dom7EventData||[];if(i.unshift(e),s(t).is(r))n.apply(t,i);else for(var a=s(t).parents(),o=0;o<a.length;o+=1)s(a[o]).is(r)&&n.apply(a[o],i)}}function d(e){var t=e&&e.target?e.target.dom7EventData||[]:[];t.unshift(e),n.apply(this,t)}"function"==typeof t[1]&&(a=(e=t)[0],n=e[1],o=e[2],r=void 0),o||(o=!1);for(var h,p=a.split(" "),c=0;c<this.length;c+=1){var u=this[c];if(r)for(h=0;h<p.length;h+=1)u.dom7LiveListeners||(u.dom7LiveListeners=[]),u.dom7LiveListeners.push({type:a,listener:n,proxyListener:l}),u.addEventListener(p[h],l,o);else for(h=0;h<p.length;h+=1)u.dom7Listeners||(u.dom7Listeners=[]),u.dom7Listeners.push({type:a,listener:n,proxyListener:d}),u.addEventListener(p[h],d,o)}return this},off:function(){for(var e,t=[],i=arguments.length;i--;)t[i]=arguments[i];var s=t[0],a=t[1],r=t[2],n=t[3];"function"==typeof t[1]&&(s=(e=t)[0],r=e[1],n=e[2],a=void 0),n||(n=!1);for(var o=s.split(" "),l=0;l<o.length;l+=1)for(var d=0;d<this.length;d+=1){var h=this[d];if(a){if(h.dom7LiveListeners)for(var p=0;p<h.dom7LiveListeners.length;p+=1)r?h.dom7LiveListeners[p].listener===r&&h.removeEventListener(o[l],h.dom7LiveListeners[p].proxyListener,n):h.dom7LiveListeners[p].type===o[l]&&h.removeEventListener(o[l],h.dom7LiveListeners[p].proxyListener,n)}else if(h.dom7Listeners)for(var c=0;c<h.dom7Listeners.length;c+=1)r?h.dom7Listeners[c].listener===r&&h.removeEventListener(o[l],h.dom7Listeners[c].proxyListener,n):h.dom7Listeners[c].type===o[l]&&h.removeEventListener(o[l],h.dom7Listeners[c].proxyListener,n)}return this},trigger:function(){for(var i=[],s=arguments.length;s--;)i[s]=arguments[s];for(var a=i[0].split(" "),r=i[1],n=0;n<a.length;n+=1)for(var o=0;o<this.length;o+=1){var l=void 0;try{l=new t.CustomEvent(a[n],{detail:r,bubbles:!0,cancelable:!0})}catch(t){(l=e.createEvent("Event")).initEvent(a[n],!0,!0),l.detail=r}this[o].dom7EventData=i.filter(function(e,t){return t>0}),this[o].dispatchEvent(l),this[o].dom7EventData=[],delete this[o].dom7EventData}return this},transitionEnd:function(e){var t,i=["webkitTransitionEnd","transitionend"],s=this;function a(r){if(r.target===this)for(e.call(this,r),t=0;t<i.length;t+=1)s.off(i[t],a)}if(e)for(t=0;t<i.length;t+=1)s.on(i[t],a);return this},outerWidth:function(e){if(this.length>0){if(e){var t=this.styles();return this[0].offsetWidth+parseFloat(t.getPropertyValue("margin-right"))+parseFloat(t.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null},outerHeight:function(e){if(this.length>0){if(e){var t=this.styles();return this[0].offsetHeight+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null},offset:function(){if(this.length>0){var i=this[0],s=i.getBoundingClientRect(),a=e.body,r=i.clientTop||a.clientTop||0,n=i.clientLeft||a.clientLeft||0,o=i===t?t.scrollY:i.scrollTop,l=i===t?t.scrollX:i.scrollLeft;return{top:s.top+o-r,left:s.left+l-n}}return null},css:function(e,i){var s;if(1===arguments.length){if("string"!=typeof e){for(s=0;s<this.length;s+=1)for(var a in e)this[s].style[a]=e[a];return this}if(this[0])return t.getComputedStyle(this[0],null).getPropertyValue(e)}if(2===arguments.length&&"string"==typeof e){for(s=0;s<this.length;s+=1)this[s].style[e]=i;return this}return this},each:function(e){if(!e)return this;for(var t=0;t<this.length;t+=1)if(!1===e.call(this[t],t,this[t]))return this;return this},html:function(e){if(void 0===e)return this[0]?this[0].innerHTML:void 0;for(var t=0;t<this.length;t+=1)this[t].innerHTML=e;return this},text:function(e){if(void 0===e)return this[0]?this[0].textContent.trim():null;for(var t=0;t<this.length;t+=1)this[t].textContent=e;return this},is:function(a){var r,n,o=this[0];if(!o||void 0===a)return!1;if("string"==typeof a){if(o.matches)return o.matches(a);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(a);if(o.msMatchesSelector)return o.msMatchesSelector(a);for(r=s(a),n=0;n<r.length;n+=1)if(r[n]===o)return!0;return!1}if(a===e)return o===e;if(a===t)return o===t;if(a.nodeType||a instanceof i){for(r=a.nodeType?[a]:a,n=0;n<r.length;n+=1)if(r[n]===o)return!0;return!1}return!1},index:function(){var e,t=this[0];if(t){for(e=0;null!==(t=t.previousSibling);)1===t.nodeType&&(e+=1);return e}},eq:function(e){if(void 0===e)return this;var t,s=this.length;return new i(e>s-1?[]:e<0?(t=s+e)<0?[]:[this[t]]:[this[e]])},append:function(){for(var t,s=[],a=arguments.length;a--;)s[a]=arguments[a];for(var r=0;r<s.length;r+=1){t=s[r];for(var n=0;n<this.length;n+=1)if("string"==typeof t){var o=e.createElement("div");for(o.innerHTML=t;o.firstChild;)this[n].appendChild(o.firstChild)}else if(t instanceof i)for(var l=0;l<t.length;l+=1)this[n].appendChild(t[l]);else this[n].appendChild(t)}return this},prepend:function(t){var s,a;for(s=0;s<this.length;s+=1)if("string"==typeof t){var r=e.createElement("div");for(r.innerHTML=t,a=r.childNodes.length-1;a>=0;a-=1)this[s].insertBefore(r.childNodes[a],this[s].childNodes[0])}else if(t instanceof i)for(a=0;a<t.length;a+=1)this[s].insertBefore(t[a],this[s].childNodes[0]);else this[s].insertBefore(t,this[s].childNodes[0]);return this},next:function(e){return this.length>0?e?this[0].nextElementSibling&&s(this[0].nextElementSibling).is(e)?new i([this[0].nextElementSibling]):new i([]):this[0].nextElementSibling?new i([this[0].nextElementSibling]):new i([]):new i([])},nextAll:function(e){var t=[],a=this[0];if(!a)return new i([]);for(;a.nextElementSibling;){var r=a.nextElementSibling;e?s(r).is(e)&&t.push(r):t.push(r),a=r}return new i(t)},prev:function(e){if(this.length>0){var t=this[0];return e?t.previousElementSibling&&s(t.previousElementSibling).is(e)?new i([t.previousElementSibling]):new i([]):t.previousElementSibling?new i([t.previousElementSibling]):new i([])}return new i([])},prevAll:function(e){var t=[],a=this[0];if(!a)return new i([]);for(;a.previousElementSibling;){var r=a.previousElementSibling;e?s(r).is(e)&&t.push(r):t.push(r),a=r}return new i(t)},parent:function(e){for(var t=[],i=0;i<this.length;i+=1)null!==this[i].parentNode&&(e?s(this[i].parentNode).is(e)&&t.push(this[i].parentNode):t.push(this[i].parentNode));return s(a(t))},parents:function(e){for(var t=[],i=0;i<this.length;i+=1)for(var r=this[i].parentNode;r;)e?s(r).is(e)&&t.push(r):t.push(r),r=r.parentNode;return s(a(t))},closest:function(e){var t=this;return void 0===e?new i([]):(t.is(e)||(t=t.parents(e).eq(0)),t)},find:function(e){for(var t=[],s=0;s<this.length;s+=1)for(var a=this[s].querySelectorAll(e),r=0;r<a.length;r+=1)t.push(a[r]);return new i(t)},children:function(e){for(var t=[],r=0;r<this.length;r+=1)for(var n=this[r].childNodes,o=0;o<n.length;o+=1)e?1===n[o].nodeType&&s(n[o]).is(e)&&t.push(n[o]):1===n[o].nodeType&&t.push(n[o]);return new i(a(t))},remove:function(){for(var e=0;e<this.length;e+=1)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this},add:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i,a;for(i=0;i<e.length;i+=1){var r=s(e[i]);for(a=0;a<r.length;a+=1)this[this.length]=r[a],this.length+=1}return this},styles:function(){return this[0]?t.getComputedStyle(this[0],null):{}}};Object.keys(r).forEach(function(e){s.fn[e]=r[e]});var n,o,l,d={deleteProps:function(e){var t=e;Object.keys(t).forEach(function(e){try{t[e]=null}catch(e){}try{delete t[e]}catch(e){}})},nextTick:function(e,t){return void 0===t&&(t=0),setTimeout(e,t)},now:function(){return Date.now()},getTranslate:function(e,i){var s,a,r;void 0===i&&(i="x");var n=t.getComputedStyle(e,null);return t.WebKitCSSMatrix?((a=n.transform||n.webkitTransform).split(",").length>6&&(a=a.split(", ").map(function(e){return e.replace(",",".")}).join(", ")),r=new t.WebKitCSSMatrix("none"===a?"":a)):s=(r=n.MozTransform||n.OTransform||n.MsTransform||n.msTransform||n.transform||n.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,")).toString().split(","),"x"===i&&(a=t.WebKitCSSMatrix?r.m41:16===s.length?parseFloat(s[12]):parseFloat(s[4])),"y"===i&&(a=t.WebKitCSSMatrix?r.m42:16===s.length?parseFloat(s[13]):parseFloat(s[5])),a||0},parseUrlQuery:function(e){var i,s,a,r,n={},o=e||t.location.href;if("string"==typeof o&&o.length)for(r=(s=(o=o.indexOf("?")>-1?o.replace(/\S*\?/,""):"").split("&").filter(function(e){return""!==e})).length,i=0;i<r;i+=1)a=s[i].replace(/#\S+/g,"").split("="),n[decodeURIComponent(a[0])]=void 0===a[1]?void 0:decodeURIComponent(a[1])||"";return n},isObject:function(e){return"object"==typeof e&&null!==e&&e.constructor&&e.constructor===Object},extend:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=Object(e[0]),s=1;s<e.length;s+=1){var a=e[s];if(void 0!==a&&null!==a)for(var r=Object.keys(Object(a)),n=0,o=r.length;n<o;n+=1){var l=r[n],h=Object.getOwnPropertyDescriptor(a,l);void 0!==h&&h.enumerable&&(d.isObject(i[l])&&d.isObject(a[l])?d.extend(i[l],a[l]):!d.isObject(i[l])&&d.isObject(a[l])?(i[l]={},d.extend(i[l],a[l])):i[l]=a[l])}}return i}},h=(l=e.createElement("div"),{touch:t.Modernizr&&!0===t.Modernizr.touch||!!("ontouchstart"in t||t.DocumentTouch&&e instanceof t.DocumentTouch),pointerEvents:!(!t.navigator.pointerEnabled&&!t.PointerEvent),prefixedPointerEvents:!!t.navigator.msPointerEnabled,transition:(o=l.style,"transition"in o||"webkitTransition"in o||"MozTransition"in o),transforms3d:t.Modernizr&&!0===t.Modernizr.csstransforms3d||(n=l.style,"webkitPerspective"in n||"MozPerspective"in n||"OPerspective"in n||"MsPerspective"in n||"perspective"in n),flexbox:function(){for(var e=l.style,t="alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient".split(" "),i=0;i<t.length;i+=1)if(t[i]in e)return!0;return!1}(),observer:"MutationObserver"in t||"WebkitMutationObserver"in t,passiveListener:function(){var e=!1;try{var i=Object.defineProperty({},"passive",{get:function(){e=!0}});t.addEventListener("testPassiveListener",null,i)}catch(e){}return e}(),gestures:"ongesturestart"in t}),p=function(e){void 0===e&&(e={});var t=this;t.params=e,t.eventsListeners={},t.params&&t.params.on&&Object.keys(t.params.on).forEach(function(e){t.on(e,t.params.on[e])})},c={components:{configurable:!0}};p.prototype.on=function(e,t,i){var s=this;if("function"!=typeof t)return s;var a=i?"unshift":"push";return e.split(" ").forEach(function(e){s.eventsListeners[e]||(s.eventsListeners[e]=[]),s.eventsListeners[e][a](t)}),s},p.prototype.once=function(e,t,i){var s=this;if("function"!=typeof t)return s;return s.on(e,function i(){for(var a=[],r=arguments.length;r--;)a[r]=arguments[r];t.apply(s,a),s.off(e,i)},i)},p.prototype.off=function(e,t){var i=this;return i.eventsListeners?(e.split(" ").forEach(function(e){void 0===t?i.eventsListeners[e]=[]:i.eventsListeners[e].forEach(function(s,a){s===t&&i.eventsListeners[e].splice(a,1)})}),i):i},p.prototype.emit=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i,s,a,r=this;return r.eventsListeners?("string"==typeof e[0]||Array.isArray(e[0])?(i=e[0],s=e.slice(1,e.length),a=r):(i=e[0].events,s=e[0].data,a=e[0].context||r),(Array.isArray(i)?i:i.split(" ")).forEach(function(e){if(r.eventsListeners&&r.eventsListeners[e]){var t=[];r.eventsListeners[e].forEach(function(e){t.push(e)}),t.forEach(function(e){e.apply(a,s)})}}),r):r},p.prototype.useModulesParams=function(e){var t=this;t.modules&&Object.keys(t.modules).forEach(function(i){var s=t.modules[i];s.params&&d.extend(e,s.params)})},p.prototype.useModules=function(e){void 0===e&&(e={});var t=this;t.modules&&Object.keys(t.modules).forEach(function(i){var s=t.modules[i],a=e[i]||{};s.instance&&Object.keys(s.instance).forEach(function(e){var i=s.instance[e];t[e]="function"==typeof i?i.bind(t):i}),s.on&&t.on&&Object.keys(s.on).forEach(function(e){t.on(e,s.on[e])}),s.create&&s.create.bind(t)(a)})},c.components.set=function(e){this.use&&this.use(e)},p.installModule=function(e){for(var t=[],i=arguments.length-1;i-- >0;)t[i]=arguments[i+1];var s=this;s.prototype.modules||(s.prototype.modules={});var a=e.name||Object.keys(s.prototype.modules).length+"_"+d.now();return s.prototype.modules[a]=e,e.proto&&Object.keys(e.proto).forEach(function(t){s.prototype[t]=e.proto[t]}),e.static&&Object.keys(e.static).forEach(function(t){s[t]=e.static[t]}),e.install&&e.install.apply(s,t),s},p.use=function(e){for(var t=[],i=arguments.length-1;i-- >0;)t[i]=arguments[i+1];var s=this;return Array.isArray(e)?(e.forEach(function(e){return s.installModule(e)}),s):s.installModule.apply(s,[e].concat(t))},Object.defineProperties(p,c);var u={updateSize:function(){var e,t,i=this.$el;e=void 0!==this.params.width?this.params.width:i[0].clientWidth,t=void 0!==this.params.height?this.params.height:i[0].clientHeight,0===e&&this.isHorizontal()||0===t&&this.isVertical()||(e=e-parseInt(i.css("padding-left"),10)-parseInt(i.css("padding-right"),10),t=t-parseInt(i.css("padding-top"),10)-parseInt(i.css("padding-bottom"),10),d.extend(this,{width:e,height:t,size:this.isHorizontal()?e:t}))},updateSlides:function(){var e=this.params,i=this.$wrapperEl,s=this.size,a=this.rtlTranslate,r=this.wrongRTL,n=i.children("."+this.params.slideClass),o=this.virtual&&e.virtual.enabled?this.virtual.slides.length:n.length,l=[],p=[],c=[],u=e.slidesOffsetBefore;"function"==typeof u&&(u=e.slidesOffsetBefore.call(this));var v=e.slidesOffsetAfter;"function"==typeof v&&(v=e.slidesOffsetAfter.call(this));var f=o,m=this.snapGrid.length,g=this.snapGrid.length,b=e.spaceBetween,w=-u,y=0,x=0;if(void 0!==s){var E,T;"string"==typeof b&&b.indexOf("%")>=0&&(b=parseFloat(b.replace("%",""))/100*s),this.virtualSize=-b,a?n.css({marginLeft:"",marginTop:""}):n.css({marginRight:"",marginBottom:""}),e.slidesPerColumn>1&&(E=Math.floor(o/e.slidesPerColumn)===o/this.params.slidesPerColumn?o:Math.ceil(o/e.slidesPerColumn)*e.slidesPerColumn,"auto"!==e.slidesPerView&&"row"===e.slidesPerColumnFill&&(E=Math.max(E,e.slidesPerView*e.slidesPerColumn)));for(var S,C=e.slidesPerColumn,M=E/C,z=M-(e.slidesPerColumn*M-o),k=0;k<o;k+=1){T=0;var P=n.eq(k);if(e.slidesPerColumn>1){var $=void 0,L=void 0,I=void 0;"column"===e.slidesPerColumnFill?(I=k-(L=Math.floor(k/C))*C,(L>z||L===z&&I===C-1)&&(I+=1)>=C&&(I=0,L+=1),$=L+I*E/C,P.css({"-webkit-box-ordinal-group":$,"-moz-box-ordinal-group":$,"-ms-flex-order":$,"-webkit-order":$,order:$})):L=k-(I=Math.floor(k/M))*M,P.css("margin-"+(this.isHorizontal()?"top":"left"),0!==I&&e.spaceBetween&&e.spaceBetween+"px").attr("data-swiper-column",L).attr("data-swiper-row",I)}if("none"!==P.css("display")){if("auto"===e.slidesPerView){var D=t.getComputedStyle(P[0],null);T=this.isHorizontal()?P[0].getBoundingClientRect().width+parseFloat(D.getPropertyValue("margin-left"))+parseFloat(D.getPropertyValue("margin-right")):P[0].getBoundingClientRect().height+parseFloat(D.getPropertyValue("margin-top"))+parseFloat(D.getPropertyValue("margin-bottom")),e.roundLengths&&(T=Math.floor(T))}else T=(s-(e.slidesPerView-1)*b)/e.slidesPerView,e.roundLengths&&(T=Math.floor(T)),n[k]&&(this.isHorizontal()?n[k].style.width=T+"px":n[k].style.height=T+"px");n[k]&&(n[k].swiperSlideSize=T),c.push(T),e.centeredSlides?(w=w+T/2+y/2+b,0===y&&0!==k&&(w=w-s/2-b),0===k&&(w=w-s/2-b),Math.abs(w)<.001&&(w=0),x%e.slidesPerGroup==0&&l.push(w),p.push(w)):(x%e.slidesPerGroup==0&&l.push(w),p.push(w),w=w+T+b),this.virtualSize+=T+b,y=T,x+=1}}if(this.virtualSize=Math.max(this.virtualSize,s)+v,a&&r&&("slide"===e.effect||"coverflow"===e.effect)&&i.css({width:this.virtualSize+e.spaceBetween+"px"}),h.flexbox&&!e.setWrapperSize||(this.isHorizontal()?i.css({width:this.virtualSize+e.spaceBetween+"px"}):i.css({height:this.virtualSize+e.spaceBetween+"px"})),e.slidesPerColumn>1&&(this.virtualSize=(T+e.spaceBetween)*E,this.virtualSize=Math.ceil(this.virtualSize/e.slidesPerColumn)-e.spaceBetween,this.isHorizontal()?i.css({width:this.virtualSize+e.spaceBetween+"px"}):i.css({height:this.virtualSize+e.spaceBetween+"px"}),e.centeredSlides)){S=[];for(var O=0;O<l.length;O+=1)l[O]<this.virtualSize+l[0]&&S.push(l[O]);l=S}if(!e.centeredSlides){S=[];for(var A=0;A<l.length;A+=1)l[A]<=this.virtualSize-s&&S.push(l[A]);l=S,Math.floor(this.virtualSize-s)-Math.floor(l[l.length-1])>1&&l.push(this.virtualSize-s)}0===l.length&&(l=[0]),0!==e.spaceBetween&&(this.isHorizontal()?a?n.css({marginLeft:b+"px"}):n.css({marginRight:b+"px"}):n.css({marginBottom:b+"px"})),d.extend(this,{slides:n,snapGrid:l,slidesGrid:p,slidesSizesGrid:c}),o!==f&&this.emit("slidesLengthChange"),l.length!==m&&(this.params.watchOverflow&&this.checkOverflow(),this.emit("snapGridLengthChange")),p.length!==g&&this.emit("slidesGridLengthChange"),(e.watchSlidesProgress||e.watchSlidesVisibility)&&this.updateSlidesOffset()}},updateAutoHeight:function(e){var t,i=[],s=0;if("number"==typeof e?this.setTransition(e):!0===e&&this.setTransition(this.params.speed),"auto"!==this.params.slidesPerView&&this.params.slidesPerView>1)for(t=0;t<Math.ceil(this.params.slidesPerView);t+=1){var a=this.activeIndex+t;if(a>this.slides.length)break;i.push(this.slides.eq(a)[0])}else i.push(this.slides.eq(this.activeIndex)[0]);for(t=0;t<i.length;t+=1)if(void 0!==i[t]){var r=i[t].offsetHeight;s=r>s?r:s}s&&this.$wrapperEl.css("height",s+"px")},updateSlidesOffset:function(){for(var e=this.slides,t=0;t<e.length;t+=1)e[t].swiperSlideOffset=this.isHorizontal()?e[t].offsetLeft:e[t].offsetTop},updateSlidesProgress:function(e){void 0===e&&(e=this.translate||0);var t=this.params,i=this.slides,s=this.rtlTranslate;if(0!==i.length){void 0===i[0].swiperSlideOffset&&this.updateSlidesOffset();var a=-e;s&&(a=e),i.removeClass(t.slideVisibleClass);for(var r=0;r<i.length;r+=1){var n=i[r],o=(a+(t.centeredSlides?this.minTranslate():0)-n.swiperSlideOffset)/(n.swiperSlideSize+t.spaceBetween);if(t.watchSlidesVisibility){var l=-(a-n.swiperSlideOffset),d=l+this.slidesSizesGrid[r];(l>=0&&l<this.size||d>0&&d<=this.size||l<=0&&d>=this.size)&&i.eq(r).addClass(t.slideVisibleClass)}n.progress=s?-o:o}}},updateProgress:function(e){void 0===e&&(e=this.translate||0);var t=this.params,i=this.maxTranslate()-this.minTranslate(),s=this.progress,a=this.isBeginning,r=this.isEnd,n=a,o=r;0===i?(s=0,a=!0,r=!0):(a=(s=(e-this.minTranslate())/i)<=0,r=s>=1),d.extend(this,{progress:s,isBeginning:a,isEnd:r}),(t.watchSlidesProgress||t.watchSlidesVisibility)&&this.updateSlidesProgress(e),a&&!n&&this.emit("reachBeginning toEdge"),r&&!o&&this.emit("reachEnd toEdge"),(n&&!a||o&&!r)&&this.emit("fromEdge"),this.emit("progress",s)},updateSlidesClasses:function(){var e,t=this.slides,i=this.params,s=this.$wrapperEl,a=this.activeIndex,r=this.realIndex,n=this.virtual&&i.virtual.enabled;t.removeClass(i.slideActiveClass+" "+i.slideNextClass+" "+i.slidePrevClass+" "+i.slideDuplicateActiveClass+" "+i.slideDuplicateNextClass+" "+i.slideDuplicatePrevClass),(e=n?this.$wrapperEl.find("."+i.slideClass+'[data-swiper-slide-index="'+a+'"]'):t.eq(a)).addClass(i.slideActiveClass),i.loop&&(e.hasClass(i.slideDuplicateClass)?s.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+r+'"]').addClass(i.slideDuplicateActiveClass):s.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+r+'"]').addClass(i.slideDuplicateActiveClass));var o=e.nextAll("."+i.slideClass).eq(0).addClass(i.slideNextClass);i.loop&&0===o.length&&(o=t.eq(0)).addClass(i.slideNextClass);var l=e.prevAll("."+i.slideClass).eq(0).addClass(i.slidePrevClass);i.loop&&0===l.length&&(l=t.eq(-1)).addClass(i.slidePrevClass),i.loop&&(o.hasClass(i.slideDuplicateClass)?s.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+o.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass):s.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+o.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass),l.hasClass(i.slideDuplicateClass)?s.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass):s.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass))},updateActiveIndex:function(e){var t,i=this.rtlTranslate?this.translate:-this.translate,s=this.slidesGrid,a=this.snapGrid,r=this.params,n=this.activeIndex,o=this.realIndex,l=this.snapIndex,h=e;if(void 0===h){for(var p=0;p<s.length;p+=1)void 0!==s[p+1]?i>=s[p]&&i<s[p+1]-(s[p+1]-s[p])/2?h=p:i>=s[p]&&i<s[p+1]&&(h=p+1):i>=s[p]&&(h=p);r.normalizeSlideIndex&&(h<0||void 0===h)&&(h=0)}if((t=a.indexOf(i)>=0?a.indexOf(i):Math.floor(h/r.slidesPerGroup))>=a.length&&(t=a.length-1),h!==n){var c=parseInt(this.slides.eq(h).attr("data-swiper-slide-index")||h,10);d.extend(this,{snapIndex:t,realIndex:c,previousIndex:n,activeIndex:h}),this.emit("activeIndexChange"),this.emit("snapIndexChange"),o!==c&&this.emit("realIndexChange"),this.emit("slideChange")}else t!==l&&(this.snapIndex=t,this.emit("snapIndexChange"))},updateClickedSlide:function(e){var t=this.params,i=s(e.target).closest("."+t.slideClass)[0],a=!1;if(i)for(var r=0;r<this.slides.length;r+=1)this.slides[r]===i&&(a=!0);if(!i||!a)return this.clickedSlide=void 0,void(this.clickedIndex=void 0);this.clickedSlide=i,this.virtual&&this.params.virtual.enabled?this.clickedIndex=parseInt(s(i).attr("data-swiper-slide-index"),10):this.clickedIndex=s(i).index(),t.slideToClickedSlide&&void 0!==this.clickedIndex&&this.clickedIndex!==this.activeIndex&&this.slideToClickedSlide()}};var v={getTranslate:function(e){void 0===e&&(e=this.isHorizontal()?"x":"y");var t=this.params,i=this.rtlTranslate,s=this.translate,a=this.$wrapperEl;if(t.virtualTranslate)return i?-s:s;var r=d.getTranslate(a[0],e);return i&&(r=-r),r||0},setTranslate:function(e,t){var i=this.rtlTranslate,s=this.params,a=this.$wrapperEl,r=this.progress,n=0,o=0;this.isHorizontal()?n=i?-e:e:o=e,s.roundLengths&&(n=Math.floor(n),o=Math.floor(o)),s.virtualTranslate||(h.transforms3d?a.transform("translate3d("+n+"px, "+o+"px, 0px)"):a.transform("translate("+n+"px, "+o+"px)")),this.translate=this.isHorizontal()?n:o;var l=this.maxTranslate()-this.minTranslate();(0===l?0:(e-this.minTranslate())/l)!==r&&this.updateProgress(e),this.emit("setTranslate",this.translate,t)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]}};var f={setTransition:function(e,t){this.$wrapperEl.transition(e),this.emit("setTransition",e,t)},transitionStart:function(e,t){void 0===e&&(e=!0);var i=this.activeIndex,s=this.params,a=this.previousIndex;s.autoHeight&&this.updateAutoHeight();var r=t;if(r||(r=i>a?"next":i<a?"prev":"reset"),this.emit("transitionStart"),e&&i!==a){if("reset"===r)return void this.emit("slideResetTransitionStart");this.emit("slideChangeTransitionStart"),"next"===r?this.emit("slideNextTransitionStart"):this.emit("slidePrevTransitionStart")}},transitionEnd:function(e,t){void 0===e&&(e=!0);var i=this.activeIndex,s=this.previousIndex;this.animating=!1,this.setTransition(0);var a=t;if(a||(a=i>s?"next":i<s?"prev":"reset"),this.emit("transitionEnd"),e&&i!==s){if("reset"===a)return void this.emit("slideResetTransitionEnd");this.emit("slideChangeTransitionEnd"),"next"===a?this.emit("slideNextTransitionEnd"):this.emit("slidePrevTransitionEnd")}}};var m={slideTo:function(e,t,i,s){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===i&&(i=!0);var a=this,r=e;r<0&&(r=0);var n=a.params,o=a.snapGrid,l=a.slidesGrid,d=a.previousIndex,p=a.activeIndex,c=a.rtlTranslate,u=a.$wrapperEl;if(a.animating&&n.preventIntercationOnTransition)return!1;var v=Math.floor(r/n.slidesPerGroup);v>=o.length&&(v=o.length-1),(p||n.initialSlide||0)===(d||0)&&i&&a.emit("beforeSlideChangeStart");var f,m=-o[v];if(a.updateProgress(m),n.normalizeSlideIndex)for(var g=0;g<l.length;g+=1)-Math.floor(100*m)>=Math.floor(100*l[g])&&(r=g);if(a.initialized&&r!==p){if(!a.allowSlideNext&&m<a.translate&&m<a.minTranslate())return!1;if(!a.allowSlidePrev&&m>a.translate&&m>a.maxTranslate()&&(p||0)!==r)return!1}return f=r>p?"next":r<p?"prev":"reset",c&&-m===a.translate||!c&&m===a.translate?(a.updateActiveIndex(r),n.autoHeight&&a.updateAutoHeight(),a.updateSlidesClasses(),"slide"!==n.effect&&a.setTranslate(m),"reset"!==f&&(a.transitionStart(i,f),a.transitionEnd(i,f)),!1):(0!==t&&h.transition?(a.setTransition(t),a.setTranslate(m),a.updateActiveIndex(r),a.updateSlidesClasses(),a.emit("beforeTransitionStart",t,s),a.transitionStart(i,f),a.animating||(a.animating=!0,u.transitionEnd(function(){a&&!a.destroyed&&a.transitionEnd(i,f)}))):(a.setTransition(0),a.setTranslate(m),a.updateActiveIndex(r),a.updateSlidesClasses(),a.emit("beforeTransitionStart",t,s),a.transitionStart(i,f),a.transitionEnd(i,f)),!0)},slideToLoop:function(e,t,i,s){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===i&&(i=!0);var a=e;return this.params.loop&&(a+=this.loopedSlides),this.slideTo(a,t,i,s)},slideNext:function(e,t,i){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);var s=this.params,a=this.animating;return s.loop?!a&&(this.loopFix(),this._clientLeft=this.$wrapperEl[0].clientLeft,this.slideTo(this.activeIndex+s.slidesPerGroup,e,t,i)):this.slideTo(this.activeIndex+s.slidesPerGroup,e,t,i)},slidePrev:function(e,t,i){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);var s=this.params,a=this.animating,r=this.snapGrid,n=this.slidesGrid,o=this.rtlTranslate;if(s.loop){if(a)return!1;this.loopFix(),this._clientLeft=this.$wrapperEl[0].clientLeft}var l,d=o?this.translate:-this.translate,h=(r[r.indexOf(d)],r[r.indexOf(d)-1]);return h&&(l=n.indexOf(h))<0&&(l=this.activeIndex-1),this.slideTo(l,e,t,i)},slideReset:function(e,t,i){return void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),this.slideTo(this.activeIndex,e,t,i)},slideToClosest:function(e,t,i){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);var s=this.activeIndex,a=Math.floor(s/this.params.slidesPerGroup);if(a<this.snapGrid.length-1){var r=this.rtlTranslate?this.translate:-this.translate,n=this.snapGrid[a];r-n>(this.snapGrid[a+1]-n)/2&&(s=this.params.slidesPerGroup)}return this.slideTo(s,e,t,i)},slideToClickedSlide:function(){var e,t=this,i=t.params,a=t.$wrapperEl,r="auto"===i.slidesPerView?t.slidesPerViewDynamic():i.slidesPerView,n=t.clickedIndex;if(i.loop){if(t.animating)return;e=parseInt(s(t.clickedSlide).attr("data-swiper-slide-index"),10),i.centeredSlides?n<t.loopedSlides-r/2||n>t.slides.length-t.loopedSlides+r/2?(t.loopFix(),n=a.children("."+i.slideClass+'[data-swiper-slide-index="'+e+'"]:not(.'+i.slideDuplicateClass+")").eq(0).index(),d.nextTick(function(){t.slideTo(n)})):t.slideTo(n):n>t.slides.length-r?(t.loopFix(),n=a.children("."+i.slideClass+'[data-swiper-slide-index="'+e+'"]:not(.'+i.slideDuplicateClass+")").eq(0).index(),d.nextTick(function(){t.slideTo(n)})):t.slideTo(n)}else t.slideTo(n)}};var g={loopCreate:function(){var t=this,i=t.params,a=t.$wrapperEl;a.children("."+i.slideClass+"."+i.slideDuplicateClass).remove();var r=a.children("."+i.slideClass);if(i.loopFillGroupWithBlank){var n=i.slidesPerGroup-r.length%i.slidesPerGroup;if(n!==i.slidesPerGroup){for(var o=0;o<n;o+=1){var l=s(e.createElement("div")).addClass(i.slideClass+" "+i.slideBlankClass);a.append(l)}r=a.children("."+i.slideClass)}}"auto"!==i.slidesPerView||i.loopedSlides||(i.loopedSlides=r.length),t.loopedSlides=parseInt(i.loopedSlides||i.slidesPerView,10),t.loopedSlides+=i.loopAdditionalSlides,t.loopedSlides>r.length&&(t.loopedSlides=r.length);var d=[],h=[];r.each(function(e,i){var a=s(i);e<t.loopedSlides&&h.push(i),e<r.length&&e>=r.length-t.loopedSlides&&d.push(i),a.attr("data-swiper-slide-index",e)});for(var p=0;p<h.length;p+=1)a.append(s(h[p].cloneNode(!0)).addClass(i.slideDuplicateClass));for(var c=d.length-1;c>=0;c-=1)a.prepend(s(d[c].cloneNode(!0)).addClass(i.slideDuplicateClass))},loopFix:function(){var e,t=this.params,i=this.activeIndex,s=this.slides,a=this.loopedSlides,r=this.allowSlidePrev,n=this.allowSlideNext,o=this.snapGrid,l=this.rtlTranslate;this.allowSlidePrev=!0,this.allowSlideNext=!0;var d=-o[i]-this.getTranslate();i<a?(e=s.length-3*a+i,e+=a,this.slideTo(e,0,!1,!0)&&0!==d&&this.setTranslate((l?-this.translate:this.translate)-d)):("auto"===t.slidesPerView&&i>=2*a||i>s.length-2*t.slidesPerView)&&(e=-s.length+i+a,e+=a,this.slideTo(e,0,!1,!0)&&0!==d&&this.setTranslate((l?-this.translate:this.translate)-d));this.allowSlidePrev=r,this.allowSlideNext=n},loopDestroy:function(){var e=this.$wrapperEl,t=this.params,i=this.slides;e.children("."+t.slideClass+"."+t.slideDuplicateClass).remove(),i.removeAttr("data-swiper-slide-index")}};var b={setGrabCursor:function(e){if(!h.touch&&this.params.simulateTouch){var t=this.el;t.style.cursor="move",t.style.cursor=e?"-webkit-grabbing":"-webkit-grab",t.style.cursor=e?"-moz-grabbin":"-moz-grab",t.style.cursor=e?"grabbing":"grab"}},unsetGrabCursor:function(){h.touch||(this.el.style.cursor="")}};var w={appendSlide:function(e){var t=this.$wrapperEl,i=this.params;if(i.loop&&this.loopDestroy(),"object"==typeof e&&"length"in e)for(var s=0;s<e.length;s+=1)e[s]&&t.append(e[s]);else t.append(e);i.loop&&this.loopCreate(),i.observer&&h.observer||this.update()},prependSlide:function(e){var t=this.params,i=this.$wrapperEl,s=this.activeIndex;t.loop&&this.loopDestroy();var a=s+1;if("object"==typeof e&&"length"in e){for(var r=0;r<e.length;r+=1)e[r]&&i.prepend(e[r]);a=s+e.length}else i.prepend(e);t.loop&&this.loopCreate(),t.observer&&h.observer||this.update(),this.slideTo(a,0,!1)},removeSlide:function(e){var t=this.params,i=this.$wrapperEl,s=this.activeIndex;t.loop&&(this.loopDestroy(),this.slides=i.children("."+t.slideClass));var a,r=s;if("object"==typeof e&&"length"in e){for(var n=0;n<e.length;n+=1)a=e[n],this.slides[a]&&this.slides.eq(a).remove(),a<r&&(r-=1);r=Math.max(r,0)}else a=e,this.slides[a]&&this.slides.eq(a).remove(),a<r&&(r-=1),r=Math.max(r,0);t.loop&&this.loopCreate(),t.observer&&h.observer||this.update(),t.loop?this.slideTo(r+this.loopedSlides,0,!1):this.slideTo(r,0,!1)},removeAllSlides:function(){for(var e=[],t=0;t<this.slides.length;t+=1)e.push(t);this.removeSlide(e)}},y=function(){var i=t.navigator.userAgent,s={ios:!1,android:!1,androidChrome:!1,desktop:!1,windows:!1,iphone:!1,ipod:!1,ipad:!1,cordova:t.cordova||t.phonegap,phonegap:t.cordova||t.phonegap},a=i.match(/(Windows Phone);?[\s\/]+([\d.]+)?/),r=i.match(/(Android);?[\s\/]+([\d.]+)?/),n=i.match(/(iPad).*OS\s([\d_]+)/),o=i.match(/(iPod)(.*OS\s([\d_]+))?/),l=!n&&i.match(/(iPhone\sOS|iOS)\s([\d_]+)/);if(a&&(s.os="windows",s.osVersion=a[2],s.windows=!0),r&&!a&&(s.os="android",s.osVersion=r[2],s.android=!0,s.androidChrome=i.toLowerCase().indexOf("chrome")>=0),(n||l||o)&&(s.os="ios",s.ios=!0),l&&!o&&(s.osVersion=l[2].replace(/_/g,"."),s.iphone=!0),n&&(s.osVersion=n[2].replace(/_/g,"."),s.ipad=!0),o&&(s.osVersion=o[3]?o[3].replace(/_/g,"."):null,s.iphone=!0),s.ios&&s.osVersion&&i.indexOf("Version/")>=0&&"10"===s.osVersion.split(".")[0]&&(s.osVersion=i.toLowerCase().split("version/")[1].split(" ")[0]),s.desktop=!(s.os||s.android||s.webView),s.webView=(l||n||o)&&i.match(/.*AppleWebKit(?!.*Safari)/i),s.os&&"ios"===s.os){var d=s.osVersion.split("."),h=e.querySelector('meta[name="viewport"]');s.minimalUi=!s.webView&&(o||l)&&(1*d[0]==7?1*d[1]>=1:1*d[0]>7)&&h&&h.getAttribute("content").indexOf("minimal-ui")>=0}return s.pixelRatio=t.devicePixelRatio||1,s}();function x(){var e=this.params,t=this.el;if(!t||0!==t.offsetWidth){e.breakpoints&&this.setBreakpoint();var i=this.allowSlideNext,s=this.allowSlidePrev,a=this.snapGrid;if(this.allowSlideNext=!0,this.allowSlidePrev=!0,this.updateSize(),this.updateSlides(),e.freeMode){var r=Math.min(Math.max(this.translate,this.maxTranslate()),this.minTranslate());this.setTranslate(r),this.updateActiveIndex(),this.updateSlidesClasses(),e.autoHeight&&this.updateAutoHeight()}else this.updateSlidesClasses(),("auto"===e.slidesPerView||e.slidesPerView>1)&&this.isEnd&&!this.params.centeredSlides?this.slideTo(this.slides.length-1,0,!1,!0):this.slideTo(this.activeIndex,0,!1,!0);this.allowSlidePrev=s,this.allowSlideNext=i,this.params.watchOverflow&&a!==this.snapGrid&&this.checkOverflow()}}var E={attachEvents:function(){var i=this.params,a=this.touchEvents,r=this.el,n=this.wrapperEl;this.onTouchStart=function(i){var a=this.touchEventsData,r=this.params,n=this.touches;if(!this.animating||!r.preventIntercationOnTransition){var o=i;if(o.originalEvent&&(o=o.originalEvent),a.isTouchEvent="touchstart"===o.type,(a.isTouchEvent||!("which"in o)||3!==o.which)&&(!a.isTouched||!a.isMoved))if(r.noSwiping&&s(o.target).closest(r.noSwipingSelector?r.noSwipingSelector:"."+r.noSwipingClass)[0])this.allowClick=!0;else if(!r.swipeHandler||s(o).closest(r.swipeHandler)[0]){n.currentX="touchstart"===o.type?o.targetTouches[0].pageX:o.pageX,n.currentY="touchstart"===o.type?o.targetTouches[0].pageY:o.pageY;var l=n.currentX,h=n.currentY;if(!(y.ios&&!y.cordova&&r.iOSEdgeSwipeDetection&&l<=r.iOSEdgeSwipeThreshold&&l>=t.screen.width-r.iOSEdgeSwipeThreshold)){if(d.extend(a,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),n.startX=l,n.startY=h,a.touchStartTime=d.now(),this.allowClick=!0,this.updateSize(),this.swipeDirection=void 0,r.threshold>0&&(a.allowThresholdMove=!1),"touchstart"!==o.type){var p=!0;s(o.target).is(a.formElements)&&(p=!1),e.activeElement&&s(e.activeElement).is(a.formElements)&&e.activeElement!==o.target&&e.activeElement.blur(),p&&this.allowTouchMove&&o.preventDefault()}this.emit("touchStart",o)}}}}.bind(this),this.onTouchMove=function(t){var i=this.touchEventsData,a=this.params,r=this.touches,n=this.rtlTranslate,o=t;if(o.originalEvent&&(o=o.originalEvent),i.isTouched){if(!i.isTouchEvent||"mousemove"!==o.type){var l="touchmove"===o.type?o.targetTouches[0].pageX:o.pageX,h="touchmove"===o.type?o.targetTouches[0].pageY:o.pageY;if(o.preventedByNestedSwiper)return r.startX=l,void(r.startY=h);if(!this.allowTouchMove)return this.allowClick=!1,void(i.isTouched&&(d.extend(r,{startX:l,startY:h,currentX:l,currentY:h}),i.touchStartTime=d.now()));if(i.isTouchEvent&&a.touchReleaseOnEdges&&!a.loop)if(this.isVertical()){if(h<r.startY&&this.translate<=this.maxTranslate()||h>r.startY&&this.translate>=this.minTranslate())return i.isTouched=!1,void(i.isMoved=!1)}else if(l<r.startX&&this.translate<=this.maxTranslate()||l>r.startX&&this.translate>=this.minTranslate())return;if(i.isTouchEvent&&e.activeElement&&o.target===e.activeElement&&s(o.target).is(i.formElements))return i.isMoved=!0,void(this.allowClick=!1);if(i.allowTouchCallbacks&&this.emit("touchMove",o),!(o.targetTouches&&o.targetTouches.length>1)){r.currentX=l,r.currentY=h;var p,c=r.currentX-r.startX,u=r.currentY-r.startY;if(void 0===i.isScrolling&&(this.isHorizontal()&&r.currentY===r.startY||this.isVertical()&&r.currentX===r.startX?i.isScrolling=!1:c*c+u*u>=25&&(p=180*Math.atan2(Math.abs(u),Math.abs(c))/Math.PI,i.isScrolling=this.isHorizontal()?p>a.touchAngle:90-p>a.touchAngle)),i.isScrolling&&this.emit("touchMoveOpposite",o),"undefined"==typeof startMoving&&(r.currentX===r.startX&&r.currentY===r.startY||(i.startMoving=!0)),i.isScrolling)i.isTouched=!1;else if(i.startMoving){this.allowClick=!1,o.preventDefault(),a.touchMoveStopPropagation&&!a.nested&&o.stopPropagation(),i.isMoved||(a.loop&&this.loopFix(),i.startTranslate=this.getTranslate(),this.setTransition(0),this.animating&&this.$wrapperEl.trigger("webkitTransitionEnd transitionend"),i.allowMomentumBounce=!1,!a.grabCursor||!0!==this.allowSlideNext&&!0!==this.allowSlidePrev||this.setGrabCursor(!0),this.emit("sliderFirstMove",o)),this.emit("sliderMove",o),i.isMoved=!0;var v=this.isHorizontal()?c:u;r.diff=v,v*=a.touchRatio,n&&(v=-v),this.swipeDirection=v>0?"prev":"next",i.currentTranslate=v+i.startTranslate;var f=!0,m=a.resistanceRatio;if(a.touchReleaseOnEdges&&(m=0),v>0&&i.currentTranslate>this.minTranslate()?(f=!1,a.resistance&&(i.currentTranslate=this.minTranslate()-1+Math.pow(-this.minTranslate()+i.startTranslate+v,m))):v<0&&i.currentTranslate<this.maxTranslate()&&(f=!1,a.resistance&&(i.currentTranslate=this.maxTranslate()+1-Math.pow(this.maxTranslate()-i.startTranslate-v,m))),f&&(o.preventedByNestedSwiper=!0),!this.allowSlideNext&&"next"===this.swipeDirection&&i.currentTranslate<i.startTranslate&&(i.currentTranslate=i.startTranslate),!this.allowSlidePrev&&"prev"===this.swipeDirection&&i.currentTranslate>i.startTranslate&&(i.currentTranslate=i.startTranslate),a.threshold>0){if(!(Math.abs(v)>a.threshold||i.allowThresholdMove))return void(i.currentTranslate=i.startTranslate);if(!i.allowThresholdMove)return i.allowThresholdMove=!0,r.startX=r.currentX,r.startY=r.currentY,i.currentTranslate=i.startTranslate,void(r.diff=this.isHorizontal()?r.currentX-r.startX:r.currentY-r.startY)}a.followFinger&&((a.freeMode||a.watchSlidesProgress||a.watchSlidesVisibility)&&(this.updateActiveIndex(),this.updateSlidesClasses()),a.freeMode&&(0===i.velocities.length&&i.velocities.push({position:r[this.isHorizontal()?"startX":"startY"],time:i.touchStartTime}),i.velocities.push({position:r[this.isHorizontal()?"currentX":"currentY"],time:d.now()})),this.updateProgress(i.currentTranslate),this.setTranslate(i.currentTranslate))}}}}else i.startMoving&&i.isScrolling&&this.emit("touchMoveOpposite",o)}.bind(this),this.onTouchEnd=function(e){var t=this,i=t.touchEventsData,s=t.params,a=t.touches,r=t.rtlTranslate,n=t.$wrapperEl,o=t.slidesGrid,l=t.snapGrid,h=e;if(h.originalEvent&&(h=h.originalEvent),i.allowTouchCallbacks&&t.emit("touchEnd",h),i.allowTouchCallbacks=!1,!i.isTouched)return i.isMoved&&s.grabCursor&&t.setGrabCursor(!1),i.isMoved=!1,void(i.startMoving=!1);s.grabCursor&&i.isMoved&&i.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);var p,c=d.now(),u=c-i.touchStartTime;if(t.allowClick&&(t.updateClickedSlide(h),t.emit("tap",h),u<300&&c-i.lastClickTime>300&&(i.clickTimeout&&clearTimeout(i.clickTimeout),i.clickTimeout=d.nextTick(function(){t&&!t.destroyed&&t.emit("click",h)},300)),u<300&&c-i.lastClickTime<300&&(i.clickTimeout&&clearTimeout(i.clickTimeout),t.emit("doubleTap",h))),i.lastClickTime=d.now(),d.nextTick(function(){t.destroyed||(t.allowClick=!0)}),!i.isTouched||!i.isMoved||!t.swipeDirection||0===a.diff||i.currentTranslate===i.startTranslate)return i.isTouched=!1,i.isMoved=!1,void(i.startMoving=!1);if(i.isTouched=!1,i.isMoved=!1,i.startMoving=!1,p=s.followFinger?r?t.translate:-t.translate:-i.currentTranslate,s.freeMode){if(p<-t.minTranslate())return void t.slideTo(t.activeIndex);if(p>-t.maxTranslate())return void(t.slides.length<l.length?t.slideTo(l.length-1):t.slideTo(t.slides.length-1));if(s.freeModeMomentum){if(i.velocities.length>1){var v=i.velocities.pop(),f=i.velocities.pop(),m=v.position-f.position,g=v.time-f.time;t.velocity=m/g,t.velocity/=2,Math.abs(t.velocity)<s.freeModeMinimumVelocity&&(t.velocity=0),(g>150||d.now()-v.time>300)&&(t.velocity=0)}else t.velocity=0;t.velocity*=s.freeModeMomentumVelocityRatio,i.velocities.length=0;var b=1e3*s.freeModeMomentumRatio,w=t.velocity*b,y=t.translate+w;r&&(y=-y);var x,E,T=!1,S=20*Math.abs(t.velocity)*s.freeModeMomentumBounceRatio;if(y<t.maxTranslate())s.freeModeMomentumBounce?(y+t.maxTranslate()<-S&&(y=t.maxTranslate()-S),x=t.maxTranslate(),T=!0,i.allowMomentumBounce=!0):y=t.maxTranslate(),s.loop&&s.centeredSlides&&(E=!0);else if(y>t.minTranslate())s.freeModeMomentumBounce?(y-t.minTranslate()>S&&(y=t.minTranslate()+S),x=t.minTranslate(),T=!0,i.allowMomentumBounce=!0):y=t.minTranslate(),s.loop&&s.centeredSlides&&(E=!0);else if(s.freeModeSticky){for(var C,M=0;M<l.length;M+=1)if(l[M]>-y){C=M;break}y=-(y=Math.abs(l[C]-y)<Math.abs(l[C-1]-y)||"next"===t.swipeDirection?l[C]:l[C-1])}if(E&&t.once("transitionEnd",function(){t.loopFix()}),0!==t.velocity)b=r?Math.abs((-y-t.translate)/t.velocity):Math.abs((y-t.translate)/t.velocity);else if(s.freeModeSticky)return void t.slideToClosest();s.freeModeMomentumBounce&&T?(t.updateProgress(x),t.setTransition(b),t.setTranslate(y),t.transitionStart(!0,t.swipeDirection),t.animating=!0,n.transitionEnd(function(){t&&!t.destroyed&&i.allowMomentumBounce&&(t.emit("momentumBounce"),t.setTransition(s.speed),t.setTranslate(x),n.transitionEnd(function(){t&&!t.destroyed&&t.transitionEnd()}))})):t.velocity?(t.updateProgress(y),t.setTransition(b),t.setTranslate(y),t.transitionStart(!0,t.swipeDirection),t.animating||(t.animating=!0,n.transitionEnd(function(){t&&!t.destroyed&&t.transitionEnd()}))):t.updateProgress(y),t.updateActiveIndex(),t.updateSlidesClasses()}else if(s.freeModeSticky)return void t.slideToClosest();(!s.freeModeMomentum||u>=s.longSwipesMs)&&(t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses())}else{for(var z=0,k=t.slidesSizesGrid[0],P=0;P<o.length;P+=s.slidesPerGroup)void 0!==o[P+s.slidesPerGroup]?p>=o[P]&&p<o[P+s.slidesPerGroup]&&(z=P,k=o[P+s.slidesPerGroup]-o[P]):p>=o[P]&&(z=P,k=o[o.length-1]-o[o.length-2]);var $=(p-o[z])/k;if(u>s.longSwipesMs){if(!s.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&($>=s.longSwipesRatio?t.slideTo(z+s.slidesPerGroup):t.slideTo(z)),"prev"===t.swipeDirection&&($>1-s.longSwipesRatio?t.slideTo(z+s.slidesPerGroup):t.slideTo(z))}else{if(!s.shortSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&t.slideTo(z+s.slidesPerGroup),"prev"===t.swipeDirection&&t.slideTo(z)}}}.bind(this),this.onClick=function(e){this.allowClick||(this.params.preventClicks&&e.preventDefault(),this.params.preventClicksPropagation&&this.animating&&(e.stopPropagation(),e.stopImmediatePropagation()))}.bind(this);var o="container"===i.touchEventsTarget?r:n,l=!!i.nested;if(h.touch||!h.pointerEvents&&!h.prefixedPointerEvents){if(h.touch){var p=!("touchstart"!==a.start||!h.passiveListener||!i.passiveListeners)&&{passive:!0,capture:!1};o.addEventListener(a.start,this.onTouchStart,p),o.addEventListener(a.move,this.onTouchMove,h.passiveListener?{passive:!1,capture:l}:l),o.addEventListener(a.end,this.onTouchEnd,p)}(i.simulateTouch&&!y.ios&&!y.android||i.simulateTouch&&!h.touch&&y.ios)&&(o.addEventListener("mousedown",this.onTouchStart,!1),e.addEventListener("mousemove",this.onTouchMove,l),e.addEventListener("mouseup",this.onTouchEnd,!1))}else o.addEventListener(a.start,this.onTouchStart,!1),e.addEventListener(a.move,this.onTouchMove,l),e.addEventListener(a.end,this.onTouchEnd,!1);(i.preventClicks||i.preventClicksPropagation)&&o.addEventListener("click",this.onClick,!0),this.on("resize observerUpdate",x,!0)},detachEvents:function(){var t=this.params,i=this.touchEvents,s=this.el,a=this.wrapperEl,r="container"===t.touchEventsTarget?s:a,n=!!t.nested;if(h.touch||!h.pointerEvents&&!h.prefixedPointerEvents){if(h.touch){var o=!("onTouchStart"!==i.start||!h.passiveListener||!t.passiveListeners)&&{passive:!0,capture:!1};r.removeEventListener(i.start,this.onTouchStart,o),r.removeEventListener(i.move,this.onTouchMove,n),r.removeEventListener(i.end,this.onTouchEnd,o)}(t.simulateTouch&&!y.ios&&!y.android||t.simulateTouch&&!h.touch&&y.ios)&&(r.removeEventListener("mousedown",this.onTouchStart,!1),e.removeEventListener("mousemove",this.onTouchMove,n),e.removeEventListener("mouseup",this.onTouchEnd,!1))}else r.removeEventListener(i.start,this.onTouchStart,!1),e.removeEventListener(i.move,this.onTouchMove,n),e.removeEventListener(i.end,this.onTouchEnd,!1);(t.preventClicks||t.preventClicksPropagation)&&r.removeEventListener("click",this.onClick,!0),this.off("resize observerUpdate",x)}};var T={setBreakpoint:function(){var e=this.activeIndex,t=this.loopedSlides;void 0===t&&(t=0);var i=this.params,s=i.breakpoints;if(s&&(!s||0!==Object.keys(s).length)){var a=this.getBreakpoint(s);if(a&&this.currentBreakpoint!==a){var r=a in s?s[a]:this.originalParams,n=i.loop&&r.slidesPerView!==i.slidesPerView;d.extend(this.params,r),d.extend(this,{allowTouchMove:this.params.allowTouchMove,allowSlideNext:this.params.allowSlideNext,allowSlidePrev:this.params.allowSlidePrev}),this.currentBreakpoint=a,n&&(this.loopDestroy(),this.loopCreate(),this.updateSlides(),this.slideTo(e-t+this.loopedSlides,0,!1)),this.emit("breakpoint",r)}}},getBreakpoint:function(e){if(e){var i=!1,s=[];Object.keys(e).forEach(function(e){s.push(e)}),s.sort(function(e,t){return parseInt(e,10)-parseInt(t,10)});for(var a=0;a<s.length;a+=1){var r=s[a];r>=t.innerWidth&&!i&&(i=r)}return i||"max"}}},S=function(){return{isIE:!!t.navigator.userAgent.match(/Trident/g)||!!t.navigator.userAgent.match(/MSIE/g),isSafari:(e=t.navigator.userAgent.toLowerCase(),e.indexOf("safari")>=0&&e.indexOf("chrome")<0&&e.indexOf("android")<0),isUiWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(t.navigator.userAgent)};var e}();var C={init:!0,direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,preventIntercationOnTransition:!1,iOSEdgeSwipeDetection:!1,iOSEdgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,centeredSlides:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,watchOverflow:!1,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:0,touchMoveStopPropagation:!0,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,loopFillGroupWithBlank:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,containerModifierClass:"swiper-container-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-invisible-blank",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",runCallbacksOnInit:!0},M={update:u,translate:v,transition:f,slide:m,loop:g,grabCursor:b,manipulation:w,events:E,breakpoints:T,checkOverflow:{checkOverflow:function(){var e=this.isLocked;this.isLocked=1===this.snapGrid.length,this.allowSlideNext=!this.isLocked,this.allowSlidePrev=!this.isLocked,e!==this.isLocked&&this.emit(this.isLocked?"lock":"unlock"),e&&e!==this.isLocked&&(this.isEnd=!1,this.navigation.update())}},classes:{addClasses:function(){var e=this.classNames,t=this.params,i=this.rtl,s=this.$el,a=[];a.push(t.direction),t.freeMode&&a.push("free-mode"),h.flexbox||a.push("no-flexbox"),t.autoHeight&&a.push("autoheight"),i&&a.push("rtl"),t.slidesPerColumn>1&&a.push("multirow"),y.android&&a.push("android"),y.ios&&a.push("ios"),S.isIE&&(h.pointerEvents||h.prefixedPointerEvents)&&a.push("wp8-"+t.direction),a.forEach(function(i){e.push(t.containerModifierClass+i)}),s.addClass(e.join(" "))},removeClasses:function(){var e=this.$el,t=this.classNames;e.removeClass(t.join(" "))}},images:{loadImage:function(e,i,s,a,r,n){var o;function l(){n&&n()}e.complete&&r?l():i?((o=new t.Image).onload=l,o.onerror=l,a&&(o.sizes=a),s&&(o.srcset=s),i&&(o.src=i)):l()},preloadImages:function(){var e=this;function t(){void 0!==e&&null!==e&&e&&!e.destroyed&&(void 0!==e.imagesLoaded&&(e.imagesLoaded+=1),e.imagesLoaded===e.imagesToLoad.length&&(e.params.updateOnImagesReady&&e.update(),e.emit("imagesReady")))}e.imagesToLoad=e.$el.find("img");for(var i=0;i<e.imagesToLoad.length;i+=1){var s=e.imagesToLoad[i];e.loadImage(s,s.currentSrc||s.getAttribute("src"),s.srcset||s.getAttribute("srcset"),s.sizes||s.getAttribute("sizes"),!0,t)}}}},z={},k=function(e){function t(){for(var i,a,r,n=[],o=arguments.length;o--;)n[o]=arguments[o];1===n.length&&n[0].constructor&&n[0].constructor===Object?r=n[0]:(a=(i=n)[0],r=i[1]),r||(r={}),r=d.extend({},r),a&&!r.el&&(r.el=a),e.call(this,r),Object.keys(M).forEach(function(e){Object.keys(M[e]).forEach(function(i){t.prototype[i]||(t.prototype[i]=M[e][i])})});var l=this;void 0===l.modules&&(l.modules={}),Object.keys(l.modules).forEach(function(e){var t=l.modules[e];if(t.params){var i=Object.keys(t.params)[0],s=t.params[i];if("object"!=typeof s)return;if(!(i in r&&"enabled"in s))return;!0===r[i]&&(r[i]={enabled:!0}),"object"!=typeof r[i]||"enabled"in r[i]||(r[i].enabled=!0),r[i]||(r[i]={enabled:!1})}});var p=d.extend({},C);l.useModulesParams(p),l.params=d.extend({},p,z,r),l.originalParams=d.extend({},l.params),l.passedParams=d.extend({},r),l.$=s;var c=s(l.params.el);if(a=c[0]){if(c.length>1){var u=[];return c.each(function(e,i){var s=d.extend({},r,{el:i});u.push(new t(s))}),u}a.swiper=l,c.data("swiper",l);var v,f,m=c.children("."+l.params.wrapperClass);return d.extend(l,{$el:c,el:a,$wrapperEl:m,wrapperEl:m[0],classNames:[],slides:s(),slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:function(){return"horizontal"===l.params.direction},isVertical:function(){return"vertical"===l.params.direction},rtl:"rtl"===a.dir.toLowerCase()||"rtl"===c.css("direction"),rtlTranslate:"horizontal"===l.params.direction&&("rtl"===a.dir.toLowerCase()||"rtl"===c.css("direction")),wrongRTL:"-webkit-box"===m.css("display"),activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,progress:0,velocity:0,animating:!1,allowSlideNext:l.params.allowSlideNext,allowSlidePrev:l.params.allowSlidePrev,touchEvents:(v=["touchstart","touchmove","touchend"],f=["mousedown","mousemove","mouseup"],h.pointerEvents?f=["pointerdown","pointermove","pointerup"]:h.prefixedPointerEvents&&(f=["MSPointerDown","MSPointerMove","MSPointerUp"]),l.touchEventsTouch={start:v[0],move:v[1],end:v[2]},l.touchEventsDesktop={start:f[0],move:f[1],end:f[2]},h.touch||!l.params.simulateTouch?l.touchEventsTouch:l.touchEventsDesktop),touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,formElements:"input, select, option, textarea, button, video",lastClickTime:d.now(),clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,isTouchEvent:void 0,startMoving:void 0},allowClick:!0,allowTouchMove:l.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),l.useModules(),l.params.init&&l.init(),l}}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={extendedDefaults:{configurable:!0},defaults:{configurable:!0},Class:{configurable:!0},$:{configurable:!0}};return t.prototype.slidesPerViewDynamic=function(){var e=this.params,t=this.slides,i=this.slidesGrid,s=this.size,a=this.activeIndex,r=1;if(e.centeredSlides){for(var n,o=t[a].swiperSlideSize,l=a+1;l<t.length;l+=1)t[l]&&!n&&(r+=1,(o+=t[l].swiperSlideSize)>s&&(n=!0));for(var d=a-1;d>=0;d-=1)t[d]&&!n&&(r+=1,(o+=t[d].swiperSlideSize)>s&&(n=!0))}else for(var h=a+1;h<t.length;h+=1)i[h]-i[a]<s&&(r+=1);return r},t.prototype.update=function(){var e=this;if(e&&!e.destroyed){var t=e.snapGrid,i=e.params;i.breakpoints&&e.setBreakpoint(),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.params.freeMode?(s(),e.params.autoHeight&&e.updateAutoHeight()):(("auto"===e.params.slidesPerView||e.params.slidesPerView>1)&&e.isEnd&&!e.params.centeredSlides?e.slideTo(e.slides.length-1,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0))||s(),i.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}function s(){var t=e.rtlTranslate?-1*e.translate:e.translate,i=Math.min(Math.max(t,e.maxTranslate()),e.minTranslate());e.setTranslate(i),e.updateActiveIndex(),e.updateSlidesClasses()}},t.prototype.init=function(){this.initialized||(this.emit("beforeInit"),this.params.breakpoints&&this.setBreakpoint(),this.addClasses(),this.params.loop&&this.loopCreate(),this.updateSize(),this.updateSlides(),this.params.watchOverflow&&this.checkOverflow(),this.params.grabCursor&&this.setGrabCursor(),this.params.preloadImages&&this.preloadImages(),this.params.loop?this.slideTo(this.params.initialSlide+this.loopedSlides,0,this.params.runCallbacksOnInit):this.slideTo(this.params.initialSlide,0,this.params.runCallbacksOnInit),this.attachEvents(),this.initialized=!0,this.emit("init"))},t.prototype.destroy=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);var i=this,s=i.params,a=i.$el,r=i.$wrapperEl,n=i.slides;i.emit("beforeDestroy"),i.initialized=!1,i.detachEvents(),s.loop&&i.loopDestroy(),t&&(i.removeClasses(),a.removeAttr("style"),r.removeAttr("style"),n&&n.length&&n.removeClass([s.slideVisibleClass,s.slideActiveClass,s.slideNextClass,s.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-slide-index").removeAttr("data-swiper-column").removeAttr("data-swiper-row")),i.emit("destroy"),Object.keys(i.eventsListeners).forEach(function(e){i.off(e)}),!1!==e&&(i.$el[0].swiper=null,i.$el.data("swiper",null),d.deleteProps(i)),i.destroyed=!0},t.extendDefaults=function(e){d.extend(z,e)},i.extendedDefaults.get=function(){return z},i.defaults.get=function(){return C},i.Class.get=function(){return e},i.$.get=function(){return s},Object.defineProperties(t,i),t}(p),P={name:"device",proto:{device:y},static:{device:y}},$={name:"support",proto:{support:h},static:{support:h}},L={name:"browser",proto:{browser:S},static:{browser:S}},I={name:"resize",create:function(){var e=this;d.extend(e,{resize:{resizeHandler:function(){e&&!e.destroyed&&e.initialized&&(e.emit("beforeResize"),e.emit("resize"))},orientationChangeHandler:function(){e&&!e.destroyed&&e.initialized&&e.emit("orientationchange")}}})},on:{init:function(){t.addEventListener("resize",this.resize.resizeHandler),t.addEventListener("orientationchange",this.resize.orientationChangeHandler)},destroy:function(){t.removeEventListener("resize",this.resize.resizeHandler),t.removeEventListener("orientationchange",this.resize.orientationChangeHandler)}}},D={func:t.MutationObserver||t.WebkitMutationObserver,attach:function(e,t){void 0===t&&(t={});var i=this,s=new(0,D.func)(function(e){e.forEach(function(e){i.emit("observerUpdate",e)})});s.observe(e,{attributes:void 0===t.attributes||t.attributes,childList:void 0===t.childList||t.childList,characterData:void 0===t.characterData||t.characterData}),i.observer.observers.push(s)},init:function(){if(h.observer&&this.params.observer){if(this.params.observeParents)for(var e=this.$el.parents(),t=0;t<e.length;t+=1)this.observer.attach(e[t]);this.observer.attach(this.$el[0],{childList:!1}),this.observer.attach(this.$wrapperEl[0],{attributes:!1})}},destroy:function(){this.observer.observers.forEach(function(e){e.disconnect()}),this.observer.observers=[]}},O={name:"observer",params:{observer:!1,observeParents:!1},create:function(){d.extend(this,{observer:{init:D.init.bind(this),attach:D.attach.bind(this),destroy:D.destroy.bind(this),observers:[]}})},on:{init:function(){this.observer.init()},destroy:function(){this.observer.destroy()}}},A={update:function(e){var t=this,i=t.params,s=i.slidesPerView,a=i.slidesPerGroup,r=i.centeredSlides,n=t.virtual,o=n.from,l=n.to,h=n.slides,p=n.slidesGrid,c=n.renderSlide,u=n.offset;t.updateActiveIndex();var v,f,m,g=t.activeIndex||0;v=t.rtlTranslate?"right":t.isHorizontal()?"left":"top",r?(f=Math.floor(s/2)+a,m=Math.floor(s/2)+a):(f=s+(a-1),m=a);var b=Math.max((g||0)-m,0),w=Math.min((g||0)+f,h.length-1),y=(t.slidesGrid[b]||0)-(t.slidesGrid[0]||0);function x(){t.updateSlides(),t.updateProgress(),t.updateSlidesClasses(),t.lazy&&t.params.lazy.enabled&&t.lazy.load()}if(d.extend(t.virtual,{from:b,to:w,offset:y,slidesGrid:t.slidesGrid}),o===b&&l===w&&!e)return t.slidesGrid!==p&&y!==u&&t.slides.css(v,y+"px"),void t.updateProgress();if(t.params.virtual.renderExternal)return t.params.virtual.renderExternal.call(t,{offset:y,from:b,to:w,slides:function(){for(var e=[],t=b;t<=w;t+=1)e.push(h[t]);return e}()}),void x();var E=[],T=[];if(e)t.$wrapperEl.find("."+t.params.slideClass).remove();else for(var S=o;S<=l;S+=1)(S<b||S>w)&&t.$wrapperEl.find("."+t.params.slideClass+'[data-swiper-slide-index="'+S+'"]').remove();for(var C=0;C<h.length;C+=1)C>=b&&C<=w&&(void 0===l||e?T.push(C):(C>l&&T.push(C),C<o&&E.push(C)));T.forEach(function(e){t.$wrapperEl.append(c(h[e],e))}),E.sort(function(e,t){return e<t}).forEach(function(e){t.$wrapperEl.prepend(c(h[e],e))}),t.$wrapperEl.children(".swiper-slide").css(v,y+"px"),x()},renderSlide:function(e,t){var i=this.params.virtual;if(i.cache&&this.virtual.cache[t])return this.virtual.cache[t];var a=i.renderSlide?s(i.renderSlide.call(this,e,t)):s('<div class="'+this.params.slideClass+'" data-swiper-slide-index="'+t+'">'+e+"</div>");return a.attr("data-swiper-slide-index")||a.attr("data-swiper-slide-index",t),i.cache&&(this.virtual.cache[t]=a),a},appendSlide:function(e){this.virtual.slides.push(e),this.virtual.update(!0)},prependSlide:function(e){if(this.virtual.slides.unshift(e),this.params.virtual.cache){var t=this.virtual.cache,i={};Object.keys(t).forEach(function(e){i[e+1]=t[e]}),this.virtual.cache=i}this.virtual.update(!0),this.slideNext(0)}},G={name:"virtual",params:{virtual:{enabled:!1,slides:[],cache:!0,renderSlide:null,renderExternal:null}},create:function(){d.extend(this,{virtual:{update:A.update.bind(this),appendSlide:A.appendSlide.bind(this),prependSlide:A.prependSlide.bind(this),renderSlide:A.renderSlide.bind(this),slides:this.params.virtual.slides,cache:{}}})},on:{beforeInit:function(){if(this.params.virtual.enabled){this.classNames.push(this.params.containerModifierClass+"virtual");var e={watchSlidesProgress:!0};d.extend(this.params,e),d.extend(this.originalParams,e),this.virtual.update()}},setTranslate:function(){this.params.virtual.enabled&&this.virtual.update()}}},H={handle:function(i){var s=this.rtlTranslate,a=i;a.originalEvent&&(a=a.originalEvent);var r=a.keyCode||a.charCode;if(!this.allowSlideNext&&(this.isHorizontal()&&39===r||this.isVertical()&&40===r))return!1;if(!this.allowSlidePrev&&(this.isHorizontal()&&37===r||this.isVertical()&&38===r))return!1;if(!(a.shiftKey||a.altKey||a.ctrlKey||a.metaKey||e.activeElement&&e.activeElement.nodeName&&("input"===e.activeElement.nodeName.toLowerCase()||"textarea"===e.activeElement.nodeName.toLowerCase()))){if(this.params.keyboard.onlyInViewport&&(37===r||39===r||38===r||40===r)){var n=!1;if(this.$el.parents("."+this.params.slideClass).length>0&&0===this.$el.parents("."+this.params.slideActiveClass).length)return;var o=t.innerWidth,l=t.innerHeight,d=this.$el.offset();s&&(d.left-=this.$el[0].scrollLeft);for(var h=[[d.left,d.top],[d.left+this.width,d.top],[d.left,d.top+this.height],[d.left+this.width,d.top+this.height]],p=0;p<h.length;p+=1){var c=h[p];c[0]>=0&&c[0]<=o&&c[1]>=0&&c[1]<=l&&(n=!0)}if(!n)return}this.isHorizontal()?(37!==r&&39!==r||(a.preventDefault?a.preventDefault():a.returnValue=!1),(39===r&&!s||37===r&&s)&&this.slideNext(),(37===r&&!s||39===r&&s)&&this.slidePrev()):(38!==r&&40!==r||(a.preventDefault?a.preventDefault():a.returnValue=!1),40===r&&this.slideNext(),38===r&&this.slidePrev()),this.emit("keyPress",r)}},enable:function(){this.keyboard.enabled||(s(e).on("keydown",this.keyboard.handle),this.keyboard.enabled=!0)},disable:function(){this.keyboard.enabled&&(s(e).off("keydown",this.keyboard.handle),this.keyboard.enabled=!1)}},N={name:"keyboard",params:{keyboard:{enabled:!1,onlyInViewport:!0}},create:function(){d.extend(this,{keyboard:{enabled:!1,enable:H.enable.bind(this),disable:H.disable.bind(this),handle:H.handle.bind(this)}})},on:{init:function(){this.params.keyboard.enabled&&this.keyboard.enable()},destroy:function(){this.keyboard.enabled&&this.keyboard.disable()}}};var B={lastScrollTime:d.now(),event:t.navigator.userAgent.indexOf("firefox")>-1?"DOMMouseScroll":function(){var t="onwheel"in e;if(!t){var i=e.createElement("div");i.setAttribute("onwheel","return;"),t="function"==typeof i.onwheel}return!t&&e.implementation&&e.implementation.hasFeature&&!0!==e.implementation.hasFeature("","")&&(t=e.implementation.hasFeature("Events.wheel","3.0")),t}()?"wheel":"mousewheel",normalize:function(e){var t=0,i=0,s=0,a=0;return"detail"in e&&(i=e.detail),"wheelDelta"in e&&(i=-e.wheelDelta/120),"wheelDeltaY"in e&&(i=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=i,i=0),s=10*t,a=10*i,"deltaY"in e&&(a=e.deltaY),"deltaX"in e&&(s=e.deltaX),(s||a)&&e.deltaMode&&(1===e.deltaMode?(s*=40,a*=40):(s*=800,a*=800)),s&&!t&&(t=s<1?-1:1),a&&!i&&(i=a<1?-1:1),{spinX:t,spinY:i,pixelX:s,pixelY:a}},handleMouseEnter:function(){this.mouseEntered=!0},handleMouseLeave:function(){this.mouseEntered=!1},handle:function(e){var i=e,s=this,a=s.params.mousewheel;if(!s.mouseEntered&&!a.releaseOnEdges)return!0;i.originalEvent&&(i=i.originalEvent);var r=0,n=s.rtlTranslate?-1:1,o=B.normalize(i);if(a.forceToAxis)if(s.isHorizontal()){if(!(Math.abs(o.pixelX)>Math.abs(o.pixelY)))return!0;r=o.pixelX*n}else{if(!(Math.abs(o.pixelY)>Math.abs(o.pixelX)))return!0;r=o.pixelY}else r=Math.abs(o.pixelX)>Math.abs(o.pixelY)?-o.pixelX*n:-o.pixelY;if(0===r)return!0;if(a.invert&&(r=-r),s.params.freeMode){s.params.loop&&s.loopFix();var l=s.getTranslate()+r*a.sensitivity,h=s.isBeginning,p=s.isEnd;if(l>=s.minTranslate()&&(l=s.minTranslate()),l<=s.maxTranslate()&&(l=s.maxTranslate()),s.setTransition(0),s.setTranslate(l),s.updateProgress(),s.updateActiveIndex(),s.updateSlidesClasses(),(!h&&s.isBeginning||!p&&s.isEnd)&&s.updateSlidesClasses(),s.params.freeModeSticky&&(clearTimeout(s.mousewheel.timeout),s.mousewheel.timeout=d.nextTick(function(){s.slideToClosest()},300)),s.emit("scroll",i),s.params.autoplay&&s.params.autoplayDisableOnInteraction&&s.stopAutoplay(),l===s.minTranslate()||l===s.maxTranslate())return!0}else{if(d.now()-s.mousewheel.lastScrollTime>60)if(r<0)if(s.isEnd&&!s.params.loop||s.animating){if(a.releaseOnEdges)return!0}else s.slideNext(),s.emit("scroll",i);else if(s.isBeginning&&!s.params.loop||s.animating){if(a.releaseOnEdges)return!0}else s.slidePrev(),s.emit("scroll",i);s.mousewheel.lastScrollTime=(new t.Date).getTime()}return i.preventDefault?i.preventDefault():i.returnValue=!1,!1},enable:function(){if(!B.event)return!1;if(this.mousewheel.enabled)return!1;var e=this.$el;return"container"!==this.params.mousewheel.eventsTarged&&(e=s(this.params.mousewheel.eventsTarged)),e.on("mouseenter",this.mousewheel.handleMouseEnter),e.on("mouseleave",this.mousewheel.handleMouseLeave),e.on(B.event,this.mousewheel.handle),this.mousewheel.enabled=!0,!0},disable:function(){if(!B.event)return!1;if(!this.mousewheel.enabled)return!1;var e=this.$el;return"container"!==this.params.mousewheel.eventsTarged&&(e=s(this.params.mousewheel.eventsTarged)),e.off(B.event,this.mousewheel.handle),this.mousewheel.enabled=!1,!0}},X={update:function(){var e=this.params.navigation;if(!this.params.loop){var t=this.navigation,i=t.$nextEl,s=t.$prevEl;s&&s.length>0&&(this.isBeginning?s.addClass(e.disabledClass):s.removeClass(e.disabledClass),s[this.params.watchOverflow&&this.isLocked?"addClass":"removeClass"](e.lockClass)),i&&i.length>0&&(this.isEnd?i.addClass(e.disabledClass):i.removeClass(e.disabledClass),i[this.params.watchOverflow&&this.isLocked?"addClass":"removeClass"](e.lockClass))}},init:function(){var e,t,i=this,a=i.params.navigation;(a.nextEl||a.prevEl)&&(a.nextEl&&(e=s(a.nextEl),i.params.uniqueNavElements&&"string"==typeof a.nextEl&&e.length>1&&1===i.$el.find(a.nextEl).length&&(e=i.$el.find(a.nextEl))),a.prevEl&&(t=s(a.prevEl),i.params.uniqueNavElements&&"string"==typeof a.prevEl&&t.length>1&&1===i.$el.find(a.prevEl).length&&(t=i.$el.find(a.prevEl))),e&&e.length>0&&e.on("click",function(e){e.preventDefault(),i.isEnd&&!i.params.loop||i.slideNext()}),t&&t.length>0&&t.on("click",function(e){e.preventDefault(),i.isBeginning&&!i.params.loop||i.slidePrev()}),d.extend(i.navigation,{$nextEl:e,nextEl:e&&e[0],$prevEl:t,prevEl:t&&t[0]}))},destroy:function(){var e=this.navigation,t=e.$nextEl,i=e.$prevEl;t&&t.length&&(t.off("click"),t.removeClass(this.params.navigation.disabledClass)),i&&i.length&&(i.off("click"),i.removeClass(this.params.navigation.disabledClass))}},Y={update:function(){var e=this.rtl,t=this.params.pagination;if(t.el&&this.pagination.el&&this.pagination.$el&&0!==this.pagination.$el.length){var i,a=this.virtual&&this.params.virtual.enabled?this.virtual.slides.length:this.slides.length,r=this.pagination.$el,n=this.params.loop?Math.ceil((a-2*this.loopedSlides)/this.params.slidesPerGroup):this.snapGrid.length;if(this.params.loop?((i=Math.ceil((this.activeIndex-this.loopedSlides)/this.params.slidesPerGroup))>a-1-2*this.loopedSlides&&(i-=a-2*this.loopedSlides),i>n-1&&(i-=n),i<0&&"bullets"!==this.params.paginationType&&(i=n+i)):i=void 0!==this.snapIndex?this.snapIndex:this.activeIndex||0,"bullets"===t.type&&this.pagination.bullets&&this.pagination.bullets.length>0){var o,l,d,h=this.pagination.bullets;if(t.dynamicBullets&&(this.pagination.bulletSize=h.eq(0)[this.isHorizontal()?"outerWidth":"outerHeight"](!0),r.css(this.isHorizontal()?"width":"height",this.pagination.bulletSize*(t.dynamicMainBullets+4)+"px"),t.dynamicMainBullets>1&&void 0!==this.previousIndex&&(this.pagination.dynamicBulletIndex+=i-this.previousIndex,this.pagination.dynamicBulletIndex>t.dynamicMainBullets-1?this.pagination.dynamicBulletIndex=t.dynamicMainBullets-1:this.pagination.dynamicBulletIndex<0&&(this.pagination.dynamicBulletIndex=0)),o=i-this.pagination.dynamicBulletIndex,d=((l=o+(Math.min(h.length,t.dynamicMainBullets)-1))+o)/2),h.removeClass(t.bulletActiveClass+" "+t.bulletActiveClass+"-next "+t.bulletActiveClass+"-next-next "+t.bulletActiveClass+"-prev "+t.bulletActiveClass+"-prev-prev "+t.bulletActiveClass+"-main"),r.length>1)h.each(function(e,a){var r=s(a),n=r.index();n===i&&r.addClass(t.bulletActiveClass),t.dynamicBullets&&(n>=o&&n<=l&&r.addClass(t.bulletActiveClass+"-main"),n===o&&r.prev().addClass(t.bulletActiveClass+"-prev").prev().addClass(t.bulletActiveClass+"-prev-prev"),n===l&&r.next().addClass(t.bulletActiveClass+"-next").next().addClass(t.bulletActiveClass+"-next-next"))});else if(h.eq(i).addClass(t.bulletActiveClass),t.dynamicBullets){for(var p=h.eq(o),c=h.eq(l),u=o;u<=l;u+=1)h.eq(u).addClass(t.bulletActiveClass+"-main");p.prev().addClass(t.bulletActiveClass+"-prev").prev().addClass(t.bulletActiveClass+"-prev-prev"),c.next().addClass(t.bulletActiveClass+"-next").next().addClass(t.bulletActiveClass+"-next-next")}if(t.dynamicBullets){var v=Math.min(h.length,t.dynamicMainBullets+4),f=(this.pagination.bulletSize*v-this.pagination.bulletSize)/2-d*this.pagination.bulletSize,m=e?"right":"left";h.css(this.isHorizontal()?m:"top",f+"px")}}if("fraction"===t.type&&(r.find("."+t.currentClass).text(i+1),r.find("."+t.totalClass).text(n)),"progressbar"===t.type){var g;g=t.progressbarOpposite?this.isHorizontal()?"vertical":"horizontal":this.isHorizontal()?"horizontal":"vertical";var b=(i+1)/n,w=1,y=1;"horizontal"===g?w=b:y=b,r.find("."+t.progressbarFillClass).transform("translate3d(0,0,0) scaleX("+w+") scaleY("+y+")").transition(this.params.speed)}"custom"===t.type&&t.renderCustom?(r.html(t.renderCustom(this,i+1,n)),this.emit("paginationRender",this,r[0])):this.emit("paginationUpdate",this,r[0]),r[this.params.watchOverflow&&this.isLocked?"addClass":"removeClass"](t.lockClass)}},render:function(){var e=this.params.pagination;if(e.el&&this.pagination.el&&this.pagination.$el&&0!==this.pagination.$el.length){var t=this.virtual&&this.params.virtual.enabled?this.virtual.slides.length:this.slides.length,i=this.pagination.$el,s="";if("bullets"===e.type){for(var a=this.params.loop?Math.ceil((t-2*this.loopedSlides)/this.params.slidesPerGroup):this.snapGrid.length,r=0;r<a;r+=1)e.renderBullet?s+=e.renderBullet.call(this,r,e.bulletClass):s+="<"+e.bulletElement+' class="'+e.bulletClass+'"></'+e.bulletElement+">";i.html(s),this.pagination.bullets=i.find("."+e.bulletClass)}"fraction"===e.type&&(s=e.renderFraction?e.renderFraction.call(this,e.currentClass,e.totalClass):'<span class="'+e.currentClass+'"></span> / <span class="'+e.totalClass+'"></span>',i.html(s)),"progressbar"===e.type&&(s=e.renderProgressbar?e.renderProgressbar.call(this,e.progressbarFillClass):'<span class="'+e.progressbarFillClass+'"></span>',i.html(s)),"custom"!==e.type&&this.emit("paginationRender",this.pagination.$el[0])}},init:function(){var e=this,t=e.params.pagination;if(t.el){var i=s(t.el);0!==i.length&&(e.params.uniqueNavElements&&"string"==typeof t.el&&i.length>1&&1===e.$el.find(t.el).length&&(i=e.$el.find(t.el)),"bullets"===t.type&&t.clickable&&i.addClass(t.clickableClass),i.addClass(t.modifierClass+t.type),"bullets"===t.type&&t.dynamicBullets&&(i.addClass(""+t.modifierClass+t.type+"-dynamic"),e.pagination.dynamicBulletIndex=0,t.dynamicMainBullets<1&&(t.dynamicMainBullets=1)),"progressbar"===t.type&&t.progressbarOpposite&&i.addClass(t.progressbarOppositeClass),t.clickable&&i.on("click","."+t.bulletClass,function(t){t.preventDefault();var i=s(this).index()*e.params.slidesPerGroup;e.params.loop&&(i+=e.loopedSlides),e.slideTo(i)}),d.extend(e.pagination,{$el:i,el:i[0]}))}},destroy:function(){var e=this.params.pagination;if(e.el&&this.pagination.el&&this.pagination.$el&&0!==this.pagination.$el.length){var t=this.pagination.$el;t.removeClass(e.hiddenClass),t.removeClass(e.modifierClass+e.type),this.pagination.bullets&&this.pagination.bullets.removeClass(e.bulletActiveClass),e.clickable&&t.off("click","."+e.bulletClass)}}},V={setTranslate:function(){if(this.params.scrollbar.el&&this.scrollbar.el){var e=this.scrollbar,t=this.rtlTranslate,i=this.progress,s=e.dragSize,a=e.trackSize,r=e.$dragEl,n=e.$el,o=this.params.scrollbar,l=s,d=(a-s)*i;t?(d=-d)>0?(l=s-d,d=0):-d+s>a&&(l=a+d):d<0?(l=s+d,d=0):d+s>a&&(l=a-d),this.isHorizontal()?(h.transforms3d?r.transform("translate3d("+d+"px, 0, 0)"):r.transform("translateX("+d+"px)"),r[0].style.width=l+"px"):(h.transforms3d?r.transform("translate3d(0px, "+d+"px, 0)"):r.transform("translateY("+d+"px)"),r[0].style.height=l+"px"),o.hide&&(clearTimeout(this.scrollbar.timeout),n[0].style.opacity=1,this.scrollbar.timeout=setTimeout(function(){n[0].style.opacity=0,n.transition(400)},1e3))}},setTransition:function(e){this.params.scrollbar.el&&this.scrollbar.el&&this.scrollbar.$dragEl.transition(e)},updateSize:function(){if(this.params.scrollbar.el&&this.scrollbar.el){var e=this.scrollbar,t=e.$dragEl,i=e.$el;t[0].style.width="",t[0].style.height="";var s,a=this.isHorizontal()?i[0].offsetWidth:i[0].offsetHeight,r=this.size/this.virtualSize,n=r*(a/this.size);s="auto"===this.params.scrollbar.dragSize?a*r:parseInt(this.params.scrollbar.dragSize,10),this.isHorizontal()?t[0].style.width=s+"px":t[0].style.height=s+"px",i[0].style.display=r>=1?"none":"",this.params.scrollbarHide&&(i[0].style.opacity=0),d.extend(e,{trackSize:a,divider:r,moveDivider:n,dragSize:s}),e.$el[this.params.watchOverflow&&this.isLocked?"addClass":"removeClass"](this.params.scrollbar.lockClass)}},setDragPosition:function(e){var t,i=this.scrollbar,s=this.rtlTranslate,a=i.$el,r=i.dragSize,n=i.trackSize;t=((this.isHorizontal()?"touchstart"===e.type||"touchmove"===e.type?e.targetTouches[0].pageX:e.pageX||e.clientX:"touchstart"===e.type||"touchmove"===e.type?e.targetTouches[0].pageY:e.pageY||e.clientY)-a.offset()[this.isHorizontal()?"left":"top"]-r/2)/(n-r),t=Math.max(Math.min(t,1),0),s&&(t=1-t);var o=this.minTranslate()+(this.maxTranslate()-this.minTranslate())*t;this.updateProgress(o),this.setTranslate(o),this.updateActiveIndex(),this.updateSlidesClasses()},onDragStart:function(e){var t=this.params.scrollbar,i=this.scrollbar,s=this.$wrapperEl,a=i.$el,r=i.$dragEl;this.scrollbar.isTouched=!0,e.preventDefault(),e.stopPropagation(),s.transition(100),r.transition(100),i.setDragPosition(e),clearTimeout(this.scrollbar.dragTimeout),a.transition(0),t.hide&&a.css("opacity",1),this.emit("scrollbarDragStart",e)},onDragMove:function(e){var t=this.scrollbar,i=this.$wrapperEl,s=t.$el,a=t.$dragEl;this.scrollbar.isTouched&&(e.preventDefault?e.preventDefault():e.returnValue=!1,t.setDragPosition(e),i.transition(0),s.transition(0),a.transition(0),this.emit("scrollbarDragMove",e))},onDragEnd:function(e){var t=this.params.scrollbar,i=this.scrollbar.$el;this.scrollbar.isTouched&&(this.scrollbar.isTouched=!1,t.hide&&(clearTimeout(this.scrollbar.dragTimeout),this.scrollbar.dragTimeout=d.nextTick(function(){i.css("opacity",0),i.transition(400)},1e3)),this.emit("scrollbarDragEnd",e),t.snapOnRelease&&this.slideToClosest())},enableDraggable:function(){if(this.params.scrollbar.el){var t=this.scrollbar,i=this.touchEvents,s=this.touchEventsDesktop,a=this.params,r=t.$el[0],n=!(!h.passiveListener||!a.passiveListener)&&{passive:!1,capture:!1},o=!(!h.passiveListener||!a.passiveListener)&&{passive:!0,capture:!1};h.touch||!h.pointerEvents&&!h.prefixedPointerEvents?(h.touch&&(r.addEventListener(i.start,this.scrollbar.onDragStart,n),r.addEventListener(i.move,this.scrollbar.onDragMove,n),r.addEventListener(i.end,this.scrollbar.onDragEnd,o)),(a.simulateTouch&&!y.ios&&!y.android||a.simulateTouch&&!h.touch&&y.ios)&&(r.addEventListener("mousedown",this.scrollbar.onDragStart,n),e.addEventListener("mousemove",this.scrollbar.onDragMove,n),e.addEventListener("mouseup",this.scrollbar.onDragEnd,o))):(r.addEventListener(s.start,this.scrollbar.onDragStart,n),e.addEventListener(s.move,this.scrollbar.onDragMove,n),e.addEventListener(s.end,this.scrollbar.onDragEnd,o))}},disableDraggable:function(){if(this.params.scrollbar.el){var t=this.scrollbar,i=this.touchEvents,s=this.touchEventsDesktop,a=this.params,r=t.$el[0],n=!(!h.passiveListener||!a.passiveListener)&&{passive:!1,capture:!1},o=!(!h.passiveListener||!a.passiveListener)&&{passive:!0,capture:!1};h.touch||!h.pointerEvents&&!h.prefixedPointerEvents?(h.touch&&(r.removeEventListener(i.start,this.scrollbar.onDragStart,n),r.removeEventListener(i.move,this.scrollbar.onDragMove,n),r.removeEventListener(i.end,this.scrollbar.onDragEnd,o)),(a.simulateTouch&&!y.ios&&!y.android||a.simulateTouch&&!h.touch&&y.ios)&&(r.removeEventListener("mousedown",this.scrollbar.onDragStart,n),e.removeEventListener("mousemove",this.scrollbar.onDragMove,n),e.removeEventListener("mouseup",this.scrollbar.onDragEnd,o))):(r.removeEventListener(s.start,this.scrollbar.onDragStart,n),e.removeEventListener(s.move,this.scrollbar.onDragMove,n),e.removeEventListener(s.end,this.scrollbar.onDragEnd,o))}},init:function(){if(this.params.scrollbar.el){var e=this.scrollbar,t=this.$el,i=this.params.scrollbar,a=s(i.el);this.params.uniqueNavElements&&"string"==typeof i.el&&a.length>1&&1===t.find(i.el).length&&(a=t.find(i.el));var r=a.find("."+this.params.scrollbar.dragClass);0===r.length&&(r=s('<div class="'+this.params.scrollbar.dragClass+'"></div>'),a.append(r)),d.extend(e,{$el:a,el:a[0],$dragEl:r,dragEl:r[0]}),i.draggable&&e.enableDraggable()}},destroy:function(){this.scrollbar.disableDraggable()}},R={setTransform:function(e,t){var i=this.rtl,a=s(e),r=i?-1:1,n=a.attr("data-swiper-parallax")||"0",o=a.attr("data-swiper-parallax-x"),l=a.attr("data-swiper-parallax-y"),d=a.attr("data-swiper-parallax-scale"),h=a.attr("data-swiper-parallax-opacity");if(o||l?(o=o||"0",l=l||"0"):this.isHorizontal()?(o=n,l="0"):(l=n,o="0"),o=o.indexOf("%")>=0?parseInt(o,10)*t*r+"%":o*t*r+"px",l=l.indexOf("%")>=0?parseInt(l,10)*t+"%":l*t+"px",void 0!==h&&null!==h){var p=h-(h-1)*(1-Math.abs(t));a[0].style.opacity=p}if(void 0===d||null===d)a.transform("translate3d("+o+", "+l+", 0px)");else{var c=d-(d-1)*(1-Math.abs(t));a.transform("translate3d("+o+", "+l+", 0px) scale("+c+")")}},setTranslate:function(){var e=this,t=e.$el,i=e.slides,a=e.progress,r=e.snapGrid;t.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(t,i){e.parallax.setTransform(i,a)}),i.each(function(t,i){var n=i.progress;e.params.slidesPerGroup>1&&"auto"!==e.params.slidesPerView&&(n+=Math.ceil(t/2)-a*(r.length-1)),n=Math.min(Math.max(n,-1),1),s(i).find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(t,i){e.parallax.setTransform(i,n)})})},setTransition:function(e){void 0===e&&(e=this.params.speed);this.$el.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(t,i){var a=s(i),r=parseInt(a.attr("data-swiper-parallax-duration"),10)||e;0===e&&(r=0),a.transition(r)})}},F={getDistanceBetweenTouches:function(e){if(e.targetTouches.length<2)return 1;var t=e.targetTouches[0].pageX,i=e.targetTouches[0].pageY,s=e.targetTouches[1].pageX,a=e.targetTouches[1].pageY;return Math.sqrt(Math.pow(s-t,2)+Math.pow(a-i,2))},onGestureStart:function(e){var t=this.params.zoom,i=this.zoom,a=i.gesture;if(i.fakeGestureTouched=!1,i.fakeGestureMoved=!1,!h.gestures){if("touchstart"!==e.type||"touchstart"===e.type&&e.targetTouches.length<2)return;i.fakeGestureTouched=!0,a.scaleStart=F.getDistanceBetweenTouches(e)}a.$slideEl&&a.$slideEl.length||(a.$slideEl=s(e.target).closest(".swiper-slide"),0===a.$slideEl.length&&(a.$slideEl=this.slides.eq(this.activeIndex)),a.$imageEl=a.$slideEl.find("img, svg, canvas"),a.$imageWrapEl=a.$imageEl.parent("."+t.containerClass),a.maxRatio=a.$imageWrapEl.attr("data-swiper-zoom")||t.maxRatio,0!==a.$imageWrapEl.length)?(a.$imageEl.transition(0),this.zoom.isScaling=!0):a.$imageEl=void 0},onGestureChange:function(e){var t=this.params.zoom,i=this.zoom,s=i.gesture;if(!h.gestures){if("touchmove"!==e.type||"touchmove"===e.type&&e.targetTouches.length<2)return;i.fakeGestureMoved=!0,s.scaleMove=F.getDistanceBetweenTouches(e)}s.$imageEl&&0!==s.$imageEl.length&&(h.gestures?this.zoom.scale=e.scale*i.currentScale:i.scale=s.scaleMove/s.scaleStart*i.currentScale,i.scale>s.maxRatio&&(i.scale=s.maxRatio-1+Math.pow(i.scale-s.maxRatio+1,.5)),i.scale<t.minRatio&&(i.scale=t.minRatio+1-Math.pow(t.minRatio-i.scale+1,.5)),s.$imageEl.transform("translate3d(0,0,0) scale("+i.scale+")"))},onGestureEnd:function(e){var t=this.params.zoom,i=this.zoom,s=i.gesture;if(!h.gestures){if(!i.fakeGestureTouched||!i.fakeGestureMoved)return;if("touchend"!==e.type||"touchend"===e.type&&e.changedTouches.length<2&&!y.android)return;i.fakeGestureTouched=!1,i.fakeGestureMoved=!1}s.$imageEl&&0!==s.$imageEl.length&&(i.scale=Math.max(Math.min(i.scale,s.maxRatio),t.minRatio),s.$imageEl.transition(this.params.speed).transform("translate3d(0,0,0) scale("+i.scale+")"),i.currentScale=i.scale,i.isScaling=!1,1===i.scale&&(s.$slideEl=void 0))},onTouchStart:function(e){var t=this.zoom,i=t.gesture,s=t.image;i.$imageEl&&0!==i.$imageEl.length&&(s.isTouched||(y.android&&e.preventDefault(),s.isTouched=!0,s.touchesStart.x="touchstart"===e.type?e.targetTouches[0].pageX:e.pageX,s.touchesStart.y="touchstart"===e.type?e.targetTouches[0].pageY:e.pageY))},onTouchMove:function(e){var t=this.zoom,i=t.gesture,s=t.image,a=t.velocity;if(i.$imageEl&&0!==i.$imageEl.length&&(this.allowClick=!1,s.isTouched&&i.$slideEl)){s.isMoved||(s.width=i.$imageEl[0].offsetWidth,s.height=i.$imageEl[0].offsetHeight,s.startX=d.getTranslate(i.$imageWrapEl[0],"x")||0,s.startY=d.getTranslate(i.$imageWrapEl[0],"y")||0,i.slideWidth=i.$slideEl[0].offsetWidth,i.slideHeight=i.$slideEl[0].offsetHeight,i.$imageWrapEl.transition(0),this.rtl&&(s.startX=-s.startX,s.startY=-s.startY));var r=s.width*t.scale,n=s.height*t.scale;if(!(r<i.slideWidth&&n<i.slideHeight)){if(s.minX=Math.min(i.slideWidth/2-r/2,0),s.maxX=-s.minX,s.minY=Math.min(i.slideHeight/2-n/2,0),s.maxY=-s.minY,s.touchesCurrent.x="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,s.touchesCurrent.y="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY,!s.isMoved&&!t.isScaling){if(this.isHorizontal()&&(Math.floor(s.minX)===Math.floor(s.startX)&&s.touchesCurrent.x<s.touchesStart.x||Math.floor(s.maxX)===Math.floor(s.startX)&&s.touchesCurrent.x>s.touchesStart.x))return void(s.isTouched=!1);if(!this.isHorizontal()&&(Math.floor(s.minY)===Math.floor(s.startY)&&s.touchesCurrent.y<s.touchesStart.y||Math.floor(s.maxY)===Math.floor(s.startY)&&s.touchesCurrent.y>s.touchesStart.y))return void(s.isTouched=!1)}e.preventDefault(),e.stopPropagation(),s.isMoved=!0,s.currentX=s.touchesCurrent.x-s.touchesStart.x+s.startX,s.currentY=s.touchesCurrent.y-s.touchesStart.y+s.startY,s.currentX<s.minX&&(s.currentX=s.minX+1-Math.pow(s.minX-s.currentX+1,.8)),s.currentX>s.maxX&&(s.currentX=s.maxX-1+Math.pow(s.currentX-s.maxX+1,.8)),s.currentY<s.minY&&(s.currentY=s.minY+1-Math.pow(s.minY-s.currentY+1,.8)),s.currentY>s.maxY&&(s.currentY=s.maxY-1+Math.pow(s.currentY-s.maxY+1,.8)),a.prevPositionX||(a.prevPositionX=s.touchesCurrent.x),a.prevPositionY||(a.prevPositionY=s.touchesCurrent.y),a.prevTime||(a.prevTime=Date.now()),a.x=(s.touchesCurrent.x-a.prevPositionX)/(Date.now()-a.prevTime)/2,a.y=(s.touchesCurrent.y-a.prevPositionY)/(Date.now()-a.prevTime)/2,Math.abs(s.touchesCurrent.x-a.prevPositionX)<2&&(a.x=0),Math.abs(s.touchesCurrent.y-a.prevPositionY)<2&&(a.y=0),a.prevPositionX=s.touchesCurrent.x,a.prevPositionY=s.touchesCurrent.y,a.prevTime=Date.now(),i.$imageWrapEl.transform("translate3d("+s.currentX+"px, "+s.currentY+"px,0)")}}},onTouchEnd:function(){var e=this.zoom,t=e.gesture,i=e.image,s=e.velocity;if(t.$imageEl&&0!==t.$imageEl.length){if(!i.isTouched||!i.isMoved)return i.isTouched=!1,void(i.isMoved=!1);i.isTouched=!1,i.isMoved=!1;var a=300,r=300,n=s.x*a,o=i.currentX+n,l=s.y*r,d=i.currentY+l;0!==s.x&&(a=Math.abs((o-i.currentX)/s.x)),0!==s.y&&(r=Math.abs((d-i.currentY)/s.y));var h=Math.max(a,r);i.currentX=o,i.currentY=d;var p=i.width*e.scale,c=i.height*e.scale;i.minX=Math.min(t.slideWidth/2-p/2,0),i.maxX=-i.minX,i.minY=Math.min(t.slideHeight/2-c/2,0),i.maxY=-i.minY,i.currentX=Math.max(Math.min(i.currentX,i.maxX),i.minX),i.currentY=Math.max(Math.min(i.currentY,i.maxY),i.minY),t.$imageWrapEl.transition(h).transform("translate3d("+i.currentX+"px, "+i.currentY+"px,0)")}},onTransitionEnd:function(){var e=this.zoom,t=e.gesture;t.$slideEl&&this.previousIndex!==this.activeIndex&&(t.$imageEl.transform("translate3d(0,0,0) scale(1)"),t.$imageWrapEl.transform("translate3d(0,0,0)"),t.$slideEl=void 0,t.$imageEl=void 0,t.$imageWrapEl=void 0,e.scale=1,e.currentScale=1)},toggle:function(e){var t=this.zoom;t.scale&&1!==t.scale?t.out():t.in(e)},in:function(e){var t,i,a,r,n,o,l,d,h,p,c,u,v,f,m,g,b=this.zoom,w=this.params.zoom,y=b.gesture,x=b.image;(y.$slideEl||(y.$slideEl=this.clickedSlide?s(this.clickedSlide):this.slides.eq(this.activeIndex),y.$imageEl=y.$slideEl.find("img, svg, canvas"),y.$imageWrapEl=y.$imageEl.parent("."+w.containerClass)),y.$imageEl&&0!==y.$imageEl.length)&&(y.$slideEl.addClass(""+w.zoomedSlideClass),void 0===x.touchesStart.x&&e?(t="touchend"===e.type?e.changedTouches[0].pageX:e.pageX,i="touchend"===e.type?e.changedTouches[0].pageY:e.pageY):(t=x.touchesStart.x,i=x.touchesStart.y),b.scale=y.$imageWrapEl.attr("data-swiper-zoom")||w.maxRatio,b.currentScale=y.$imageWrapEl.attr("data-swiper-zoom")||w.maxRatio,e?(m=y.$slideEl[0].offsetWidth,g=y.$slideEl[0].offsetHeight,a=y.$slideEl.offset().left+m/2-t,r=y.$slideEl.offset().top+g/2-i,l=y.$imageEl[0].offsetWidth,d=y.$imageEl[0].offsetHeight,h=l*b.scale,p=d*b.scale,v=-(c=Math.min(m/2-h/2,0)),f=-(u=Math.min(g/2-p/2,0)),n=a*b.scale,o=r*b.scale,n<c&&(n=c),n>v&&(n=v),o<u&&(o=u),o>f&&(o=f)):(n=0,o=0),y.$imageWrapEl.transition(300).transform("translate3d("+n+"px, "+o+"px,0)"),y.$imageEl.transition(300).transform("translate3d(0,0,0) scale("+b.scale+")"))},out:function(){var e=this.zoom,t=this.params.zoom,i=e.gesture;i.$slideEl||(i.$slideEl=this.clickedSlide?s(this.clickedSlide):this.slides.eq(this.activeIndex),i.$imageEl=i.$slideEl.find("img, svg, canvas"),i.$imageWrapEl=i.$imageEl.parent("."+t.containerClass)),i.$imageEl&&0!==i.$imageEl.length&&(e.scale=1,e.currentScale=1,i.$imageWrapEl.transition(300).transform("translate3d(0,0,0)"),i.$imageEl.transition(300).transform("translate3d(0,0,0) scale(1)"),i.$slideEl.removeClass(""+t.zoomedSlideClass),i.$slideEl=void 0)},enable:function(){var e=this.zoom;if(!e.enabled){e.enabled=!0;var t=!("touchstart"!==this.touchEvents.start||!h.passiveListener||!this.params.passiveListeners)&&{passive:!0,capture:!1};h.gestures?(this.$wrapperEl.on("gesturestart",".swiper-slide",e.onGestureStart,t),this.$wrapperEl.on("gesturechange",".swiper-slide",e.onGestureChange,t),this.$wrapperEl.on("gestureend",".swiper-slide",e.onGestureEnd,t)):"touchstart"===this.touchEvents.start&&(this.$wrapperEl.on(this.touchEvents.start,".swiper-slide",e.onGestureStart,t),this.$wrapperEl.on(this.touchEvents.move,".swiper-slide",e.onGestureChange,t),this.$wrapperEl.on(this.touchEvents.end,".swiper-slide",e.onGestureEnd,t)),this.$wrapperEl.on(this.touchEvents.move,"."+this.params.zoom.containerClass,e.onTouchMove)}},disable:function(){var e=this.zoom;if(e.enabled){this.zoom.enabled=!1;var t=!("touchstart"!==this.touchEvents.start||!h.passiveListener||!this.params.passiveListeners)&&{passive:!0,capture:!1};h.gestures?(this.$wrapperEl.off("gesturestart",".swiper-slide",e.onGestureStart,t),this.$wrapperEl.off("gesturechange",".swiper-slide",e.onGestureChange,t),this.$wrapperEl.off("gestureend",".swiper-slide",e.onGestureEnd,t)):"touchstart"===this.touchEvents.start&&(this.$wrapperEl.off(this.touchEvents.start,".swiper-slide",e.onGestureStart,t),this.$wrapperEl.off(this.touchEvents.move,".swiper-slide",e.onGestureChange,t),this.$wrapperEl.off(this.touchEvents.end,".swiper-slide",e.onGestureEnd,t)),this.$wrapperEl.off(this.touchEvents.move,"."+this.params.zoom.containerClass,e.onTouchMove)}}},W={loadInSlide:function(e,t){void 0===t&&(t=!0);var i=this,a=i.params.lazy;if(void 0!==e&&0!==i.slides.length){var r=i.virtual&&i.params.virtual.enabled?i.$wrapperEl.children("."+i.params.slideClass+'[data-swiper-slide-index="'+e+'"]'):i.slides.eq(e),n=r.find("."+a.elementClass+":not(."+a.loadedClass+"):not(."+a.loadingClass+")");!r.hasClass(a.elementClass)||r.hasClass(a.loadedClass)||r.hasClass(a.loadingClass)||(n=n.add(r[0])),0!==n.length&&n.each(function(e,n){var o=s(n);o.addClass(a.loadingClass);var l=o.attr("data-background"),d=o.attr("data-src"),h=o.attr("data-srcset"),p=o.attr("data-sizes");i.loadImage(o[0],d||l,h,p,!1,function(){if(void 0!==i&&null!==i&&i&&(!i||i.params)&&!i.destroyed){if(l?(o.css("background-image",'url("'+l+'")'),o.removeAttr("data-background")):(h&&(o.attr("srcset",h),o.removeAttr("data-srcset")),p&&(o.attr("sizes",p),o.removeAttr("data-sizes")),d&&(o.attr("src",d),o.removeAttr("data-src"))),o.addClass(a.loadedClass).removeClass(a.loadingClass),r.find("."+a.preloaderClass).remove(),i.params.loop&&t){var e=r.attr("data-swiper-slide-index");if(r.hasClass(i.params.slideDuplicateClass)){var s=i.$wrapperEl.children('[data-swiper-slide-index="'+e+'"]:not(.'+i.params.slideDuplicateClass+")");i.lazy.loadInSlide(s.index(),!1)}else{var n=i.$wrapperEl.children("."+i.params.slideDuplicateClass+'[data-swiper-slide-index="'+e+'"]');i.lazy.loadInSlide(n.index(),!1)}}i.emit("lazyImageReady",r[0],o[0])}}),i.emit("lazyImageLoad",r[0],o[0])})}},load:function(){var e=this,t=e.$wrapperEl,i=e.params,a=e.slides,r=e.activeIndex,n=e.virtual&&i.virtual.enabled,o=i.lazy,l=i.slidesPerView;function d(e){if(n){if(t.children("."+i.slideClass+'[data-swiper-slide-index="'+e+'"]').length)return!0}else if(a[e])return!0;return!1}function h(e){return n?s(e).attr("data-swiper-slide-index"):s(e).index()}if("auto"===l&&(l=0),e.lazy.initialImageLoaded||(e.lazy.initialImageLoaded=!0),e.params.watchSlidesVisibility)t.children("."+i.slideVisibleClass).each(function(t,i){var a=n?s(i).attr("data-swiper-slide-index"):s(i).index();e.lazy.loadInSlide(a)});else if(l>1)for(var p=r;p<r+l;p+=1)d(p)&&e.lazy.loadInSlide(p);else e.lazy.loadInSlide(r);if(o.loadPrevNext)if(l>1||o.loadPrevNextAmount&&o.loadPrevNextAmount>1){for(var c=o.loadPrevNextAmount,u=l,v=Math.min(r+u+Math.max(c,u),a.length),f=Math.max(r-Math.max(u,c),0),m=r+l;m<v;m+=1)d(m)&&e.lazy.loadInSlide(m);for(var g=f;g<r;g+=1)d(g)&&e.lazy.loadInSlide(g)}else{var b=t.children("."+i.slideNextClass);b.length>0&&e.lazy.loadInSlide(h(b));var w=t.children("."+i.slidePrevClass);w.length>0&&e.lazy.loadInSlide(h(w))}}},q={LinearSpline:function(e,t){var i,s,a,r,n,o=function(e,t){for(s=-1,i=e.length;i-s>1;)e[a=i+s>>1]<=t?s=a:i=a;return i};return this.x=e,this.y=t,this.lastIndex=e.length-1,this.interpolate=function(e){return e?(n=o(this.x,e),r=n-1,(e-this.x[r])*(this.y[n]-this.y[r])/(this.x[n]-this.x[r])+this.y[r]):0},this},getInterpolateFunction:function(e){this.controller.spline||(this.controller.spline=this.params.loop?new q.LinearSpline(this.slidesGrid,e.slidesGrid):new q.LinearSpline(this.snapGrid,e.snapGrid))},setTranslate:function(e,t){var i,s,a=this,r=a.controller.control;function n(e){var t=a.rtlTranslate?-a.translate:a.translate;"slide"===a.params.controller.by&&(a.controller.getInterpolateFunction(e),s=-a.controller.spline.interpolate(-t)),s&&"container"!==a.params.controller.by||(i=(e.maxTranslate()-e.minTranslate())/(a.maxTranslate()-a.minTranslate()),s=(t-a.minTranslate())*i+e.minTranslate()),a.params.controller.inverse&&(s=e.maxTranslate()-s),e.updateProgress(s),e.setTranslate(s,a),e.updateActiveIndex(),e.updateSlidesClasses()}if(Array.isArray(r))for(var o=0;o<r.length;o+=1)r[o]!==t&&r[o]instanceof k&&n(r[o]);else r instanceof k&&t!==r&&n(r)},setTransition:function(e,t){var i,s=this,a=s.controller.control;function r(t){t.setTransition(e,s),0!==e&&(t.transitionStart(),t.$wrapperEl.transitionEnd(function(){a&&(t.params.loop&&"slide"===s.params.controller.by&&t.loopFix(),t.transitionEnd())}))}if(Array.isArray(a))for(i=0;i<a.length;i+=1)a[i]!==t&&a[i]instanceof k&&r(a[i]);else a instanceof k&&t!==a&&r(a)}},j={makeElFocusable:function(e){return e.attr("tabIndex","0"),e},addElRole:function(e,t){return e.attr("role",t),e},addElLabel:function(e,t){return e.attr("aria-label",t),e},disableEl:function(e){return e.attr("aria-disabled",!0),e},enableEl:function(e){return e.attr("aria-disabled",!1),e},onEnterKey:function(e){var t=this.params.a11y;if(13===e.keyCode){var i=s(e.target);this.navigation&&this.navigation.$nextEl&&i.is(this.navigation.$nextEl)&&(this.isEnd&&!this.params.loop||this.slideNext(),this.isEnd?this.a11y.notify(t.lastSlideMessage):this.a11y.notify(t.nextSlideMessage)),this.navigation&&this.navigation.$prevEl&&i.is(this.navigation.$prevEl)&&(this.isBeginning&&!this.params.loop||this.slidePrev(),this.isBeginning?this.a11y.notify(t.firstSlideMessage):this.a11y.notify(t.prevSlideMessage)),this.pagination&&i.is("."+this.params.pagination.bulletClass)&&i[0].click()}},notify:function(e){var t=this.a11y.liveRegion;0!==t.length&&(t.html(""),t.html(e))},updateNavigation:function(){if(!this.params.loop){var e=this.navigation,t=e.$nextEl,i=e.$prevEl;i&&i.length>0&&(this.isBeginning?this.a11y.disableEl(i):this.a11y.enableEl(i)),t&&t.length>0&&(this.isEnd?this.a11y.disableEl(t):this.a11y.enableEl(t))}},updatePagination:function(){var e=this,t=e.params.a11y;e.pagination&&e.params.pagination.clickable&&e.pagination.bullets&&e.pagination.bullets.length&&e.pagination.bullets.each(function(i,a){var r=s(a);e.a11y.makeElFocusable(r),e.a11y.addElRole(r,"button"),e.a11y.addElLabel(r,t.paginationBulletMessage.replace(/{{index}}/,r.index()+1))})},init:function(){this.$el.append(this.a11y.liveRegion);var e,t,i=this.params.a11y;this.navigation&&this.navigation.$nextEl&&(e=this.navigation.$nextEl),this.navigation&&this.navigation.$prevEl&&(t=this.navigation.$prevEl),e&&(this.a11y.makeElFocusable(e),this.a11y.addElRole(e,"button"),this.a11y.addElLabel(e,i.nextSlideMessage),e.on("keydown",this.a11y.onEnterKey)),t&&(this.a11y.makeElFocusable(t),this.a11y.addElRole(t,"button"),this.a11y.addElLabel(t,i.prevSlideMessage),t.on("keydown",this.a11y.onEnterKey)),this.pagination&&this.params.pagination.clickable&&this.pagination.bullets&&this.pagination.bullets.length&&this.pagination.$el.on("keydown","."+this.params.pagination.bulletClass,this.a11y.onEnterKey)},destroy:function(){var e,t;this.a11y.liveRegion&&this.a11y.liveRegion.length>0&&this.a11y.liveRegion.remove(),this.navigation&&this.navigation.$nextEl&&(e=this.navigation.$nextEl),this.navigation&&this.navigation.$prevEl&&(t=this.navigation.$prevEl),e&&e.off("keydown",this.a11y.onEnterKey),t&&t.off("keydown",this.a11y.onEnterKey),this.pagination&&this.params.pagination.clickable&&this.pagination.bullets&&this.pagination.bullets.length&&this.pagination.$el.off("keydown","."+this.params.pagination.bulletClass,this.a11y.onEnterKey)}},K={init:function(){if(this.params.history){if(!t.history||!t.history.pushState)return this.params.history.enabled=!1,void(this.params.hashNavigation.enabled=!0);var e=this.history;e.initialized=!0,e.paths=K.getPathValues(),(e.paths.key||e.paths.value)&&(e.scrollToSlide(0,e.paths.value,this.params.runCallbacksOnInit),this.params.history.replaceState||t.addEventListener("popstate",this.history.setHistoryPopState))}},destroy:function(){this.params.history.replaceState||t.removeEventListener("popstate",this.history.setHistoryPopState)},setHistoryPopState:function(){this.history.paths=K.getPathValues(),this.history.scrollToSlide(this.params.speed,this.history.paths.value,!1)},getPathValues:function(){var e=t.location.pathname.slice(1).split("/").filter(function(e){return""!==e}),i=e.length;return{key:e[i-2],value:e[i-1]}},setHistory:function(e,i){if(this.history.initialized&&this.params.history.enabled){var s=this.slides.eq(i),a=K.slugify(s.attr("data-history"));t.location.pathname.includes(e)||(a=e+"/"+a);var r=t.history.state;r&&r.value===a||(this.params.history.replaceState?t.history.replaceState({value:a},null,a):t.history.pushState({value:a},null,a))}},slugify:function(e){return e.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},scrollToSlide:function(e,t,i){if(t)for(var s=0,a=this.slides.length;s<a;s+=1){var r=this.slides.eq(s);if(K.slugify(r.attr("data-history"))===t&&!r.hasClass(this.params.slideDuplicateClass)){var n=r.index();this.slideTo(n,e,i)}}else this.slideTo(0,e,i)}},U={onHashCange:function(){var t=e.location.hash.replace("#","");t!==this.slides.eq(this.activeIndex).attr("data-hash")&&this.slideTo(this.$wrapperEl.children("."+this.params.slideClass+'[data-hash="'+t+'"]').index())},setHash:function(){if(this.hashNavigation.initialized&&this.params.hashNavigation.enabled)if(this.params.hashNavigation.replaceState&&t.history&&t.history.replaceState)t.history.replaceState(null,null,"#"+this.slides.eq(this.activeIndex).attr("data-hash")||"");else{var i=this.slides.eq(this.activeIndex),s=i.attr("data-hash")||i.attr("data-history");e.location.hash=s||""}},init:function(){if(!(!this.params.hashNavigation.enabled||this.params.history&&this.params.history.enabled)){this.hashNavigation.initialized=!0;var i=e.location.hash.replace("#","");if(i)for(var a=0,r=this.slides.length;a<r;a+=1){var n=this.slides.eq(a);if((n.attr("data-hash")||n.attr("data-history"))===i&&!n.hasClass(this.params.slideDuplicateClass)){var o=n.index();this.slideTo(o,0,this.params.runCallbacksOnInit,!0)}}this.params.hashNavigation.watchState&&s(t).on("hashchange",this.hashNavigation.onHashCange)}},destroy:function(){this.params.hashNavigation.watchState&&s(t).off("hashchange",this.hashNavigation.onHashCange)}},_={run:function(){var e=this,t=e.slides.eq(e.activeIndex),i=e.params.autoplay.delay;t.attr("data-swiper-autoplay")&&(i=t.attr("data-swiper-autoplay")||e.params.autoplay.delay),e.autoplay.timeout=d.nextTick(function(){e.params.autoplay.reverseDirection?e.params.loop?(e.loopFix(),e.slidePrev(e.params.speed,!0,!0),e.emit("autoplay")):e.isBeginning?e.params.autoplay.stopOnLastSlide?e.autoplay.stop():(e.slideTo(e.slides.length-1,e.params.speed,!0,!0),e.emit("autoplay")):(e.slidePrev(e.params.speed,!0,!0),e.emit("autoplay")):e.params.loop?(e.loopFix(),e.slideNext(e.params.speed,!0,!0),e.emit("autoplay")):e.isEnd?e.params.autoplay.stopOnLastSlide?e.autoplay.stop():(e.slideTo(0,e.params.speed,!0,!0),e.emit("autoplay")):(e.slideNext(e.params.speed,!0,!0),e.emit("autoplay"))},i)},start:function(){return void 0===this.autoplay.timeout&&(!this.autoplay.running&&(this.autoplay.running=!0,this.emit("autoplayStart"),this.autoplay.run(),!0))},stop:function(){return!!this.autoplay.running&&(void 0!==this.autoplay.timeout&&(this.autoplay.timeout&&(clearTimeout(this.autoplay.timeout),this.autoplay.timeout=void 0),this.autoplay.running=!1,this.emit("autoplayStop"),!0))},pause:function(e){var t=this;t.autoplay.running&&(t.autoplay.paused||(t.autoplay.timeout&&clearTimeout(t.autoplay.timeout),t.autoplay.paused=!0,0!==e&&t.params.autoplay.waitForTransition?t.$wrapperEl.transitionEnd(function(){t&&!t.destroyed&&(t.autoplay.paused=!1,t.autoplay.running?t.autoplay.run():t.autoplay.stop())}):(t.autoplay.paused=!1,t.autoplay.run())))}},Z={setTranslate:function(){for(var e=this.slides,t=0;t<e.length;t+=1){var i=this.slides.eq(t),s=-i[0].swiperSlideOffset;this.params.virtualTranslate||(s-=this.translate);var a=0;this.isHorizontal()||(a=s,s=0);var r=this.params.fadeEffect.crossFade?Math.max(1-Math.abs(i[0].progress),0):1+Math.min(Math.max(i[0].progress,-1),0);i.css({opacity:r}).transform("translate3d("+s+"px, "+a+"px, 0px)")}},setTransition:function(e){var t=this,i=t.slides,s=t.$wrapperEl;if(i.transition(e),t.params.virtualTranslate&&0!==e){var a=!1;i.transitionEnd(function(){if(!a&&t&&!t.destroyed){a=!0,t.animating=!1;for(var e=["webkitTransitionEnd","transitionend"],i=0;i<e.length;i+=1)s.trigger(e[i])}})}}},Q={setTranslate:function(){var e,t=this.$el,i=this.$wrapperEl,a=this.slides,r=this.width,n=this.height,o=this.rtlTranslate,l=this.size,d=this.params.cubeEffect,h=this.isHorizontal(),p=this.virtual&&this.params.virtual.enabled,c=0;d.shadow&&(h?(0===(e=i.find(".swiper-cube-shadow")).length&&(e=s('<div class="swiper-cube-shadow"></div>'),i.append(e)),e.css({height:r+"px"})):0===(e=t.find(".swiper-cube-shadow")).length&&(e=s('<div class="swiper-cube-shadow"></div>'),t.append(e)));for(var u=0;u<a.length;u+=1){var v=a.eq(u),f=u;p&&(f=parseInt(v.attr("data-swiper-slide-index"),10));var m=90*f,g=Math.floor(m/360);o&&(m=-m,g=Math.floor(-m/360));var b=Math.max(Math.min(v[0].progress,1),-1),w=0,y=0,x=0;f%4==0?(w=4*-g*l,x=0):(f-1)%4==0?(w=0,x=4*-g*l):(f-2)%4==0?(w=l+4*g*l,x=l):(f-3)%4==0&&(w=-l,x=3*l+4*l*g),o&&(w=-w),h||(y=w,w=0);var E="rotateX("+(h?0:-m)+"deg) rotateY("+(h?m:0)+"deg) translate3d("+w+"px, "+y+"px, "+x+"px)";if(b<=1&&b>-1&&(c=90*f+90*b,o&&(c=90*-f-90*b)),v.transform(E),d.slideShadows){var T=h?v.find(".swiper-slide-shadow-left"):v.find(".swiper-slide-shadow-top"),C=h?v.find(".swiper-slide-shadow-right"):v.find(".swiper-slide-shadow-bottom");0===T.length&&(T=s('<div class="swiper-slide-shadow-'+(h?"left":"top")+'"></div>'),v.append(T)),0===C.length&&(C=s('<div class="swiper-slide-shadow-'+(h?"right":"bottom")+'"></div>'),v.append(C)),T.length&&(T[0].style.opacity=Math.max(-b,0)),C.length&&(C[0].style.opacity=Math.max(b,0))}}if(i.css({"-webkit-transform-origin":"50% 50% -"+l/2+"px","-moz-transform-origin":"50% 50% -"+l/2+"px","-ms-transform-origin":"50% 50% -"+l/2+"px","transform-origin":"50% 50% -"+l/2+"px"}),d.shadow)if(h)e.transform("translate3d(0px, "+(r/2+d.shadowOffset)+"px, "+-r/2+"px) rotateX(90deg) rotateZ(0deg) scale("+d.shadowScale+")");else{var M=Math.abs(c)-90*Math.floor(Math.abs(c)/90),z=1.5-(Math.sin(2*M*Math.PI/360)/2+Math.cos(2*M*Math.PI/360)/2),k=d.shadowScale,P=d.shadowScale/z,$=d.shadowOffset;e.transform("scale3d("+k+", 1, "+P+") translate3d(0px, "+(n/2+$)+"px, "+-n/2/P+"px) rotateX(-90deg)")}var L=S.isSafari||S.isUiWebView?-l/2:0;i.transform("translate3d(0px,0,"+L+"px) rotateX("+(this.isHorizontal()?0:c)+"deg) rotateY("+(this.isHorizontal()?-c:0)+"deg)")},setTransition:function(e){var t=this.$el;this.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),this.params.cubeEffect.shadow&&!this.isHorizontal()&&t.find(".swiper-cube-shadow").transition(e)}},J={setTranslate:function(){for(var e=this.slides,t=this.rtlTranslate,i=0;i<e.length;i+=1){var a=e.eq(i),r=a[0].progress;this.params.flipEffect.limitRotation&&(r=Math.max(Math.min(a[0].progress,1),-1));var n=-180*r,o=0,l=-a[0].swiperSlideOffset,d=0;if(this.isHorizontal()?t&&(n=-n):(d=l,l=0,o=-n,n=0),a[0].style.zIndex=-Math.abs(Math.round(r))+e.length,this.params.flipEffect.slideShadows){var h=this.isHorizontal()?a.find(".swiper-slide-shadow-left"):a.find(".swiper-slide-shadow-top"),p=this.isHorizontal()?a.find(".swiper-slide-shadow-right"):a.find(".swiper-slide-shadow-bottom");0===h.length&&(h=s('<div class="swiper-slide-shadow-'+(this.isHorizontal()?"left":"top")+'"></div>'),a.append(h)),0===p.length&&(p=s('<div class="swiper-slide-shadow-'+(this.isHorizontal()?"right":"bottom")+'"></div>'),a.append(p)),h.length&&(h[0].style.opacity=Math.max(-r,0)),p.length&&(p[0].style.opacity=Math.max(r,0))}a.transform("translate3d("+l+"px, "+d+"px, 0px) rotateX("+o+"deg) rotateY("+n+"deg)")}},setTransition:function(e){var t=this,i=t.slides,s=t.activeIndex,a=t.$wrapperEl;if(i.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),t.params.virtualTranslate&&0!==e){var r=!1;i.eq(s).transitionEnd(function(){if(!r&&t&&!t.destroyed){r=!0,t.animating=!1;for(var e=["webkitTransitionEnd","transitionend"],i=0;i<e.length;i+=1)a.trigger(e[i])}})}}},ee={setTranslate:function(){for(var e=this.width,t=this.height,i=this.slides,a=this.$wrapperEl,r=this.slidesSizesGrid,n=this.params.coverflowEffect,o=this.isHorizontal(),l=this.translate,d=o?e/2-l:t/2-l,p=o?n.rotate:-n.rotate,c=n.depth,u=0,v=i.length;u<v;u+=1){var f=i.eq(u),m=r[u],g=(d-f[0].swiperSlideOffset-m/2)/m*n.modifier,b=o?p*g:0,w=o?0:p*g,y=-c*Math.abs(g),x=o?0:n.stretch*g,E=o?n.stretch*g:0;Math.abs(E)<.001&&(E=0),Math.abs(x)<.001&&(x=0),Math.abs(y)<.001&&(y=0),Math.abs(b)<.001&&(b=0),Math.abs(w)<.001&&(w=0);var T="translate3d("+E+"px,"+x+"px,"+y+"px) rotateX("+w+"deg) rotateY("+b+"deg)";if(f.transform(T),f[0].style.zIndex=1-Math.abs(Math.round(g)),n.slideShadows){var S=o?f.find(".swiper-slide-shadow-left"):f.find(".swiper-slide-shadow-top"),C=o?f.find(".swiper-slide-shadow-right"):f.find(".swiper-slide-shadow-bottom");0===S.length&&(S=s('<div class="swiper-slide-shadow-'+(o?"left":"top")+'"></div>'),f.append(S)),0===C.length&&(C=s('<div class="swiper-slide-shadow-'+(o?"right":"bottom")+'"></div>'),f.append(C)),S.length&&(S[0].style.opacity=g>0?g:0),C.length&&(C[0].style.opacity=-g>0?-g:0)}}(h.pointerEvents||h.prefixedPointerEvents)&&(a[0].style.perspectiveOrigin=d+"px 50%")},setTransition:function(e){this.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e)}},te=[P,$,L,I,O,G,N,{name:"mousewheel",params:{mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarged:"container"}},create:function(){d.extend(this,{mousewheel:{enabled:!1,enable:B.enable.bind(this),disable:B.disable.bind(this),handle:B.handle.bind(this),handleMouseEnter:B.handleMouseEnter.bind(this),handleMouseLeave:B.handleMouseLeave.bind(this),lastScrollTime:d.now()}})},on:{init:function(){this.params.mousewheel.enabled&&this.mousewheel.enable()},destroy:function(){this.mousewheel.enabled&&this.mousewheel.disable()}}},{name:"navigation",params:{navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock"}},create:function(){d.extend(this,{navigation:{init:X.init.bind(this),update:X.update.bind(this),destroy:X.destroy.bind(this)}})},on:{init:function(){this.navigation.init(),this.navigation.update()},toEdge:function(){this.navigation.update()},fromEdge:function(){this.navigation.update()},destroy:function(){this.navigation.destroy()},click:function(e){var t=this.navigation,i=t.$nextEl,a=t.$prevEl;!this.params.navigation.hideOnClick||s(e.target).is(a)||s(e.target).is(i)||(i&&i.toggleClass(this.params.navigation.hiddenClass),a&&a.toggleClass(this.params.navigation.hiddenClass))}}},{name:"pagination",params:{pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,bulletClass:"swiper-pagination-bullet",bulletActiveClass:"swiper-pagination-bullet-active",modifierClass:"swiper-pagination-",currentClass:"swiper-pagination-current",totalClass:"swiper-pagination-total",hiddenClass:"swiper-pagination-hidden",progressbarFillClass:"swiper-pagination-progressbar-fill",progressbarOppositeClass:"swiper-pagination-progressbar-opposite",clickableClass:"swiper-pagination-clickable",lockClass:"swiper-pagination-lock"}},create:function(){d.extend(this,{pagination:{init:Y.init.bind(this),render:Y.render.bind(this),update:Y.update.bind(this),destroy:Y.destroy.bind(this),dynamicBulletIndex:0}})},on:{init:function(){this.pagination.init(),this.pagination.render(),this.pagination.update()},activeIndexChange:function(){this.params.loop?this.pagination.update():void 0===this.snapIndex&&this.pagination.update()},snapIndexChange:function(){this.params.loop||this.pagination.update()},slidesLengthChange:function(){this.params.loop&&(this.pagination.render(),this.pagination.update())},snapGridLengthChange:function(){this.params.loop||(this.pagination.render(),this.pagination.update())},destroy:function(){this.pagination.destroy()},click:function(e){this.params.pagination.el&&this.params.pagination.hideOnClick&&this.pagination.$el.length>0&&!s(e.target).hasClass(this.params.pagination.bulletClass)&&this.pagination.$el.toggleClass(this.params.pagination.hiddenClass)}}},{name:"scrollbar",params:{scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag"}},create:function(){d.extend(this,{scrollbar:{init:V.init.bind(this),destroy:V.destroy.bind(this),updateSize:V.updateSize.bind(this),setTranslate:V.setTranslate.bind(this),setTransition:V.setTransition.bind(this),enableDraggable:V.enableDraggable.bind(this),disableDraggable:V.disableDraggable.bind(this),setDragPosition:V.setDragPosition.bind(this),onDragStart:V.onDragStart.bind(this),onDragMove:V.onDragMove.bind(this),onDragEnd:V.onDragEnd.bind(this),isTouched:!1,timeout:null,dragTimeout:null}})},on:{init:function(){this.scrollbar.init(),this.scrollbar.updateSize(),this.scrollbar.setTranslate()},update:function(){this.scrollbar.updateSize()},resize:function(){this.scrollbar.updateSize()},observerUpdate:function(){this.scrollbar.updateSize()},setTranslate:function(){this.scrollbar.setTranslate()},setTransition:function(e){this.scrollbar.setTransition(e)},destroy:function(){this.scrollbar.destroy()}}},{name:"parallax",params:{parallax:{enabled:!1}},create:function(){d.extend(this,{parallax:{setTransform:R.setTransform.bind(this),setTranslate:R.setTranslate.bind(this),setTransition:R.setTransition.bind(this)}})},on:{beforeInit:function(){this.params.parallax.enabled&&(this.params.watchSlidesProgress=!0)},init:function(){this.params.parallax&&this.parallax.setTranslate()},setTranslate:function(){this.params.parallax&&this.parallax.setTranslate()},setTransition:function(e){this.params.parallax&&this.parallax.setTransition(e)}}},{name:"zoom",params:{zoom:{enabled:!1,maxRatio:3,minRatio:1,toggle:!0,containerClass:"swiper-zoom-container",zoomedSlideClass:"swiper-slide-zoomed"}},create:function(){var e=this,t={enabled:!1,scale:1,currentScale:1,isScaling:!1,gesture:{$slideEl:void 0,slideWidth:void 0,slideHeight:void 0,$imageEl:void 0,$imageWrapEl:void 0,maxRatio:3},image:{isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},velocity:{x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0}};"onGestureStart onGestureChange onGestureEnd onTouchStart onTouchMove onTouchEnd onTransitionEnd toggle enable disable in out".split(" ").forEach(function(i){t[i]=F[i].bind(e)}),d.extend(e,{zoom:t})},on:{init:function(){this.params.zoom.enabled&&this.zoom.enable()},destroy:function(){this.zoom.disable()},touchStart:function(e){this.zoom.enabled&&this.zoom.onTouchStart(e)},touchEnd:function(e){this.zoom.enabled&&this.zoom.onTouchEnd(e)},doubleTap:function(e){this.params.zoom.enabled&&this.zoom.enabled&&this.params.zoom.toggle&&this.zoom.toggle(e)},transitionEnd:function(){this.zoom.enabled&&this.params.zoom.enabled&&this.zoom.onTransitionEnd()}}},{name:"lazy",params:{lazy:{enabled:!1,loadPrevNext:!1,loadPrevNextAmount:1,loadOnTransitionStart:!1,elementClass:"swiper-lazy",loadingClass:"swiper-lazy-loading",loadedClass:"swiper-lazy-loaded",preloaderClass:"swiper-lazy-preloader"}},create:function(){d.extend(this,{lazy:{initialImageLoaded:!1,load:W.load.bind(this),loadInSlide:W.loadInSlide.bind(this)}})},on:{beforeInit:function(){this.params.lazy.enabled&&this.params.preloadImages&&(this.params.preloadImages=!1)},init:function(){this.params.lazy.enabled&&!this.params.loop&&0===this.params.initialSlide&&this.lazy.load()},scroll:function(){this.params.freeMode&&!this.params.freeModeSticky&&this.lazy.load()},resize:function(){this.params.lazy.enabled&&this.lazy.load()},scrollbarDragMove:function(){this.params.lazy.enabled&&this.lazy.load()},transitionStart:function(){this.params.lazy.enabled&&(this.params.lazy.loadOnTransitionStart||!this.params.lazy.loadOnTransitionStart&&!this.lazy.initialImageLoaded)&&this.lazy.load()},transitionEnd:function(){this.params.lazy.enabled&&!this.params.lazy.loadOnTransitionStart&&this.lazy.load()}}},{name:"controller",params:{controller:{control:void 0,inverse:!1,by:"slide"}},create:function(){d.extend(this,{controller:{control:this.params.controller.control,getInterpolateFunction:q.getInterpolateFunction.bind(this),setTranslate:q.setTranslate.bind(this),setTransition:q.setTransition.bind(this)}})},on:{update:function(){this.controller.control&&this.controller.spline&&(this.controller.spline=void 0,delete this.controller.spline)},resize:function(){this.controller.control&&this.controller.spline&&(this.controller.spline=void 0,delete this.controller.spline)},observerUpdate:function(){this.controller.control&&this.controller.spline&&(this.controller.spline=void 0,delete this.controller.spline)},setTranslate:function(e,t){this.controller.control&&this.controller.setTranslate(e,t)},setTransition:function(e,t){this.controller.control&&this.controller.setTransition(e,t)}}},{name:"a11y",params:{a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}"}},create:function(){var e=this;d.extend(e,{a11y:{liveRegion:s('<span class="'+e.params.a11y.notificationClass+'" aria-live="assertive" aria-atomic="true"></span>')}}),Object.keys(j).forEach(function(t){e.a11y[t]=j[t].bind(e)})},on:{init:function(){this.params.a11y.enabled&&(this.a11y.init(),this.a11y.updateNavigation())},toEdge:function(){this.params.a11y.enabled&&this.a11y.updateNavigation()},fromEdge:function(){this.params.a11y.enabled&&this.a11y.updateNavigation()},paginationUpdate:function(){this.params.a11y.enabled&&this.a11y.updatePagination()},destroy:function(){this.params.a11y.enabled&&this.a11y.destroy()}}},{name:"history",params:{history:{enabled:!1,replaceState:!1,key:"slides"}},create:function(){d.extend(this,{history:{init:K.init.bind(this),setHistory:K.setHistory.bind(this),setHistoryPopState:K.setHistoryPopState.bind(this),scrollToSlide:K.scrollToSlide.bind(this),destroy:K.destroy.bind(this)}})},on:{init:function(){this.params.history.enabled&&this.history.init()},destroy:function(){this.params.history.enabled&&this.history.destroy()},transitionEnd:function(){this.history.initialized&&this.history.setHistory(this.params.history.key,this.activeIndex)}}},{name:"hash-navigation",params:{hashNavigation:{enabled:!1,replaceState:!1,watchState:!1}},create:function(){d.extend(this,{hashNavigation:{initialized:!1,init:U.init.bind(this),destroy:U.destroy.bind(this),setHash:U.setHash.bind(this),onHashCange:U.onHashCange.bind(this)}})},on:{init:function(){this.params.hashNavigation.enabled&&this.hashNavigation.init()},destroy:function(){this.params.hashNavigation.enabled&&this.hashNavigation.destroy()},transitionEnd:function(){this.hashNavigation.initialized&&this.hashNavigation.setHash()}}},{name:"autoplay",params:{autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!0,stopOnLastSlide:!1,reverseDirection:!1}},create:function(){d.extend(this,{autoplay:{running:!1,paused:!1,run:_.run.bind(this),start:_.start.bind(this),stop:_.stop.bind(this),pause:_.pause.bind(this)}})},on:{init:function(){this.params.autoplay.enabled&&this.autoplay.start()},beforeTransitionStart:function(e,t){this.autoplay.running&&(t||!this.params.autoplay.disableOnInteraction?this.autoplay.pause(e):this.autoplay.stop())},sliderFirstMove:function(){this.autoplay.running&&(this.params.autoplay.disableOnInteraction?this.autoplay.stop():this.autoplay.pause())},destroy:function(){this.autoplay.running&&this.autoplay.stop()}}},{name:"effect-fade",params:{fadeEffect:{crossFade:!1}},create:function(){d.extend(this,{fadeEffect:{setTranslate:Z.setTranslate.bind(this),setTransition:Z.setTransition.bind(this)}})},on:{beforeInit:function(){if("fade"===this.params.effect){this.classNames.push(this.params.containerModifierClass+"fade");var e={slidesPerView:1,slidesPerColumn:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!0};d.extend(this.params,e),d.extend(this.originalParams,e)}},setTranslate:function(){"fade"===this.params.effect&&this.fadeEffect.setTranslate()},setTransition:function(e){"fade"===this.params.effect&&this.fadeEffect.setTransition(e)}}},{name:"effect-cube",params:{cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}},create:function(){d.extend(this,{cubeEffect:{setTranslate:Q.setTranslate.bind(this),setTransition:Q.setTransition.bind(this)}})},on:{beforeInit:function(){if("cube"===this.params.effect){this.classNames.push(this.params.containerModifierClass+"cube"),this.classNames.push(this.params.containerModifierClass+"3d");var e={slidesPerView:1,slidesPerColumn:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0};d.extend(this.params,e),d.extend(this.originalParams,e)}},setTranslate:function(){"cube"===this.params.effect&&this.cubeEffect.setTranslate()},setTransition:function(e){"cube"===this.params.effect&&this.cubeEffect.setTransition(e)}}},{name:"effect-flip",params:{flipEffect:{slideShadows:!0,limitRotation:!0}},create:function(){d.extend(this,{flipEffect:{setTranslate:J.setTranslate.bind(this),setTransition:J.setTransition.bind(this)}})},on:{beforeInit:function(){if("flip"===this.params.effect){this.classNames.push(this.params.containerModifierClass+"flip"),this.classNames.push(this.params.containerModifierClass+"3d");var e={slidesPerView:1,slidesPerColumn:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!0};d.extend(this.params,e),d.extend(this.originalParams,e)}},setTranslate:function(){"flip"===this.params.effect&&this.flipEffect.setTranslate()},setTransition:function(e){"flip"===this.params.effect&&this.flipEffect.setTransition(e)}}},{name:"effect-coverflow",params:{coverflowEffect:{rotate:50,stretch:0,depth:100,modifier:1,slideShadows:!0}},create:function(){d.extend(this,{coverflowEffect:{setTranslate:ee.setTranslate.bind(this),setTransition:ee.setTransition.bind(this)}})},on:{beforeInit:function(){"coverflow"===this.params.effect&&(this.classNames.push(this.params.containerModifierClass+"coverflow"),this.classNames.push(this.params.containerModifierClass+"3d"),this.params.watchSlidesProgress=!0,this.originalParams.watchSlidesProgress=!0)},setTranslate:function(){"coverflow"===this.params.effect&&this.coverflowEffect.setTranslate()},setTransition:function(e){"coverflow"===this.params.effect&&this.coverflowEffect.setTransition(e)}}}];return void 0===k.use&&(k.use=k.Class.use,k.installModule=k.Class.installModule),k.use(te),k});
  320. //# sourceMappingURL=swiper.min.js.map
  321. /* jQuery Parallax
  322. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  323. /*
  324. Plugin: jQuery Parallax
  325. Version 1.1.3
  326. Author: Ian Lunn
  327. Twitter: @IanLunn
  328. Author URL: http://www.ianlunn.co.uk/
  329. Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/
  330. Dual licensed under the MIT and GPL licenses:
  331. http://www.opensource.org/licenses/mit-license.php
  332. http://www.gnu.org/licenses/gpl.html
  333. */
  334. (function( jQuery ){
  335. var jQuerywindow = jQuery(window);
  336. var windowHeight = jQuerywindow.height();
  337. jQuerywindow.resize(function () {
  338. windowHeight = jQuerywindow.height();
  339. });
  340. jQuery.fn.parallax = function(xpos, speedFactor, outerHeight) {
  341. var jQuerythis = jQuery(this);
  342. var getHeight;
  343. var firstTop;
  344. var paddingTop = 0;
  345. //get the starting position of each element to have parallax applied to it
  346. jQuerythis.each(function(){
  347. firstTop = jQuerythis.offset().top;
  348. });
  349. if (outerHeight) {
  350. getHeight = function(jqo) {
  351. return jqo.outerHeight(true);
  352. };
  353. } else {
  354. getHeight = function(jqo) {
  355. return jqo.height();
  356. };
  357. }
  358. // setup defaults if arguments aren't specified
  359. if (arguments.length < 1 || xpos === null) xpos = "50%";
  360. if (arguments.length < 2 || speedFactor === null) speedFactor = 0.1;
  361. if (arguments.length < 3 || outerHeight === null) outerHeight = true;
  362. // function to be called whenever the window is scrolled or resized
  363. function update(){
  364. var pos = jQuerywindow.scrollTop();
  365. jQuerythis.each(function(){
  366. var jQueryelement = jQuery(this);
  367. var top = jQueryelement.offset().top;
  368. var height = getHeight(jQueryelement);
  369. // Check if totally above or totally below viewport
  370. if (top + height < pos || top > pos + windowHeight) {
  371. return;
  372. }
  373. jQuerythis.css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px");
  374. });
  375. }
  376. jQuerywindow.bind('scroll', update).resize(update);
  377. update();
  378. };
  379. })(jQuery);
  380. /* Slick 1.6.0
  381. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  382. /* _ _ _ _
  383. ___| (_) ___| | __ (_)___
  384. / __| | |/ __| |/ / | / __|
  385. \__ \ | | (__| < _ | \__ \
  386. |___/_|_|\___|_|\_(_)/ |___/
  387. |__/
  388. Version: 1.6.0
  389. */
  390. /* global window, document, define, jQuery, setInterval, clearInterval */
  391. !function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};e=function(){function e(e,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(e),appendDots:i(e),arrows:!0,asNavFor:null,prevArrow:'<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',nextArrow:'<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button" data-role="none" role="button" tabindex="0" />').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(e),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(e).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,"undefined"!=typeof document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=t++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}var t=0;return e}(),e.prototype.activateADA=function(){var i=this;i.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},e.prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(0>t||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):o===!0?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr("data-slick-index",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&i.options.adaptiveHeight===!0&&i.options.vertical===!1){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),s.options.rtl===!0&&s.options.vertical===!1&&(e=-e),s.transformsEnabled===!1?s.options.vertical===!1?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):s.cssTransitions===!1?(s.options.rtl===!0&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),s.options.vertical===!1?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),s.options.vertical===!1?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this,t=e.options.asNavFor;return t&&null!==t&&(t=i(t).not(e.$slider)),t},e.prototype.asNavFor=function(e){var t=this,o=t.getNavTarget();null!==o&&"object"==typeof o&&o.each(function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};e.options.fade===!1?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,e.options.fade===!1?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){var i=this;i.autoPlayTimer&&clearInterval(i.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(i.options.infinite===!1&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1===0&&(i.direction=1))),i.slideHandler(e))},e.prototype.buildArrows=function(){var e=this;e.options.arrows===!0&&(e.$prevArrow=i(e.options.prevArrow).addClass("slick-arrow"),e.$nextArrow=i(e.options.nextArrow).addClass("slick-arrow"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),e.options.infinite!==!0&&e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},e.prototype.buildDots=function(){var e,t,o=this;if(o.options.dots===!0&&o.slideCount>o.options.slidesToShow){for(o.$slider.addClass("slick-dotted"),t=i("<ul />").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i("<li />").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active").attr("aria-hidden","false")}},e.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+":not(.slick-cloned)").addClass("slick-slide"),e.slideCount=e.$slides.length,e.$slides.each(function(e,t){i(t).attr("data-slick-index",e).data("originalStyling",i(t).attr("style")||"")}),e.$slider.addClass("slick-slider"),e.$slideTrack=0===e.slideCount?i('<div class="slick-track"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class="slick-track"/>').parent(),e.$list=e.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent(),e.$slideTrack.css("opacity",0),(e.options.centerMode===!0||e.options.swipeToSlide===!0)&&(e.options.slidesToScroll=1),i("img[data-lazy]",e.$slider).not("[src]").addClass("slick-loading"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.options.draggable===!0&&e.$list.addClass("draggable")},e.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.options.rows>1){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;s>i;i++){var a=document.createElement("div");for(e=0;e<l.options.rows;e++){var d=document.createElement("div");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&d.appendChild(n.get(c))}a.appendChild(d)}o.appendChild(a)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+"%",display:"inline-block"})}},e.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,a=r.$slider.width(),d=window.innerWidth||i(window).width();if("window"===r.respondTo?n=d:"slider"===r.respondTo?n=a:"min"===r.respondTo&&(n=Math.min(d,a)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){s=null;for(o in r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(r.originalSettings.mobileFirst===!1?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||l===!1||r.$slider.trigger("breakpoint",[r,l])}},e.prototype.changeSlide=function(e,t){var o,s,n,r=this,l=i(e.currentTarget);switch(l.is("a")&&e.preventDefault(),l.is("li")||(l=l.closest("li")),n=r.slideCount%r.options.slidesToScroll!==0,o=n?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,e.data.message){case"previous":s=0===o?r.options.slidesToScroll:r.options.slidesToShow-o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-s,!1,t);break;case"next":s=0===o?r.options.slidesToScroll:o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+s,!1,t);break;case"index":var a=0===e.data.index?0:e.data.index||l.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(a),!1,t),l.children().trigger("focus");break;default:return}},e.prototype.checkNavigable=function(i){var e,t,o=this;if(e=o.getNavigableIndexes(),t=0,i>e[e.length-1])i=e[e.length-1];else for(var s in e){if(i<e[s]){i=t;break}t=e[s]}return i},e.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&i("li",e.$dots).off("click.slick",e.changeSlide).off("mouseenter.slick",i.proxy(e.interrupt,e,!0)).off("mouseleave.slick",i.proxy(e.interrupt,e,!1)),e.$slider.off("focus.slick blur.slick"),e.options.arrows===!0&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off("click.slick",e.changeSlide),e.$nextArrow&&e.$nextArrow.off("click.slick",e.changeSlide)),e.$list.off("touchstart.slick mousedown.slick",e.swipeHandler),e.$list.off("touchmove.slick mousemove.slick",e.swipeHandler),e.$list.off("touchend.slick mouseup.slick",e.swipeHandler),e.$list.off("touchcancel.slick mouseleave.slick",e.swipeHandler),e.$list.off("click.slick",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),e.options.accessibility===!0&&e.$list.off("keydown.slick",e.keyHandler),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().off("click.slick",e.selectHandler),i(window).off("orientationchange.slick.slick-"+e.instanceUid,e.orientationChange),i(window).off("resize.slick.slick-"+e.instanceUid,e.resize),i("[draggable!=true]",e.$slideTrack).off("dragstart",e.preventDefault),i(window).off("load.slick.slick-"+e.instanceUid,e.setPosition),i(document).off("ready.slick.slick-"+e.instanceUid,e.setPosition)},e.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.off("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>1&&(i=e.$slides.children().children(),i.removeAttr("style"),e.$slider.empty().append(i))},e.prototype.clickHandler=function(i){var e=this;e.shouldClick===!1&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(".slick-cloned",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$slider.removeClass("slick-dotted"),t.unslicked=!0,e||t.$slider.trigger("destroy",[t])},e.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]="",e.options.fade===!1?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.fadeSlide=function(i,e){var t=this;t.cssTransitions===!1?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},e.prototype.fadeSlideOut=function(i){var e=this;e.cssTransitions===!1?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},e.prototype.focusHandler=function(){var e=this;e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*:not(.slick-arrow)",function(t){t.stopImmediatePropagation();var o=i(this);setTimeout(function(){e.options.pauseOnFocus&&(e.focussed=o.is(":focus"),e.autoPlay())},0)})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){var i=this;return i.currentSlide},e.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(i.options.infinite===!0)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(i.options.centerMode===!0)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},e.prototype.getLeft=function(i){var e,t,o,s=this,n=0;return s.slideOffset=0,t=s.$slides.first().outerHeight(!0),s.options.infinite===!0?(s.slideCount>s.options.slidesToShow&&(s.slideOffset=s.slideWidth*s.options.slidesToShow*-1,n=t*s.options.slidesToShow*-1),s.slideCount%s.options.slidesToScroll!==0&&i+s.options.slidesToScroll>s.slideCount&&s.slideCount>s.options.slidesToShow&&(i>s.slideCount?(s.slideOffset=(s.options.slidesToShow-(i-s.slideCount))*s.slideWidth*-1,n=(s.options.slidesToShow-(i-s.slideCount))*t*-1):(s.slideOffset=s.slideCount%s.options.slidesToScroll*s.slideWidth*-1,n=s.slideCount%s.options.slidesToScroll*t*-1))):i+s.options.slidesToShow>s.slideCount&&(s.slideOffset=(i+s.options.slidesToShow-s.slideCount)*s.slideWidth,n=(i+s.options.slidesToShow-s.slideCount)*t),s.slideCount<=s.options.slidesToShow&&(s.slideOffset=0,n=0),s.options.centerMode===!0&&s.options.infinite===!0?s.slideOffset+=s.slideWidth*Math.floor(s.options.slidesToShow/2)-s.slideWidth:s.options.centerMode===!0&&(s.slideOffset=0,s.slideOffset+=s.slideWidth*Math.floor(s.options.slidesToShow/2)),e=s.options.vertical===!1?i*s.slideWidth*-1+s.slideOffset:i*t*-1+n,s.options.variableWidth===!0&&(o=s.slideCount<=s.options.slidesToShow||s.options.infinite===!1?s.$slideTrack.children(".slick-slide").eq(i):s.$slideTrack.children(".slick-slide").eq(i+s.options.slidesToShow),e=s.options.rtl===!0?o[0]?-1*(s.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,s.options.centerMode===!0&&(o=s.slideCount<=s.options.slidesToShow||s.options.infinite===!1?s.$slideTrack.children(".slick-slide").eq(i):s.$slideTrack.children(".slick-slide").eq(i+s.options.slidesToShow+1),e=s.options.rtl===!0?o[0]?-1*(s.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,e+=(s.$list.width()-o.outerWidth())/2)),e},e.prototype.getOption=e.prototype.slickGetOption=function(i){var e=this;return e.options[i]},e.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(e.options.infinite===!1?i=e.slideCount:(t=-1*e.options.slidesToScroll,o=-1*e.options.slidesToScroll,i=2*e.slideCount);i>t;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var e,t,o,s=this;return o=s.options.centerMode===!0?s.slideWidth*Math.floor(s.options.slidesToShow/2):0,s.options.swipeToSlide===!0?(s.$slideTrack.find(".slick-slide").each(function(e,n){return n.offsetLeft-o+i(n).outerWidth()/2>-1*s.swipeLeft?(t=n,!1):void 0}),e=Math.abs(i(t).attr("data-slick-index")-s.currentSlide)||1):s.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,e){var t=this;t.changeSlide({data:{message:"index",index:parseInt(i)}},e)},e.prototype.init=function(e){var t=this;i(t.$slider).hasClass("slick-initialized")||(i(t.$slider).addClass("slick-initialized"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger("init",[t]),t.options.accessibility===!0&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},e.prototype.initADA=function(){var e=this;e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),e.$slideTrack.attr("role","listbox"),e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function(t){i(this).attr({role:"option","aria-describedby":"slick-slide"+e.instanceUid+t})}),null!==e.$dots&&e.$dots.attr("role","tablist").find("li").each(function(t){i(this).attr({role:"presentation","aria-selected":"false","aria-controls":"navigation"+e.instanceUid+t,id:"slick-slide"+e.instanceUid+t})}).first().attr("aria-selected","true").end().find("button").attr("role","button").end().closest("div").attr("role","toolbar"),e.activateADA()},e.prototype.initArrowEvents=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide))},e.prototype.initDotEvents=function(){var e=this;e.options.dots===!0&&e.slideCount>e.options.slidesToShow&&i("li",e.$dots).on("click.slick",{message:"index"},e.changeSlide),e.options.dots===!0&&e.options.pauseOnDotsHover===!0&&i("li",e.$dots).on("mouseenter.slick",i.proxy(e.interrupt,e,!0)).on("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.on("mouseleave.slick",i.proxy(e.interrupt,e,!1)))},e.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on("touchstart.slick mousedown.slick",{action:"start"},e.swipeHandler),e.$list.on("touchmove.slick mousemove.slick",{action:"move"},e.swipeHandler),e.$list.on("touchend.slick mouseup.slick",{action:"end"},e.swipeHandler),e.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},e.swipeHandler),e.$list.on("click.slick",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),e.options.accessibility===!0&&e.$list.on("keydown.slick",e.keyHandler),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),i(window).on("orientationchange.slick.slick-"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on("resize.slick.slick-"+e.instanceUid,i.proxy(e.resize,e)),i("[draggable!=true]",e.$slideTrack).on("dragstart",e.preventDefault),i(window).on("load.slick.slick-"+e.instanceUid,e.setPosition),i(document).on("ready.slick.slick-"+e.instanceUid,e.setPosition)},e.prototype.initUI=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),i.options.dots===!0&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},e.prototype.keyHandler=function(i){var e=this;i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&e.options.accessibility===!0?e.changeSlide({data:{message:e.options.rtl===!0?"next":"previous"}}):39===i.keyCode&&e.options.accessibility===!0&&e.changeSlide({data:{message:e.options.rtl===!0?"previous":"next"}}))},e.prototype.lazyLoad=function(){function e(e){i("img[data-lazy]",e).each(function(){var e=i(this),t=i(this).attr("data-lazy"),o=document.createElement("img");o.onload=function(){e.animate({opacity:0},100,function(){e.attr("src",t).animate({opacity:1},200,function(){e.removeAttr("data-lazy").removeClass("slick-loading")}),r.$slider.trigger("lazyLoaded",[r,e,t])})},o.onerror=function(){e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),r.$slider.trigger("lazyLoadError",[r,e,t])},o.src=t})}var t,o,s,n,r=this;r.options.centerMode===!0?r.options.infinite===!0?(s=r.currentSlide+(r.options.slidesToShow/2+1),n=s+r.options.slidesToShow+2):(s=Math.max(0,r.currentSlide-(r.options.slidesToShow/2+1)),n=2+(r.options.slidesToShow/2+1)+r.currentSlide):(s=r.options.infinite?r.options.slidesToShow+r.currentSlide:r.currentSlide,n=Math.ceil(s+r.options.slidesToShow),r.options.fade===!0&&(s>0&&s--,n<=r.slideCount&&n++)),t=r.$slider.find(".slick-slide").slice(s,n),e(t),r.slideCount<=r.options.slidesToShow?(o=r.$slider.find(".slick-slide"),e(o)):r.currentSlide>=r.slideCount-r.options.slidesToShow?(o=r.$slider.find(".slick-cloned").slice(0,r.options.slidesToShow),e(o)):0===r.currentSlide&&(o=r.$slider.find(".slick-cloned").slice(-1*r.options.slidesToShow),e(o))},e.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){var i=this;i.changeSlide({data:{message:"next"}})},e.prototype.orientationChange=function(){var i=this;i.checkResponsive(),i.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(i){var e=this;e.unslicked||(e.$slider.trigger("afterChange",[e,i]),e.animating=!1,e.setPosition(),e.swipeLeft=null,e.options.autoplay&&e.autoPlay(),e.options.accessibility===!0&&e.initADA())},e.prototype.prev=e.prototype.slickPrev=function(){var i=this;i.changeSlide({data:{message:"previous"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n=this,r=i("img[data-lazy]",n.$slider);r.length?(t=r.first(),o=t.attr("data-lazy"),s=document.createElement("img"),s.onload=function(){t.attr("src",o).removeAttr("data-lazy").removeClass("slick-loading"),n.options.adaptiveHeight===!0&&n.setPosition(),n.$slider.trigger("lazyLoaded",[n,t,o]),n.progressiveLazyLoad()},s.onerror=function(){3>e?setTimeout(function(){n.progressiveLazyLoad(e+1)},500):(t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,t,o]),n.progressiveLazyLoad())},s.src=o):n.$slider.trigger("allImagesLoaded",[n])},e.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:"index",index:t}},!1)},e.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if("array"===i.type(n)&&n.length){s.respondTo=s.options.respondTo||"window";for(e in n)if(o=s.breakpoints.length-1,t=n[e].breakpoint,n.hasOwnProperty(e)){for(;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort(function(i,e){return s.options.mobileFirst?i-e:e-i})}},e.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass("slick-slide"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger("reInit",[e])},e.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout(function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,e,t){var o=this;return"boolean"==typeof i?(e=i,i=e===!0?0:o.slideCount-1):i=e===!0?--i:i,o.slideCount<1||0>i||i>o.slideCount-1?!1:(o.unload(),t===!0?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,void o.reinit())},e.prototype.setCSS=function(i){var e,t,o=this,s={};o.options.rtl===!0&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,o.transformsEnabled===!1?o.$slideTrack.css(s):(s={},o.cssTransitions===!1?(s[o.animType]="translate("+e+", "+t+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+e+", "+t+", 0px)",o.$slideTrack.css(s)))},e.prototype.setDimensions=function(){var i=this;i.options.vertical===!1?i.options.centerMode===!0&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),i.options.centerMode===!0&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),i.options.vertical===!1&&i.options.variableWidth===!1?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):i.options.variableWidth===!0?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();i.options.variableWidth===!1&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},e.prototype.setFade=function(){var e,t=this;t.$slides.each(function(o,s){e=t.slideWidth*o*-1,t.options.rtl===!0?i(s).css({position:"relative",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}):i(s).css({position:"relative",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})}),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&i.options.adaptiveHeight===!0&&i.options.vertical===!1){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css("height",e)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if("object"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":"undefined"!=typeof arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)i.each(o,function(i,e){r.options[i]=e});else if("responsive"===n)for(t in s)if("array"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},e.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),i.options.fade===!1?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},e.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=i.options.vertical===!0?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),(void 0!==e.WebkitTransition||void 0!==e.MozTransition||void 0!==e.msTransition)&&i.options.useCSS===!0&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&i.animType!==!1&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&i.animType!==!1},e.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;t=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(i).addClass("slick-current"),n.options.centerMode===!0?(e=Math.floor(n.options.slidesToShow/2),n.options.infinite===!0&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e,i+e+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+i,
  392. t.slice(o-e+1,o+e+2).addClass("slick-active").attr("aria-hidden","false")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass("slick-center"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(i).addClass("slick-center")):i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):t.length<=n.options.slidesToShow?t.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=n.options.infinite===!0?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):t.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")),"ondemand"===n.options.lazyLoad&&n.lazyLoad()},e.prototype.setupInfinite=function(){var e,t,o,s=this;if(s.options.fade===!0&&(s.options.centerMode=!1),s.options.infinite===!0&&s.options.fade===!1&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=s.options.centerMode===!0?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(e=0;o>e;e+=1)t=e,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},e.prototype.interrupt=function(i){var e=this;i||e.autoPlay(),e.interrupted=i},e.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(".slick-slide")?i(e.target):i(e.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));return s||(s=0),t.slideCount<=t.options.slidesToShow?(t.setSlideClasses(s),void t.asNavFor(s)):void t.slideHandler(s)},e.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,a=null,d=this;return e=e||!1,d.animating===!0&&d.options.waitForAnimate===!0||d.options.fade===!0&&d.currentSlide===i||d.slideCount<=d.options.slidesToShow?void 0:(e===!1&&d.asNavFor(i),o=i,a=d.getLeft(o),r=d.getLeft(d.currentSlide),d.currentLeft=null===d.swipeLeft?r:d.swipeLeft,d.options.infinite===!1&&d.options.centerMode===!1&&(0>i||i>d.getDotCount()*d.options.slidesToScroll)?void(d.options.fade===!1&&(o=d.currentSlide,t!==!0?d.animateSlide(r,function(){d.postSlide(o)}):d.postSlide(o))):d.options.infinite===!1&&d.options.centerMode===!0&&(0>i||i>d.slideCount-d.options.slidesToScroll)?void(d.options.fade===!1&&(o=d.currentSlide,t!==!0?d.animateSlide(r,function(){d.postSlide(o)}):d.postSlide(o))):(d.options.autoplay&&clearInterval(d.autoPlayTimer),s=0>o?d.slideCount%d.options.slidesToScroll!==0?d.slideCount-d.slideCount%d.options.slidesToScroll:d.slideCount+o:o>=d.slideCount?d.slideCount%d.options.slidesToScroll!==0?0:o-d.slideCount:o,d.animating=!0,d.$slider.trigger("beforeChange",[d,d.currentSlide,s]),n=d.currentSlide,d.currentSlide=s,d.setSlideClasses(d.currentSlide),d.options.asNavFor&&(l=d.getNavTarget(),l=l.slick("getSlick"),l.slideCount<=l.options.slidesToShow&&l.setSlideClasses(d.currentSlide)),d.updateDots(),d.updateArrows(),d.options.fade===!0?(t!==!0?(d.fadeSlideOut(n),d.fadeSlide(s,function(){d.postSlide(s)})):d.postSlide(s),void d.animateHeight()):void(t!==!0?d.animateSlide(a,function(){d.postSlide(s)}):d.postSlide(s))))},e.prototype.startLoad=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),i.options.dots===!0&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},e.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),o=Math.round(180*t/Math.PI),0>o&&(o=360-Math.abs(o)),45>=o&&o>=0?s.options.rtl===!1?"left":"right":360>=o&&o>=315?s.options.rtl===!1?"left":"right":o>=135&&225>=o?s.options.rtl===!1?"right":"left":s.options.verticalSwiping===!0?o>=35&&135>=o?"down":"up":"vertical"},e.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.interrupted=!1,o.shouldClick=o.touchObject.swipeLength>10?!1:!0,void 0===o.touchObject.curX)return!1;if(o.touchObject.edgeHit===!0&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},e.prototype.swipeHandler=function(i){var e=this;if(!(e.options.swipe===!1||"ontouchend"in document&&e.options.swipe===!1||e.options.draggable===!1&&-1!==i.type.indexOf("mouse")))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,e.options.verticalSwiping===!0&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},e.prototype.swipeMove=function(i){var e,t,o,s,n,r=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!r.dragging||n&&1!==n.length?!1:(e=r.getLeft(r.currentSlide),r.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,r.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,r.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(r.touchObject.curX-r.touchObject.startX,2))),r.options.verticalSwiping===!0&&(r.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(r.touchObject.curY-r.touchObject.startY,2)))),t=r.swipeDirection(),"vertical"!==t?(void 0!==i.originalEvent&&r.touchObject.swipeLength>4&&i.preventDefault(),s=(r.options.rtl===!1?1:-1)*(r.touchObject.curX>r.touchObject.startX?1:-1),r.options.verticalSwiping===!0&&(s=r.touchObject.curY>r.touchObject.startY?1:-1),o=r.touchObject.swipeLength,r.touchObject.edgeHit=!1,r.options.infinite===!1&&(0===r.currentSlide&&"right"===t||r.currentSlide>=r.getDotCount()&&"left"===t)&&(o=r.touchObject.swipeLength*r.options.edgeFriction,r.touchObject.edgeHit=!0),r.options.vertical===!1?r.swipeLeft=e+o*s:r.swipeLeft=e+o*(r.$list.height()/r.listWidth)*s,r.options.verticalSwiping===!0&&(r.swipeLeft=e+o*s),r.options.fade===!0||r.options.touchMove===!1?!1:r.animating===!0?(r.swipeLeft=null,!1):void r.setCSS(r.swipeLeft)):void 0)},e.prototype.swipeStart=function(i){var e,t=this;return t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow?(t.touchObject={},!1):(void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,void(t.dragging=!0))},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},e.prototype.unload=function(){var e=this;i(".slick-cloned",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},e.prototype.unslick=function(i){var e=this;e.$slider.trigger("unslick",[e,i]),e.destroy()},e.prototype.updateArrows=function(){var i,e=this;i=Math.floor(e.options.slidesToShow/2),e.options.arrows===!0&&e.slideCount>e.options.slidesToShow&&!e.options.infinite&&(e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===e.currentSlide?(e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):e.currentSlide>=e.slideCount-e.options.slidesToShow&&e.options.centerMode===!1?(e.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):e.currentSlide>=e.slideCount-1&&e.options.centerMode===!0&&(e.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},e.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").attr("aria-hidden","true"),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden","false"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;r>i;i++)if("object"==typeof s||"undefined"==typeof s?o[i].slick=new e(o[i],s):t=o[i].slick[s].apply(o[i].slick,n),"undefined"!=typeof t)return t;return o}});
  393. /* instafeed
  394. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  395. // Generated by CoffeeScript 1.9.3
  396. (function(){var e;e=function(){function e(e,t){var n,r;this.options={target:"instafeed",get:"popular",resolution:"thumbnail",sortBy:"none",links:!0,mock:!1,useHttp:!1};if(typeof e=="object")for(n in e)r=e[n],this.options[n]=r;this.context=t!=null?t:this,this.unique=this._genKey()}return e.prototype.hasNext=function(){return typeof this.context.nextUrl=="string"&&this.context.nextUrl.length>0},e.prototype.next=function(){return this.hasNext()?this.run(this.context.nextUrl):!1},e.prototype.run=function(t){var n,r,i;if(typeof this.options.clientId!="string"&&typeof this.options.accessToken!="string")throw new Error("Missing clientId or accessToken.");if(typeof this.options.accessToken!="string"&&typeof this.options.clientId!="string")throw new Error("Missing clientId or accessToken.");return this.options.before!=null&&typeof this.options.before=="function"&&this.options.before.call(this),typeof document!="undefined"&&document!==null&&(i=document.createElement("script"),i.id="instafeed-fetcher",i.src=t||this._buildUrl(),n=document.getElementsByTagName("head"),n[0].appendChild(i),r="instafeedCache"+this.unique,window[r]=new e(this.options,this),window[r].unique=this.unique),!0},e.prototype.parse=function(e){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D;if(typeof e!="object"){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,"Invalid JSON data"),!1;throw new Error("Invalid JSON response")}if(e.meta.code!==200){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,e.meta.error_message),!1;throw new Error("Error from Instagram: "+e.meta.error_message)}if(e.data.length===0){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,"No images were returned from Instagram"),!1;throw new Error("No images were returned from Instagram")}this.options.success!=null&&typeof this.options.success=="function"&&this.options.success.call(this,e),this.context.nextUrl="",e.pagination!=null&&(this.context.nextUrl=e.pagination.next_url);if(this.options.sortBy!=="none"){this.options.sortBy==="random"?M=["","random"]:M=this.options.sortBy.split("-"),O=M[0]==="least"?!0:!1;switch(M[1]){case"random":e.data.sort(function(){return.5-Math.random()});break;case"recent":e.data=this._sortBy(e.data,"created_time",O);break;case"liked":e.data=this._sortBy(e.data,"likes.count",O);break;case"commented":e.data=this._sortBy(e.data,"comments.count",O);break;default:throw new Error("Invalid option for sortBy: '"+this.options.sortBy+"'.")}}if(typeof document!="undefined"&&document!==null&&this.options.mock===!1){m=e.data,A=parseInt(this.options.limit,10),this.options.limit!=null&&m.length>A&&(m=m.slice(0,A)),u=document.createDocumentFragment(),this.options.filter!=null&&typeof this.options.filter=="function"&&(m=this._filter(m,this.options.filter));if(this.options.template!=null&&typeof this.options.template=="string"){f="",d="",w="",D=document.createElement("div");for(c=0,N=m.length;c<N;c++){h=m[c],p=h.images[this.options.resolution];if(typeof p!="object")throw o="No image found for resolution: "+this.options.resolution+".",new Error(o);E=p.width,y=p.height,b="square",E>y&&(b="landscape"),E<y&&(b="portrait"),v=p.url,l=window.location.protocol.indexOf("http")>=0,l&&!this.options.useHttp&&(v=v.replace(/https?:\/\//,"//")),d=this._makeTemplate(this.options.template,{model:h,id:h.id,link:h.link,type:h.type,image:v,width:E,height:y,orientation:b,caption:this._getObjectProperty(h,"caption.text"),likes:h.likes.count,comments:h.comments.count,location:this._getObjectProperty(h,"location.name")}),f+=d}D.innerHTML=f,i=[],r=0,n=D.childNodes.length;while(r<n)i.push(D.childNodes[r]),r+=1;for(x=0,C=i.length;x<C;x++)L=i[x],u.appendChild(L)}else for(T=0,k=m.length;T<k;T++){h=m[T],g=document.createElement("img"),p=h.images[this.options.resolution];if(typeof p!="object")throw o="No image found for resolution: "+this.options.resolution+".",new Error(o);v=p.url,l=window.location.protocol.indexOf("http")>=0,l&&!this.options.useHttp&&(v=v.replace(/https?:\/\//,"//")),g.src=v,this.options.links===!0?(t=document.createElement("a"),t.href=h.link,t.appendChild(g),u.appendChild(t)):u.appendChild(g)}_=this.options.target,typeof _=="string"&&(_=document.getElementById(_));if(_==null)throw o='No element with id="'+this.options.target+'" on page.',new Error(o);_.appendChild(u),a=document.getElementsByTagName("head")[0],a.removeChild(document.getElementById("instafeed-fetcher")),S="instafeedCache"+this.unique,window[S]=void 0;try{delete window[S]}catch(P){s=P}}return this.options.after!=null&&typeof this.options.after=="function"&&this.options.after.call(this),!0},e.prototype._buildUrl=function(){var e,t,n;e="https://api.instagram.com/v1";switch(this.options.get){case"popular":t="media/popular";break;case"tagged":if(!this.options.tagName)throw new Error("No tag name specified. Use the 'tagName' option.");t="tags/"+this.options.tagName+"/media/recent";break;case"location":if(!this.options.locationId)throw new Error("No location specified. Use the 'locationId' option.");t="locations/"+this.options.locationId+"/media/recent";break;case"user":if(!this.options.userId)throw new Error("No user specified. Use the 'userId' option.");t="users/"+this.options.userId+"/media/recent";break;default:throw new Error("Invalid option for get: '"+this.options.get+"'.")}return n=e+"/"+t,this.options.accessToken!=null?n+="?access_token="+this.options.accessToken:n+="?client_id="+this.options.clientId,this.options.limit!=null&&(n+="&count="+this.options.limit),n+="&callback=instafeedCache"+this.unique+".parse",n},e.prototype._genKey=function(){var e;return e=function(){return((1+Math.random())*65536|0).toString(16).substring(1)},""+e()+e()+e()+e()},e.prototype._makeTemplate=function(e,t){var n,r,i,s,o;r=/(?:\{{2})([\w\[\]\.]+)(?:\}{2})/,n=e;while(r.test(n))s=n.match(r)[1],o=(i=this._getObjectProperty(t,s))!=null?i:"",n=n.replace(r,function(){return""+o});return n},e.prototype._getObjectProperty=function(e,t){var n,r;t=t.replace(/\[(\w+)\]/g,".$1"),r=t.split(".");while(r.length){n=r.shift();if(!(e!=null&&n in e))return null;e=e[n]}return e},e.prototype._sortBy=function(e,t,n){var r;return r=function(e,r){var i,s;return i=this._getObjectProperty(e,t),s=this._getObjectProperty(r,t),n?i>s?1:-1:i<s?1:-1},e.sort(r.bind(this)),e},e.prototype._filter=function(e,t){var n,r,i,s,o;n=[],r=function(e){if(t(e))return n.push(e)};for(i=0,o=e.length;i<o;i++)s=e[i],r(s);return n},e}(),function(e,t){return typeof define=="function"&&define.amd?define([],t):typeof module=="object"&&module.exports?module.exports=t():e.Instafeed=t()}(this,function(){return e})}).call(this);
  397. /* fancyBox v3.3.1
  398. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  399. // ==================================================
  400. // fancyBox v3.3.1
  401. //
  402. // Licensed GPLv3 for open source use
  403. // or fancyBox Commercial License for commercial use
  404. //
  405. // http://fancyapps.com/fancybox/
  406. // Copyright 2018 fancyApps
  407. //
  408. // ==================================================
  409. !function(t,e,n,o){"use strict";function i(t,e){var o,i,a=[],s=0;t&&t.isDefaultPrevented()||(t.preventDefault(),e=t&&t.data?t.data.options:e||{},o=e.$target||n(t.currentTarget),i=o.attr("data-fancybox")||"",i?(a=e.selector?n(e.selector):t.data?t.data.items:[],a=a.length?a.filter('[data-fancybox="'+i+'"]'):n('[data-fancybox="'+i+'"]'),s=a.index(o),s<0&&(s=0)):a=[o],n.fancybox.open(a,e,s))}if(t.console=t.console||{info:function(t){}},n){if(n.fn.fancybox)return void console.info("fancyBox already initialized");var a={loop:!1,gutter:50,keyboard:!0,arrows:!0,infobar:!0,smallBtn:"auto",toolbar:"auto",buttons:["zoom","thumbs","close"],idleTime:3,protect:!1,modal:!1,image:{preload:!1},ajax:{settings:{data:{fancybox:!0}}},iframe:{tpl:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen allowtransparency="true" src=""></iframe>',preload:!0,css:{},attr:{scrolling:"auto"}},defaultType:"image",animationEffect:"zoom",animationDuration:366,zoomOpacity:"auto",transitionEffect:"fade",transitionDuration:366,slideClass:"",baseClass:"",baseTpl:'<div class="fancybox-container" role="dialog" tabindex="-1"><div class="fancybox-bg"></div><div class="fancybox-inner"><div class="fancybox-infobar"><span data-fancybox-index></span>&nbsp;/&nbsp;<span data-fancybox-count></span></div><div class="fancybox-toolbar">{{buttons}}</div><div class="fancybox-navigation">{{arrows}}</div><div class="fancybox-stage"></div><div class="fancybox-caption"></div></div></div>',spinnerTpl:'<div class="fancybox-loading"></div>',errorTpl:'<div class="fancybox-error"><p>{{ERROR}}</p></div>',btnTpl:{download:'<a download data-fancybox-download class="fancybox-button fancybox-button--download" title="{{DOWNLOAD}}" href="javascript:;"><svg viewBox="0 0 40 40"><path d="M13,16 L20,23 L27,16 M20,7 L20,23 M10,24 L10,28 L30,28 L30,24" /></svg></a>',zoom:'<button data-fancybox-zoom class="fancybox-button fancybox-button--zoom" title="{{ZOOM}}"><svg viewBox="0 0 40 40"><path d="M18,17 m-8,0 a8,8 0 1,0 16,0 a8,8 0 1,0 -16,0 M24,22 L31,29" /></svg></button>',close:'<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}"><svg viewBox="0 0 40 40"><path d="M10,10 L30,30 M30,10 L10,30" /></svg></button>',smallBtn:'<button data-fancybox-close class="fancybox-close-small" title="{{CLOSE}}"><svg viewBox="0 0 32 32"><path d="M10,10 L22,22 M22,10 L10,22"></path></svg></button>',arrowLeft:'<a data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}" href="javascript:;"><svg viewBox="0 0 40 40"><path d="M18,12 L10,20 L18,28 M10,20 L30,20"></path></svg></a>',arrowRight:'<a data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}" href="javascript:;"><svg viewBox="0 0 40 40"><path d="M10,20 L30,20 M22,12 L30,20 L22,28"></path></svg></a>'},parentEl:"body",autoFocus:!1,backFocus:!0,trapFocus:!0,fullScreen:{autoStart:!1},touch:{vertical:!0,momentum:!0},hash:null,media:{},slideShow:{autoStart:!1,speed:4e3},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"},wheel:"auto",onInit:n.noop,beforeLoad:n.noop,afterLoad:n.noop,beforeShow:n.noop,afterShow:n.noop,beforeClose:n.noop,afterClose:n.noop,onActivate:n.noop,onDeactivate:n.noop,clickContent:function(t,e){return"image"===t.type&&"zoom"},clickSlide:"close",clickOutside:"close",dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1,mobile:{idleTime:!1,clickContent:function(t,e){return"image"===t.type&&"toggleControls"},clickSlide:function(t,e){return"image"===t.type?"toggleControls":"close"},dblclickContent:function(t,e){return"image"===t.type&&"zoom"},dblclickSlide:function(t,e){return"image"===t.type&&"zoom"}},lang:"en",i18n:{en:{CLOSE:"Close",NEXT:"Next",PREV:"Previous",ERROR:"The requested content cannot be loaded. <br/> Please try again later.",PLAY_START:"Start slideshow",PLAY_STOP:"Pause slideshow",FULL_SCREEN:"Full screen",THUMBS:"Thumbnails",DOWNLOAD:"Download",SHARE:"Share",ZOOM:"Zoom"},de:{CLOSE:"Schliessen",NEXT:"Weiter",PREV:"Zurück",ERROR:"Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es später nochmal.",PLAY_START:"Diaschau starten",PLAY_STOP:"Diaschau beenden",FULL_SCREEN:"Vollbild",THUMBS:"Vorschaubilder",DOWNLOAD:"Herunterladen",SHARE:"Teilen",ZOOM:"Maßstab"}}},s=n(t),r=n(e),c=0,l=function(t){return t&&t.hasOwnProperty&&t instanceof n},d=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),u=function(){var t,n=e.createElement("fakeelement"),i={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in i)if(n.style[t]!==o)return i[t];return"transitionend"}(),f=function(t){return t&&t.length&&t[0].offsetHeight},p=function(t,e){var o=n.extend(!0,{},t,e);return n.each(e,function(t,e){n.isArray(e)&&(o[t]=e)}),o},h=function(t,o,i){var a=this;a.opts=p({index:i},n.fancybox.defaults),n.isPlainObject(o)&&(a.opts=p(a.opts,o)),n.fancybox.isMobile&&(a.opts=p(a.opts,a.opts.mobile)),a.id=a.opts.id||++c,a.currIndex=parseInt(a.opts.index,10)||0,a.prevIndex=null,a.prevPos=null,a.currPos=0,a.firstRun=!0,a.group=[],a.slides={},a.addContent(t),a.group.length&&(a.$lastFocus=n(e.activeElement).trigger("blur"),a.init())};n.extend(h.prototype,{init:function(){var i,a,r,c=this,l=c.group[c.currIndex],d=l.opts,u=n.fancybox.scrollbarWidth;"image"===l.type||!/iPad|iPhone|iPod/.test(navigator.userAgent)||t.MSStream||n("body").hasClass("fancybox-iosfix")||n("body").addClass("fancybox-iosfix").css("top",-s.scrollTop()),n.fancybox.getInstance()||(n("body").addClass("fancybox-active"),!n.fancybox.isMobile&&e.body.scrollHeight>t.innerHeight&&(u===o&&(i=n('<div style="width:50px;height:50px;overflow:scroll;" />').appendTo("body"),u=n.fancybox.scrollbarWidth=i[0].offsetWidth-i[0].clientWidth,i.remove()),n("head").append('<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar { margin-right: '+u+"px; }</style>"),n("body").addClass("compensate-for-scrollbar"))),r="",n.each(d.buttons,function(t,e){r+=d.btnTpl[e]||""}),a=n(c.translate(c,d.baseTpl.replace("{{buttons}}",r).replace("{{arrows}}",d.btnTpl.arrowLeft+d.btnTpl.arrowRight))).attr("id","fancybox-container-"+c.id).addClass("fancybox-is-hidden").addClass(d.baseClass).data("FancyBox",c).appendTo(d.parentEl),c.$refs={container:a},["bg","inner","infobar","toolbar","stage","caption","navigation"].forEach(function(t){c.$refs[t]=a.find(".fancybox-"+t)}),c.trigger("onInit"),c.activate(),c.jumpTo(c.currIndex)},translate:function(t,e){var n=t.opts.i18n[t.opts.lang];return e.replace(/\{\{(\w+)\}\}/g,function(t,e){var i=n[e];return i===o?t:i})},addContent:function(t){var e,i=this,a=n.makeArray(t);n.each(a,function(t,e){var a,s,r,c,l,d={},u={};n.isPlainObject(e)?(d=e,u=e.opts||e):"object"===n.type(e)&&n(e).length?(a=n(e),u=a.data()||{},u=n.extend(!0,{},u,u.options),u.$orig=a,d.src=i.opts.src||u.src||a.attr("href"),d.type||d.src||(d.type="inline",d.src=e)):d={type:"html",src:e+""},d.opts=n.extend(!0,{},i.opts,u),n.isArray(u.buttons)&&(d.opts.buttons=u.buttons),s=d.type||d.opts.type,c=d.src||"",!s&&c&&((r=c.match(/\.(mp4|mov|ogv)((\?|#).*)?$/i))?(s="video",d.opts.videoFormat||(d.opts.videoFormat="video/"+("ogv"===r[1]?"ogg":r[1]))):c.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?s="image":c.match(/\.(pdf)((\?|#).*)?$/i)?s="iframe":"#"===c.charAt(0)&&(s="inline")),s?d.type=s:i.trigger("objectNeedsType",d),d.contentType||(d.contentType=n.inArray(d.type,["html","inline","ajax"])>-1?"html":d.type),d.index=i.group.length,"auto"==d.opts.smallBtn&&(d.opts.smallBtn=n.inArray(d.type,["html","inline","ajax"])>-1),"auto"===d.opts.toolbar&&(d.opts.toolbar=!d.opts.smallBtn),d.opts.$trigger&&d.index===i.opts.index&&(d.opts.$thumb=d.opts.$trigger.find("img:first")),d.opts.$thumb&&d.opts.$thumb.length||!d.opts.$orig||(d.opts.$thumb=d.opts.$orig.find("img:first")),"function"===n.type(d.opts.caption)&&(d.opts.caption=d.opts.caption.apply(e,[i,d])),"function"===n.type(i.opts.caption)&&(d.opts.caption=i.opts.caption.apply(e,[i,d])),d.opts.caption instanceof n||(d.opts.caption=d.opts.caption===o?"":d.opts.caption+""),"ajax"===d.type&&(l=c.split(/\s+/,2),l.length>1&&(d.src=l.shift(),d.opts.filter=l.shift())),d.opts.modal&&(d.opts=n.extend(!0,d.opts,{infobar:0,toolbar:0,smallBtn:0,keyboard:0,slideShow:0,fullScreen:0,thumbs:0,touch:0,clickContent:!1,clickSlide:!1,clickOutside:!1,dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1})),i.group.push(d)}),Object.keys(i.slides).length&&(i.updateControls(),e=i.Thumbs,e&&e.isActive&&(e.create(),e.focus()))},addEvents:function(){var o=this;o.removeEvents(),o.$refs.container.on("click.fb-close","[data-fancybox-close]",function(t){t.stopPropagation(),t.preventDefault(),o.close(t)}).on("touchstart.fb-prev click.fb-prev","[data-fancybox-prev]",function(t){t.stopPropagation(),t.preventDefault(),o.previous()}).on("touchstart.fb-next click.fb-next","[data-fancybox-next]",function(t){t.stopPropagation(),t.preventDefault(),o.next()}).on("click.fb","[data-fancybox-zoom]",function(t){o[o.isScaledDown()?"scaleToActual":"scaleToFit"]()}),s.on("orientationchange.fb resize.fb",function(t){t&&t.originalEvent&&"resize"===t.originalEvent.type?d(function(){o.update()}):(o.$refs.stage.hide(),setTimeout(function(){o.$refs.stage.show(),o.update()},n.fancybox.isMobile?600:250))}),r.on("focusin.fb",function(t){var o=n.fancybox?n.fancybox.getInstance():null;o.isClosing||!o.current||!o.current.opts.trapFocus||n(t.target).hasClass("fancybox-container")||n(t.target).is(e)||o&&"fixed"!==n(t.target).css("position")&&!o.$refs.container.has(t.target).length&&(t.stopPropagation(),o.focus())}),r.on("keydown.fb",function(t){var e=o.current,i=t.keyCode||t.which;if(e&&e.opts.keyboard&&!(t.ctrlKey||t.altKey||t.shiftKey||n(t.target).is("input")||n(t.target).is("textarea")))return 8===i||27===i?(t.preventDefault(),void o.close(t)):37===i||38===i?(t.preventDefault(),void o.previous()):39===i||40===i?(t.preventDefault(),void o.next()):void o.trigger("afterKeydown",t,i)}),o.group[o.currIndex].opts.idleTime&&(o.idleSecondsCounter=0,r.on("mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",function(t){o.idleSecondsCounter=0,o.isIdle&&o.showControls(),o.isIdle=!1}),o.idleInterval=t.setInterval(function(){o.idleSecondsCounter++,o.idleSecondsCounter>=o.group[o.currIndex].opts.idleTime&&!o.isDragging&&(o.isIdle=!0,o.idleSecondsCounter=0,o.hideControls())},1e3))},removeEvents:function(){var e=this;s.off("orientationchange.fb resize.fb"),r.off("focusin.fb keydown.fb .fb-idle"),this.$refs.container.off(".fb-close .fb-prev .fb-next"),e.idleInterval&&(t.clearInterval(e.idleInterval),e.idleInterval=null)},previous:function(t){return this.jumpTo(this.currPos-1,t)},next:function(t){return this.jumpTo(this.currPos+1,t)},jumpTo:function(t,e){var i,a,s,r,c,l,d,u=this,p=u.group.length;if(!(u.isDragging||u.isClosing||u.isAnimating&&u.firstRun)){if(t=parseInt(t,10),a=u.current?u.current.opts.loop:u.opts.loop,!a&&(t<0||t>=p))return!1;if(i=u.firstRun=!Object.keys(u.slides).length,!(p<2&&!i&&u.isDragging)){if(r=u.current,u.prevIndex=u.currIndex,u.prevPos=u.currPos,s=u.createSlide(t),p>1&&((a||s.index>0)&&u.createSlide(t-1),(a||s.index<p-1)&&u.createSlide(t+1)),u.current=s,u.currIndex=s.index,u.currPos=s.pos,u.trigger("beforeShow",i),u.updateControls(),l=n.fancybox.getTranslate(s.$slide),s.isMoved=(0!==l.left||0!==l.top)&&!s.$slide.hasClass("fancybox-animated"),s.forcedDuration=o,n.isNumeric(e)?s.forcedDuration=e:e=s.opts[i?"animationDuration":"transitionDuration"],e=parseInt(e,10),i)return s.opts.animationEffect&&e&&u.$refs.container.css("transition-duration",e+"ms"),u.$refs.container.removeClass("fancybox-is-hidden"),f(u.$refs.container),u.$refs.container.addClass("fancybox-is-open"),f(u.$refs.container),s.$slide.addClass("fancybox-slide--previous"),u.loadSlide(s),s.$slide.removeClass("fancybox-slide--previous").addClass("fancybox-slide--current"),void u.preload("image");n.each(u.slides,function(t,e){n.fancybox.stop(e.$slide)}),s.$slide.removeClass("fancybox-slide--next fancybox-slide--previous").addClass("fancybox-slide--current"),s.isMoved?(c=Math.round(s.$slide.width()),n.each(u.slides,function(t,o){var i=o.pos-s.pos;n.fancybox.animate(o.$slide,{top:0,left:i*c+i*o.opts.gutter},e,function(){o.$slide.removeAttr("style").removeClass("fancybox-slide--next fancybox-slide--previous"),o.pos===u.currPos&&(s.isMoved=!1,u.complete())})})):u.$refs.stage.children().removeAttr("style"),s.isLoaded?u.revealContent(s):u.loadSlide(s),u.preload("image"),r.pos!==s.pos&&(d="fancybox-slide--"+(r.pos>s.pos?"next":"previous"),r.$slide.removeClass("fancybox-slide--complete fancybox-slide--current fancybox-slide--next fancybox-slide--previous"),r.isComplete=!1,e&&(s.isMoved||s.opts.transitionEffect)&&(s.isMoved?r.$slide.addClass(d):(d="fancybox-animated "+d+" fancybox-fx-"+s.opts.transitionEffect,n.fancybox.animate(r.$slide,d,e,function(){r.$slide.removeClass(d).removeAttr("style")}))))}}},createSlide:function(t){var e,o,i=this;return o=t%i.group.length,o=o<0?i.group.length+o:o,!i.slides[t]&&i.group[o]&&(e=n('<div class="fancybox-slide"></div>').appendTo(i.$refs.stage),i.slides[t]=n.extend(!0,{},i.group[o],{pos:t,$slide:e,isLoaded:!1}),i.updateSlide(i.slides[t])),i.slides[t]},scaleToActual:function(t,e,i){var a,s,r,c,l,d=this,u=d.current,f=u.$content,p=n.fancybox.getTranslate(u.$slide).width,h=n.fancybox.getTranslate(u.$slide).height,g=u.width,b=u.height;!d.isAnimating&&f&&"image"==u.type&&u.isLoaded&&!u.hasError&&(n.fancybox.stop(f),d.isAnimating=!0,t=t===o?.5*p:t,e=e===o?.5*h:e,a=n.fancybox.getTranslate(f),a.top-=n.fancybox.getTranslate(u.$slide).top,a.left-=n.fancybox.getTranslate(u.$slide).left,c=g/a.width,l=b/a.height,s=.5*p-.5*g,r=.5*h-.5*b,g>p&&(s=a.left*c-(t*c-t),s>0&&(s=0),s<p-g&&(s=p-g)),b>h&&(r=a.top*l-(e*l-e),r>0&&(r=0),r<h-b&&(r=h-b)),d.updateCursor(g,b),n.fancybox.animate(f,{top:r,left:s,scaleX:c,scaleY:l},i||330,function(){d.isAnimating=!1}),d.SlideShow&&d.SlideShow.isActive&&d.SlideShow.stop())},scaleToFit:function(t){var e,o=this,i=o.current,a=i.$content;!o.isAnimating&&a&&"image"==i.type&&i.isLoaded&&!i.hasError&&(n.fancybox.stop(a),o.isAnimating=!0,e=o.getFitPos(i),o.updateCursor(e.width,e.height),n.fancybox.animate(a,{top:e.top,left:e.left,scaleX:e.width/a.width(),scaleY:e.height/a.height()},t||330,function(){o.isAnimating=!1}))},getFitPos:function(t){var e,n,o,i,a,s=this,r=t.$content,c=t.width||t.opts.width,l=t.height||t.opts.height,d={};return!!(t.isLoaded&&r&&r.length)&&(i={top:parseInt(t.$slide.css("paddingTop"),10),right:parseInt(t.$slide.css("paddingRight"),10),bottom:parseInt(t.$slide.css("paddingBottom"),10),left:parseInt(t.$slide.css("paddingLeft"),10)},e=parseInt(s.$refs.stage.width(),10)-(i.left+i.right),n=parseInt(s.$refs.stage.height(),10)-(i.top+i.bottom),c&&l||(c=e,l=n),o=Math.min(1,e/c,n/l),c=Math.floor(o*c),l=Math.floor(o*l),"image"===t.type?(d.top=Math.floor(.5*(n-l))+i.top,d.left=Math.floor(.5*(e-c))+i.left):"video"===t.contentType&&(a=t.opts.width&&t.opts.height?c/l:t.opts.ratio||16/9,l>c/a?l=c/a:c>l*a&&(c=l*a)),d.width=c,d.height=l,d)},update:function(){var t=this;n.each(t.slides,function(e,n){t.updateSlide(n)})},updateSlide:function(t,e){var o=this,i=t&&t.$content,a=t.width||t.opts.width,s=t.height||t.opts.height;i&&(a||s||"video"===t.contentType)&&!t.hasError&&(n.fancybox.stop(i),n.fancybox.setTranslate(i,o.getFitPos(t)),t.pos===o.currPos&&(o.isAnimating=!1,o.updateCursor())),t.$slide.trigger("refresh"),o.$refs.toolbar.toggleClass("compensate-for-scrollbar",t.$slide.get(0).scrollHeight>t.$slide.get(0).clientHeight),o.trigger("onUpdate",t)},centerSlide:function(t,e){var i,a,s=this;s.current&&(i=Math.round(t.$slide.width()),a=t.pos-s.current.pos,n.fancybox.animate(t.$slide,{top:0,left:a*i+a*t.opts.gutter,opacity:1},e===o?0:e,null,!1))},updateCursor:function(t,e){var o,i=this,a=i.current,s=i.$refs.container.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-drag fancybox-can-zoomOut");a&&!i.isClosing&&(o=i.isZoomable(),s.toggleClass("fancybox-is-zoomable",o),n("[data-fancybox-zoom]").prop("disabled",!o),o&&("zoom"===a.opts.clickContent||n.isFunction(a.opts.clickContent)&&"zoom"===a.opts.clickContent(a))?i.isScaledDown(t,e)?s.addClass("fancybox-can-zoomIn"):a.opts.touch?s.addClass("fancybox-can-drag"):s.addClass("fancybox-can-zoomOut"):a.opts.touch&&"video"!==a.contentType&&s.addClass("fancybox-can-drag"))},isZoomable:function(){var t,e=this,n=e.current;if(n&&!e.isClosing&&"image"===n.type&&!n.hasError){if(!n.isLoaded)return!0;if(t=e.getFitPos(n),n.width>t.width||n.height>t.height)return!0}return!1},isScaledDown:function(t,e){var i=this,a=!1,s=i.current,r=s.$content;return t!==o&&e!==o?a=t<s.width&&e<s.height:r&&(a=n.fancybox.getTranslate(r),a=a.width<s.width&&a.height<s.height),a},canPan:function(){var t,e=this,n=!1,o=e.current;return"image"===o.type&&(t=o.$content)&&!o.hasError&&(n=e.getFitPos(o),n=Math.abs(t.width()-n.width)>1||Math.abs(t.height()-n.height)>1),n},loadSlide:function(t){var e,o,i,a=this;if(!t.isLoading&&!t.isLoaded){switch(t.isLoading=!0,a.trigger("beforeLoad",t),e=t.type,o=t.$slide,o.off("refresh").trigger("onReset").addClass(t.opts.slideClass),e){case"image":a.setImage(t);break;case"iframe":a.setIframe(t);break;case"html":a.setContent(t,t.src||t.content);break;case"video":a.setContent(t,'<video class="fancybox-video" controls controlsList="nodownload"><source src="'+t.src+'" type="'+t.opts.videoFormat+"\">Your browser doesn't support HTML5 video</video");break;case"inline":n(t.src).length?a.setContent(t,n(t.src)):a.setError(t);break;case"ajax":a.showLoading(t),i=n.ajax(n.extend({},t.opts.ajax.settings,{url:t.src,success:function(e,n){"success"===n&&a.setContent(t,e)},error:function(e,n){e&&"abort"!==n&&a.setError(t)}})),o.one("onReset",function(){i.abort()});break;default:a.setError(t)}return!0}},setImage:function(e){var o,i,a,s,r,c=this,l=e.opts.srcset||e.opts.image.srcset;if(e.timouts=setTimeout(function(){var t=e.$image;!e.isLoading||t&&t[0].complete||e.hasError||c.showLoading(e)},300),l){s=t.devicePixelRatio||1,r=t.innerWidth*s,a=l.split(",").map(function(t){var e={};return t.trim().split(/\s+/).forEach(function(t,n){var o=parseInt(t.substring(0,t.length-1),10);return 0===n?e.url=t:void(o&&(e.value=o,e.postfix=t[t.length-1]))}),e}),a.sort(function(t,e){return t.value-e.value});for(var d=0;d<a.length;d++){var u=a[d];if("w"===u.postfix&&u.value>=r||"x"===u.postfix&&u.value>=s){i=u;break}}!i&&a.length&&(i=a[a.length-1]),i&&(e.src=i.url,e.width&&e.height&&"w"==i.postfix&&(e.height=e.width/e.height*i.value,e.width=i.value),e.opts.srcset=l)}e.$content=n('<div class="fancybox-content"></div>').addClass("fancybox-is-hidden").appendTo(e.$slide.addClass("fancybox-slide--image")),o=e.opts.thumb||!(!e.opts.$thumb||!e.opts.$thumb.length)&&e.opts.$thumb.attr("src"),e.opts.preload!==!1&&e.opts.width&&e.opts.height&&o&&(e.width=e.opts.width,e.height=e.opts.height,e.$ghost=n("<img />").one("error",function(){n(this).remove(),e.$ghost=null}).one("load",function(){c.afterLoad(e)}).addClass("fancybox-image").appendTo(e.$content).attr("src",o)),c.setBigImage(e)},setBigImage:function(t){var e=this,o=n("<img />");t.$image=o.one("error",function(){e.setError(t)}).one("load",function(){var n;t.$ghost||(e.resolveImageSlideSize(t,this.naturalWidth,this.naturalHeight),e.afterLoad(t)),t.timouts&&(clearTimeout(t.timouts),t.timouts=null),e.isClosing||(t.opts.srcset&&(n=t.opts.sizes,n&&"auto"!==n||(n=(t.width/t.height>1&&s.width()/s.height()>1?"100":Math.round(t.width/t.height*100))+"vw"),o.attr("sizes",n).attr("srcset",t.opts.srcset)),t.$ghost&&setTimeout(function(){t.$ghost&&!e.isClosing&&t.$ghost.hide()},Math.min(300,Math.max(1e3,t.height/1600))),e.hideLoading(t))}).addClass("fancybox-image").attr("src",t.src).appendTo(t.$content),(o[0].complete||"complete"==o[0].readyState)&&o[0].naturalWidth&&o[0].naturalHeight?o.trigger("load"):o[0].error&&o.trigger("error")},resolveImageSlideSize:function(t,e,n){var o=parseInt(t.opts.width,10),i=parseInt(t.opts.height,10);t.width=e,t.height=n,o>0&&(t.width=o,t.height=Math.floor(o*n/e)),i>0&&(t.width=Math.floor(i*e/n),t.height=i)},setIframe:function(t){var e,i=this,a=t.opts.iframe,s=t.$slide;t.$content=n('<div class="fancybox-content'+(a.preload?" fancybox-is-hidden":"")+'"></div>').css(a.css).appendTo(s),s.addClass("fancybox-slide--"+t.contentType),t.$iframe=e=n(a.tpl.replace(/\{rnd\}/g,(new Date).getTime())).attr(a.attr).appendTo(t.$content),a.preload?(i.showLoading(t),e.on("load.fb error.fb",function(e){this.isReady=1,t.$slide.trigger("refresh"),i.afterLoad(t)}),s.on("refresh.fb",function(){var n,i,s=t.$content,r=a.css.width,c=a.css.height;if(1===e[0].isReady){try{n=e.contents(),i=n.find("body")}catch(t){}i&&i.length&&i.children().length&&(s.css({width:"",height:""}),r===o&&(r=Math.ceil(Math.max(i[0].clientWidth,i.outerWidth(!0)))),r&&s.width(r),c===o&&(c=Math.ceil(Math.max(i[0].clientHeight,i.outerHeight(!0)))),c&&s.height(c)),s.removeClass("fancybox-is-hidden")}})):this.afterLoad(t),e.attr("src",t.src),s.one("onReset",function(){try{n(this).find("iframe").hide().unbind().attr("src","//about:blank")}catch(t){}n(this).off("refresh.fb").empty(),t.isLoaded=!1})},setContent:function(t,e){var o=this;o.isClosing||(o.hideLoading(t),t.$content&&n.fancybox.stop(t.$content),t.$slide.empty(),l(e)&&e.parent().length?(e.parent().parent(".fancybox-slide--inline").trigger("onReset"),t.$placeholder=n("<div>").hide().insertAfter(e),e.css("display","inline-block")):t.hasError||("string"===n.type(e)&&(e=n("<div>").append(n.trim(e)).contents(),3===e[0].nodeType&&(e=n("<div>").html(e))),t.opts.filter&&(e=n("<div>").html(e).find(t.opts.filter))),t.$slide.one("onReset",function(){n(this).find("video,audio").trigger("pause"),t.$placeholder&&(t.$placeholder.after(e.hide()).remove(),t.$placeholder=null),t.$smallBtn&&(t.$smallBtn.remove(),t.$smallBtn=null),t.hasError||(n(this).empty(),t.isLoaded=!1)}),n(e).appendTo(t.$slide),n(e).is("video,audio")&&(n(e).addClass("fancybox-video"),n(e).wrap("<div></div>"),t.contentType="video",t.opts.width=t.opts.width||n(e).attr("width"),t.opts.height=t.opts.height||n(e).attr("height")),t.$content=t.$slide.children().filter("div,form,main,video,audio").first().addClass("fancybox-content"),t.$slide.addClass("fancybox-slide--"+t.contentType),this.afterLoad(t))},setError:function(t){t.hasError=!0,t.$slide.trigger("onReset").removeClass("fancybox-slide--"+t.contentType).addClass("fancybox-slide--error"),t.contentType="html",this.setContent(t,this.translate(t,t.opts.errorTpl)),t.pos===this.currPos&&(this.isAnimating=!1)},showLoading:function(t){var e=this;t=t||e.current,t&&!t.$spinner&&(t.$spinner=n(e.translate(e,e.opts.spinnerTpl)).appendTo(t.$slide))},hideLoading:function(t){var e=this;t=t||e.current,t&&t.$spinner&&(t.$spinner.remove(),delete t.$spinner)},afterLoad:function(t){var e=this;e.isClosing||(t.isLoading=!1,t.isLoaded=!0,e.trigger("afterLoad",t),e.hideLoading(t),t.pos===e.currPos&&e.updateCursor(),!t.opts.smallBtn||t.$smallBtn&&t.$smallBtn.length||(t.$smallBtn=n(e.translate(t,t.opts.btnTpl.smallBtn)).prependTo(t.$content)),t.opts.protect&&t.$content&&!t.hasError&&(t.$content.on("contextmenu.fb",function(t){return 2==t.button&&t.preventDefault(),!0}),"image"===t.type&&n('<div class="fancybox-spaceball"></div>').appendTo(t.$content)),e.revealContent(t))},revealContent:function(t){var e,i,a,s,r=this,c=t.$slide,l=!1,d=!1;return e=t.opts[r.firstRun?"animationEffect":"transitionEffect"],a=t.opts[r.firstRun?"animationDuration":"transitionDuration"],a=parseInt(t.forcedDuration===o?a:t.forcedDuration,10),t.pos===r.currPos&&(t.isComplete?e=!1:r.isAnimating=!0),!t.isMoved&&t.pos===r.currPos&&a||(e=!1),"zoom"===e&&(t.pos===r.currPos&&a&&"image"===t.type&&!t.hasError&&(d=r.getThumbPos(t))?l=r.getFitPos(t):e="fade"),"zoom"===e?(l.scaleX=l.width/d.width,l.scaleY=l.height/d.height,s=t.opts.zoomOpacity,"auto"==s&&(s=Math.abs(t.width/t.height-d.width/d.height)>.1),s&&(d.opacity=.1,l.opacity=1),n.fancybox.setTranslate(t.$content.removeClass("fancybox-is-hidden"),d),f(t.$content),void n.fancybox.animate(t.$content,l,a,function(){r.isAnimating=!1,r.complete()})):(r.updateSlide(t),e?(n.fancybox.stop(c),i="fancybox-animated fancybox-slide--"+(t.pos>=r.prevPos?"next":"previous")+" fancybox-fx-"+e,c.removeAttr("style").removeClass("fancybox-slide--current fancybox-slide--next fancybox-slide--previous").addClass(i),t.$content.removeClass("fancybox-is-hidden"),f(c),void n.fancybox.animate(c,"fancybox-slide--current",a,function(e){c.removeClass(i).removeAttr("style"),t.pos===r.currPos&&r.complete()},!0)):(f(c),t.$content.removeClass("fancybox-is-hidden"),void(t.pos===r.currPos&&r.complete())))},getThumbPos:function(o){var i,a=this,s=!1,r=o.opts.$thumb,c=r?r.offset():0,l=function(e){for(var o,i=e[0],a=i.getBoundingClientRect(),s=[];null!==i.parentElement;)"hidden"!==n(i.parentElement).css("overflow")&&"auto"!==n(i.parentElement).css("overflow")||s.push(i.parentElement.getBoundingClientRect()),i=i.parentElement;return o=s.every(function(t){var e=Math.min(a.right,t.right)-Math.max(a.left,t.left),n=Math.min(a.bottom,t.bottom)-Math.max(a.top,t.top);return e>0&&n>0}),o&&a.bottom>0&&a.right>0&&a.left<n(t).width()&&a.top<n(t).height()};return c&&r[0].ownerDocument===e&&l(r)&&(i=a.$refs.stage.offset(),s={top:c.top-i.top+parseFloat(r.css("border-top-width")||0),left:c.left-i.left+parseFloat(r.css("border-left-width")||0),width:r.width(),height:r.height(),scaleX:1,scaleY:1}),s},complete:function(){var t=this,o=t.current,i={};!o.isMoved&&o.isLoaded&&(o.isComplete||(o.isComplete=!0,o.$slide.siblings().trigger("onReset"),t.preload("inline"),f(o.$slide),o.$slide.addClass("fancybox-slide--complete"),n.each(t.slides,function(e,o){o.pos>=t.currPos-1&&o.pos<=t.currPos+1?i[o.pos]=o:o&&(n.fancybox.stop(o.$slide),o.$slide.off().remove())}),t.slides=i),t.isAnimating=!1,t.updateCursor(),t.trigger("afterShow"),o.$slide.find("video,audio").filter(":visible:first").trigger("play"),(n(e.activeElement).is("[disabled]")||o.opts.autoFocus&&"image"!=o.type&&"iframe"!==o.type)&&t.focus())},preload:function(t){var e=this,n=e.slides[e.currPos+1],o=e.slides[e.currPos-1];n&&n.type===t&&e.loadSlide(n),o&&o.type===t&&e.loadSlide(o)},focus:function(){var t,e=this.current;this.isClosing||e&&e.isComplete&&e.$content&&(t=e.$content.find("input[autofocus]:enabled:visible:first"),t.length||(t=e.$content.find("button,:input,[tabindex],a").filter(":enabled:visible:first")),t=t&&t.length?t:e.$content,t.trigger("focus"))},activate:function(){var t=this;n(".fancybox-container").each(function(){var e=n(this).data("FancyBox");e&&e.id!==t.id&&!e.isClosing&&(e.trigger("onDeactivate"),e.removeEvents(),e.isVisible=!1)}),t.isVisible=!0,(t.current||t.isIdle)&&(t.update(),t.updateControls()),t.trigger("onActivate"),t.addEvents()},close:function(t,e){var o,i,a,s,r,c,l,p=this,h=p.current,g=function(){p.cleanUp(t)};return!p.isClosing&&(p.isClosing=!0,p.trigger("beforeClose",t)===!1?(p.isClosing=!1,d(function(){p.update()}),!1):(p.removeEvents(),h.timouts&&clearTimeout(h.timouts),a=h.$content,o=h.opts.animationEffect,i=n.isNumeric(e)?e:o?h.opts.animationDuration:0,h.$slide.off(u).removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"),h.$slide.siblings().trigger("onReset").remove(),i&&p.$refs.container.removeClass("fancybox-is-open").addClass("fancybox-is-closing"),p.hideLoading(h),p.hideControls(),p.updateCursor(),"zoom"!==o||t!==!0&&a&&i&&"image"===h.type&&!h.hasError&&(l=p.getThumbPos(h))||(o="fade"),"zoom"===o?(n.fancybox.stop(a),s=n.fancybox.getTranslate(a),c={top:s.top,left:s.left,scaleX:s.width/l.width,scaleY:s.height/l.height,width:l.width,height:l.height},r=h.opts.zoomOpacity,"auto"==r&&(r=Math.abs(h.width/h.height-l.width/l.height)>.1),r&&(l.opacity=0),n.fancybox.setTranslate(a,c),f(a),n.fancybox.animate(a,l,i,g),!0):(o&&i?t===!0?setTimeout(g,i):n.fancybox.animate(h.$slide.removeClass("fancybox-slide--current"),"fancybox-animated fancybox-slide--previous fancybox-fx-"+o,i,g):g(),!0)))},cleanUp:function(t){var e,o,i=this,a=n("body");i.current.$slide.trigger("onReset"),i.$refs.container.empty().remove(),i.trigger("afterClose",t),i.$lastFocus&&i.current.opts.backFocus&&i.$lastFocus.trigger("focus"),i.current=null,e=n.fancybox.getInstance(),e?e.activate():(a.removeClass("fancybox-active compensate-for-scrollbar"),n("#fancybox-style-noscroll").remove(),a.hasClass("fancybox-iosfix")&&(o=parseInt(a[0].style.top,10),a.css("top","").removeClass("fancybox-iosfix"),s.scrollTop(-o)))},trigger:function(t,e){var o,i=Array.prototype.slice.call(arguments,1),a=this,s=e&&e.opts?e:a.current;return s?i.unshift(s):s=a,i.unshift(a),n.isFunction(s.opts[t])&&(o=s.opts[t].apply(s,i)),o===!1?o:void("afterClose"!==t&&a.$refs?a.$refs.container.trigger(t+".fb",i):r.trigger(t+".fb",i))},updateControls:function(t){var e=this,n=e.current,o=n.index,i=n.opts.caption,a=e.$refs.container,s=e.$refs.caption;n.$slide.trigger("refresh"),e.$caption=i&&i.length?s.html(i):null,e.isHiddenControls||e.isIdle||e.showControls(),a.find("[data-fancybox-count]").html(e.group.length),a.find("[data-fancybox-index]").html(o+1),a.find("[data-fancybox-prev]").toggleClass("disabled",!n.opts.loop&&o<=0),a.find("[data-fancybox-next]").toggleClass("disabled",!n.opts.loop&&o>=e.group.length-1),"image"===n.type?a.find("[data-fancybox-zoom]").show().end().find("[data-fancybox-download]").attr("href",n.opts.image.src||n.src).show():n.opts.toolbar&&a.find("[data-fancybox-download],[data-fancybox-zoom]").hide()},hideControls:function(){this.isHiddenControls=!0,this.$refs.container.removeClass("fancybox-show-infobar fancybox-show-toolbar fancybox-show-caption fancybox-show-nav")},showControls:function(){var t=this,e=t.current?t.current.opts:t.opts,n=t.$refs.container;t.isHiddenControls=!1,t.idleSecondsCounter=0,n.toggleClass("fancybox-show-toolbar",!(!e.toolbar||!e.buttons)).toggleClass("fancybox-show-infobar",!!(e.infobar&&t.group.length>1)).toggleClass("fancybox-show-nav",!!(e.arrows&&t.group.length>1)).toggleClass("fancybox-is-modal",!!e.modal),t.$caption?n.addClass("fancybox-show-caption "):n.removeClass("fancybox-show-caption")},toggleControls:function(){this.isHiddenControls?this.showControls():this.hideControls()}}),n.fancybox={version:"3.3.1",defaults:a,getInstance:function(t){var e=n('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"),o=Array.prototype.slice.call(arguments,1);return e instanceof h&&("string"===n.type(t)?e[t].apply(e,o):"function"===n.type(t)&&t.apply(e,o),e)},open:function(t,e,n){return new h(t,e,n)},close:function(t){var e=this.getInstance();e&&(e.close(),t===!0&&this.close())},destroy:function(){this.close(!0),r.add("body").off("click.fb-start","**")},isMobile:e.createTouch!==o&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),use3d:function(){var n=e.createElement("div");return t.getComputedStyle&&t.getComputedStyle(n)&&t.getComputedStyle(n).getPropertyValue("transform")&&!(e.documentMode&&e.documentMode<11)}(),getTranslate:function(t){var e;return!(!t||!t.length)&&(e=t[0].getBoundingClientRect(),{top:e.top||0,left:e.left||0,width:e.width,height:e.height,opacity:parseFloat(t.css("opacity"))})},setTranslate:function(t,e){var n="",i={};if(t&&e)return e.left===o&&e.top===o||(n=(e.left===o?t.position().left:e.left)+"px, "+(e.top===o?t.position().top:e.top)+"px",n=this.use3d?"translate3d("+n+", 0px)":"translate("+n+")"),e.scaleX!==o&&e.scaleY!==o&&(n=(n.length?n+" ":"")+"scale("+e.scaleX+", "+e.scaleY+")"),n.length&&(i.transform=n),e.opacity!==o&&(i.opacity=e.opacity),e.width!==o&&(i.width=e.width),e.height!==o&&(i.height=e.height),t.css(i)},animate:function(t,e,i,a,s){
  410. var r=!1;n.isFunction(i)&&(a=i,i=null),n.isPlainObject(e)||t.removeAttr("style"),n.fancybox.stop(t),t.on(u,function(o){(!o||!o.originalEvent||t.is(o.originalEvent.target)&&"z-index"!=o.originalEvent.propertyName)&&(n.fancybox.stop(t),r&&n.fancybox.setTranslate(t,r),n.isPlainObject(e)?s===!1&&t.removeAttr("style"):s!==!0&&t.removeClass(e),n.isFunction(a)&&a(o))}),n.isNumeric(i)&&t.css("transition-duration",i+"ms"),n.isPlainObject(e)?(e.scaleX!==o&&e.scaleY!==o&&(r=n.extend({},e,{width:t.width()*e.scaleX,height:t.height()*e.scaleY,scaleX:1,scaleY:1}),delete e.width,delete e.height,t.parent().hasClass("fancybox-slide--image")&&t.parent().addClass("fancybox-is-scaling")),n.fancybox.setTranslate(t,e)):t.addClass(e),t.data("timer",setTimeout(function(){t.trigger("transitionend")},i+16))},stop:function(t){t&&t.length&&(clearTimeout(t.data("timer")),t.off("transitionend").css("transition-duration",""),t.parent().removeClass("fancybox-is-scaling"))}},n.fn.fancybox=function(t){var e;return t=t||{},e=t.selector||!1,e?n("body").off("click.fb-start",e).on("click.fb-start",e,{options:t},i):this.off("click.fb-start").on("click.fb-start",{items:this,options:t},i),this},r.on("click.fb-start","[data-fancybox]",i),r.on("click.fb-start","[data-trigger]",function(t){i(t,{$target:n('[data-fancybox="'+n(t.currentTarget).attr("data-trigger")+'"]').eq(n(t.currentTarget).attr("data-index")||0),$trigger:n(this)})})}}(window,document,window.jQuery||jQuery),function(t){"use strict";var e=function(e,n,o){if(e)return o=o||"","object"===t.type(o)&&(o=t.param(o,!0)),t.each(n,function(t,n){e=e.replace("$"+t,n||"")}),o.length&&(e+=(e.indexOf("?")>0?"&":"?")+o),e},n={youtube:{matcher:/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},paramPlace:8,type:"iframe",url:"//www.youtube.com/embed/$4",thumb:"//img.youtube.com/vi/$4/hqdefault.jpg"},vimeo:{matcher:/^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1,api:1},paramPlace:3,type:"iframe",url:"//player.vimeo.com/video/$2"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},gmap_place:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/?ll="+(t[9]?t[9]+"&z="+Math.floor(t[10])+(t[12]?t[12].replace(/^\//,"&"):""):t[12]+"").replace(/\?/,"&")+"&output="+(t[12]&&t[12].indexOf("layer=c")>0?"svembed":"embed")}},gmap_search:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/maps?q="+t[5].replace("query=","q=").replace("api=1","")+"&output=embed"}}};t(document).on("objectNeedsType.fb",function(o,i,a){var s,r,c,l,d,u,f,p=a.src||"",h=!1;s=t.extend(!0,{},n,a.opts.media),t.each(s,function(n,o){if(c=p.match(o.matcher)){if(h=o.type,f=n,u={},o.paramPlace&&c[o.paramPlace]){d=c[o.paramPlace],"?"==d[0]&&(d=d.substring(1)),d=d.split("&");for(var i=0;i<d.length;++i){var s=d[i].split("=",2);2==s.length&&(u[s[0]]=decodeURIComponent(s[1].replace(/\+/g," ")))}}return l=t.extend(!0,{},o.params,a.opts[n],u),p="function"===t.type(o.url)?o.url.call(this,c,l,a):e(o.url,c,l),r="function"===t.type(o.thumb)?o.thumb.call(this,c,l,a):e(o.thumb,c),"vimeo"===n&&(p=p.replace("&%23","#")),!1}}),h?(a.opts.thumb||a.opts.$thumb&&a.opts.$thumb.length||(a.opts.thumb=r),"iframe"===h&&(a.opts=t.extend(!0,a.opts,{iframe:{preload:!1,attr:{scrolling:"no"}}})),t.extend(a,{type:h,src:p,origSrc:a.src,contentSource:f,contentType:"image"===h?"image":"gmap_place"==f||"gmap_search"==f?"map":"video"})):p&&(a.type=a.opts.defaultType)})}(window.jQuery||jQuery),function(t,e,n){"use strict";var o=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),i=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),a=function(e){var n=[];e=e.originalEvent||e||t.e,e=e.touches&&e.touches.length?e.touches:e.changedTouches&&e.changedTouches.length?e.changedTouches:[e];for(var o in e)e[o].pageX?n.push({x:e[o].pageX,y:e[o].pageY}):e[o].clientX&&n.push({x:e[o].clientX,y:e[o].clientY});return n},s=function(t,e,n){return e&&t?"x"===n?t.x-e.x:"y"===n?t.y-e.y:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):0},r=function(t){if(t.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio')||n.isFunction(t.get(0).onclick)||t.data("selectable"))return!0;for(var e=0,o=t[0].attributes,i=o.length;e<i;e++)if("data-fancybox-"===o[e].nodeName.substr(0,14))return!0;return!1},c=function(e){var n=t.getComputedStyle(e)["overflow-y"],o=t.getComputedStyle(e)["overflow-x"],i=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,a=("scroll"===o||"auto"===o)&&e.scrollWidth>e.clientWidth;return i||a},l=function(t){for(var e=!1;;){if(e=c(t.get(0)))break;if(t=t.parent(),!t.length||t.hasClass("fancybox-stage")||t.is("body"))break}return e},d=function(t){var e=this;e.instance=t,e.$bg=t.$refs.bg,e.$stage=t.$refs.stage,e.$container=t.$refs.container,e.destroy(),e.$container.on("touchstart.fb.touch mousedown.fb.touch",n.proxy(e,"ontouchstart"))};d.prototype.destroy=function(){this.$container.off(".fb.touch")},d.prototype.ontouchstart=function(o){var i=this,c=n(o.target),d=i.instance,u=d.current,f=u.$content,p="touchstart"==o.type;if(p&&i.$container.off("mousedown.fb.touch"),(!o.originalEvent||2!=o.originalEvent.button)&&c.length&&!r(c)&&!r(c.parent())&&(c.is("img")||!(o.originalEvent.clientX>c[0].clientWidth+c.offset().left))){if(!u||d.isAnimating||d.isClosing)return o.stopPropagation(),void o.preventDefault();if(i.realPoints=i.startPoints=a(o),i.startPoints.length){if(o.stopPropagation(),i.startEvent=o,i.canTap=!0,i.$target=c,i.$content=f,i.opts=u.opts.touch,i.isPanning=!1,i.isSwiping=!1,i.isZooming=!1,i.isScrolling=!1,i.startTime=(new Date).getTime(),i.distanceX=i.distanceY=i.distance=0,i.canvasWidth=Math.round(u.$slide[0].clientWidth),i.canvasHeight=Math.round(u.$slide[0].clientHeight),i.contentLastPos=null,i.contentStartPos=n.fancybox.getTranslate(i.$content)||{top:0,left:0},i.sliderStartPos=i.sliderLastPos||n.fancybox.getTranslate(u.$slide),i.stagePos=n.fancybox.getTranslate(d.$refs.stage),i.sliderStartPos.top-=i.stagePos.top,i.sliderStartPos.left-=i.stagePos.left,i.contentStartPos.top-=i.stagePos.top,i.contentStartPos.left-=i.stagePos.left,n(e).off(".fb.touch").on(p?"touchend.fb.touch touchcancel.fb.touch":"mouseup.fb.touch mouseleave.fb.touch",n.proxy(i,"ontouchend")).on(p?"touchmove.fb.touch":"mousemove.fb.touch",n.proxy(i,"ontouchmove")),n.fancybox.isMobile&&e.addEventListener("scroll",i.onscroll,!0),!i.opts&&!d.canPan()||!c.is(i.$stage)&&!i.$stage.find(c).length)return void(c.is(".fancybox-image")&&o.preventDefault());n.fancybox.isMobile&&(l(c)||l(c.parent()))||o.preventDefault(),(1===i.startPoints.length||u.hasError)&&(i.instance.canPan()?(n.fancybox.stop(i.$content),i.$content.css("transition-duration",""),i.isPanning=!0):i.isSwiping=!0,i.$container.addClass("fancybox-controls--isGrabbing")),2===i.startPoints.length&&"image"===u.type&&(u.isLoaded||u.$ghost)&&(i.canTap=!1,i.isSwiping=!1,i.isPanning=!1,i.isZooming=!0,n.fancybox.stop(i.$content),i.$content.css("transition-duration",""),i.centerPointStartX=.5*(i.startPoints[0].x+i.startPoints[1].x)-n(t).scrollLeft(),i.centerPointStartY=.5*(i.startPoints[0].y+i.startPoints[1].y)-n(t).scrollTop(),i.percentageOfImageAtPinchPointX=(i.centerPointStartX-i.contentStartPos.left)/i.contentStartPos.width,i.percentageOfImageAtPinchPointY=(i.centerPointStartY-i.contentStartPos.top)/i.contentStartPos.height,i.startDistanceBetweenFingers=s(i.startPoints[0],i.startPoints[1]))}}},d.prototype.onscroll=function(t){var n=this;n.isScrolling=!0,e.removeEventListener("scroll",n.onscroll,!0)},d.prototype.ontouchmove=function(t){var e=this,o=n(t.target);return void 0!==t.originalEvent.buttons&&0===t.originalEvent.buttons?void e.ontouchend(t):e.isScrolling||!o.is(e.$stage)&&!e.$stage.find(o).length?void(e.canTap=!1):(e.newPoints=a(t),void((e.opts||e.instance.canPan())&&e.newPoints.length&&e.newPoints.length&&(e.isSwiping&&e.isSwiping===!0||t.preventDefault(),e.distanceX=s(e.newPoints[0],e.startPoints[0],"x"),e.distanceY=s(e.newPoints[0],e.startPoints[0],"y"),e.distance=s(e.newPoints[0],e.startPoints[0]),e.distance>0&&(e.isSwiping?e.onSwipe(t):e.isPanning?e.onPan():e.isZooming&&e.onZoom()))))},d.prototype.onSwipe=function(e){var a,s=this,r=s.isSwiping,c=s.sliderStartPos.left||0;if(r!==!0)"x"==r&&(s.distanceX>0&&(s.instance.group.length<2||0===s.instance.current.index&&!s.instance.current.opts.loop)?c+=Math.pow(s.distanceX,.8):s.distanceX<0&&(s.instance.group.length<2||s.instance.current.index===s.instance.group.length-1&&!s.instance.current.opts.loop)?c-=Math.pow(-s.distanceX,.8):c+=s.distanceX),s.sliderLastPos={top:"x"==r?0:s.sliderStartPos.top+s.distanceY,left:c},s.requestId&&(i(s.requestId),s.requestId=null),s.requestId=o(function(){s.sliderLastPos&&(n.each(s.instance.slides,function(t,e){var o=e.pos-s.instance.currPos;n.fancybox.setTranslate(e.$slide,{top:s.sliderLastPos.top,left:s.sliderLastPos.left+o*s.canvasWidth+o*e.opts.gutter})}),s.$container.addClass("fancybox-is-sliding"))});else if(Math.abs(s.distance)>10){if(s.canTap=!1,s.instance.group.length<2&&s.opts.vertical?s.isSwiping="y":s.instance.isDragging||s.opts.vertical===!1||"auto"===s.opts.vertical&&n(t).width()>800?s.isSwiping="x":(a=Math.abs(180*Math.atan2(s.distanceY,s.distanceX)/Math.PI),s.isSwiping=a>45&&a<135?"y":"x"),s.canTap=!1,"y"===s.isSwiping&&n.fancybox.isMobile&&(l(s.$target)||l(s.$target.parent())))return void(s.isScrolling=!0);s.instance.isDragging=s.isSwiping,s.startPoints=s.newPoints,n.each(s.instance.slides,function(t,e){n.fancybox.stop(e.$slide),e.$slide.css("transition-duration",""),e.inTransition=!1,e.pos===s.instance.current.pos&&(s.sliderStartPos.left=n.fancybox.getTranslate(e.$slide).left-n.fancybox.getTranslate(s.instance.$refs.stage).left)}),s.instance.SlideShow&&s.instance.SlideShow.isActive&&s.instance.SlideShow.stop()}},d.prototype.onPan=function(){var t=this;return s(t.newPoints[0],t.realPoints[0])<(n.fancybox.isMobile?10:5)?void(t.startPoints=t.newPoints):(t.canTap=!1,t.contentLastPos=t.limitMovement(),t.requestId&&(i(t.requestId),t.requestId=null),void(t.requestId=o(function(){n.fancybox.setTranslate(t.$content,t.contentLastPos)})))},d.prototype.limitMovement=function(){var t,e,n,o,i,a,s=this,r=s.canvasWidth,c=s.canvasHeight,l=s.distanceX,d=s.distanceY,u=s.contentStartPos,f=u.left,p=u.top,h=u.width,g=u.height;return i=h>r?f+l:f,a=p+d,t=Math.max(0,.5*r-.5*h),e=Math.max(0,.5*c-.5*g),n=Math.min(r-h,.5*r-.5*h),o=Math.min(c-g,.5*c-.5*g),l>0&&i>t&&(i=t-1+Math.pow(-t+f+l,.8)||0),l<0&&i<n&&(i=n+1-Math.pow(n-f-l,.8)||0),d>0&&a>e&&(a=e-1+Math.pow(-e+p+d,.8)||0),d<0&&a<o&&(a=o+1-Math.pow(o-p-d,.8)||0),{top:a,left:i}},d.prototype.limitPosition=function(t,e,n,o){var i=this,a=i.canvasWidth,s=i.canvasHeight;return n>a?(t=t>0?0:t,t=t<a-n?a-n:t):t=Math.max(0,a/2-n/2),o>s?(e=e>0?0:e,e=e<s-o?s-o:e):e=Math.max(0,s/2-o/2),{top:e,left:t}},d.prototype.onZoom=function(){var e=this,a=e.contentStartPos,r=a.width,c=a.height,l=a.left,d=a.top,u=s(e.newPoints[0],e.newPoints[1]),f=u/e.startDistanceBetweenFingers,p=Math.floor(r*f),h=Math.floor(c*f),g=(r-p)*e.percentageOfImageAtPinchPointX,b=(c-h)*e.percentageOfImageAtPinchPointY,m=(e.newPoints[0].x+e.newPoints[1].x)/2-n(t).scrollLeft(),y=(e.newPoints[0].y+e.newPoints[1].y)/2-n(t).scrollTop(),v=m-e.centerPointStartX,x=y-e.centerPointStartY,w=l+(g+v),$=d+(b+x),S={top:$,left:w,scaleX:f,scaleY:f};e.canTap=!1,e.newWidth=p,e.newHeight=h,e.contentLastPos=S,e.requestId&&(i(e.requestId),e.requestId=null),e.requestId=o(function(){n.fancybox.setTranslate(e.$content,e.contentLastPos)})},d.prototype.ontouchend=function(t){var o=this,s=Math.max((new Date).getTime()-o.startTime,1),r=o.isSwiping,c=o.isPanning,l=o.isZooming,d=o.isScrolling;return o.endPoints=a(t),o.$container.removeClass("fancybox-controls--isGrabbing"),n(e).off(".fb.touch"),e.removeEventListener("scroll",o.onscroll,!0),o.requestId&&(i(o.requestId),o.requestId=null),o.isSwiping=!1,o.isPanning=!1,o.isZooming=!1,o.isScrolling=!1,o.instance.isDragging=!1,o.canTap?o.onTap(t):(o.speed=366,o.velocityX=o.distanceX/s*.5,o.velocityY=o.distanceY/s*.5,o.speedX=Math.max(.5*o.speed,Math.min(1.5*o.speed,1/Math.abs(o.velocityX)*o.speed)),void(c?o.endPanning():l?o.endZooming():o.endSwiping(r,d)))},d.prototype.endSwiping=function(t,e){var o=this,i=!1,a=o.instance.group.length;o.sliderLastPos=null,"y"==t&&!e&&Math.abs(o.distanceY)>50?(n.fancybox.animate(o.instance.current.$slide,{top:o.sliderStartPos.top+o.distanceY+150*o.velocityY,opacity:0},200),i=o.instance.close(!0,200)):"x"==t&&o.distanceX>50&&a>1?i=o.instance.previous(o.speedX):"x"==t&&o.distanceX<-50&&a>1&&(i=o.instance.next(o.speedX)),i!==!1||"x"!=t&&"y"!=t||(e||a<2?o.instance.centerSlide(o.instance.current,150):o.instance.jumpTo(o.instance.current.index)),o.$container.removeClass("fancybox-is-sliding")},d.prototype.endPanning=function(){var t,e,o,i=this;i.contentLastPos&&(i.opts.momentum===!1?(t=i.contentLastPos.left,e=i.contentLastPos.top):(t=i.contentLastPos.left+i.velocityX*i.speed,e=i.contentLastPos.top+i.velocityY*i.speed),o=i.limitPosition(t,e,i.contentStartPos.width,i.contentStartPos.height),o.width=i.contentStartPos.width,o.height=i.contentStartPos.height,n.fancybox.animate(i.$content,o,330))},d.prototype.endZooming=function(){var t,e,o,i,a=this,s=a.instance.current,r=a.newWidth,c=a.newHeight;a.contentLastPos&&(t=a.contentLastPos.left,e=a.contentLastPos.top,i={top:e,left:t,width:r,height:c,scaleX:1,scaleY:1},n.fancybox.setTranslate(a.$content,i),r<a.canvasWidth&&c<a.canvasHeight?a.instance.scaleToFit(150):r>s.width||c>s.height?a.instance.scaleToActual(a.centerPointStartX,a.centerPointStartY,150):(o=a.limitPosition(t,e,r,c),n.fancybox.setTranslate(a.$content,n.fancybox.getTranslate(a.$content)),n.fancybox.animate(a.$content,o,150)))},d.prototype.onTap=function(e){var o,i=this,s=n(e.target),r=i.instance,c=r.current,l=e&&a(e)||i.startPoints,d=l[0]?l[0].x-n(t).scrollLeft()-i.stagePos.left:0,u=l[0]?l[0].y-n(t).scrollTop()-i.stagePos.top:0,f=function(t){var o=c.opts[t];if(n.isFunction(o)&&(o=o.apply(r,[c,e])),o)switch(o){case"close":r.close(i.startEvent);break;case"toggleControls":r.toggleControls(!0);break;case"next":r.next();break;case"nextOrClose":r.group.length>1?r.next():r.close(i.startEvent);break;case"zoom":"image"==c.type&&(c.isLoaded||c.$ghost)&&(r.canPan()?r.scaleToFit():r.isScaledDown()?r.scaleToActual(d,u):r.group.length<2&&r.close(i.startEvent))}};if((!e.originalEvent||2!=e.originalEvent.button)&&(s.is("img")||!(d>s[0].clientWidth+s.offset().left))){if(s.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container"))o="Outside";else if(s.is(".fancybox-slide"))o="Slide";else{if(!r.current.$content||!r.current.$content.find(s).addBack().filter(s).length)return;o="Content"}if(i.tapped){if(clearTimeout(i.tapped),i.tapped=null,Math.abs(d-i.tapX)>50||Math.abs(u-i.tapY)>50)return this;f("dblclick"+o)}else i.tapX=d,i.tapY=u,c.opts["dblclick"+o]&&c.opts["dblclick"+o]!==c.opts["click"+o]?i.tapped=setTimeout(function(){i.tapped=null,f("click"+o)},500):f("click"+o);return this}},n(e).on("onActivate.fb",function(t,e){e&&!e.Guestures&&(e.Guestures=new d(e))})}(window,document,window.jQuery||jQuery),function(t,e){"use strict";e.extend(!0,e.fancybox.defaults,{btnTpl:{slideShow:'<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}"><svg viewBox="0 0 40 40"><path d="M13,12 L27,20 L13,27 Z" /><path d="M15,10 v19 M23,10 v19" /></svg></button>'},slideShow:{autoStart:!1,speed:3e3}});var n=function(t){this.instance=t,this.init()};e.extend(n.prototype,{timer:null,isActive:!1,$button:null,init:function(){var t=this;t.$button=t.instance.$refs.toolbar.find("[data-fancybox-play]").on("click",function(){t.toggle()}),(t.instance.group.length<2||!t.instance.group[t.instance.currIndex].opts.slideShow)&&t.$button.hide()},set:function(t){var e=this;e.instance&&e.instance.current&&(t===!0||e.instance.current.opts.loop||e.instance.currIndex<e.instance.group.length-1)?e.timer=setTimeout(function(){e.isActive&&e.instance.jumpTo((e.instance.currIndex+1)%e.instance.group.length)},e.instance.current.opts.slideShow.speed):(e.stop(),e.instance.idleSecondsCounter=0,e.instance.showControls())},clear:function(){var t=this;clearTimeout(t.timer),t.timer=null},start:function(){var t=this,e=t.instance.current;e&&(t.isActive=!0,t.$button.attr("title",e.opts.i18n[e.opts.lang].PLAY_STOP).removeClass("fancybox-button--play").addClass("fancybox-button--pause"),t.set(!0))},stop:function(){var t=this,e=t.instance.current;t.clear(),t.$button.attr("title",e.opts.i18n[e.opts.lang].PLAY_START).removeClass("fancybox-button--pause").addClass("fancybox-button--play"),t.isActive=!1},toggle:function(){var t=this;t.isActive?t.stop():t.start()}}),e(t).on({"onInit.fb":function(t,e){e&&!e.SlideShow&&(e.SlideShow=new n(e))},"beforeShow.fb":function(t,e,n,o){var i=e&&e.SlideShow;o?i&&n.opts.slideShow.autoStart&&i.start():i&&i.isActive&&i.clear()},"afterShow.fb":function(t,e,n){var o=e&&e.SlideShow;o&&o.isActive&&o.set()},"afterKeydown.fb":function(n,o,i,a,s){var r=o&&o.SlideShow;!r||!i.opts.slideShow||80!==s&&32!==s||e(t.activeElement).is("button,a,input")||(a.preventDefault(),r.toggle())},"beforeClose.fb onDeactivate.fb":function(t,e){var n=e&&e.SlideShow;n&&n.stop()}}),e(t).on("visibilitychange",function(){var n=e.fancybox.getInstance(),o=n&&n.SlideShow;o&&o.isActive&&(t.hidden?o.clear():o.set())})}(document,window.jQuery||jQuery),function(t,e){"use strict";var n=function(){for(var e=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n={},o=0;o<e.length;o++){var i=e[o];if(i&&i[1]in t){for(var a=0;a<i.length;a++)n[e[0][a]]=i[a];return n}}return!1}();if(!n)return void(e&&e.fancybox&&(e.fancybox.defaults.btnTpl.fullScreen=!1));var o={request:function(e){e=e||t.documentElement,e[n.requestFullscreen](e.ALLOW_KEYBOARD_INPUT)},exit:function(){t[n.exitFullscreen]()},toggle:function(e){e=e||t.documentElement,this.isFullscreen()?this.exit():this.request(e)},isFullscreen:function(){return Boolean(t[n.fullscreenElement])},enabled:function(){return Boolean(t[n.fullscreenEnabled])}};e.extend(!0,e.fancybox.defaults,{btnTpl:{fullScreen:'<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fullscreen" title="{{FULL_SCREEN}}"><svg viewBox="0 0 40 40"><path d="M9,12 v16 h22 v-16 h-22 v8" /></svg></button>'},fullScreen:{autoStart:!1}}),e(t).on({"onInit.fb":function(t,e){var n;e&&e.group[e.currIndex].opts.fullScreen?(n=e.$refs.container,n.on("click.fb-fullscreen","[data-fancybox-fullscreen]",function(t){t.stopPropagation(),t.preventDefault(),o.toggle()}),e.opts.fullScreen&&e.opts.fullScreen.autoStart===!0&&o.request(),e.FullScreen=o):e&&e.$refs.toolbar.find("[data-fancybox-fullscreen]").hide()},"afterKeydown.fb":function(t,e,n,o,i){e&&e.FullScreen&&70===i&&(o.preventDefault(),e.FullScreen.toggle())},"beforeClose.fb":function(t,e){e&&e.FullScreen&&e.$refs.container.hasClass("fancybox-is-fullscreen")&&o.exit()}}),e(t).on(n.fullscreenchange,function(){var t=o.isFullscreen(),n=e.fancybox.getInstance();n&&(n.current&&"image"===n.current.type&&n.isAnimating&&(n.current.$content.css("transition","none"),n.isAnimating=!1,n.update(!0,!0,0)),n.trigger("onFullscreenChange",t),n.$refs.container.toggleClass("fancybox-is-fullscreen",t))})}(document,window.jQuery||jQuery),function(t,e){"use strict";var n="fancybox-thumbs",o=n+"-active",i=n+"-loading";e.fancybox.defaults=e.extend(!0,{btnTpl:{thumbs:'<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}"><svg viewBox="0 0 120 120"><path d="M30,30 h14 v14 h-14 Z M50,30 h14 v14 h-14 Z M70,30 h14 v14 h-14 Z M30,50 h14 v14 h-14 Z M50,50 h14 v14 h-14 Z M70,50 h14 v14 h-14 Z M30,70 h14 v14 h-14 Z M50,70 h14 v14 h-14 Z M70,70 h14 v14 h-14 Z" /></svg></button>'},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"}},e.fancybox.defaults);var a=function(t){this.init(t)};e.extend(a.prototype,{$button:null,$grid:null,$list:null,isVisible:!1,isActive:!1,init:function(t){var e,n,o=this;o.instance=t,t.Thumbs=o,o.opts=t.group[t.currIndex].opts.thumbs,e=t.group[0],e=e.opts.thumb||!(!e.opts.$thumb||!e.opts.$thumb.length)&&e.opts.$thumb.attr("src"),t.group.length>1&&(n=t.group[1],n=n.opts.thumb||!(!n.opts.$thumb||!n.opts.$thumb.length)&&n.opts.$thumb.attr("src")),o.$button=t.$refs.toolbar.find("[data-fancybox-thumbs]"),o.opts&&e&&n&&e&&n?(o.$button.show().on("click",function(){o.toggle()}),o.isActive=!0):o.$button.hide()},create:function(){var t,o=this,a=o.instance,s=o.opts.parentEl,r=[];o.$grid||(o.$grid=e('<div class="'+n+" "+n+"-"+o.opts.axis+'"></div>').appendTo(a.$refs.container.find(s).addBack().filter(s)),o.$grid.on("click","li",function(){a.jumpTo(e(this).attr("data-index"))})),o.$list||(o.$list=e("<ul>").appendTo(o.$grid)),e.each(a.group,function(e,n){t=n.opts.thumb||(n.opts.$thumb?n.opts.$thumb.attr("src"):null),t||"image"!==n.type||(t=n.src),r.push('<li data-index="'+e+'" tabindex="0" class="'+i+'"'+(t&&t.length?' style="background-image:url('+t+')" />':"")+"></li>")}),o.$list[0].innerHTML=r.join(""),"x"===o.opts.axis&&o.$list.width(parseInt(o.$grid.css("padding-right"),10)+a.group.length*o.$list.children().eq(0).outerWidth(!0))},focus:function(t){var e,n,i=this,a=i.$list,s=i.$grid;i.instance.current&&(e=a.children().removeClass(o).filter('[data-index="'+i.instance.current.index+'"]').addClass(o),n=e.position(),"y"===i.opts.axis&&(n.top<0||n.top>a.height()-e.outerHeight())?a.stop().animate({scrollTop:a.scrollTop()+n.top},t):"x"===i.opts.axis&&(n.left<s.scrollLeft()||n.left>s.scrollLeft()+(s.width()-e.outerWidth()))&&a.parent().stop().animate({scrollLeft:n.left},t))},update:function(){var t=this;t.instance.$refs.container.toggleClass("fancybox-show-thumbs",this.isVisible),t.isVisible?(t.$grid||t.create(),t.instance.trigger("onThumbsShow"),t.focus(0)):t.$grid&&t.instance.trigger("onThumbsHide"),t.instance.update()},hide:function(){this.isVisible=!1,this.update()},show:function(){this.isVisible=!0,this.update()},toggle:function(){this.isVisible=!this.isVisible,this.update()}}),e(t).on({"onInit.fb":function(t,e){var n;e&&!e.Thumbs&&(n=new a(e),n.isActive&&n.opts.autoStart===!0&&n.show())},"beforeShow.fb":function(t,e,n,o){var i=e&&e.Thumbs;i&&i.isVisible&&i.focus(o?0:250)},"afterKeydown.fb":function(t,e,n,o,i){var a=e&&e.Thumbs;a&&a.isActive&&71===i&&(o.preventDefault(),a.toggle())},"beforeClose.fb":function(t,e){var n=e&&e.Thumbs;n&&n.isVisible&&n.opts.hideOnClose!==!1&&n.$grid.hide()}})}(document,window.jQuery||jQuery),function(t,e){"use strict";function n(t){var e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}e.extend(!0,e.fancybox.defaults,{btnTpl:{share:'<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}"><svg viewBox="0 0 40 40"><path d="M6,30 C8,18 19,16 23,16 L23,16 L23,10 L33,20 L23,29 L23,24 C19,24 8,27 6,30 Z"></svg></button>'},share:{url:function(t,e){return!t.currentHash&&"inline"!==e.type&&"html"!==e.type&&(e.origSrc||e.src)||window.location},tpl:'<div class="fancybox-share"><h1>{{SHARE}}</h1><p><a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196" /></svg><span>Facebook</span></a><a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z" /></svg><span>Twitter</span></a><a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z" fill="#fff"/></svg><span>Pinterest</span></a></p><p><input class="fancybox-share__input" type="text" value="{{url_raw}}" /></p></div>'}}),e(t).on("click","[data-fancybox-share]",function(){var t,o,i=e.fancybox.getInstance(),a=i.current||null;a&&("function"===e.type(a.opts.share.url)&&(t=a.opts.share.url.apply(a,[i,a])),o=a.opts.share.tpl.replace(/\{\{media\}\}/g,"image"===a.type?encodeURIComponent(a.src):"").replace(/\{\{url\}\}/g,encodeURIComponent(t)).replace(/\{\{url_raw\}\}/g,n(t)).replace(/\{\{descr\}\}/g,i.$caption?encodeURIComponent(i.$caption.text()):""),e.fancybox.open({src:i.translate(i,o),type:"html",opts:{animationEffect:!1,afterLoad:function(t,e){i.$refs.container.one("beforeClose.fb",function(){t.close(null,0)}),e.$content.find(".fancybox-share__links a").click(function(){return window.open(this.href,"Share","width=550, height=450"),!1})}}}))})}(document,window.jQuery||jQuery),function(t,e,n){"use strict";function o(){var t=e.location.hash.substr(1),n=t.split("-"),o=n.length>1&&/^\+?\d+$/.test(n[n.length-1])?parseInt(n.pop(-1),10)||1:1,i=n.join("-");return{hash:t,index:o<1?1:o,gallery:i}}function i(t){var e;""!==t.gallery&&(e=n("[data-fancybox='"+n.escapeSelector(t.gallery)+"']").eq(t.index-1).trigger("click.fb-start"))}function a(t){var e,n;return!!t&&(e=t.current?t.current.opts:t.opts,n=e.hash||(e.$orig?e.$orig.data("fancybox"):""),""!==n&&n)}n.escapeSelector||(n.escapeSelector=function(t){var e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,n=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t};return(t+"").replace(e,n)}),n(function(){n.fancybox.defaults.hash!==!1&&(n(t).on({"onInit.fb":function(t,e){var n,i;e.group[e.currIndex].opts.hash!==!1&&(n=o(),i=a(e),i&&n.gallery&&i==n.gallery&&(e.currIndex=n.index-1))},"beforeShow.fb":function(n,o,i,s){var r;i&&i.opts.hash!==!1&&(r=a(o),r&&(o.currentHash=r+(o.group.length>1?"-"+(i.index+1):""),e.location.hash!=="#"+o.currentHash&&(o.origHash||(o.origHash=e.location.hash),o.hashTimer&&clearTimeout(o.hashTimer),o.hashTimer=setTimeout(function(){"replaceState"in e.history?(e.history[s?"pushState":"replaceState"]({},t.title,e.location.pathname+e.location.search+"#"+o.currentHash),s&&(o.hasCreatedHistory=!0)):e.location.hash=o.currentHash,o.hashTimer=null},300))))},"beforeClose.fb":function(n,o,i){var s;i.opts.hash!==!1&&(s=a(o),o.currentHash&&o.hasCreatedHistory?e.history.back():o.currentHash&&("replaceState"in e.history?e.history.replaceState({},t.title,e.location.pathname+e.location.search+(o.origHash||"")):e.location.hash=o.origHash),o.currentHash=null,clearTimeout(o.hashTimer))}}),n(e).on("hashchange.fb",function(){var t,e=o();n.each(n(".fancybox-container").get().reverse(),function(e,o){var i=n(o).data("FancyBox");if(i.currentHash)return t=i,!1}),t?!t.currentHash||t.currentHash===e.gallery+"-"+e.index||1===e.index&&t.currentHash==e.gallery||(t.currentHash=null,t.close()):""!==e.gallery&&i(e)}),setTimeout(function(){n.fancybox.getInstance()||i(o())},50))})}(document,window,window.jQuery||jQuery),function(t,e){"use strict";var n=(new Date).getTime();e(t).on({"onInit.fb":function(t,e,o){e.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll",function(t){var o=e.current,i=(new Date).getTime();e.group.length<2||o.opts.wheel===!1||"auto"===o.opts.wheel&&"image"!==o.type||(t.preventDefault(),t.stopPropagation(),o.$slide.hasClass("fancybox-animated")||(t=t.originalEvent||t,i-n<250||(n=i,e[(-t.deltaY||-t.deltaX||t.wheelDelta||-t.detail)<0?"next":"previous"]())))})}})}(document,window.jQuery||jQuery);
  411. /* Jquery.sticky.min.js
  412. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  413. !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){var e=Array.prototype.slice,i=Array.prototype.splice,n={topSpacing:0,bottomSpacing:0,className:"is-sticky",wrapperClassName:"sticky-wrapper",center:!1,getWidthFrom:"",widthFromWrapper:!0,responsiveWidth:!1,zIndex:"auto"},r=t(window),s=t(document),o=[],c=r.height(),a=function(){for(var e=r.scrollTop(),i=s.height(),n=i-c,a=e>n?n-e:0,p=0,d=o.length;p<d;p++){var l=o[p],u=l.stickyWrapper.offset().top,h=u-l.topSpacing-a;if(l.stickyWrapper.css("height",l.stickyElement.outerHeight()),e<=h)null!==l.currentTop&&(l.stickyElement.css({width:"",position:"",top:"","z-index":""}),l.stickyElement.parent().removeClass(l.className),l.stickyElement.trigger("sticky-end",[l]),l.currentTop=null);else{var g=i-l.stickyElement.outerHeight()-l.topSpacing-l.bottomSpacing-e-a;if(g<0?g+=l.topSpacing:g=l.topSpacing,l.currentTop!==g){var m;l.getWidthFrom?m=t(l.getWidthFrom).width()||null:l.widthFromWrapper&&(m=l.stickyWrapper.width()),null==m&&(m=l.stickyElement.width()),l.stickyElement.css("width",m).css("position","fixed").css("top",g).css("z-index",l.zIndex),l.stickyElement.parent().addClass(l.className),null===l.currentTop?l.stickyElement.trigger("sticky-start",[l]):l.stickyElement.trigger("sticky-update",[l]),l.currentTop===l.topSpacing&&l.currentTop>g||null===l.currentTop&&g<l.topSpacing?l.stickyElement.trigger("sticky-bottom-reached",[l]):null!==l.currentTop&&g===l.topSpacing&&l.currentTop<g&&l.stickyElement.trigger("sticky-bottom-unreached",[l]),l.currentTop=g}var y=l.stickyWrapper.parent(),f=l.stickyElement.offset().top+l.stickyElement.outerHeight()>=y.offset().top+y.outerHeight()&&l.stickyElement.offset().top<=l.topSpacing;f?l.stickyElement.css("position","absolute").css("top","").css("bottom",0).css("z-index",""):l.stickyElement.css("position","fixed").css("top",g).css("bottom","").css("z-index",l.zIndex)}}},p=function(){c=r.height();for(var e=0,i=o.length;e<i;e++){var n=o[e],s=null;n.getWidthFrom?n.responsiveWidth&&(s=t(n.getWidthFrom).width()):n.widthFromWrapper&&(s=n.stickyWrapper.width()),null!=s&&n.stickyElement.css("width",s)}},d={init:function(e){return this.each(function(){var i=t.extend({},n,e),r=t(this),s=r.attr("id"),c=s?s+"-"+n.wrapperClassName:n.wrapperClassName,a=t("<div></div>").attr("id",c).addClass(i.wrapperClassName);r.wrapAll(function(){if(0==t(this).parent("#"+c).length)return a});var p=r.parent();i.center&&p.css({width:r.outerWidth(),marginLeft:"auto",marginRight:"auto"}),"right"===r.css("float")&&r.css({float:"none"}).parent().css({float:"right"}),i.stickyElement=r,i.stickyWrapper=p,i.currentTop=null,o.push(i),d.setWrapperHeight(this),d.setupChangeListeners(this)})},setWrapperHeight:function(e){var i=t(e),n=i.parent();n&&n.css("height",i.outerHeight())},setupChangeListeners:function(t){if(window.MutationObserver){var e=new window.MutationObserver(function(e){(e[0].addedNodes.length||e[0].removedNodes.length)&&d.setWrapperHeight(t)});e.observe(t,{subtree:!0,childList:!0})}else window.addEventListener?(t.addEventListener("DOMNodeInserted",function(){d.setWrapperHeight(t)},!1),t.addEventListener("DOMNodeRemoved",function(){d.setWrapperHeight(t)},!1)):window.attachEvent&&(t.attachEvent("onDOMNodeInserted",function(){d.setWrapperHeight(t)}),t.attachEvent("onDOMNodeRemoved",function(){d.setWrapperHeight(t)}))},update:a,unstick:function(e){return this.each(function(){for(var e=this,n=t(e),r=-1,s=o.length;s-- >0;)o[s].stickyElement.get(0)===e&&(i.call(o,s,1),r=s);r!==-1&&(n.unwrap(),n.css({width:"",position:"",top:"",float:"","z-index":""}))})}};window.addEventListener?(window.addEventListener("scroll",a,!1),window.addEventListener("resize",p,!1)):window.attachEvent&&(window.attachEvent("onscroll",a),window.attachEvent("onresize",p)),t.fn.sticky=function(i){return d[i]?d[i].apply(this,e.call(arguments,1)):"object"!=typeof i&&i?void t.error("Method "+i+" does not exist on jQuery.sticky"):d.init.apply(this,arguments)},t.fn.unstick=function(i){return d[i]?d[i].apply(this,e.call(arguments,1)):"object"!=typeof i&&i?void t.error("Method "+i+" does not exist on jQuery.sticky"):d.unstick.apply(this,arguments)},t(function(){setTimeout(a,0)})});
  414. //# sourceMappingURL=jquery.sticky.min.js.map
  415. /* bootstrap-spin - v1.0
  416. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  417. /* ========================================================================
  418. * bootstrap-spin - v1.0
  419. * https://github.com/wpic/bootstrap-spin
  420. * ========================================================================
  421. * Copyright 2014 WPIC, Hamed Abdollahpour
  422. *
  423. * ========================================================================
  424. * Licensed under the Apache License, Version 2.0 (the "License");
  425. * you may not use this file except in compliance with the License.
  426. * You may obtain a copy of the License at
  427. *
  428. * http://www.apache.org/licenses/LICENSE-2.0
  429. *
  430. * Unless required by applicable law or agreed to in writing, software
  431. * distributed under the License is distributed on an "AS IS" BASIS,
  432. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  433. * See the License for the specific language governing permissions and
  434. * limitations under the License.
  435. * ========================================================================
  436. */
  437. (function ( $ ) {
  438. $.fn.bootstrapNumber = function( options ) {
  439. var settings = $.extend({
  440. upClass: 'default',
  441. downClass: 'default',
  442. center: true
  443. }, options );
  444. return this.each(function(e) {
  445. var self = $(this);
  446. var clone = self.clone();
  447. var min = self.attr('min');
  448. var max = self.attr('max');
  449. function setText(n) {
  450. if((min && n < min) || (max && n > max)) {
  451. return false;
  452. }
  453. clone.val(n);
  454. return true;
  455. }
  456. var group = $("<div class='input-group'></div>");
  457. var down = $("<button type='button'><span class='icon icon-minus'></span></button>").attr('class', 'btn btn-' + settings.downClass).click(function() {
  458. setText(parseInt(clone.val()) - 1);
  459. });
  460. var up = $("<button type='button'><span class='icon icon-plus'></span></button>").attr('class', 'btn btn-' + settings.upClass).click(function() {
  461. setText(parseInt(clone.val()) + 1);
  462. });
  463. $("<span class='input-group-btn'></span>").append(down).appendTo(group);
  464. clone.appendTo(group);
  465. if(clone) {
  466. clone.css('text-align', 'center');
  467. }
  468. $("<span class='input-group-btn'></span>").append(up).appendTo(group);
  469. // remove spins from original
  470. clone.attr('type', 'text').keydown(function (e) {
  471. if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -0 ||
  472. (e.keyCode == 65 && e.ctrlKey === true) ||
  473. (e.keyCode >= 35 && e.keyCode <= 39)) {
  474. return;
  475. }
  476. if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
  477. e.preventDefault();
  478. }
  479. var c = String.fromCharCode(e.which);
  480. var n = parseInt(clone.val() + c);
  481. if((min && n < min) || (max && n > max)) {
  482. e.preventDefault();
  483. }
  484. });
  485. self.replaceWith(group);
  486. });
  487. };
  488. } ( jQuery ));
  489. /* Jquery Countdown
  490. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  491. /*!
  492. * The Final Countdown for jQuery v2.2.0 (http://hilios.github.io/jQuery.countdown/)
  493. * Copyright (c) 2016 Edson Hilios
  494. *
  495. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  496. * this software and associated documentation files (the "Software"), to deal in
  497. * the Software without restriction, including without limitation the rights to
  498. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  499. * the Software, and to permit persons to whom the Software is furnished to do so,
  500. * subject to the following conditions:
  501. *
  502. * The above copyright notice and this permission notice shall be included in all
  503. * copies or substantial portions of the Software.
  504. *
  505. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  506. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  507. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  508. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  509. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  510. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  511. */
  512. !function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";function b(a){if(a instanceof Date)return a;if(String(a).match(g))return String(a).match(/^[0-9]*$/)&&(a=Number(a)),String(a).match(/\-/)&&(a=String(a).replace(/\-/g,"/")),new Date(a);throw new Error("Couldn't cast `"+a+"` to a date object.")}function c(a){var b=a.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return new RegExp(b)}function d(a){return function(b){var d=b.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(d)for(var f=0,g=d.length;f<g;++f){var h=d[f].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),j=c(h[0]),k=h[1]||"",l=h[3]||"",m=null;h=h[2],i.hasOwnProperty(h)&&(m=i[h],m=Number(a[m])),null!==m&&("!"===k&&(m=e(l,m)),""===k&&m<10&&(m="0"+m.toString()),b=b.replace(j,m.toString()))}return b=b.replace(/%%/,"%")}}function e(a,b){var c="s",d="";return a&&(a=a.replace(/(:|;|\s)/gi,"").split(/\,/),1===a.length?c=a[0]:(d=a[0],c=a[1])),Math.abs(b)>1?c:d}var f=[],g=[],h={precision:100,elapse:!1,defer:!1};g.push(/^[0-9]*$/.source),g.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g=new RegExp(g.join("|"));var i={Y:"years",m:"months",n:"daysToMonth",d:"daysToWeek",w:"weeks",W:"weeksToMonth",H:"hours",M:"minutes",S:"seconds",D:"totalDays",I:"totalHours",N:"totalMinutes",T:"totalSeconds"},j=function(b,c,d){this.el=b,this.$el=a(b),this.interval=null,this.offset={},this.options=a.extend({},h),this.instanceNumber=f.length,f.push(this),this.$el.data("countdown-instance",this.instanceNumber),d&&("function"==typeof d?(this.$el.on("update.countdown",d),this.$el.on("stoped.countdown",d),this.$el.on("finish.countdown",d)):this.options=a.extend({},h,d)),this.setFinalDate(c),this.options.defer===!1&&this.start()};a.extend(j.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var a=this;this.update(),this.interval=setInterval(function(){a.update.call(a)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),f[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(a){this.finalDate=b(a)},update:function(){if(0===this.$el.closest("html").length)return void this.remove();var b,c=void 0!==a._data(this.el,"events"),d=new Date;b=this.finalDate.getTime()-d.getTime(),b=Math.ceil(b/1e3),b=!this.options.elapse&&b<0?0:Math.abs(b),this.totalSecsLeft!==b&&c&&(this.totalSecsLeft=b,this.elapsed=d>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),weeksToMonth:Math.floor(this.totalSecsLeft/60/60/24/7)%4,months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-d.getFullYear()),totalDays:Math.floor(this.totalSecsLeft/60/60/24),totalHours:Math.floor(this.totalSecsLeft/60/60),totalMinutes:Math.floor(this.totalSecsLeft/60),totalSeconds:this.totalSecsLeft},this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish")))},dispatchEvent:function(b){var c=a.Event(b+".countdown");c.finalDate=this.finalDate,c.elapsed=this.elapsed,c.offset=a.extend({},this.offset),c.strftime=d(this.offset),this.$el.trigger(c)}}),a.fn.countdown=function(){var b=Array.prototype.slice.call(arguments,0);return this.each(function(){var c=a(this).data("countdown-instance");if(void 0!==c){var d=f[c],e=b[0];j.prototype.hasOwnProperty(e)?d[e].apply(d,b.slice(1)):null===String(e).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(d.setFinalDate.call(d,e),d.start()):a.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,e))}else new j(this,b[0],b[1])})}});
  513. /* JQuery.nicescroll 3.6.8
  514. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  515. /* jquery.nicescroll 3.6.8 InuYaksa*2015 MIT http://nicescroll.areaaperta.com */(function(f){"function"===typeof define&&define.amd?define(["jquery"],f):"object"===typeof exports?module.exports=f(require("jquery")):f(jQuery)})(function(f){var B=!1,F=!1,O=0,P=2E3,A=0,J=["webkit","ms","moz","o"],v=window.requestAnimationFrame||!1,w=window.cancelAnimationFrame||!1;if(!v)for(var Q in J){var G=J[Q];if(v=window[G+"RequestAnimationFrame"]){w=window[G+"CancelAnimationFrame"]||window[G+"CancelRequestAnimationFrame"];break}}var x=window.MutationObserver||window.WebKitMutationObserver||
  516. !1,K={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"6px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:24,touchbehavior:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},
  517. disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:function(){var f=document.getElementsByTagName("script"),f=f.length?f[f.length-
  518. 1].src.split("?")[0]:"";return 0<f.split("/").length?f.split("/").slice(0,-1).join("/")+"/":""}(),preventmultitouchscrolling:!0,disablemutationobserver:!1},H=!1,R=function(){if(H)return H;var f=document.createElement("DIV"),c=f.style,k=navigator.userAgent,l=navigator.platform,d={haspointerlock:"pointerLockElement"in document||"webkitPointerLockElement"in document||"mozPointerLockElement"in document};d.isopera="opera"in window;d.isopera12=d.isopera&&"getUserMedia"in navigator;d.isoperamini="[object OperaMini]"===
  519. Object.prototype.toString.call(window.operamini);d.isie="all"in document&&"attachEvent"in f&&!d.isopera;d.isieold=d.isie&&!("msInterpolationMode"in c);d.isie7=d.isie&&!d.isieold&&(!("documentMode"in document)||7==document.documentMode);d.isie8=d.isie&&"documentMode"in document&&8==document.documentMode;d.isie9=d.isie&&"performance"in window&&9==document.documentMode;d.isie10=d.isie&&"performance"in window&&10==document.documentMode;d.isie11="msRequestFullscreen"in f&&11<=document.documentMode;d.isieedge12=
  520. navigator.userAgent.match(/Edge\/12\./);d.isieedge="msOverflowStyle"in f;d.ismodernie=d.isie11||d.isieedge;d.isie9mobile=/iemobile.9/i.test(k);d.isie9mobile&&(d.isie9=!1);d.isie7mobile=!d.isie9mobile&&d.isie7&&/iemobile/i.test(k);d.ismozilla="MozAppearance"in c;d.iswebkit="WebkitAppearance"in c;d.ischrome="chrome"in window;d.ischrome38=d.ischrome&&"touchAction"in c;d.ischrome22=!d.ischrome38&&d.ischrome&&d.haspointerlock;d.ischrome26=!d.ischrome38&&d.ischrome&&"transition"in c;d.cantouch="ontouchstart"in
  521. document.documentElement||"ontouchstart"in window;d.hasw3ctouch=(window.PointerEvent||!1)&&(0<navigator.MaxTouchPoints||0<navigator.msMaxTouchPoints);d.hasmstouch=!d.hasw3ctouch&&(window.MSPointerEvent||!1);d.ismac=/^mac$/i.test(l);d.isios=d.cantouch&&/iphone|ipad|ipod/i.test(l);d.isios4=d.isios&&!("seal"in Object);d.isios7=d.isios&&"webkitHidden"in document;d.isios8=d.isios&&"hidden"in document;d.isandroid=/android/i.test(k);d.haseventlistener="addEventListener"in f;d.trstyle=!1;d.hastransform=!1;
  522. d.hastranslate3d=!1;d.transitionstyle=!1;d.hastransition=!1;d.transitionend=!1;l=["transform","msTransform","webkitTransform","MozTransform","OTransform"];for(k=0;k<l.length;k++)if(void 0!==c[l[k]]){d.trstyle=l[k];break}d.hastransform=!!d.trstyle;d.hastransform&&(c[d.trstyle]="translate3d(1px,2px,3px)",d.hastranslate3d=/translate3d/.test(c[d.trstyle]));d.transitionstyle=!1;d.prefixstyle="";d.transitionend=!1;for(var l="transition webkitTransition msTransition MozTransition OTransition OTransition KhtmlTransition".split(" "),
  523. q=" -webkit- -ms- -moz- -o- -o -khtml-".split(" "),t="transitionend webkitTransitionEnd msTransitionEnd transitionend otransitionend oTransitionEnd KhtmlTransitionEnd".split(" "),k=0;k<l.length;k++)if(l[k]in c){d.transitionstyle=l[k];d.prefixstyle=q[k];d.transitionend=t[k];break}d.ischrome26&&(d.prefixstyle=q[1]);d.hastransition=d.transitionstyle;a:{k=["grab","-webkit-grab","-moz-grab"];if(d.ischrome&&!d.ischrome38||d.isie)k=[];for(l=0;l<k.length;l++)if(q=k[l],c.cursor=q,c.cursor==q){c=q;break a}c=
  524. "url(//patriciaportfolio.googlecode.com/files/openhand.cur),n-resize"}d.cursorgrabvalue=c;d.hasmousecapture="setCapture"in f;d.hasMutationObserver=!1!==x;return H=d},S=function(h,c){function k(){var b=a.doc.css(e.trstyle);return b&&"matrix"==b.substr(0,6)?b.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/):!1}function l(){var b=a.win;if("zIndex"in b)return b.zIndex();for(;0<b.length&&9!=b[0].nodeType;){var g=b.css("zIndex");if(!isNaN(g)&&0!=g)return parseInt(g);b=b.parent()}return!1}function d(b,
  525. g,u){g=b.css(g);b=parseFloat(g);return isNaN(b)?(b=z[g]||0,u=3==b?u?a.win.outerHeight()-a.win.innerHeight():a.win.outerWidth()-a.win.innerWidth():1,a.isie8&&b&&(b+=1),u?b:0):b}function q(b,g,u,c){a._bind(b,g,function(a){a=a?a:window.event;var c={original:a,target:a.target||a.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==a.type?0:1,deltaX:0,deltaZ:0,preventDefault:function(){a.preventDefault?a.preventDefault():a.returnValue=!1;return!1},stopImmediatePropagation:function(){a.stopImmediatePropagation?
  526. a.stopImmediatePropagation():a.cancelBubble=!0}};"mousewheel"==g?(a.wheelDeltaX&&(c.deltaX=-.025*a.wheelDeltaX),a.wheelDeltaY&&(c.deltaY=-.025*a.wheelDeltaY),c.deltaY||c.deltaX||(c.deltaY=-.025*a.wheelDelta)):c.deltaY=a.detail;return u.call(b,c)},c)}function t(b,g,c){var d,e;0==b.deltaMode?(d=-Math.floor(a.opt.mousescrollstep/54*b.deltaX),e=-Math.floor(a.opt.mousescrollstep/54*b.deltaY)):1==b.deltaMode&&(d=-Math.floor(b.deltaX*a.opt.mousescrollstep),e=-Math.floor(b.deltaY*a.opt.mousescrollstep));
  527. g&&a.opt.oneaxismousemode&&0==d&&e&&(d=e,e=0,c&&(0>d?a.getScrollLeft()>=a.page.maxw:0>=a.getScrollLeft())&&(e=d,d=0));a.isrtlmode&&(d=-d);d&&(a.scrollmom&&a.scrollmom.stop(),a.lastdeltax+=d,a.debounced("mousewheelx",function(){var b=a.lastdeltax;a.lastdeltax=0;a.rail.drag||a.doScrollLeftBy(b)},15));if(e){if(a.opt.nativeparentscrolling&&c&&!a.ispage&&!a.zoomactive)if(0>e){if(a.getScrollTop()>=a.page.maxh)return!0}else if(0>=a.getScrollTop())return!0;a.scrollmom&&a.scrollmom.stop();a.lastdeltay+=e;
  528. a.synched("mousewheely",function(){var b=a.lastdeltay;a.lastdeltay=0;a.rail.drag||a.doScrollBy(b)},15)}b.stopImmediatePropagation();return b.preventDefault()}var a=this;this.version="3.6.8";this.name="nicescroll";this.me=c;this.opt={doc:f("body"),win:!1};f.extend(this.opt,K);this.opt.snapbackspeed=80;if(h)for(var r in a.opt)void 0!==h[r]&&(a.opt[r]=h[r]);a.opt.disablemutationobserver&&(x=!1);this.iddoc=(this.doc=a.opt.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/^BODY|HTML/.test(a.opt.win?
  529. a.opt.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=!1!==a.opt.win;this.win=a.opt.win||(this.ispage?f(window):this.doc);this.docscroll=this.ispage&&!this.haswrapper?f(window):this.win;this.body=f("body");this.iframe=this.isfixed=this.viewport=!1;this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName;this.istextarea="TEXTAREA"==this.win[0].nodeName;this.forcescreen=!1;this.canshowonmouseevent="scroll"!=a.opt.autohidemode;this.page=this.view=this.onzoomout=this.onzoomin=
  530. this.onscrollcancel=this.onscrollend=this.onscrollstart=this.onclick=this.ongesturezoom=this.onkeypress=this.onmousewheel=this.onmousemove=this.onmouseup=this.onmousedown=!1;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;if("auto"==this.opt.rtlmode){r=this.win[0]==window?this.body:this.win;var p=r.css("writing-mode")||r.css("-webkit-writing-mode")||r.css("-ms-writing-mode")||r.css("-moz-writing-mode");"horizontal-tb"==p||"lr-tb"==p||""==p?(this.isrtlmode=
  531. "rtl"==r.css("direction"),this.isvertical=!1):(this.isrtlmode="vertical-rl"==p||"tb"==p||"tb-rl"==p||"rl-tb"==p,this.isvertical="vertical-rl"==p||"tb"==p||"tb-rl"==p)}else this.isrtlmode=!0===this.opt.rtlmode,this.isvertical=!1;this.observerbody=this.observerremover=this.observer=this.scrollmom=this.scrollrunning=!1;do this.id="ascrail"+P++;while(document.getElementById(this.id));this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.selectiondrag=this.cursorfreezed=this.cursor=this.rail=
  532. !1;this.visibility=!0;this.hidden=this.locked=this.railslocked=!1;this.cursoractive=!0;this.wheelprevented=!1;this.overflowx=a.opt.overflowx;this.overflowy=a.opt.overflowy;this.nativescrollingarea=!1;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltay=this.lastdeltax=0;this.detected=R();var e=f.extend({},this.detected);this.ishwscroll=(this.canhwscroll=e.hastransform&&a.opt.hwacceleration)&&a.haswrapper;this.hasreversehr=this.isrtlmode?this.isvertical?
  533. !(e.iswebkit||e.isie||e.isie11):!(e.iswebkit||e.isie&&!e.isie10&&!e.isie11):!1;this.istouchcapable=!1;e.cantouch||!e.hasw3ctouch&&!e.hasmstouch?!e.cantouch||e.isios||e.isandroid||!e.iswebkit&&!e.ismozilla||(this.istouchcapable=!0):this.istouchcapable=!0;a.opt.enablemouselockapi||(e.hasmousecapture=!1,e.haspointerlock=!1);this.debounced=function(b,g,c){a&&(a.delaylist[b]||(g.call(a),a.delaylist[b]={h:v(function(){a.delaylist[b].fn.call(a);a.delaylist[b]=!1},c)}),a.delaylist[b].fn=g)};var I=!1;this.synched=
  534. function(b,g){a.synclist[b]=g;(function(){I||(v(function(){if(a){I=!1;for(var b in a.synclist){var g=a.synclist[b];g&&g.call(a);a.synclist[b]=!1}}}),I=!0)})();return b};this.unsynched=function(b){a.synclist[b]&&(a.synclist[b]=!1)};this.css=function(b,g){for(var c in g)a.saved.css.push([b,c,b.css(c)]),b.css(c,g[c])};this.scrollTop=function(b){return void 0===b?a.getScrollTop():a.setScrollTop(b)};this.scrollLeft=function(b){return void 0===b?a.getScrollLeft():a.setScrollLeft(b)};var D=function(a,g,
  535. c,d,e,f,k){this.st=a;this.ed=g;this.spd=c;this.p1=d||0;this.p2=e||1;this.p3=f||0;this.p4=k||1;this.ts=(new Date).getTime();this.df=this.ed-this.st};D.prototype={B2:function(a){return 3*a*a*(1-a)},B3:function(a){return 3*a*(1-a)*(1-a)},B4:function(a){return(1-a)*(1-a)*(1-a)},getNow:function(){var a=1-((new Date).getTime()-this.ts)/this.spd,g=this.B2(a)+this.B3(a)+this.B4(a);return 0>a?this.ed:this.st+Math.round(this.df*g)},update:function(a,g){this.st=this.getNow();this.ed=a;this.spd=g;this.ts=(new Date).getTime();
  536. this.df=this.ed-this.st;return this}};if(this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"};e.hastranslate3d&&e.isios&&this.doc.css("-webkit-backface-visibility","hidden");this.getScrollTop=function(b){if(!b){if(b=k())return 16==b.length?-b[13]:-b[5];if(a.timerscroll&&a.timerscroll.bz)return a.timerscroll.bz.getNow()}return a.doc.translate.y};this.getScrollLeft=function(b){if(!b){if(b=k())return 16==b.length?-b[12]:-b[4];if(a.timerscroll&&a.timerscroll.bh)return a.timerscroll.bh.getNow()}return a.doc.translate.x};
  537. this.notifyScrollEvent=function(a){var g=document.createEvent("UIEvents");g.initUIEvent("scroll",!1,!0,window,1);g.niceevent=!0;a.dispatchEvent(g)};var y=this.isrtlmode?1:-1;e.hastranslate3d&&a.opt.enabletranslate3d?(this.setScrollTop=function(b,g){a.doc.translate.y=b;a.doc.translate.ty=-1*b+"px";a.doc.css(e.trstyle,"translate3d("+a.doc.translate.tx+","+a.doc.translate.ty+",0px)");g||a.notifyScrollEvent(a.win[0])},this.setScrollLeft=function(b,g){a.doc.translate.x=b;a.doc.translate.tx=b*y+"px";a.doc.css(e.trstyle,
  538. "translate3d("+a.doc.translate.tx+","+a.doc.translate.ty+",0px)");g||a.notifyScrollEvent(a.win[0])}):(this.setScrollTop=function(b,g){a.doc.translate.y=b;a.doc.translate.ty=-1*b+"px";a.doc.css(e.trstyle,"translate("+a.doc.translate.tx+","+a.doc.translate.ty+")");g||a.notifyScrollEvent(a.win[0])},this.setScrollLeft=function(b,g){a.doc.translate.x=b;a.doc.translate.tx=b*y+"px";a.doc.css(e.trstyle,"translate("+a.doc.translate.tx+","+a.doc.translate.ty+")");g||a.notifyScrollEvent(a.win[0])})}else this.getScrollTop=
  539. function(){return a.docscroll.scrollTop()},this.setScrollTop=function(b){return setTimeout(function(){a&&a.docscroll.scrollTop(b)},1)},this.getScrollLeft=function(){return a.hasreversehr?a.detected.ismozilla?a.page.maxw-Math.abs(a.docscroll.scrollLeft()):a.page.maxw-a.docscroll.scrollLeft():a.docscroll.scrollLeft()},this.setScrollLeft=function(b){return setTimeout(function(){if(a)return a.hasreversehr&&(b=a.detected.ismozilla?-(a.page.maxw-b):a.page.maxw-b),a.docscroll.scrollLeft(b)},1)};this.getTarget=
  540. function(a){return a?a.target?a.target:a.srcElement?a.srcElement:!1:!1};this.hasParent=function(a,g){if(!a)return!1;for(var c=a.target||a.srcElement||a||!1;c&&c.id!=g;)c=c.parentNode||!1;return!1!==c};var z={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=function(){return{top:window.pageYOffset||document.documentElement.scrollTop,left:window.pageXOffset||document.documentElement.scrollLeft}};this.getOffset=function(){if(a.isfixed){var b=a.win.offset(),g=a.getDocumentScrollOffset();b.top-=g.top;
  541. b.left-=g.left;return b}b=a.win.offset();if(!a.viewport)return b;g=a.viewport.offset();return{top:b.top-g.top,left:b.left-g.left}};this.updateScrollBar=function(b){var g,c,e;if(a.ishwscroll)a.rail.css({height:a.win.innerHeight()-(a.opt.railpadding.top+a.opt.railpadding.bottom)}),a.railh&&a.railh.css({width:a.win.innerWidth()-(a.opt.railpadding.left+a.opt.railpadding.right)});else{var f=a.getOffset();g=f.top;c=f.left-(a.opt.railpadding.left+a.opt.railpadding.right);g+=d(a.win,"border-top-width",!0);
  542. c+=a.rail.align?a.win.outerWidth()-d(a.win,"border-right-width")-a.rail.width:d(a.win,"border-left-width");if(e=a.opt.railoffset)e.top&&(g+=e.top),e.left&&(c+=e.left);a.railslocked||a.rail.css({top:g,left:c,height:(b?b.h:a.win.innerHeight())-(a.opt.railpadding.top+a.opt.railpadding.bottom)});a.zoom&&a.zoom.css({top:g+1,left:1==a.rail.align?c-20:c+a.rail.width+4});if(a.railh&&!a.railslocked){g=f.top;c=f.left;if(e=a.opt.railhoffset)e.top&&(g+=e.top),e.left&&(c+=e.left);b=a.railh.align?g+d(a.win,"border-top-width",
  543. !0)+a.win.innerHeight()-a.railh.height:g+d(a.win,"border-top-width",!0);c+=d(a.win,"border-left-width");a.railh.css({top:b-(a.opt.railpadding.top+a.opt.railpadding.bottom),left:c,width:a.railh.width})}}};this.doRailClick=function(b,g,c){var d;a.railslocked||(a.cancelEvent(b),g?(g=c?a.doScrollLeft:a.doScrollTop,d=c?(b.pageX-a.railh.offset().left-a.cursorwidth/2)*a.scrollratio.x:(b.pageY-a.rail.offset().top-a.cursorheight/2)*a.scrollratio.y,g(d)):(g=c?a.doScrollLeftBy:a.doScrollBy,d=c?a.scroll.x:a.scroll.y,
  544. b=c?b.pageX-a.railh.offset().left:b.pageY-a.rail.offset().top,c=c?a.view.w:a.view.h,g(d>=b?c:-c)))};a.hasanimationframe=v;a.hascancelanimationframe=w;a.hasanimationframe?a.hascancelanimationframe||(w=function(){a.cancelAnimationFrame=!0}):(v=function(a){return setTimeout(a,15-Math.floor(+new Date/1E3)%16)},w=clearTimeout);this.init=function(){a.saved.css=[];if(e.isie7mobile||e.isoperamini)return!0;e.hasmstouch&&a.css(a.ispage?f("html"):a.win,{_touchaction:"none"});var b=e.ismodernie||e.isie10?{"-ms-overflow-style":"none"}:
  545. {"overflow-y":"hidden"};a.zindex="auto";a.zindex=a.ispage||"auto"!=a.opt.zindex?a.opt.zindex:l()||"auto";!a.ispage&&"auto"!=a.zindex&&a.zindex>A&&(A=a.zindex);a.isie&&0==a.zindex&&"auto"==a.opt.zindex&&(a.zindex="auto");if(!a.ispage||!e.cantouch&&!e.isieold&&!e.isie9mobile){var c=a.docscroll;a.ispage&&(c=a.haswrapper?a.win:a.doc);e.isie9mobile||a.css(c,b);a.ispage&&e.isie7&&("BODY"==a.doc[0].nodeName?a.css(f("html"),{"overflow-y":"hidden"}):"HTML"==a.doc[0].nodeName&&a.css(f("body"),b));!e.isios||
  546. a.ispage||a.haswrapper||a.css(f("body"),{"-webkit-overflow-scrolling":"touch"});var d=f(document.createElement("div"));d.css({position:"relative",top:0,"float":"right",width:a.opt.cursorwidth,height:0,"background-color":a.opt.cursorcolor,border:a.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":a.opt.cursorborderradius,"-moz-border-radius":a.opt.cursorborderradius,"border-radius":a.opt.cursorborderradius});d.hborder=parseFloat(d.outerHeight()-d.innerHeight());d.addClass("nicescroll-cursors");
  547. a.cursor=d;var m=f(document.createElement("div"));m.attr("id",a.id);m.addClass("nicescroll-rails nicescroll-rails-vr");var k,h,p=["left","right","top","bottom"],L;for(L in p)h=p[L],(k=a.opt.railpadding[h])?m.css("padding-"+h,k+"px"):a.opt.railpadding[h]=0;m.append(d);m.width=Math.max(parseFloat(a.opt.cursorwidth),d.outerWidth());m.css({width:m.width+"px",zIndex:a.zindex,background:a.opt.background,cursor:"default"});m.visibility=!0;m.scrollable=!0;m.align="left"==a.opt.railalign?0:1;a.rail=m;d=a.rail.drag=
  548. !1;!a.opt.boxzoom||a.ispage||e.isieold||(d=document.createElement("div"),a.bind(d,"click",a.doZoom),a.bind(d,"mouseenter",function(){a.zoom.css("opacity",a.opt.cursoropacitymax)}),a.bind(d,"mouseleave",function(){a.zoom.css("opacity",a.opt.cursoropacitymin)}),a.zoom=f(d),a.zoom.css({cursor:"pointer",zIndex:a.zindex,backgroundImage:"url("+a.opt.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0px 0px"}),a.opt.dblclickzoom&&a.bind(a.win,"dblclick",a.doZoom),e.cantouch&&a.opt.gesturezoom&&
  549. (a.ongesturezoom=function(b){1.5<b.scale&&a.doZoomIn(b);.8>b.scale&&a.doZoomOut(b);return a.cancelEvent(b)},a.bind(a.win,"gestureend",a.ongesturezoom)));a.railh=!1;var n;a.opt.horizrailenabled&&(a.css(c,{overflowX:"hidden"}),d=f(document.createElement("div")),d.css({position:"absolute",top:0,height:a.opt.cursorwidth,width:0,backgroundColor:a.opt.cursorcolor,border:a.opt.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":a.opt.cursorborderradius,"-moz-border-radius":a.opt.cursorborderradius,
  550. "border-radius":a.opt.cursorborderradius}),e.isieold&&d.css("overflow","hidden"),d.wborder=parseFloat(d.outerWidth()-d.innerWidth()),d.addClass("nicescroll-cursors"),a.cursorh=d,n=f(document.createElement("div")),n.attr("id",a.id+"-hr"),n.addClass("nicescroll-rails nicescroll-rails-hr"),n.height=Math.max(parseFloat(a.opt.cursorwidth),d.outerHeight()),n.css({height:n.height+"px",zIndex:a.zindex,background:a.opt.background}),n.append(d),n.visibility=!0,n.scrollable=!0,n.align="top"==a.opt.railvalign?
  551. 0:1,a.railh=n,a.railh.drag=!1);a.ispage?(m.css({position:"fixed",top:0,height:"100%"}),m.align?m.css({right:0}):m.css({left:0}),a.body.append(m),a.railh&&(n.css({position:"fixed",left:0,width:"100%"}),n.align?n.css({bottom:0}):n.css({top:0}),a.body.append(n))):(a.ishwscroll?("static"==a.win.css("position")&&a.css(a.win,{position:"relative"}),c="HTML"==a.win[0].nodeName?a.body:a.win,f(c).scrollTop(0).scrollLeft(0),a.zoom&&(a.zoom.css({position:"absolute",top:1,right:0,"margin-right":m.width+4}),c.append(a.zoom)),
  552. m.css({position:"absolute",top:0}),m.align?m.css({right:0}):m.css({left:0}),c.append(m),n&&(n.css({position:"absolute",left:0,bottom:0}),n.align?n.css({bottom:0}):n.css({top:0}),c.append(n))):(a.isfixed="fixed"==a.win.css("position"),c=a.isfixed?"fixed":"absolute",a.isfixed||(a.viewport=a.getViewport(a.win[0])),a.viewport&&(a.body=a.viewport,0==/fixed|absolute/.test(a.viewport.css("position"))&&a.css(a.viewport,{position:"relative"})),m.css({position:c}),a.zoom&&a.zoom.css({position:c}),a.updateScrollBar(),
  553. a.body.append(m),a.zoom&&a.body.append(a.zoom),a.railh&&(n.css({position:c}),a.body.append(n))),e.isios&&a.css(a.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),e.isie&&a.opt.disableoutline&&a.win.attr("hideFocus","true"),e.iswebkit&&a.opt.disableoutline&&a.win.css("outline","none"));!1===a.opt.autohidemode?(a.autohidedom=!1,a.rail.css({opacity:a.opt.cursoropacitymax}),a.railh&&a.railh.css({opacity:a.opt.cursoropacitymax})):!0===a.opt.autohidemode||"leave"===a.opt.autohidemode?
  554. (a.autohidedom=f().add(a.rail),e.isie8&&(a.autohidedom=a.autohidedom.add(a.cursor)),a.railh&&(a.autohidedom=a.autohidedom.add(a.railh)),a.railh&&e.isie8&&(a.autohidedom=a.autohidedom.add(a.cursorh))):"scroll"==a.opt.autohidemode?(a.autohidedom=f().add(a.rail),a.railh&&(a.autohidedom=a.autohidedom.add(a.railh))):"cursor"==a.opt.autohidemode?(a.autohidedom=f().add(a.cursor),a.railh&&(a.autohidedom=a.autohidedom.add(a.cursorh))):"hidden"==a.opt.autohidemode&&(a.autohidedom=!1,a.hide(),a.railslocked=
  555. !1);if(e.isie9mobile)a.scrollmom=new M(a),a.onmangotouch=function(){var b=a.getScrollTop(),c=a.getScrollLeft();if(b==a.scrollmom.lastscrolly&&c==a.scrollmom.lastscrollx)return!0;var g=b-a.mangotouch.sy,d=c-a.mangotouch.sx;if(0!=Math.round(Math.sqrt(Math.pow(d,2)+Math.pow(g,2)))){var e=0>g?-1:1,f=0>d?-1:1,u=+new Date;a.mangotouch.lazy&&clearTimeout(a.mangotouch.lazy);80<u-a.mangotouch.tm||a.mangotouch.dry!=e||a.mangotouch.drx!=f?(a.scrollmom.stop(),a.scrollmom.reset(c,b),a.mangotouch.sy=b,a.mangotouch.ly=
  556. b,a.mangotouch.sx=c,a.mangotouch.lx=c,a.mangotouch.dry=e,a.mangotouch.drx=f,a.mangotouch.tm=u):(a.scrollmom.stop(),a.scrollmom.update(a.mangotouch.sx-d,a.mangotouch.sy-g),a.mangotouch.tm=u,g=Math.max(Math.abs(a.mangotouch.ly-b),Math.abs(a.mangotouch.lx-c)),a.mangotouch.ly=b,a.mangotouch.lx=c,2<g&&(a.mangotouch.lazy=setTimeout(function(){a.mangotouch.lazy=!1;a.mangotouch.dry=0;a.mangotouch.drx=0;a.mangotouch.tm=0;a.scrollmom.doMomentum(30)},100)))}},m=a.getScrollTop(),n=a.getScrollLeft(),a.mangotouch=
  557. {sy:m,ly:m,dry:0,sx:n,lx:n,drx:0,lazy:!1,tm:0},a.bind(a.docscroll,"scroll",a.onmangotouch);else{if(e.cantouch||a.istouchcapable||a.opt.touchbehavior||e.hasmstouch){a.scrollmom=new M(a);a.ontouchstart=function(b){if(b.pointerType&&2!=b.pointerType&&"touch"!=b.pointerType)return!1;a.hasmoving=!1;if(!a.railslocked){var c;if(e.hasmstouch)for(c=b.target?b.target:!1;c;){var g=f(c).getNiceScroll();if(0<g.length&&g[0].me==a.me)break;if(0<g.length)return!1;if("DIV"==c.nodeName&&c.id==a.id)break;c=c.parentNode?
  558. c.parentNode:!1}a.cancelScroll();if((c=a.getTarget(b))&&/INPUT/i.test(c.nodeName)&&/range/i.test(c.type))return a.stopPropagation(b);!("clientX"in b)&&"changedTouches"in b&&(b.clientX=b.changedTouches[0].clientX,b.clientY=b.changedTouches[0].clientY);a.forcescreen&&(g=b,b={original:b.original?b.original:b},b.clientX=g.screenX,b.clientY=g.screenY);a.rail.drag={x:b.clientX,y:b.clientY,sx:a.scroll.x,sy:a.scroll.y,st:a.getScrollTop(),sl:a.getScrollLeft(),pt:2,dl:!1};if(a.ispage||!a.opt.directionlockdeadzone)a.rail.drag.dl=
  559. "f";else{var g=f(window).width(),d=f(window).height(),d=Math.max(0,Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)-d),g=Math.max(0,Math.max(document.body.scrollWidth,document.documentElement.scrollWidth)-g);a.rail.drag.ck=!a.rail.scrollable&&a.railh.scrollable?0<d?"v":!1:a.rail.scrollable&&!a.railh.scrollable?0<g?"h":!1:!1;a.rail.drag.ck||(a.rail.drag.dl="f")}a.opt.touchbehavior&&a.isiframe&&e.isie&&(g=a.win.position(),a.rail.drag.x+=g.left,a.rail.drag.y+=g.top);a.hasmoving=
  560. !1;a.lastmouseup=!1;a.scrollmom.reset(b.clientX,b.clientY);if(!e.cantouch&&!this.istouchcapable&&!b.pointerType){if(!c||!/INPUT|SELECT|TEXTAREA/i.test(c.nodeName))return!a.ispage&&e.hasmousecapture&&c.setCapture(),a.opt.touchbehavior?(c.onclick&&!c._onclick&&(c._onclick=c.onclick,c.onclick=function(b){if(a.hasmoving)return!1;c._onclick.call(this,b)}),a.cancelEvent(b)):a.stopPropagation(b);/SUBMIT|CANCEL|BUTTON/i.test(f(c).attr("type"))&&(pc={tg:c,click:!1},a.preventclick=pc)}}};a.ontouchend=function(b){if(!a.rail.drag)return!0;
  561. if(2==a.rail.drag.pt){if(b.pointerType&&2!=b.pointerType&&"touch"!=b.pointerType)return!1;a.scrollmom.doMomentum();a.rail.drag=!1;if(a.hasmoving&&(a.lastmouseup=!0,a.hideCursor(),e.hasmousecapture&&document.releaseCapture(),!e.cantouch))return a.cancelEvent(b)}else if(1==a.rail.drag.pt)return a.onmouseup(b)};var q=a.opt.touchbehavior&&a.isiframe&&!e.hasmousecapture;a.ontouchmove=function(b,c){if(!a.rail.drag||b.targetTouches&&a.opt.preventmultitouchscrolling&&1<b.targetTouches.length||b.pointerType&&
  562. 2!=b.pointerType&&"touch"!=b.pointerType)return!1;if(2==a.rail.drag.pt){if(e.cantouch&&e.isios&&void 0===b.original)return!0;a.hasmoving=!0;a.preventclick&&!a.preventclick.click&&(a.preventclick.click=a.preventclick.tg.onclick||!1,a.preventclick.tg.onclick=a.onpreventclick);b=f.extend({original:b},b);"changedTouches"in b&&(b.clientX=b.changedTouches[0].clientX,b.clientY=b.changedTouches[0].clientY);if(a.forcescreen){var g=b;b={original:b.original?b.original:b};b.clientX=g.screenX;b.clientY=g.screenY}var d,
  563. g=d=0;q&&!c&&(d=a.win.position(),g=-d.left,d=-d.top);var u=b.clientY+d;d=u-a.rail.drag.y;var m=b.clientX+g,k=m-a.rail.drag.x,h=a.rail.drag.st-d;a.ishwscroll&&a.opt.bouncescroll?0>h?h=Math.round(h/2):h>a.page.maxh&&(h=a.page.maxh+Math.round((h-a.page.maxh)/2)):(0>h&&(u=h=0),h>a.page.maxh&&(h=a.page.maxh,u=0));var l;a.railh&&a.railh.scrollable&&(l=a.isrtlmode?k-a.rail.drag.sl:a.rail.drag.sl-k,a.ishwscroll&&a.opt.bouncescroll?0>l?l=Math.round(l/2):l>a.page.maxw&&(l=a.page.maxw+Math.round((l-a.page.maxw)/
  564. 2)):(0>l&&(m=l=0),l>a.page.maxw&&(l=a.page.maxw,m=0)));g=!1;if(a.rail.drag.dl)g=!0,"v"==a.rail.drag.dl?l=a.rail.drag.sl:"h"==a.rail.drag.dl&&(h=a.rail.drag.st);else{d=Math.abs(d);var k=Math.abs(k),C=a.opt.directionlockdeadzone;if("v"==a.rail.drag.ck){if(d>C&&k<=.3*d)return a.rail.drag=!1,!0;k>C&&(a.rail.drag.dl="f",f("body").scrollTop(f("body").scrollTop()))}else if("h"==a.rail.drag.ck){if(k>C&&d<=.3*k)return a.rail.drag=!1,!0;d>C&&(a.rail.drag.dl="f",f("body").scrollLeft(f("body").scrollLeft()))}}a.synched("touchmove",
  565. function(){a.rail.drag&&2==a.rail.drag.pt&&(a.prepareTransition&&a.prepareTransition(0),a.rail.scrollable&&a.setScrollTop(h),a.scrollmom.update(m,u),a.railh&&a.railh.scrollable?(a.setScrollLeft(l),a.showCursor(h,l)):a.showCursor(h),e.isie10&&document.selection.clear())});e.ischrome&&a.istouchcapable&&(g=!1);if(g)return a.cancelEvent(b)}else if(1==a.rail.drag.pt)return a.onmousemove(b)}}a.onmousedown=function(b,c){if(!a.rail.drag||1==a.rail.drag.pt){if(a.railslocked)return a.cancelEvent(b);a.cancelScroll();
  566. a.rail.drag={x:b.clientX,y:b.clientY,sx:a.scroll.x,sy:a.scroll.y,pt:1,hr:!!c};var g=a.getTarget(b);!a.ispage&&e.hasmousecapture&&g.setCapture();a.isiframe&&!e.hasmousecapture&&(a.saved.csspointerevents=a.doc.css("pointer-events"),a.css(a.doc,{"pointer-events":"none"}));a.hasmoving=!1;return a.cancelEvent(b)}};a.onmouseup=function(b){if(a.rail.drag){if(1!=a.rail.drag.pt)return!0;e.hasmousecapture&&document.releaseCapture();a.isiframe&&!e.hasmousecapture&&a.doc.css("pointer-events",a.saved.csspointerevents);
  567. a.rail.drag=!1;a.hasmoving&&a.triggerScrollEnd();return a.cancelEvent(b)}};a.onmousemove=function(b){if(a.rail.drag){if(1==a.rail.drag.pt){if(e.ischrome&&0==b.which)return a.onmouseup(b);a.cursorfreezed=!0;a.hasmoving=!0;if(a.rail.drag.hr){a.scroll.x=a.rail.drag.sx+(b.clientX-a.rail.drag.x);0>a.scroll.x&&(a.scroll.x=0);var c=a.scrollvaluemaxw;a.scroll.x>c&&(a.scroll.x=c)}else a.scroll.y=a.rail.drag.sy+(b.clientY-a.rail.drag.y),0>a.scroll.y&&(a.scroll.y=0),c=a.scrollvaluemax,a.scroll.y>c&&(a.scroll.y=
  568. c);a.synched("mousemove",function(){a.rail.drag&&1==a.rail.drag.pt&&(a.showCursor(),a.rail.drag.hr?a.hasreversehr?a.doScrollLeft(a.scrollvaluemaxw-Math.round(a.scroll.x*a.scrollratio.x),a.opt.cursordragspeed):a.doScrollLeft(Math.round(a.scroll.x*a.scrollratio.x),a.opt.cursordragspeed):a.doScrollTop(Math.round(a.scroll.y*a.scrollratio.y),a.opt.cursordragspeed))});return a.cancelEvent(b)}}else a.checkarea=0};if(e.cantouch||a.opt.touchbehavior)a.onpreventclick=function(b){if(a.preventclick)return a.preventclick.tg.onclick=
  569. a.preventclick.click,a.preventclick=!1,a.cancelEvent(b)},a.bind(a.win,"mousedown",a.ontouchstart),a.onclick=e.isios?!1:function(b){return a.lastmouseup?(a.lastmouseup=!1,a.cancelEvent(b)):!0},a.opt.grabcursorenabled&&e.cursorgrabvalue&&(a.css(a.ispage?a.doc:a.win,{cursor:e.cursorgrabvalue}),a.css(a.rail,{cursor:e.cursorgrabvalue}));else{var r=function(b){if(a.selectiondrag){if(b){var c=a.win.outerHeight();b=b.pageY-a.selectiondrag.top;0<b&&b<c&&(b=0);b>=c&&(b-=c);a.selectiondrag.df=b}0!=a.selectiondrag.df&&
  570. (a.doScrollBy(2*-Math.floor(a.selectiondrag.df/6)),a.debounced("doselectionscroll",function(){r()},50))}};a.hasTextSelected="getSelection"in document?function(){return 0<document.getSelection().rangeCount}:"selection"in document?function(){return"None"!=document.selection.type}:function(){return!1};a.onselectionstart=function(b){a.ispage||(a.selectiondrag=a.win.offset())};a.onselectionend=function(b){a.selectiondrag=!1};a.onselectiondrag=function(b){a.selectiondrag&&a.hasTextSelected()&&a.debounced("selectionscroll",
  571. function(){r(b)},250)}}e.hasw3ctouch?(a.css(a.rail,{"touch-action":"none"}),a.css(a.cursor,{"touch-action":"none"}),a.bind(a.win,"pointerdown",a.ontouchstart),a.bind(document,"pointerup",a.ontouchend),a.bind(document,"pointermove",a.ontouchmove)):e.hasmstouch?(a.css(a.rail,{"-ms-touch-action":"none"}),a.css(a.cursor,{"-ms-touch-action":"none"}),a.bind(a.win,"MSPointerDown",a.ontouchstart),a.bind(document,"MSPointerUp",a.ontouchend),a.bind(document,"MSPointerMove",a.ontouchmove),a.bind(a.cursor,"MSGestureHold",
  572. function(a){a.preventDefault()}),a.bind(a.cursor,"contextmenu",function(a){a.preventDefault()})):this.istouchcapable&&(a.bind(a.win,"touchstart",a.ontouchstart),a.bind(document,"touchend",a.ontouchend),a.bind(document,"touchcancel",a.ontouchend),a.bind(document,"touchmove",a.ontouchmove));if(a.opt.cursordragontouch||!e.cantouch&&!a.opt.touchbehavior)a.rail.css({cursor:"default"}),a.railh&&a.railh.css({cursor:"default"}),a.jqbind(a.rail,"mouseenter",function(){if(!a.ispage&&!a.win.is(":visible"))return!1;
  573. a.canshowonmouseevent&&a.showCursor();a.rail.active=!0}),a.jqbind(a.rail,"mouseleave",function(){a.rail.active=!1;a.rail.drag||a.hideCursor()}),a.opt.sensitiverail&&(a.bind(a.rail,"click",function(b){a.doRailClick(b,!1,!1)}),a.bind(a.rail,"dblclick",function(b){a.doRailClick(b,!0,!1)}),a.bind(a.cursor,"click",function(b){a.cancelEvent(b)}),a.bind(a.cursor,"dblclick",function(b){a.cancelEvent(b)})),a.railh&&(a.jqbind(a.railh,"mouseenter",function(){if(!a.ispage&&!a.win.is(":visible"))return!1;a.canshowonmouseevent&&
  574. a.showCursor();a.rail.active=!0}),a.jqbind(a.railh,"mouseleave",function(){a.rail.active=!1;a.rail.drag||a.hideCursor()}),a.opt.sensitiverail&&(a.bind(a.railh,"click",function(b){a.doRailClick(b,!1,!0)}),a.bind(a.railh,"dblclick",function(b){a.doRailClick(b,!0,!0)}),a.bind(a.cursorh,"click",function(b){a.cancelEvent(b)}),a.bind(a.cursorh,"dblclick",function(b){a.cancelEvent(b)})));e.cantouch||a.opt.touchbehavior?(a.bind(e.hasmousecapture?a.win:document,"mouseup",a.ontouchend),a.bind(document,"mousemove",
  575. a.ontouchmove),a.onclick&&a.bind(document,"click",a.onclick),a.opt.cursordragontouch?(a.bind(a.cursor,"mousedown",a.onmousedown),a.bind(a.cursor,"mouseup",a.onmouseup),a.cursorh&&a.bind(a.cursorh,"mousedown",function(b){a.onmousedown(b,!0)}),a.cursorh&&a.bind(a.cursorh,"mouseup",a.onmouseup)):(a.bind(a.rail,"mousedown",function(a){a.preventDefault()}),a.railh&&a.bind(a.railh,"mousedown",function(a){a.preventDefault()}))):(a.bind(e.hasmousecapture?a.win:document,"mouseup",a.onmouseup),a.bind(document,
  576. "mousemove",a.onmousemove),a.onclick&&a.bind(document,"click",a.onclick),a.bind(a.cursor,"mousedown",a.onmousedown),a.bind(a.cursor,"mouseup",a.onmouseup),a.railh&&(a.bind(a.cursorh,"mousedown",function(b){a.onmousedown(b,!0)}),a.bind(a.cursorh,"mouseup",a.onmouseup)),!a.ispage&&a.opt.enablescrollonselection&&(a.bind(a.win[0],"mousedown",a.onselectionstart),a.bind(document,"mouseup",a.onselectionend),a.bind(a.cursor,"mouseup",a.onselectionend),a.cursorh&&a.bind(a.cursorh,"mouseup",a.onselectionend),
  577. a.bind(document,"mousemove",a.onselectiondrag)),a.zoom&&(a.jqbind(a.zoom,"mouseenter",function(){a.canshowonmouseevent&&a.showCursor();a.rail.active=!0}),a.jqbind(a.zoom,"mouseleave",function(){a.rail.active=!1;a.rail.drag||a.hideCursor()})));a.opt.enablemousewheel&&(a.isiframe||a.mousewheel(e.isie&&a.ispage?document:a.win,a.onmousewheel),a.mousewheel(a.rail,a.onmousewheel),a.railh&&a.mousewheel(a.railh,a.onmousewheelhr));a.ispage||e.cantouch||/HTML|^BODY/.test(a.win[0].nodeName)||(a.win.attr("tabindex")||
  578. a.win.attr({tabindex:O++}),a.jqbind(a.win,"focus",function(b){B=a.getTarget(b).id||!0;a.hasfocus=!0;a.canshowonmouseevent&&a.noticeCursor()}),a.jqbind(a.win,"blur",function(b){B=!1;a.hasfocus=!1}),a.jqbind(a.win,"mouseenter",function(b){F=a.getTarget(b).id||!0;a.hasmousefocus=!0;a.canshowonmouseevent&&a.noticeCursor()}),a.jqbind(a.win,"mouseleave",function(){F=!1;a.hasmousefocus=!1;a.rail.drag||a.hideCursor()}))}a.onkeypress=function(b){if(a.railslocked&&0==a.page.maxh)return!0;b=b?b:window.e;var c=
  579. a.getTarget(b);if(c&&/INPUT|TEXTAREA|SELECT|OPTION/.test(c.nodeName)&&(!c.getAttribute("type")&&!c.type||!/submit|button|cancel/i.tp)||f(c).attr("contenteditable"))return!0;if(a.hasfocus||a.hasmousefocus&&!B||a.ispage&&!B&&!F){c=b.keyCode;if(a.railslocked&&27!=c)return a.cancelEvent(b);var g=b.ctrlKey||!1,d=b.shiftKey||!1,e=!1;switch(c){case 38:case 63233:a.doScrollBy(72);e=!0;break;case 40:case 63235:a.doScrollBy(-72);e=!0;break;case 37:case 63232:a.railh&&(g?a.doScrollLeft(0):a.doScrollLeftBy(72),
  580. e=!0);break;case 39:case 63234:a.railh&&(g?a.doScrollLeft(a.page.maxw):a.doScrollLeftBy(-72),e=!0);break;case 33:case 63276:a.doScrollBy(a.view.h);e=!0;break;case 34:case 63277:a.doScrollBy(-a.view.h);e=!0;break;case 36:case 63273:a.railh&&g?a.doScrollPos(0,0):a.doScrollTo(0);e=!0;break;case 35:case 63275:a.railh&&g?a.doScrollPos(a.page.maxw,a.page.maxh):a.doScrollTo(a.page.maxh);e=!0;break;case 32:a.opt.spacebarenabled&&(d?a.doScrollBy(a.view.h):a.doScrollBy(-a.view.h),e=!0);break;case 27:a.zoomactive&&
  581. (a.doZoom(),e=!0)}if(e)return a.cancelEvent(b)}};a.opt.enablekeyboard&&a.bind(document,e.isopera&&!e.isopera12?"keypress":"keydown",a.onkeypress);a.bind(document,"keydown",function(b){b.ctrlKey&&(a.wheelprevented=!0)});a.bind(document,"keyup",function(b){b.ctrlKey||(a.wheelprevented=!1)});a.bind(window,"blur",function(b){a.wheelprevented=!1});a.bind(window,"resize",a.lazyResize);a.bind(window,"orientationchange",a.lazyResize);a.bind(window,"load",a.lazyResize);if(e.ischrome&&!a.ispage&&!a.haswrapper){var t=
  582. a.win.attr("style"),m=parseFloat(a.win.css("width"))+1;a.win.css("width",m);a.synched("chromefix",function(){a.win.attr("style",t)})}a.onAttributeChange=function(b){a.lazyResize(a.isieold?250:30)};a.isie11||!1===x||(a.observerbody=new x(function(b){b.forEach(function(b){if("attributes"==b.type)return f("body").hasClass("modal-open")&&f("body").hasClass("modal-dialog")&&!f.contains(f(".modal-dialog")[0],a.doc[0])?a.hide():a.show()});if(document.body.scrollHeight!=a.page.maxh)return a.lazyResize(30)}),
  583. a.observerbody.observe(document.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]}));a.ispage||a.haswrapper||(!1!==x?(a.observer=new x(function(b){b.forEach(a.onAttributeChange)}),a.observer.observe(a.win[0],{childList:!0,characterData:!1,attributes:!0,subtree:!1}),a.observerremover=new x(function(b){b.forEach(function(b){if(0<b.removedNodes.length)for(var c in b.removedNodes)if(a&&b.removedNodes[c]==a.win[0])return a.remove()})}),a.observerremover.observe(a.win[0].parentNode,
  584. {childList:!0,characterData:!1,attributes:!1,subtree:!1})):(a.bind(a.win,e.isie&&!e.isie9?"propertychange":"DOMAttrModified",a.onAttributeChange),e.isie9&&a.win[0].attachEvent("onpropertychange",a.onAttributeChange),a.bind(a.win,"DOMNodeRemoved",function(b){b.target==a.win[0]&&a.remove()})));!a.ispage&&a.opt.boxzoom&&a.bind(window,"resize",a.resizeZoom);a.istextarea&&(a.bind(a.win,"keydown",a.lazyResize),a.bind(a.win,"mouseup",a.lazyResize));a.lazyResize(30)}if("IFRAME"==this.doc[0].nodeName){var N=
  585. function(){a.iframexd=!1;var c;try{c="contentDocument"in this?this.contentDocument:this.contentWindow.document}catch(g){a.iframexd=!0,c=!1}if(a.iframexd)return"console"in window&&console.log("NiceScroll error: policy restriced iframe"),!0;a.forcescreen=!0;a.isiframe&&(a.iframe={doc:f(c),html:a.doc.contents().find("html")[0],body:a.doc.contents().find("body")[0]},a.getContentSize=function(){return{w:Math.max(a.iframe.html.scrollWidth,a.iframe.body.scrollWidth),h:Math.max(a.iframe.html.scrollHeight,
  586. a.iframe.body.scrollHeight)}},a.docscroll=f(a.iframe.body));if(!e.isios&&a.opt.iframeautoresize&&!a.isiframe){a.win.scrollTop(0);a.doc.height("");var d=Math.max(c.getElementsByTagName("html")[0].scrollHeight,c.body.scrollHeight);a.doc.height(d)}a.lazyResize(30);e.isie7&&a.css(f(a.iframe.html),b);a.css(f(a.iframe.body),b);e.isios&&a.haswrapper&&a.css(f(c.body),{"-webkit-transform":"translate3d(0,0,0)"});"contentWindow"in this?a.bind(this.contentWindow,"scroll",a.onscroll):a.bind(c,"scroll",a.onscroll);
  587. a.opt.enablemousewheel&&a.mousewheel(c,a.onmousewheel);a.opt.enablekeyboard&&a.bind(c,e.isopera?"keypress":"keydown",a.onkeypress);if(e.cantouch||a.opt.touchbehavior)a.bind(c,"mousedown",a.ontouchstart),a.bind(c,"mousemove",function(b){return a.ontouchmove(b,!0)}),a.opt.grabcursorenabled&&e.cursorgrabvalue&&a.css(f(c.body),{cursor:e.cursorgrabvalue});a.bind(c,"mouseup",a.ontouchend);a.zoom&&(a.opt.dblclickzoom&&a.bind(c,"dblclick",a.doZoom),a.ongesturezoom&&a.bind(c,"gestureend",a.ongesturezoom))};
  588. this.doc[0].readyState&&"complete"==this.doc[0].readyState&&setTimeout(function(){N.call(a.doc[0],!1)},500);a.bind(this.doc,"load",N)}};this.showCursor=function(b,c){a.cursortimeout&&(clearTimeout(a.cursortimeout),a.cursortimeout=0);if(a.rail){a.autohidedom&&(a.autohidedom.stop().css({opacity:a.opt.cursoropacitymax}),a.cursoractive=!0);a.rail.drag&&1==a.rail.drag.pt||(void 0!==b&&!1!==b&&(a.scroll.y=Math.round(1*b/a.scrollratio.y)),void 0!==c&&(a.scroll.x=Math.round(1*c/a.scrollratio.x)));a.cursor.css({height:a.cursorheight,
  589. top:a.scroll.y});if(a.cursorh){var d=a.hasreversehr?a.scrollvaluemaxw-a.scroll.x:a.scroll.x;!a.rail.align&&a.rail.visibility?a.cursorh.css({width:a.cursorwidth,left:d+a.rail.width}):a.cursorh.css({width:a.cursorwidth,left:d});a.cursoractive=!0}a.zoom&&a.zoom.stop().css({opacity:a.opt.cursoropacitymax})}};this.hideCursor=function(b){a.cursortimeout||!a.rail||!a.autohidedom||a.hasmousefocus&&"leave"==a.opt.autohidemode||(a.cursortimeout=setTimeout(function(){a.rail.active&&a.showonmouseevent||(a.autohidedom.stop().animate({opacity:a.opt.cursoropacitymin}),
  590. a.zoom&&a.zoom.stop().animate({opacity:a.opt.cursoropacitymin}),a.cursoractive=!1);a.cursortimeout=0},b||a.opt.hidecursordelay))};this.noticeCursor=function(b,c,d){a.showCursor(c,d);a.rail.active||a.hideCursor(b)};this.getContentSize=a.ispage?function(){return{w:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),h:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}}:a.haswrapper?function(){return{w:a.doc.outerWidth()+parseInt(a.win.css("paddingLeft"))+
  591. parseInt(a.win.css("paddingRight")),h:a.doc.outerHeight()+parseInt(a.win.css("paddingTop"))+parseInt(a.win.css("paddingBottom"))}}:function(){return{w:a.docscroll[0].scrollWidth,h:a.docscroll[0].scrollHeight}};this.onResize=function(b,c){if(!a||!a.win)return!1;if(!a.haswrapper&&!a.ispage){if("none"==a.win.css("display"))return a.visibility&&a.hideRail().hideRailHr(),!1;a.hidden||a.visibility||a.showRail().showRailHr()}var d=a.page.maxh,e=a.page.maxw,f=a.view.h,k=a.view.w;a.view={w:a.ispage?a.win.width():
  592. parseInt(a.win[0].clientWidth),h:a.ispage?a.win.height():parseInt(a.win[0].clientHeight)};a.page=c?c:a.getContentSize();a.page.maxh=Math.max(0,a.page.h-a.view.h);a.page.maxw=Math.max(0,a.page.w-a.view.w);if(a.page.maxh==d&&a.page.maxw==e&&a.view.w==k&&a.view.h==f){if(a.ispage)return a;d=a.win.offset();if(a.lastposition&&(e=a.lastposition,e.top==d.top&&e.left==d.left))return a;a.lastposition=d}0==a.page.maxh?(a.hideRail(),a.scrollvaluemax=0,a.scroll.y=0,a.scrollratio.y=0,a.cursorheight=0,a.setScrollTop(0),
  593. a.rail&&(a.rail.scrollable=!1)):(a.page.maxh-=a.opt.railpadding.top+a.opt.railpadding.bottom,a.rail.scrollable=!0);0==a.page.maxw?(a.hideRailHr(),a.scrollvaluemaxw=0,a.scroll.x=0,a.scrollratio.x=0,a.cursorwidth=0,a.setScrollLeft(0),a.railh&&(a.railh.scrollable=!1)):(a.page.maxw-=a.opt.railpadding.left+a.opt.railpadding.right,a.railh&&(a.railh.scrollable=a.opt.horizrailenabled));a.railslocked=a.locked||0==a.page.maxh&&0==a.page.maxw;if(a.railslocked)return a.ispage||a.updateScrollBar(a.view),!1;a.hidden||
  594. a.visibility?!a.railh||a.hidden||a.railh.visibility||a.showRailHr():a.showRail().showRailHr();a.istextarea&&a.win.css("resize")&&"none"!=a.win.css("resize")&&(a.view.h-=20);a.cursorheight=Math.min(a.view.h,Math.round(a.view.h/a.page.h*a.view.h));a.cursorheight=a.opt.cursorfixedheight?a.opt.cursorfixedheight:Math.max(a.opt.cursorminheight,a.cursorheight);a.cursorwidth=Math.min(a.view.w,Math.round(a.view.w/a.page.w*a.view.w));a.cursorwidth=a.opt.cursorfixedheight?a.opt.cursorfixedheight:Math.max(a.opt.cursorminheight,
  595. a.cursorwidth);a.scrollvaluemax=a.view.h-a.cursorheight-a.cursor.hborder-(a.opt.railpadding.top+a.opt.railpadding.bottom);a.railh&&(a.railh.width=0<a.page.maxh?a.view.w-a.rail.width:a.view.w,a.scrollvaluemaxw=a.railh.width-a.cursorwidth-a.cursorh.wborder-(a.opt.railpadding.left+a.opt.railpadding.right));a.ispage||a.updateScrollBar(a.view);a.scrollratio={x:a.page.maxw/a.scrollvaluemaxw,y:a.page.maxh/a.scrollvaluemax};a.getScrollTop()>a.page.maxh?a.doScrollTop(a.page.maxh):(a.scroll.y=Math.round(a.getScrollTop()*
  596. (1/a.scrollratio.y)),a.scroll.x=Math.round(a.getScrollLeft()*(1/a.scrollratio.x)),a.cursoractive&&a.noticeCursor());a.scroll.y&&0==a.getScrollTop()&&a.doScrollTo(Math.floor(a.scroll.y*a.scrollratio.y));return a};this.resize=a.onResize;this.hlazyresize=0;this.lazyResize=function(b){a.haswrapper||a.hide();a.hlazyresize&&clearTimeout(a.hlazyresize);a.hlazyresize=setTimeout(function(){a&&a.show().resize()},240);return a};this.jqbind=function(b,c,d){a.events.push({e:b,n:c,f:d,q:!0});f(b).bind(c,d)};this.mousewheel=
  597. function(b,c,d){b="jquery"in b?b[0]:b;if("onwheel"in document.createElement("div"))a._bind(b,"wheel",c,d||!1);else{var e=void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";q(b,e,c,d||!1);"DOMMouseScroll"==e&&q(b,"MozMousePixelScroll",c,d||!1)}};e.haseventlistener?(this.bind=function(b,c,d,e){a._bind("jquery"in b?b[0]:b,c,d,e||!1)},this._bind=function(b,c,d,e){a.events.push({e:b,n:c,f:d,b:e,q:!1});b.addEventListener(c,d,e||!1)},this.cancelEvent=function(a){if(!a)return!1;a=a.original?a.original:
  598. a;a.cancelable&&a.preventDefault();a.stopPropagation();a.preventManipulation&&a.preventManipulation();return!1},this.stopPropagation=function(a){if(!a)return!1;a=a.original?a.original:a;a.stopPropagation();return!1},this._unbind=function(a,c,d,e){a.removeEventListener(c,d,e)}):(this.bind=function(b,c,d,e){var f="jquery"in b?b[0]:b;a._bind(f,c,function(b){(b=b||window.event||!1)&&b.srcElement&&(b.target=b.srcElement);"pageY"in b||(b.pageX=b.clientX+document.documentElement.scrollLeft,b.pageY=b.clientY+
  599. document.documentElement.scrollTop);return!1===d.call(f,b)||!1===e?a.cancelEvent(b):!0})},this._bind=function(b,c,d,e){a.events.push({e:b,n:c,f:d,b:e,q:!1});b.attachEvent?b.attachEvent("on"+c,d):b["on"+c]=d},this.cancelEvent=function(a){a=window.event||!1;if(!a)return!1;a.cancelBubble=!0;a.cancel=!0;return a.returnValue=!1},this.stopPropagation=function(a){a=window.event||!1;if(!a)return!1;a.cancelBubble=!0;return!1},this._unbind=function(a,c,d,e){a.detachEvent?a.detachEvent("on"+c,d):a["on"+c]=!1});
  600. this.unbindAll=function(){for(var b=0;b<a.events.length;b++){var c=a.events[b];c.q?c.e.unbind(c.n,c.f):a._unbind(c.e,c.n,c.f,c.b)}};this.showRail=function(){0==a.page.maxh||!a.ispage&&"none"==a.win.css("display")||(a.visibility=!0,a.rail.visibility=!0,a.rail.css("display","block"));return a};this.showRailHr=function(){if(!a.railh)return a;0==a.page.maxw||!a.ispage&&"none"==a.win.css("display")||(a.railh.visibility=!0,a.railh.css("display","block"));return a};this.hideRail=function(){a.visibility=
  601. !1;a.rail.visibility=!1;a.rail.css("display","none");return a};this.hideRailHr=function(){if(!a.railh)return a;a.railh.visibility=!1;a.railh.css("display","none");return a};this.show=function(){a.hidden=!1;a.railslocked=!1;return a.showRail().showRailHr()};this.hide=function(){a.hidden=!0;a.railslocked=!0;return a.hideRail().hideRailHr()};this.toggle=function(){return a.hidden?a.show():a.hide()};this.remove=function(){a.stop();a.cursortimeout&&clearTimeout(a.cursortimeout);for(var b in a.delaylist)a.delaylist[b]&&
  602. w(a.delaylist[b].h);a.doZoomOut();a.unbindAll();e.isie9&&a.win[0].detachEvent("onpropertychange",a.onAttributeChange);!1!==a.observer&&a.observer.disconnect();!1!==a.observerremover&&a.observerremover.disconnect();!1!==a.observerbody&&a.observerbody.disconnect();a.events=null;a.cursor&&a.cursor.remove();a.cursorh&&a.cursorh.remove();a.rail&&a.rail.remove();a.railh&&a.railh.remove();a.zoom&&a.zoom.remove();for(b=0;b<a.saved.css.length;b++){var c=a.saved.css[b];c[0].css(c[1],void 0===c[2]?"":c[2])}a.saved=
  603. !1;a.me.data("__nicescroll","");var d=f.nicescroll;d.each(function(b){if(this&&this.id===a.id){delete d[b];for(var c=++b;c<d.length;c++,b++)d[b]=d[c];d.length--;d.length&&delete d[d.length]}});for(var k in a)a[k]=null,delete a[k];a=null};this.scrollstart=function(b){this.onscrollstart=b;return a};this.scrollend=function(b){this.onscrollend=b;return a};this.scrollcancel=function(b){this.onscrollcancel=b;return a};this.zoomin=function(b){this.onzoomin=b;return a};this.zoomout=function(b){this.onzoomout=
  604. b;return a};this.isScrollable=function(a){a=a.target?a.target:a;if("OPTION"==a.nodeName)return!0;for(;a&&1==a.nodeType&&!/^BODY|HTML/.test(a.nodeName);){var c=f(a),c=c.css("overflowY")||c.css("overflowX")||c.css("overflow")||"";if(/scroll|auto/.test(c))return a.clientHeight!=a.scrollHeight;a=a.parentNode?a.parentNode:!1}return!1};this.getViewport=function(a){for(a=a&&a.parentNode?a.parentNode:!1;a&&1==a.nodeType&&!/^BODY|HTML/.test(a.nodeName);){var c=f(a);if(/fixed|absolute/.test(c.css("position")))return c;
  605. var d=c.css("overflowY")||c.css("overflowX")||c.css("overflow")||"";if(/scroll|auto/.test(d)&&a.clientHeight!=a.scrollHeight||0<c.getNiceScroll().length)return c;a=a.parentNode?a.parentNode:!1}return!1};this.triggerScrollEnd=function(){if(a.onscrollend){var b=a.getScrollLeft(),c=a.getScrollTop();a.onscrollend.call(a,{type:"scrollend",current:{x:b,y:c},end:{x:b,y:c}})}};this.onmousewheel=function(b){if(!a.wheelprevented){if(a.railslocked)return a.debounced("checkunlock",a.resize,250),!0;if(a.rail.drag)return a.cancelEvent(b);
  606. "auto"==a.opt.oneaxismousemode&&0!=b.deltaX&&(a.opt.oneaxismousemode=!1);if(a.opt.oneaxismousemode&&0==b.deltaX&&!a.rail.scrollable)return a.railh&&a.railh.scrollable?a.onmousewheelhr(b):!0;var c=+new Date,d=!1;a.opt.preservenativescrolling&&a.checkarea+600<c&&(a.nativescrollingarea=a.isScrollable(b),d=!0);a.checkarea=c;if(a.nativescrollingarea)return!0;if(b=t(b,!1,d))a.checkarea=0;return b}};this.onmousewheelhr=function(b){if(!a.wheelprevented){if(a.railslocked||!a.railh.scrollable)return!0;if(a.rail.drag)return a.cancelEvent(b);
  607. var c=+new Date,d=!1;a.opt.preservenativescrolling&&a.checkarea+600<c&&(a.nativescrollingarea=a.isScrollable(b),d=!0);a.checkarea=c;return a.nativescrollingarea?!0:a.railslocked?a.cancelEvent(b):t(b,!0,d)}};this.stop=function(){a.cancelScroll();a.scrollmon&&a.scrollmon.stop();a.cursorfreezed=!1;a.scroll.y=Math.round(a.getScrollTop()*(1/a.scrollratio.y));a.noticeCursor();return a};this.getTransitionSpeed=function(b){b=Math.min(Math.round(10*a.opt.scrollspeed),Math.round(b/20*a.opt.scrollspeed));return 20<
  608. b?b:0};a.opt.smoothscroll?a.ishwscroll&&e.hastransition&&a.opt.usetransition&&a.opt.smoothscroll?(this.prepareTransition=function(b,c){var d=c?20<b?b:0:a.getTransitionSpeed(b),f=d?e.prefixstyle+"transform "+d+"ms ease-out":"";a.lasttransitionstyle&&a.lasttransitionstyle==f||(a.lasttransitionstyle=f,a.doc.css(e.transitionstyle,f));return d},this.doScrollLeft=function(b,c){var d=a.scrollrunning?a.newscrolly:a.getScrollTop();a.doScrollPos(b,d,c)},this.doScrollTop=function(b,c){var d=a.scrollrunning?
  609. a.newscrollx:a.getScrollLeft();a.doScrollPos(d,b,c)},this.doScrollPos=function(b,c,d){var f=a.getScrollTop(),k=a.getScrollLeft();(0>(a.newscrolly-f)*(c-f)||0>(a.newscrollx-k)*(b-k))&&a.cancelScroll();0==a.opt.bouncescroll&&(0>c?c=0:c>a.page.maxh&&(c=a.page.maxh),0>b?b=0:b>a.page.maxw&&(b=a.page.maxw));if(a.scrollrunning&&b==a.newscrollx&&c==a.newscrolly)return!1;a.newscrolly=c;a.newscrollx=b;a.newscrollspeed=d||!1;if(a.timer)return!1;a.timer=setTimeout(function(){var d=a.getScrollTop(),f=a.getScrollLeft(),
  610. k=Math.round(Math.sqrt(Math.pow(b-f,2)+Math.pow(c-d,2))),k=a.newscrollspeed&&1<a.newscrollspeed?a.newscrollspeed:a.getTransitionSpeed(k);a.newscrollspeed&&1>=a.newscrollspeed&&(k*=a.newscrollspeed);a.prepareTransition(k,!0);a.timerscroll&&a.timerscroll.tm&&clearInterval(a.timerscroll.tm);0<k&&(!a.scrollrunning&&a.onscrollstart&&a.onscrollstart.call(a,{type:"scrollstart",current:{x:f,y:d},request:{x:b,y:c},end:{x:a.newscrollx,y:a.newscrolly},speed:k}),e.transitionend?a.scrollendtrapped||(a.scrollendtrapped=
  611. !0,a.bind(a.doc,e.transitionend,a.onScrollTransitionEnd,!1)):(a.scrollendtrapped&&clearTimeout(a.scrollendtrapped),a.scrollendtrapped=setTimeout(a.onScrollTransitionEnd,k)),a.timerscroll={bz:new D(d,a.newscrolly,k,0,0,.58,1),bh:new D(f,a.newscrollx,k,0,0,.58,1)},a.cursorfreezed||(a.timerscroll.tm=setInterval(function(){a.showCursor(a.getScrollTop(),a.getScrollLeft())},60)));a.synched("doScroll-set",function(){a.timer=0;a.scrollendtrapped&&(a.scrollrunning=!0);a.setScrollTop(a.newscrolly);a.setScrollLeft(a.newscrollx);
  612. if(!a.scrollendtrapped)a.onScrollTransitionEnd()})},50)},this.cancelScroll=function(){if(!a.scrollendtrapped)return!0;var b=a.getScrollTop(),c=a.getScrollLeft();a.scrollrunning=!1;e.transitionend||clearTimeout(e.transitionend);a.scrollendtrapped=!1;a._unbind(a.doc[0],e.transitionend,a.onScrollTransitionEnd);a.prepareTransition(0);a.setScrollTop(b);a.railh&&a.setScrollLeft(c);a.timerscroll&&a.timerscroll.tm&&clearInterval(a.timerscroll.tm);a.timerscroll=!1;a.cursorfreezed=!1;a.showCursor(b,c);return a},
  613. this.onScrollTransitionEnd=function(){a.scrollendtrapped&&a._unbind(a.doc[0],e.transitionend,a.onScrollTransitionEnd);a.scrollendtrapped=!1;a.prepareTransition(0);a.timerscroll&&a.timerscroll.tm&&clearInterval(a.timerscroll.tm);a.timerscroll=!1;var b=a.getScrollTop(),c=a.getScrollLeft();a.setScrollTop(b);a.railh&&a.setScrollLeft(c);a.noticeCursor(!1,b,c);a.cursorfreezed=!1;0>b?b=0:b>a.page.maxh&&(b=a.page.maxh);0>c?c=0:c>a.page.maxw&&(c=a.page.maxw);if(b!=a.newscrolly||c!=a.newscrollx)return a.doScrollPos(c,
  614. b,a.opt.snapbackspeed);a.onscrollend&&a.scrollrunning&&a.triggerScrollEnd();a.scrollrunning=!1}):(this.doScrollLeft=function(b,c){var d=a.scrollrunning?a.newscrolly:a.getScrollTop();a.doScrollPos(b,d,c)},this.doScrollTop=function(b,c){var d=a.scrollrunning?a.newscrollx:a.getScrollLeft();a.doScrollPos(d,b,c)},this.doScrollPos=function(b,c,d){function e(){if(a.cancelAnimationFrame)return!0;a.scrollrunning=!0;if(p=1-p)return a.timer=v(e)||1;var b=0,c,d,f=d=a.getScrollTop();if(a.dst.ay){f=a.bzscroll?
  615. a.dst.py+a.bzscroll.getNow()*a.dst.ay:a.newscrolly;c=f-d;if(0>c&&f<a.newscrolly||0<c&&f>a.newscrolly)f=a.newscrolly;a.setScrollTop(f);f==a.newscrolly&&(b=1)}else b=1;d=c=a.getScrollLeft();if(a.dst.ax){d=a.bzscroll?a.dst.px+a.bzscroll.getNow()*a.dst.ax:a.newscrollx;c=d-c;if(0>c&&d<a.newscrollx||0<c&&d>a.newscrollx)d=a.newscrollx;a.setScrollLeft(d);d==a.newscrollx&&(b+=1)}else b+=1;2==b?(a.timer=0,a.cursorfreezed=!1,a.bzscroll=!1,a.scrollrunning=!1,0>f?f=0:f>a.page.maxh&&(f=Math.max(0,a.page.maxh)),
  616. 0>d?d=0:d>a.page.maxw&&(d=a.page.maxw),d!=a.newscrollx||f!=a.newscrolly?a.doScrollPos(d,f):a.onscrollend&&a.triggerScrollEnd()):a.timer=v(e)||1}c=void 0===c||!1===c?a.getScrollTop(!0):c;if(a.timer&&a.newscrolly==c&&a.newscrollx==b)return!0;a.timer&&w(a.timer);a.timer=0;var f=a.getScrollTop(),k=a.getScrollLeft();(0>(a.newscrolly-f)*(c-f)||0>(a.newscrollx-k)*(b-k))&&a.cancelScroll();a.newscrolly=c;a.newscrollx=b;a.bouncescroll&&a.rail.visibility||(0>a.newscrolly?a.newscrolly=0:a.newscrolly>a.page.maxh&&
  617. (a.newscrolly=a.page.maxh));a.bouncescroll&&a.railh.visibility||(0>a.newscrollx?a.newscrollx=0:a.newscrollx>a.page.maxw&&(a.newscrollx=a.page.maxw));a.dst={};a.dst.x=b-k;a.dst.y=c-f;a.dst.px=k;a.dst.py=f;var h=Math.round(Math.sqrt(Math.pow(a.dst.x,2)+Math.pow(a.dst.y,2)));a.dst.ax=a.dst.x/h;a.dst.ay=a.dst.y/h;var l=0,n=h;0==a.dst.x?(l=f,n=c,a.dst.ay=1,a.dst.py=0):0==a.dst.y&&(l=k,n=b,a.dst.ax=1,a.dst.px=0);h=a.getTransitionSpeed(h);d&&1>=d&&(h*=d);a.bzscroll=0<h?a.bzscroll?a.bzscroll.update(n,h):
  618. new D(l,n,h,0,1,0,1):!1;if(!a.timer){(f==a.page.maxh&&c>=a.page.maxh||k==a.page.maxw&&b>=a.page.maxw)&&a.checkContentSize();var p=1;a.cancelAnimationFrame=!1;a.timer=1;a.onscrollstart&&!a.scrollrunning&&a.onscrollstart.call(a,{type:"scrollstart",current:{x:k,y:f},request:{x:b,y:c},end:{x:a.newscrollx,y:a.newscrolly},speed:h});e();(f==a.page.maxh&&c>=f||k==a.page.maxw&&b>=k)&&a.checkContentSize();a.noticeCursor()}},this.cancelScroll=function(){a.timer&&w(a.timer);a.timer=0;a.bzscroll=!1;a.scrollrunning=
  619. !1;return a}):(this.doScrollLeft=function(b,c){var d=a.getScrollTop();a.doScrollPos(b,d,c)},this.doScrollTop=function(b,c){var d=a.getScrollLeft();a.doScrollPos(d,b,c)},this.doScrollPos=function(b,c,d){var e=b>a.page.maxw?a.page.maxw:b;0>e&&(e=0);var f=c>a.page.maxh?a.page.maxh:c;0>f&&(f=0);a.synched("scroll",function(){a.setScrollTop(f);a.setScrollLeft(e)})},this.cancelScroll=function(){});this.doScrollBy=function(b,c){var d=0,d=c?Math.floor((a.scroll.y-b)*a.scrollratio.y):(a.timer?a.newscrolly:
  620. a.getScrollTop(!0))-b;if(a.bouncescroll){var e=Math.round(a.view.h/2);d<-e?d=-e:d>a.page.maxh+e&&(d=a.page.maxh+e)}a.cursorfreezed=!1;e=a.getScrollTop(!0);if(0>d&&0>=e)return a.noticeCursor();if(d>a.page.maxh&&e>=a.page.maxh)return a.checkContentSize(),a.noticeCursor();a.doScrollTop(d)};this.doScrollLeftBy=function(b,c){var d=0,d=c?Math.floor((a.scroll.x-b)*a.scrollratio.x):(a.timer?a.newscrollx:a.getScrollLeft(!0))-b;if(a.bouncescroll){var e=Math.round(a.view.w/2);d<-e?d=-e:d>a.page.maxw+e&&(d=a.page.maxw+
  621. e)}a.cursorfreezed=!1;e=a.getScrollLeft(!0);if(0>d&&0>=e||d>a.page.maxw&&e>=a.page.maxw)return a.noticeCursor();a.doScrollLeft(d)};this.doScrollTo=function(b,c){a.cursorfreezed=!1;a.doScrollTop(b)};this.checkContentSize=function(){var b=a.getContentSize();b.h==a.page.h&&b.w==a.page.w||a.resize(!1,b)};a.onscroll=function(b){a.rail.drag||a.cursorfreezed||a.synched("scroll",function(){a.scroll.y=Math.round(a.getScrollTop()*(1/a.scrollratio.y));a.railh&&(a.scroll.x=Math.round(a.getScrollLeft()*(1/a.scrollratio.x)));
  622. a.noticeCursor()})};a.bind(a.docscroll,"scroll",a.onscroll);this.doZoomIn=function(b){if(!a.zoomactive){a.zoomactive=!0;a.zoomrestore={style:{}};var c="position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),d=a.win[0].style,k;for(k in c){var h=c[k];a.zoomrestore.style[h]=void 0!==d[h]?d[h]:""}a.zoomrestore.style.width=a.win.css("width");a.zoomrestore.style.height=a.win.css("height");a.zoomrestore.padding={w:a.win.outerWidth()-a.win.width(),h:a.win.outerHeight()-
  623. a.win.height()};e.isios4&&(a.zoomrestore.scrollTop=f(window).scrollTop(),f(window).scrollTop(0));a.win.css({position:e.isios4?"absolute":"fixed",top:0,left:0,zIndex:A+100,margin:0});c=a.win.css("backgroundColor");(""==c||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(c))&&a.win.css("backgroundColor","#fff");a.rail.css({zIndex:A+101});a.zoom.css({zIndex:A+102});a.zoom.css("backgroundPosition","0px -18px");a.resizeZoom();a.onzoomin&&a.onzoomin.call(a);return a.cancelEvent(b)}};this.doZoomOut=
  624. function(b){if(a.zoomactive)return a.zoomactive=!1,a.win.css("margin",""),a.win.css(a.zoomrestore.style),e.isios4&&f(window).scrollTop(a.zoomrestore.scrollTop),a.rail.css({"z-index":a.zindex}),a.zoom.css({"z-index":a.zindex}),a.zoomrestore=!1,a.zoom.css("backgroundPosition","0px 0px"),a.onResize(),a.onzoomout&&a.onzoomout.call(a),a.cancelEvent(b)};this.doZoom=function(b){return a.zoomactive?a.doZoomOut(b):a.doZoomIn(b)};this.resizeZoom=function(){if(a.zoomactive){var b=a.getScrollTop();a.win.css({width:f(window).width()-
  625. a.zoomrestore.padding.w+"px",height:f(window).height()-a.zoomrestore.padding.h+"px"});a.onResize();a.setScrollTop(Math.min(a.page.maxh,b))}};this.init();f.nicescroll.push(this)},M=function(f){var c=this;this.nc=f;this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0;this.snapy=this.snapx=!1;this.demuly=this.demulx=0;this.lastscrolly=this.lastscrollx=-1;this.timer=this.chky=this.chkx=0;this.time=function(){return+new Date};this.reset=function(f,h){c.stop();var d=c.time();c.steptime=
  626. 0;c.lasttime=d;c.speedx=0;c.speedy=0;c.lastx=f;c.lasty=h;c.lastscrollx=-1;c.lastscrolly=-1};this.update=function(f,h){var d=c.time();c.steptime=d-c.lasttime;c.lasttime=d;var d=h-c.lasty,q=f-c.lastx,t=c.nc.getScrollTop(),a=c.nc.getScrollLeft(),t=t+d,a=a+q;c.snapx=0>a||a>c.nc.page.maxw;c.snapy=0>t||t>c.nc.page.maxh;c.speedx=q;c.speedy=d;c.lastx=f;c.lasty=h};this.stop=function(){c.nc.unsynched("domomentum2d");c.timer&&clearTimeout(c.timer);c.timer=0;c.lastscrollx=-1;c.lastscrolly=-1};this.doSnapy=function(f,
  627. h){var d=!1;0>h?(h=0,d=!0):h>c.nc.page.maxh&&(h=c.nc.page.maxh,d=!0);0>f?(f=0,d=!0):f>c.nc.page.maxw&&(f=c.nc.page.maxw,d=!0);d?c.nc.doScrollPos(f,h,c.nc.opt.snapbackspeed):c.nc.triggerScrollEnd()};this.doMomentum=function(f){var h=c.time(),d=f?h+f:c.lasttime;f=c.nc.getScrollLeft();var q=c.nc.getScrollTop(),t=c.nc.page.maxh,a=c.nc.page.maxw;c.speedx=0<a?Math.min(60,c.speedx):0;c.speedy=0<t?Math.min(60,c.speedy):0;d=d&&60>=h-d;if(0>q||q>t||0>f||f>a)d=!1;f=c.speedx&&d?c.speedx:!1;if(c.speedy&&d&&c.speedy||
  628. f){var r=Math.max(16,c.steptime);50<r&&(f=r/50,c.speedx*=f,c.speedy*=f,r=50);c.demulxy=0;c.lastscrollx=c.nc.getScrollLeft();c.chkx=c.lastscrollx;c.lastscrolly=c.nc.getScrollTop();c.chky=c.lastscrolly;var p=c.lastscrollx,e=c.lastscrolly,v=function(){var d=600<c.time()-h?.04:.02;c.speedx&&(p=Math.floor(c.lastscrollx-c.speedx*(1-c.demulxy)),c.lastscrollx=p,0>p||p>a)&&(d=.1);c.speedy&&(e=Math.floor(c.lastscrolly-c.speedy*(1-c.demulxy)),c.lastscrolly=e,0>e||e>t)&&(d=.1);c.demulxy=Math.min(1,c.demulxy+
  629. d);c.nc.synched("domomentum2d",function(){c.speedx&&(c.nc.getScrollLeft(),c.chkx=p,c.nc.setScrollLeft(p));c.speedy&&(c.nc.getScrollTop(),c.chky=e,c.nc.setScrollTop(e));c.timer||(c.nc.hideCursor(),c.doSnapy(p,e))});1>c.demulxy?c.timer=setTimeout(v,r):(c.stop(),c.nc.hideCursor(),c.doSnapy(p,e))};v()}else c.doSnapy(c.nc.getScrollLeft(),c.nc.getScrollTop())}},y=f.fn.scrollTop;f.cssHooks.pageYOffset={get:function(h,c,k){return(c=f.data(h,"__nicescroll")||!1)&&c.ishwscroll?c.getScrollTop():y.call(h)},set:function(h,
  630. c){var k=f.data(h,"__nicescroll")||!1;k&&k.ishwscroll?k.setScrollTop(parseInt(c)):y.call(h,c);return this}};f.fn.scrollTop=function(h){if(void 0===h){var c=this[0]?f.data(this[0],"__nicescroll")||!1:!1;return c&&c.ishwscroll?c.getScrollTop():y.call(this)}return this.each(function(){var c=f.data(this,"__nicescroll")||!1;c&&c.ishwscroll?c.setScrollTop(parseInt(h)):y.call(f(this),h)})};var z=f.fn.scrollLeft;f.cssHooks.pageXOffset={get:function(h,c,k){return(c=f.data(h,"__nicescroll")||!1)&&c.ishwscroll?
  631. c.getScrollLeft():z.call(h)},set:function(h,c){var k=f.data(h,"__nicescroll")||!1;k&&k.ishwscroll?k.setScrollLeft(parseInt(c)):z.call(h,c);return this}};f.fn.scrollLeft=function(h){if(void 0===h){var c=this[0]?f.data(this[0],"__nicescroll")||!1:!1;return c&&c.ishwscroll?c.getScrollLeft():z.call(this)}return this.each(function(){var c=f.data(this,"__nicescroll")||!1;c&&c.ishwscroll?c.setScrollLeft(parseInt(h)):z.call(f(this),h)})};var E=function(h){var c=this;this.length=0;this.name="nicescrollarray";
  632. this.each=function(d){f.each(c,d);return c};this.push=function(d){c[c.length]=d;c.length++};this.eq=function(d){return c[d]};if(h)for(var k=0;k<h.length;k++){var l=f.data(h[k],"__nicescroll")||!1;l&&(this[this.length]=l,this.length++)}return this};(function(f,c,k){for(var l=0;l<c.length;l++)k(f,c[l])})(E.prototype,"show hide toggle onResize resize remove stop doScrollPos".split(" "),function(f,c){f[c]=function(){var f=arguments;return this.each(function(){this[c].apply(this,f)})}});f.fn.getNiceScroll=
  633. function(h){return void 0===h?new E(this):this[h]&&f.data(this[h],"__nicescroll")||!1};f.expr[":"].nicescroll=function(h){return void 0!==f.data(h,"__nicescroll")};f.fn.niceScroll=function(h,c){void 0!==c||"object"!=typeof h||"jquery"in h||(c=h,h=!1);c=f.extend({},c);var k=new E;void 0===c&&(c={});h&&(c.doc=f(h),c.win=f(this));var l=!("doc"in c);l||"win"in c||(c.win=f(this));this.each(function(){var d=f(this).data("__nicescroll")||!1;d||(c.doc=l?f(this):c.doc,d=new S(c,f(this)),f(this).data("__nicescroll",
  634. d));k.push(d)});return 1==k.length?k[0]:k};window.NiceScroll={getjQuery:function(){return f}};f.nicescroll||(f.nicescroll=new E,f.nicescroll.options=K)});
  635. /* JQuery Nice Select - v1.0
  636. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  637. /* jQuery Nice Select - v1.0
  638. https://github.com/hernansartorio/jquery-nice-select
  639. Made by Hernán Sartorio */
  640. !function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("<div></div>").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html('<span class="current"></span><ul class="list"></ul>'));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("<li></li>").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery);
  641. /* jQuery UI - v1.12.1
  642. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  643. /*! jQuery UI - v1.12.1 - 2016-09-14
  644. * http://jqueryui.com
  645. * Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
  646. * Copyright jQuery Foundation and other contributors; Licensed MIT */
  647. (function( factory ) {
  648. if ( typeof define === "function" && define.amd ) {
  649. // AMD. Register as an anonymous module.
  650. define([ "jquery" ], factory );
  651. } else {
  652. // Browser globals
  653. factory( jQuery );
  654. }
  655. }(function( $ ) {
  656. $.ui = $.ui || {};
  657. var version = $.ui.version = "1.12.1";
  658. /*!
  659. * jQuery UI Widget 1.12.1
  660. * http://jqueryui.com
  661. *
  662. * Copyright jQuery Foundation and other contributors
  663. * Released under the MIT license.
  664. * http://jquery.org/license
  665. */
  666. //>>label: Widget
  667. //>>group: Core
  668. //>>description: Provides a factory for creating stateful widgets with a common API.
  669. //>>docs: http://api.jqueryui.com/jQuery.widget/
  670. //>>demos: http://jqueryui.com/widget/
  671. var widgetUuid = 0;
  672. var widgetSlice = Array.prototype.slice;
  673. $.cleanData = ( function( orig ) {
  674. return function( elems ) {
  675. var events, elem, i;
  676. for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
  677. try {
  678. // Only trigger remove when necessary to save time
  679. events = $._data( elem, "events" );
  680. if ( events && events.remove ) {
  681. $( elem ).triggerHandler( "remove" );
  682. }
  683. // Http://bugs.jquery.com/ticket/8235
  684. } catch ( e ) {}
  685. }
  686. orig( elems );
  687. };
  688. } )( $.cleanData );
  689. $.widget = function( name, base, prototype ) {
  690. var existingConstructor, constructor, basePrototype;
  691. // ProxiedPrototype allows the provided prototype to remain unmodified
  692. // so that it can be used as a mixin for multiple widgets (#8876)
  693. var proxiedPrototype = {};
  694. var namespace = name.split( "." )[ 0 ];
  695. name = name.split( "." )[ 1 ];
  696. var fullName = namespace + "-" + name;
  697. if ( !prototype ) {
  698. prototype = base;
  699. base = $.Widget;
  700. }
  701. if ( $.isArray( prototype ) ) {
  702. prototype = $.extend.apply( null, [ {} ].concat( prototype ) );
  703. }
  704. // Create selector for plugin
  705. $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
  706. return !!$.data( elem, fullName );
  707. };
  708. $[ namespace ] = $[ namespace ] || {};
  709. existingConstructor = $[ namespace ][ name ];
  710. constructor = $[ namespace ][ name ] = function( options, element ) {
  711. // Allow instantiation without "new" keyword
  712. if ( !this._createWidget ) {
  713. return new constructor( options, element );
  714. }
  715. // Allow instantiation without initializing for simple inheritance
  716. // must use "new" keyword (the code above always passes args)
  717. if ( arguments.length ) {
  718. this._createWidget( options, element );
  719. }
  720. };
  721. // Extend with the existing constructor to carry over any static properties
  722. $.extend( constructor, existingConstructor, {
  723. version: prototype.version,
  724. // Copy the object used to create the prototype in case we need to
  725. // redefine the widget later
  726. _proto: $.extend( {}, prototype ),
  727. // Track widgets that inherit from this widget in case this widget is
  728. // redefined after a widget inherits from it
  729. _childConstructors: []
  730. } );
  731. basePrototype = new base();
  732. // We need to make the options hash a property directly on the new instance
  733. // otherwise we'll modify the options hash on the prototype that we're
  734. // inheriting from
  735. basePrototype.options = $.widget.extend( {}, basePrototype.options );
  736. $.each( prototype, function( prop, value ) {
  737. if ( !$.isFunction( value ) ) {
  738. proxiedPrototype[ prop ] = value;
  739. return;
  740. }
  741. proxiedPrototype[ prop ] = ( function() {
  742. function _super() {
  743. return base.prototype[ prop ].apply( this, arguments );
  744. }
  745. function _superApply( args ) {
  746. return base.prototype[ prop ].apply( this, args );
  747. }
  748. return function() {
  749. var __super = this._super;
  750. var __superApply = this._superApply;
  751. var returnValue;
  752. this._super = _super;
  753. this._superApply = _superApply;
  754. returnValue = value.apply( this, arguments );
  755. this._super = __super;
  756. this._superApply = __superApply;
  757. return returnValue;
  758. };
  759. } )();
  760. } );
  761. constructor.prototype = $.widget.extend( basePrototype, {
  762. // TODO: remove support for widgetEventPrefix
  763. // always use the name + a colon as the prefix, e.g., draggable:start
  764. // don't prefix for widgets that aren't DOM-based
  765. widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name
  766. }, proxiedPrototype, {
  767. constructor: constructor,
  768. namespace: namespace,
  769. widgetName: name,
  770. widgetFullName: fullName
  771. } );
  772. // If this widget is being redefined then we need to find all widgets that
  773. // are inheriting from it and redefine all of them so that they inherit from
  774. // the new version of this widget. We're essentially trying to replace one
  775. // level in the prototype chain.
  776. if ( existingConstructor ) {
  777. $.each( existingConstructor._childConstructors, function( i, child ) {
  778. var childPrototype = child.prototype;
  779. // Redefine the child widget using the same prototype that was
  780. // originally used, but inherit from the new version of the base
  781. $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor,
  782. child._proto );
  783. } );
  784. // Remove the list of existing child constructors from the old constructor
  785. // so the old child constructors can be garbage collected
  786. delete existingConstructor._childConstructors;
  787. } else {
  788. base._childConstructors.push( constructor );
  789. }
  790. $.widget.bridge( name, constructor );
  791. return constructor;
  792. };
  793. $.widget.extend = function( target ) {
  794. var input = widgetSlice.call( arguments, 1 );
  795. var inputIndex = 0;
  796. var inputLength = input.length;
  797. var key;
  798. var value;
  799. for ( ; inputIndex < inputLength; inputIndex++ ) {
  800. for ( key in input[ inputIndex ] ) {
  801. value = input[ inputIndex ][ key ];
  802. if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
  803. // Clone objects
  804. if ( $.isPlainObject( value ) ) {
  805. target[ key ] = $.isPlainObject( target[ key ] ) ?
  806. $.widget.extend( {}, target[ key ], value ) :
  807. // Don't extend strings, arrays, etc. with objects
  808. $.widget.extend( {}, value );
  809. // Copy everything else by reference
  810. } else {
  811. target[ key ] = value;
  812. }
  813. }
  814. }
  815. }
  816. return target;
  817. };
  818. $.widget.bridge = function( name, object ) {
  819. var fullName = object.prototype.widgetFullName || name;
  820. $.fn[ name ] = function( options ) {
  821. var isMethodCall = typeof options === "string";
  822. var args = widgetSlice.call( arguments, 1 );
  823. var returnValue = this;
  824. if ( isMethodCall ) {
  825. // If this is an empty collection, we need to have the instance method
  826. // return undefined instead of the jQuery instance
  827. if ( !this.length && options === "instance" ) {
  828. returnValue = undefined;
  829. } else {
  830. this.each( function() {
  831. var methodValue;
  832. var instance = $.data( this, fullName );
  833. if ( options === "instance" ) {
  834. returnValue = instance;
  835. return false;
  836. }
  837. if ( !instance ) {
  838. return $.error( "cannot call methods on " + name +
  839. " prior to initialization; " +
  840. "attempted to call method '" + options + "'" );
  841. }
  842. if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === "_" ) {
  843. return $.error( "no such method '" + options + "' for " + name +
  844. " widget instance" );
  845. }
  846. methodValue = instance[ options ].apply( instance, args );
  847. if ( methodValue !== instance && methodValue !== undefined ) {
  848. returnValue = methodValue && methodValue.jquery ?
  849. returnValue.pushStack( methodValue.get() ) :
  850. methodValue;
  851. return false;
  852. }
  853. } );
  854. }
  855. } else {
  856. // Allow multiple hashes to be passed on init
  857. if ( args.length ) {
  858. options = $.widget.extend.apply( null, [ options ].concat( args ) );
  859. }
  860. this.each( function() {
  861. var instance = $.data( this, fullName );
  862. if ( instance ) {
  863. instance.option( options || {} );
  864. if ( instance._init ) {
  865. instance._init();
  866. }
  867. } else {
  868. $.data( this, fullName, new object( options, this ) );
  869. }
  870. } );
  871. }
  872. return returnValue;
  873. };
  874. };
  875. $.Widget = function( /* options, element */ ) {};
  876. $.Widget._childConstructors = [];
  877. $.Widget.prototype = {
  878. widgetName: "widget",
  879. widgetEventPrefix: "",
  880. defaultElement: "<div>",
  881. options: {
  882. classes: {},
  883. disabled: false,
  884. // Callbacks
  885. create: null
  886. },
  887. _createWidget: function( options, element ) {
  888. element = $( element || this.defaultElement || this )[ 0 ];
  889. this.element = $( element );
  890. this.uuid = widgetUuid++;
  891. this.eventNamespace = "." + this.widgetName + this.uuid;
  892. this.bindings = $();
  893. this.hoverable = $();
  894. this.focusable = $();
  895. this.classesElementLookup = {};
  896. if ( element !== this ) {
  897. $.data( element, this.widgetFullName, this );
  898. this._on( true, this.element, {
  899. remove: function( event ) {
  900. if ( event.target === element ) {
  901. this.destroy();
  902. }
  903. }
  904. } );
  905. this.document = $( element.style ?
  906. // Element within the document
  907. element.ownerDocument :
  908. // Element is window or document
  909. element.document || element );
  910. this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow );
  911. }
  912. this.options = $.widget.extend( {},
  913. this.options,
  914. this._getCreateOptions(),
  915. options );
  916. this._create();
  917. if ( this.options.disabled ) {
  918. this._setOptionDisabled( this.options.disabled );
  919. }
  920. this._trigger( "create", null, this._getCreateEventData() );
  921. this._init();
  922. },
  923. _getCreateOptions: function() {
  924. return {};
  925. },
  926. _getCreateEventData: $.noop,
  927. _create: $.noop,
  928. _init: $.noop,
  929. destroy: function() {
  930. var that = this;
  931. this._destroy();
  932. $.each( this.classesElementLookup, function( key, value ) {
  933. that._removeClass( value, key );
  934. } );
  935. // We can probably remove the unbind calls in 2.0
  936. // all event bindings should go through this._on()
  937. this.element
  938. .off( this.eventNamespace )
  939. .removeData( this.widgetFullName );
  940. this.widget()
  941. .off( this.eventNamespace )
  942. .removeAttr( "aria-disabled" );
  943. // Clean up events and states
  944. this.bindings.off( this.eventNamespace );
  945. },
  946. _destroy: $.noop,
  947. widget: function() {
  948. return this.element;
  949. },
  950. option: function( key, value ) {
  951. var options = key;
  952. var parts;
  953. var curOption;
  954. var i;
  955. if ( arguments.length === 0 ) {
  956. // Don't return a reference to the internal hash
  957. return $.widget.extend( {}, this.options );
  958. }
  959. if ( typeof key === "string" ) {
  960. // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
  961. options = {};
  962. parts = key.split( "." );
  963. key = parts.shift();
  964. if ( parts.length ) {
  965. curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
  966. for ( i = 0; i < parts.length - 1; i++ ) {
  967. curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
  968. curOption = curOption[ parts[ i ] ];
  969. }
  970. key = parts.pop();
  971. if ( arguments.length === 1 ) {
  972. return curOption[ key ] === undefined ? null : curOption[ key ];
  973. }
  974. curOption[ key ] = value;
  975. } else {
  976. if ( arguments.length === 1 ) {
  977. return this.options[ key ] === undefined ? null : this.options[ key ];
  978. }
  979. options[ key ] = value;
  980. }
  981. }
  982. this._setOptions( options );
  983. return this;
  984. },
  985. _setOptions: function( options ) {
  986. var key;
  987. for ( key in options ) {
  988. this._setOption( key, options[ key ] );
  989. }
  990. return this;
  991. },
  992. _setOption: function( key, value ) {
  993. if ( key === "classes" ) {
  994. this._setOptionClasses( value );
  995. }
  996. this.options[ key ] = value;
  997. if ( key === "disabled" ) {
  998. this._setOptionDisabled( value );
  999. }
  1000. return this;
  1001. },
  1002. _setOptionClasses: function( value ) {
  1003. var classKey, elements, currentElements;
  1004. for ( classKey in value ) {
  1005. currentElements = this.classesElementLookup[ classKey ];
  1006. if ( value[ classKey ] === this.options.classes[ classKey ] ||
  1007. !currentElements ||
  1008. !currentElements.length ) {
  1009. continue;
  1010. }
  1011. // We are doing this to create a new jQuery object because the _removeClass() call
  1012. // on the next line is going to destroy the reference to the current elements being
  1013. // tracked. We need to save a copy of this collection so that we can add the new classes
  1014. // below.
  1015. elements = $( currentElements.get() );
  1016. this._removeClass( currentElements, classKey );
  1017. // We don't use _addClass() here, because that uses this.options.classes
  1018. // for generating the string of classes. We want to use the value passed in from
  1019. // _setOption(), this is the new value of the classes option which was passed to
  1020. // _setOption(). We pass this value directly to _classes().
  1021. elements.addClass( this._classes( {
  1022. element: elements,
  1023. keys: classKey,
  1024. classes: value,
  1025. add: true
  1026. } ) );
  1027. }
  1028. },
  1029. _setOptionDisabled: function( value ) {
  1030. this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value );
  1031. // If the widget is becoming disabled, then nothing is interactive
  1032. if ( value ) {
  1033. this._removeClass( this.hoverable, null, "ui-state-hover" );
  1034. this._removeClass( this.focusable, null, "ui-state-focus" );
  1035. }
  1036. },
  1037. enable: function() {
  1038. return this._setOptions( { disabled: false } );
  1039. },
  1040. disable: function() {
  1041. return this._setOptions( { disabled: true } );
  1042. },
  1043. _classes: function( options ) {
  1044. var full = [];
  1045. var that = this;
  1046. options = $.extend( {
  1047. element: this.element,
  1048. classes: this.options.classes || {}
  1049. }, options );
  1050. function processClassString( classes, checkOption ) {
  1051. var current, i;
  1052. for ( i = 0; i < classes.length; i++ ) {
  1053. current = that.classesElementLookup[ classes[ i ] ] || $();
  1054. if ( options.add ) {
  1055. current = $( $.unique( current.get().concat( options.element.get() ) ) );
  1056. } else {
  1057. current = $( current.not( options.element ).get() );
  1058. }
  1059. that.classesElementLookup[ classes[ i ] ] = current;
  1060. full.push( classes[ i ] );
  1061. if ( checkOption && options.classes[ classes[ i ] ] ) {
  1062. full.push( options.classes[ classes[ i ] ] );
  1063. }
  1064. }
  1065. }
  1066. this._on( options.element, {
  1067. "remove": "_untrackClassesElement"
  1068. } );
  1069. if ( options.keys ) {
  1070. processClassString( options.keys.match( /\S+/g ) || [], true );
  1071. }
  1072. if ( options.extra ) {
  1073. processClassString( options.extra.match( /\S+/g ) || [] );
  1074. }
  1075. return full.join( " " );
  1076. },
  1077. _untrackClassesElement: function( event ) {
  1078. var that = this;
  1079. $.each( that.classesElementLookup, function( key, value ) {
  1080. if ( $.inArray( event.target, value ) !== -1 ) {
  1081. that.classesElementLookup[ key ] = $( value.not( event.target ).get() );
  1082. }
  1083. } );
  1084. },
  1085. _removeClass: function( element, keys, extra ) {
  1086. return this._toggleClass( element, keys, extra, false );
  1087. },
  1088. _addClass: function( element, keys, extra ) {
  1089. return this._toggleClass( element, keys, extra, true );
  1090. },
  1091. _toggleClass: function( element, keys, extra, add ) {
  1092. add = ( typeof add === "boolean" ) ? add : extra;
  1093. var shift = ( typeof element === "string" || element === null ),
  1094. options = {
  1095. extra: shift ? keys : extra,
  1096. keys: shift ? element : keys,
  1097. element: shift ? this.element : element,
  1098. add: add
  1099. };
  1100. options.element.toggleClass( this._classes( options ), add );
  1101. return this;
  1102. },
  1103. _on: function( suppressDisabledCheck, element, handlers ) {
  1104. var delegateElement;
  1105. var instance = this;
  1106. // No suppressDisabledCheck flag, shuffle arguments
  1107. if ( typeof suppressDisabledCheck !== "boolean" ) {
  1108. handlers = element;
  1109. element = suppressDisabledCheck;
  1110. suppressDisabledCheck = false;
  1111. }
  1112. // No element argument, shuffle and use this.element
  1113. if ( !handlers ) {
  1114. handlers = element;
  1115. element = this.element;
  1116. delegateElement = this.widget();
  1117. } else {
  1118. element = delegateElement = $( element );
  1119. this.bindings = this.bindings.add( element );
  1120. }
  1121. $.each( handlers, function( event, handler ) {
  1122. function handlerProxy() {
  1123. // Allow widgets to customize the disabled handling
  1124. // - disabled as an array instead of boolean
  1125. // - disabled class as method for disabling individual parts
  1126. if ( !suppressDisabledCheck &&
  1127. ( instance.options.disabled === true ||
  1128. $( this ).hasClass( "ui-state-disabled" ) ) ) {
  1129. return;
  1130. }
  1131. return ( typeof handler === "string" ? instance[ handler ] : handler )
  1132. .apply( instance, arguments );
  1133. }
  1134. // Copy the guid so direct unbinding works
  1135. if ( typeof handler !== "string" ) {
  1136. handlerProxy.guid = handler.guid =
  1137. handler.guid || handlerProxy.guid || $.guid++;
  1138. }
  1139. var match = event.match( /^([\w:-]*)\s*(.*)$/ );
  1140. var eventName = match[ 1 ] + instance.eventNamespace;
  1141. var selector = match[ 2 ];
  1142. if ( selector ) {
  1143. delegateElement.on( eventName, selector, handlerProxy );
  1144. } else {
  1145. element.on( eventName, handlerProxy );
  1146. }
  1147. } );
  1148. },
  1149. _off: function( element, eventName ) {
  1150. eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) +
  1151. this.eventNamespace;
  1152. element.off( eventName ).off( eventName );
  1153. // Clear the stack to avoid memory leaks (#10056)
  1154. this.bindings = $( this.bindings.not( element ).get() );
  1155. this.focusable = $( this.focusable.not( element ).get() );
  1156. this.hoverable = $( this.hoverable.not( element ).get() );
  1157. },
  1158. _delay: function( handler, delay ) {
  1159. function handlerProxy() {
  1160. return ( typeof handler === "string" ? instance[ handler ] : handler )
  1161. .apply( instance, arguments );
  1162. }
  1163. var instance = this;
  1164. return setTimeout( handlerProxy, delay || 0 );
  1165. },
  1166. _hoverable: function( element ) {
  1167. this.hoverable = this.hoverable.add( element );
  1168. this._on( element, {
  1169. mouseenter: function( event ) {
  1170. this._addClass( $( event.currentTarget ), null, "ui-state-hover" );
  1171. },
  1172. mouseleave: function( event ) {
  1173. this._removeClass( $( event.currentTarget ), null, "ui-state-hover" );
  1174. }
  1175. } );
  1176. },
  1177. _focusable: function( element ) {
  1178. this.focusable = this.focusable.add( element );
  1179. this._on( element, {
  1180. focusin: function( event ) {
  1181. this._addClass( $( event.currentTarget ), null, "ui-state-focus" );
  1182. },
  1183. focusout: function( event ) {
  1184. this._removeClass( $( event.currentTarget ), null, "ui-state-focus" );
  1185. }
  1186. } );
  1187. },
  1188. _trigger: function( type, event, data ) {
  1189. var prop, orig;
  1190. var callback = this.options[ type ];
  1191. data = data || {};
  1192. event = $.Event( event );
  1193. event.type = ( type === this.widgetEventPrefix ?
  1194. type :
  1195. this.widgetEventPrefix + type ).toLowerCase();
  1196. // The original event may come from any element
  1197. // so we need to reset the target on the new event
  1198. event.target = this.element[ 0 ];
  1199. // Copy original event properties over to the new event
  1200. orig = event.originalEvent;
  1201. if ( orig ) {
  1202. for ( prop in orig ) {
  1203. if ( !( prop in event ) ) {
  1204. event[ prop ] = orig[ prop ];
  1205. }
  1206. }
  1207. }
  1208. this.element.trigger( event, data );
  1209. return !( $.isFunction( callback ) &&
  1210. callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||
  1211. event.isDefaultPrevented() );
  1212. }
  1213. };
  1214. $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
  1215. $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
  1216. if ( typeof options === "string" ) {
  1217. options = { effect: options };
  1218. }
  1219. var hasOptions;
  1220. var effectName = !options ?
  1221. method :
  1222. options === true || typeof options === "number" ?
  1223. defaultEffect :
  1224. options.effect || defaultEffect;
  1225. options = options || {};
  1226. if ( typeof options === "number" ) {
  1227. options = { duration: options };
  1228. }
  1229. hasOptions = !$.isEmptyObject( options );
  1230. options.complete = callback;
  1231. if ( options.delay ) {
  1232. element.delay( options.delay );
  1233. }
  1234. if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
  1235. element[ method ]( options );
  1236. } else if ( effectName !== method && element[ effectName ] ) {
  1237. element[ effectName ]( options.duration, options.easing, callback );
  1238. } else {
  1239. element.queue( function( next ) {
  1240. $( this )[ method ]();
  1241. if ( callback ) {
  1242. callback.call( element[ 0 ] );
  1243. }
  1244. next();
  1245. } );
  1246. }
  1247. };
  1248. } );
  1249. var widget = $.widget;
  1250. /*!
  1251. * jQuery UI Position 1.12.1
  1252. * http://jqueryui.com
  1253. *
  1254. * Copyright jQuery Foundation and other contributors
  1255. * Released under the MIT license.
  1256. * http://jquery.org/license
  1257. *
  1258. * http://api.jqueryui.com/position/
  1259. */
  1260. //>>label: Position
  1261. //>>group: Core
  1262. //>>description: Positions elements relative to other elements.
  1263. //>>docs: http://api.jqueryui.com/position/
  1264. //>>demos: http://jqueryui.com/position/
  1265. ( function() {
  1266. var cachedScrollbarWidth,
  1267. max = Math.max,
  1268. abs = Math.abs,
  1269. rhorizontal = /left|center|right/,
  1270. rvertical = /top|center|bottom/,
  1271. roffset = /[\+\-]\d+(\.[\d]+)?%?/,
  1272. rposition = /^\w+/,
  1273. rpercent = /%$/,
  1274. _position = $.fn.position;
  1275. function getOffsets( offsets, width, height ) {
  1276. return [
  1277. parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
  1278. parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
  1279. ];
  1280. }
  1281. function parseCss( element, property ) {
  1282. return parseInt( $.css( element, property ), 10 ) || 0;
  1283. }
  1284. function getDimensions( elem ) {
  1285. var raw = elem[ 0 ];
  1286. if ( raw.nodeType === 9 ) {
  1287. return {
  1288. width: elem.width(),
  1289. height: elem.height(),
  1290. offset: { top: 0, left: 0 }
  1291. };
  1292. }
  1293. if ( $.isWindow( raw ) ) {
  1294. return {
  1295. width: elem.width(),
  1296. height: elem.height(),
  1297. offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
  1298. };
  1299. }
  1300. if ( raw.preventDefault ) {
  1301. return {
  1302. width: 0,
  1303. height: 0,
  1304. offset: { top: raw.pageY, left: raw.pageX }
  1305. };
  1306. }
  1307. return {
  1308. width: elem.outerWidth(),
  1309. height: elem.outerHeight(),
  1310. offset: elem.offset()
  1311. };
  1312. }
  1313. $.position = {
  1314. scrollbarWidth: function() {
  1315. if ( cachedScrollbarWidth !== undefined ) {
  1316. return cachedScrollbarWidth;
  1317. }
  1318. var w1, w2,
  1319. div = $( "<div " +
  1320. "style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>" +
  1321. "<div style='height:100px;width:auto;'></div></div>" ),
  1322. innerDiv = div.children()[ 0 ];
  1323. $( "body" ).append( div );
  1324. w1 = innerDiv.offsetWidth;
  1325. div.css( "overflow", "scroll" );
  1326. w2 = innerDiv.offsetWidth;
  1327. if ( w1 === w2 ) {
  1328. w2 = div[ 0 ].clientWidth;
  1329. }
  1330. div.remove();
  1331. return ( cachedScrollbarWidth = w1 - w2 );
  1332. },
  1333. getScrollInfo: function( within ) {
  1334. var overflowX = within.isWindow || within.isDocument ? "" :
  1335. within.element.css( "overflow-x" ),
  1336. overflowY = within.isWindow || within.isDocument ? "" :
  1337. within.element.css( "overflow-y" ),
  1338. hasOverflowX = overflowX === "scroll" ||
  1339. ( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ),
  1340. hasOverflowY = overflowY === "scroll" ||
  1341. ( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight );
  1342. return {
  1343. width: hasOverflowY ? $.position.scrollbarWidth() : 0,
  1344. height: hasOverflowX ? $.position.scrollbarWidth() : 0
  1345. };
  1346. },
  1347. getWithinInfo: function( element ) {
  1348. var withinElement = $( element || window ),
  1349. isWindow = $.isWindow( withinElement[ 0 ] ),
  1350. isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9,
  1351. hasOffset = !isWindow && !isDocument;
  1352. return {
  1353. element: withinElement,
  1354. isWindow: isWindow,
  1355. isDocument: isDocument,
  1356. offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 },
  1357. scrollLeft: withinElement.scrollLeft(),
  1358. scrollTop: withinElement.scrollTop(),
  1359. width: withinElement.outerWidth(),
  1360. height: withinElement.outerHeight()
  1361. };
  1362. }
  1363. };
  1364. $.fn.position = function( options ) {
  1365. if ( !options || !options.of ) {
  1366. return _position.apply( this, arguments );
  1367. }
  1368. // Make a copy, we don't want to modify arguments
  1369. options = $.extend( {}, options );
  1370. var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
  1371. target = $( options.of ),
  1372. within = $.position.getWithinInfo( options.within ),
  1373. scrollInfo = $.position.getScrollInfo( within ),
  1374. collision = ( options.collision || "flip" ).split( " " ),
  1375. offsets = {};
  1376. dimensions = getDimensions( target );
  1377. if ( target[ 0 ].preventDefault ) {
  1378. // Force left top to allow flipping
  1379. options.at = "left top";
  1380. }
  1381. targetWidth = dimensions.width;
  1382. targetHeight = dimensions.height;
  1383. targetOffset = dimensions.offset;
  1384. // Clone to reuse original targetOffset later
  1385. basePosition = $.extend( {}, targetOffset );
  1386. // Force my and at to have valid horizontal and vertical positions
  1387. // if a value is missing or invalid, it will be converted to center
  1388. $.each( [ "my", "at" ], function() {
  1389. var pos = ( options[ this ] || "" ).split( " " ),
  1390. horizontalOffset,
  1391. verticalOffset;
  1392. if ( pos.length === 1 ) {
  1393. pos = rhorizontal.test( pos[ 0 ] ) ?
  1394. pos.concat( [ "center" ] ) :
  1395. rvertical.test( pos[ 0 ] ) ?
  1396. [ "center" ].concat( pos ) :
  1397. [ "center", "center" ];
  1398. }
  1399. pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
  1400. pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
  1401. // Calculate offsets
  1402. horizontalOffset = roffset.exec( pos[ 0 ] );
  1403. verticalOffset = roffset.exec( pos[ 1 ] );
  1404. offsets[ this ] = [
  1405. horizontalOffset ? horizontalOffset[ 0 ] : 0,
  1406. verticalOffset ? verticalOffset[ 0 ] : 0
  1407. ];
  1408. // Reduce to just the positions without the offsets
  1409. options[ this ] = [
  1410. rposition.exec( pos[ 0 ] )[ 0 ],
  1411. rposition.exec( pos[ 1 ] )[ 0 ]
  1412. ];
  1413. } );
  1414. // Normalize collision option
  1415. if ( collision.length === 1 ) {
  1416. collision[ 1 ] = collision[ 0 ];
  1417. }
  1418. if ( options.at[ 0 ] === "right" ) {
  1419. basePosition.left += targetWidth;
  1420. } else if ( options.at[ 0 ] === "center" ) {
  1421. basePosition.left += targetWidth / 2;
  1422. }
  1423. if ( options.at[ 1 ] === "bottom" ) {
  1424. basePosition.top += targetHeight;
  1425. } else if ( options.at[ 1 ] === "center" ) {
  1426. basePosition.top += targetHeight / 2;
  1427. }
  1428. atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
  1429. basePosition.left += atOffset[ 0 ];
  1430. basePosition.top += atOffset[ 1 ];
  1431. return this.each( function() {
  1432. var collisionPosition, using,
  1433. elem = $( this ),
  1434. elemWidth = elem.outerWidth(),
  1435. elemHeight = elem.outerHeight(),
  1436. marginLeft = parseCss( this, "marginLeft" ),
  1437. marginTop = parseCss( this, "marginTop" ),
  1438. collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) +
  1439. scrollInfo.width,
  1440. collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) +
  1441. scrollInfo.height,
  1442. position = $.extend( {}, basePosition ),
  1443. myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
  1444. if ( options.my[ 0 ] === "right" ) {
  1445. position.left -= elemWidth;
  1446. } else if ( options.my[ 0 ] === "center" ) {
  1447. position.left -= elemWidth / 2;
  1448. }
  1449. if ( options.my[ 1 ] === "bottom" ) {
  1450. position.top -= elemHeight;
  1451. } else if ( options.my[ 1 ] === "center" ) {
  1452. position.top -= elemHeight / 2;
  1453. }
  1454. position.left += myOffset[ 0 ];
  1455. position.top += myOffset[ 1 ];
  1456. collisionPosition = {
  1457. marginLeft: marginLeft,
  1458. marginTop: marginTop
  1459. };
  1460. $.each( [ "left", "top" ], function( i, dir ) {
  1461. if ( $.ui.position[ collision[ i ] ] ) {
  1462. $.ui.position[ collision[ i ] ][ dir ]( position, {
  1463. targetWidth: targetWidth,
  1464. targetHeight: targetHeight,
  1465. elemWidth: elemWidth,
  1466. elemHeight: elemHeight,
  1467. collisionPosition: collisionPosition,
  1468. collisionWidth: collisionWidth,
  1469. collisionHeight: collisionHeight,
  1470. offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
  1471. my: options.my,
  1472. at: options.at,
  1473. within: within,
  1474. elem: elem
  1475. } );
  1476. }
  1477. } );
  1478. if ( options.using ) {
  1479. // Adds feedback as second argument to using callback, if present
  1480. using = function( props ) {
  1481. var left = targetOffset.left - position.left,
  1482. right = left + targetWidth - elemWidth,
  1483. top = targetOffset.top - position.top,
  1484. bottom = top + targetHeight - elemHeight,
  1485. feedback = {
  1486. target: {
  1487. element: target,
  1488. left: targetOffset.left,
  1489. top: targetOffset.top,
  1490. width: targetWidth,
  1491. height: targetHeight
  1492. },
  1493. element: {
  1494. element: elem,
  1495. left: position.left,
  1496. top: position.top,
  1497. width: elemWidth,
  1498. height: elemHeight
  1499. },
  1500. horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
  1501. vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
  1502. };
  1503. if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
  1504. feedback.horizontal = "center";
  1505. }
  1506. if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
  1507. feedback.vertical = "middle";
  1508. }
  1509. if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
  1510. feedback.important = "horizontal";
  1511. } else {
  1512. feedback.important = "vertical";
  1513. }
  1514. options.using.call( this, props, feedback );
  1515. };
  1516. }
  1517. elem.offset( $.extend( position, { using: using } ) );
  1518. } );
  1519. };
  1520. $.ui.position = {
  1521. fit: {
  1522. left: function( position, data ) {
  1523. var within = data.within,
  1524. withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
  1525. outerWidth = within.width,
  1526. collisionPosLeft = position.left - data.collisionPosition.marginLeft,
  1527. overLeft = withinOffset - collisionPosLeft,
  1528. overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
  1529. newOverRight;
  1530. // Element is wider than within
  1531. if ( data.collisionWidth > outerWidth ) {
  1532. // Element is initially over the left side of within
  1533. if ( overLeft > 0 && overRight <= 0 ) {
  1534. newOverRight = position.left + overLeft + data.collisionWidth - outerWidth -
  1535. withinOffset;
  1536. position.left += overLeft - newOverRight;
  1537. // Element is initially over right side of within
  1538. } else if ( overRight > 0 && overLeft <= 0 ) {
  1539. position.left = withinOffset;
  1540. // Element is initially over both left and right sides of within
  1541. } else {
  1542. if ( overLeft > overRight ) {
  1543. position.left = withinOffset + outerWidth - data.collisionWidth;
  1544. } else {
  1545. position.left = withinOffset;
  1546. }
  1547. }
  1548. // Too far left -> align with left edge
  1549. } else if ( overLeft > 0 ) {
  1550. position.left += overLeft;
  1551. // Too far right -> align with right edge
  1552. } else if ( overRight > 0 ) {
  1553. position.left -= overRight;
  1554. // Adjust based on position and margin
  1555. } else {
  1556. position.left = max( position.left - collisionPosLeft, position.left );
  1557. }
  1558. },
  1559. top: function( position, data ) {
  1560. var within = data.within,
  1561. withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
  1562. outerHeight = data.within.height,
  1563. collisionPosTop = position.top - data.collisionPosition.marginTop,
  1564. overTop = withinOffset - collisionPosTop,
  1565. overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
  1566. newOverBottom;
  1567. // Element is taller than within
  1568. if ( data.collisionHeight > outerHeight ) {
  1569. // Element is initially over the top of within
  1570. if ( overTop > 0 && overBottom <= 0 ) {
  1571. newOverBottom = position.top + overTop + data.collisionHeight - outerHeight -
  1572. withinOffset;
  1573. position.top += overTop - newOverBottom;
  1574. // Element is initially over bottom of within
  1575. } else if ( overBottom > 0 && overTop <= 0 ) {
  1576. position.top = withinOffset;
  1577. // Element is initially over both top and bottom of within
  1578. } else {
  1579. if ( overTop > overBottom ) {
  1580. position.top = withinOffset + outerHeight - data.collisionHeight;
  1581. } else {
  1582. position.top = withinOffset;
  1583. }
  1584. }
  1585. // Too far up -> align with top
  1586. } else if ( overTop > 0 ) {
  1587. position.top += overTop;
  1588. // Too far down -> align with bottom edge
  1589. } else if ( overBottom > 0 ) {
  1590. position.top -= overBottom;
  1591. // Adjust based on position and margin
  1592. } else {
  1593. position.top = max( position.top - collisionPosTop, position.top );
  1594. }
  1595. }
  1596. },
  1597. flip: {
  1598. left: function( position, data ) {
  1599. var within = data.within,
  1600. withinOffset = within.offset.left + within.scrollLeft,
  1601. outerWidth = within.width,
  1602. offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
  1603. collisionPosLeft = position.left - data.collisionPosition.marginLeft,
  1604. overLeft = collisionPosLeft - offsetLeft,
  1605. overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
  1606. myOffset = data.my[ 0 ] === "left" ?
  1607. -data.elemWidth :
  1608. data.my[ 0 ] === "right" ?
  1609. data.elemWidth :
  1610. 0,
  1611. atOffset = data.at[ 0 ] === "left" ?
  1612. data.targetWidth :
  1613. data.at[ 0 ] === "right" ?
  1614. -data.targetWidth :
  1615. 0,
  1616. offset = -2 * data.offset[ 0 ],
  1617. newOverRight,
  1618. newOverLeft;
  1619. if ( overLeft < 0 ) {
  1620. newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth -
  1621. outerWidth - withinOffset;
  1622. if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
  1623. position.left += myOffset + atOffset + offset;
  1624. }
  1625. } else if ( overRight > 0 ) {
  1626. newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset +
  1627. atOffset + offset - offsetLeft;
  1628. if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
  1629. position.left += myOffset + atOffset + offset;
  1630. }
  1631. }
  1632. },
  1633. top: function( position, data ) {
  1634. var within = data.within,
  1635. withinOffset = within.offset.top + within.scrollTop,
  1636. outerHeight = within.height,
  1637. offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
  1638. collisionPosTop = position.top - data.collisionPosition.marginTop,
  1639. overTop = collisionPosTop - offsetTop,
  1640. overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
  1641. top = data.my[ 1 ] === "top",
  1642. myOffset = top ?
  1643. -data.elemHeight :
  1644. data.my[ 1 ] === "bottom" ?
  1645. data.elemHeight :
  1646. 0,
  1647. atOffset = data.at[ 1 ] === "top" ?
  1648. data.targetHeight :
  1649. data.at[ 1 ] === "bottom" ?
  1650. -data.targetHeight :
  1651. 0,
  1652. offset = -2 * data.offset[ 1 ],
  1653. newOverTop,
  1654. newOverBottom;
  1655. if ( overTop < 0 ) {
  1656. newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight -
  1657. outerHeight - withinOffset;
  1658. if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
  1659. position.top += myOffset + atOffset + offset;
  1660. }
  1661. } else if ( overBottom > 0 ) {
  1662. newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset +
  1663. offset - offsetTop;
  1664. if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
  1665. position.top += myOffset + atOffset + offset;
  1666. }
  1667. }
  1668. }
  1669. },
  1670. flipfit: {
  1671. left: function() {
  1672. $.ui.position.flip.left.apply( this, arguments );
  1673. $.ui.position.fit.left.apply( this, arguments );
  1674. },
  1675. top: function() {
  1676. $.ui.position.flip.top.apply( this, arguments );
  1677. $.ui.position.fit.top.apply( this, arguments );
  1678. }
  1679. }
  1680. };
  1681. } )();
  1682. var position = $.ui.position;
  1683. /*!
  1684. * jQuery UI :data 1.12.1
  1685. * http://jqueryui.com
  1686. *
  1687. * Copyright jQuery Foundation and other contributors
  1688. * Released under the MIT license.
  1689. * http://jquery.org/license
  1690. */
  1691. //>>label: :data Selector
  1692. //>>group: Core
  1693. //>>description: Selects elements which have data stored under the specified key.
  1694. //>>docs: http://api.jqueryui.com/data-selector/
  1695. var data = $.extend( $.expr[ ":" ], {
  1696. data: $.expr.createPseudo ?
  1697. $.expr.createPseudo( function( dataName ) {
  1698. return function( elem ) {
  1699. return !!$.data( elem, dataName );
  1700. };
  1701. } ) :
  1702. // Support: jQuery <1.8
  1703. function( elem, i, match ) {
  1704. return !!$.data( elem, match[ 3 ] );
  1705. }
  1706. } );
  1707. /*!
  1708. * jQuery UI Disable Selection 1.12.1
  1709. * http://jqueryui.com
  1710. *
  1711. * Copyright jQuery Foundation and other contributors
  1712. * Released under the MIT license.
  1713. * http://jquery.org/license
  1714. */
  1715. //>>label: disableSelection
  1716. //>>group: Core
  1717. //>>description: Disable selection of text content within the set of matched elements.
  1718. //>>docs: http://api.jqueryui.com/disableSelection/
  1719. // This file is deprecated
  1720. var disableSelection = $.fn.extend( {
  1721. disableSelection: ( function() {
  1722. var eventType = "onselectstart" in document.createElement( "div" ) ?
  1723. "selectstart" :
  1724. "mousedown";
  1725. return function() {
  1726. return this.on( eventType + ".ui-disableSelection", function( event ) {
  1727. event.preventDefault();
  1728. } );
  1729. };
  1730. } )(),
  1731. enableSelection: function() {
  1732. return this.off( ".ui-disableSelection" );
  1733. }
  1734. } );
  1735. /*!
  1736. * jQuery UI Effects 1.12.1
  1737. * http://jqueryui.com
  1738. *
  1739. * Copyright jQuery Foundation and other contributors
  1740. * Released under the MIT license.
  1741. * http://jquery.org/license
  1742. */
  1743. //>>label: Effects Core
  1744. //>>group: Effects
  1745. // jscs:disable maximumLineLength
  1746. //>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects.
  1747. // jscs:enable maximumLineLength
  1748. //>>docs: http://api.jqueryui.com/category/effects-core/
  1749. //>>demos: http://jqueryui.com/effect/
  1750. var dataSpace = "ui-effects-",
  1751. dataSpaceStyle = "ui-effects-style",
  1752. dataSpaceAnimated = "ui-effects-animated",
  1753. // Create a local jQuery because jQuery Color relies on it and the
  1754. // global may not exist with AMD and a custom build (#10199)
  1755. jQuery = $;
  1756. $.effects = {
  1757. effect: {}
  1758. };
  1759. /*!
  1760. * jQuery Color Animations v2.1.2
  1761. * https://github.com/jquery/jquery-color
  1762. *
  1763. * Copyright 2014 jQuery Foundation and other contributors
  1764. * Released under the MIT license.
  1765. * http://jquery.org/license
  1766. *
  1767. * Date: Wed Jan 16 08:47:09 2013 -0600
  1768. */
  1769. ( function( jQuery, undefined ) {
  1770. var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor " +
  1771. "borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
  1772. // Plusequals test for += 100 -= 100
  1773. rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
  1774. // A set of RE's that can match strings and generate color tuples.
  1775. stringParsers = [ {
  1776. re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
  1777. parse: function( execResult ) {
  1778. return [
  1779. execResult[ 1 ],
  1780. execResult[ 2 ],
  1781. execResult[ 3 ],
  1782. execResult[ 4 ]
  1783. ];
  1784. }
  1785. }, {
  1786. re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
  1787. parse: function( execResult ) {
  1788. return [
  1789. execResult[ 1 ] * 2.55,
  1790. execResult[ 2 ] * 2.55,
  1791. execResult[ 3 ] * 2.55,
  1792. execResult[ 4 ]
  1793. ];
  1794. }
  1795. }, {
  1796. // This regex ignores A-F because it's compared against an already lowercased string
  1797. re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
  1798. parse: function( execResult ) {
  1799. return [
  1800. parseInt( execResult[ 1 ], 16 ),
  1801. parseInt( execResult[ 2 ], 16 ),
  1802. parseInt( execResult[ 3 ], 16 )
  1803. ];
  1804. }
  1805. }, {
  1806. // This regex ignores A-F because it's compared against an already lowercased string
  1807. re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
  1808. parse: function( execResult ) {
  1809. return [
  1810. parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
  1811. parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
  1812. parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
  1813. ];
  1814. }
  1815. }, {
  1816. re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
  1817. space: "hsla",
  1818. parse: function( execResult ) {
  1819. return [
  1820. execResult[ 1 ],
  1821. execResult[ 2 ] / 100,
  1822. execResult[ 3 ] / 100,
  1823. execResult[ 4 ]
  1824. ];
  1825. }
  1826. } ],
  1827. // JQuery.Color( )
  1828. color = jQuery.Color = function( color, green, blue, alpha ) {
  1829. return new jQuery.Color.fn.parse( color, green, blue, alpha );
  1830. },
  1831. spaces = {
  1832. rgba: {
  1833. props: {
  1834. red: {
  1835. idx: 0,
  1836. type: "byte"
  1837. },
  1838. green: {
  1839. idx: 1,
  1840. type: "byte"
  1841. },
  1842. blue: {
  1843. idx: 2,
  1844. type: "byte"
  1845. }
  1846. }
  1847. },
  1848. hsla: {
  1849. props: {
  1850. hue: {
  1851. idx: 0,
  1852. type: "degrees"
  1853. },
  1854. saturation: {
  1855. idx: 1,
  1856. type: "percent"
  1857. },
  1858. lightness: {
  1859. idx: 2,
  1860. type: "percent"
  1861. }
  1862. }
  1863. }
  1864. },
  1865. propTypes = {
  1866. "byte": {
  1867. floor: true,
  1868. max: 255
  1869. },
  1870. "percent": {
  1871. max: 1
  1872. },
  1873. "degrees": {
  1874. mod: 360,
  1875. floor: true
  1876. }
  1877. },
  1878. support = color.support = {},
  1879. // Element for support tests
  1880. supportElem = jQuery( "<p>" )[ 0 ],
  1881. // Colors = jQuery.Color.names
  1882. colors,
  1883. // Local aliases of functions called often
  1884. each = jQuery.each;
  1885. // Determine rgba support immediately
  1886. supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
  1887. support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
  1888. // Define cache name and alpha properties
  1889. // for rgba and hsla spaces
  1890. each( spaces, function( spaceName, space ) {
  1891. space.cache = "_" + spaceName;
  1892. space.props.alpha = {
  1893. idx: 3,
  1894. type: "percent",
  1895. def: 1
  1896. };
  1897. } );
  1898. function clamp( value, prop, allowEmpty ) {
  1899. var type = propTypes[ prop.type ] || {};
  1900. if ( value == null ) {
  1901. return ( allowEmpty || !prop.def ) ? null : prop.def;
  1902. }
  1903. // ~~ is an short way of doing floor for positive numbers
  1904. value = type.floor ? ~~value : parseFloat( value );
  1905. // IE will pass in empty strings as value for alpha,
  1906. // which will hit this case
  1907. if ( isNaN( value ) ) {
  1908. return prop.def;
  1909. }
  1910. if ( type.mod ) {
  1911. // We add mod before modding to make sure that negatives values
  1912. // get converted properly: -10 -> 350
  1913. return ( value + type.mod ) % type.mod;
  1914. }
  1915. // For now all property types without mod have min and max
  1916. return 0 > value ? 0 : type.max < value ? type.max : value;
  1917. }
  1918. function stringParse( string ) {
  1919. var inst = color(),
  1920. rgba = inst._rgba = [];
  1921. string = string.toLowerCase();
  1922. each( stringParsers, function( i, parser ) {
  1923. var parsed,
  1924. match = parser.re.exec( string ),
  1925. values = match && parser.parse( match ),
  1926. spaceName = parser.space || "rgba";
  1927. if ( values ) {
  1928. parsed = inst[ spaceName ]( values );
  1929. // If this was an rgba parse the assignment might happen twice
  1930. // oh well....
  1931. inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
  1932. rgba = inst._rgba = parsed._rgba;
  1933. // Exit each( stringParsers ) here because we matched
  1934. return false;
  1935. }
  1936. } );
  1937. // Found a stringParser that handled it
  1938. if ( rgba.length ) {
  1939. // If this came from a parsed string, force "transparent" when alpha is 0
  1940. // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
  1941. if ( rgba.join() === "0,0,0,0" ) {
  1942. jQuery.extend( rgba, colors.transparent );
  1943. }
  1944. return inst;
  1945. }
  1946. // Named colors
  1947. return colors[ string ];
  1948. }
  1949. color.fn = jQuery.extend( color.prototype, {
  1950. parse: function( red, green, blue, alpha ) {
  1951. if ( red === undefined ) {
  1952. this._rgba = [ null, null, null, null ];
  1953. return this;
  1954. }
  1955. if ( red.jquery || red.nodeType ) {
  1956. red = jQuery( red ).css( green );
  1957. green = undefined;
  1958. }
  1959. var inst = this,
  1960. type = jQuery.type( red ),
  1961. rgba = this._rgba = [];
  1962. // More than 1 argument specified - assume ( red, green, blue, alpha )
  1963. if ( green !== undefined ) {
  1964. red = [ red, green, blue, alpha ];
  1965. type = "array";
  1966. }
  1967. if ( type === "string" ) {
  1968. return this.parse( stringParse( red ) || colors._default );
  1969. }
  1970. if ( type === "array" ) {
  1971. each( spaces.rgba.props, function( key, prop ) {
  1972. rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
  1973. } );
  1974. return this;
  1975. }
  1976. if ( type === "object" ) {
  1977. if ( red instanceof color ) {
  1978. each( spaces, function( spaceName, space ) {
  1979. if ( red[ space.cache ] ) {
  1980. inst[ space.cache ] = red[ space.cache ].slice();
  1981. }
  1982. } );
  1983. } else {
  1984. each( spaces, function( spaceName, space ) {
  1985. var cache = space.cache;
  1986. each( space.props, function( key, prop ) {
  1987. // If the cache doesn't exist, and we know how to convert
  1988. if ( !inst[ cache ] && space.to ) {
  1989. // If the value was null, we don't need to copy it
  1990. // if the key was alpha, we don't need to copy it either
  1991. if ( key === "alpha" || red[ key ] == null ) {
  1992. return;
  1993. }
  1994. inst[ cache ] = space.to( inst._rgba );
  1995. }
  1996. // This is the only case where we allow nulls for ALL properties.
  1997. // call clamp with alwaysAllowEmpty
  1998. inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
  1999. } );
  2000. // Everything defined but alpha?
  2001. if ( inst[ cache ] &&
  2002. jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
  2003. // Use the default of 1
  2004. inst[ cache ][ 3 ] = 1;
  2005. if ( space.from ) {
  2006. inst._rgba = space.from( inst[ cache ] );
  2007. }
  2008. }
  2009. } );
  2010. }
  2011. return this;
  2012. }
  2013. },
  2014. is: function( compare ) {
  2015. var is = color( compare ),
  2016. same = true,
  2017. inst = this;
  2018. each( spaces, function( _, space ) {
  2019. var localCache,
  2020. isCache = is[ space.cache ];
  2021. if ( isCache ) {
  2022. localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
  2023. each( space.props, function( _, prop ) {
  2024. if ( isCache[ prop.idx ] != null ) {
  2025. same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
  2026. return same;
  2027. }
  2028. } );
  2029. }
  2030. return same;
  2031. } );
  2032. return same;
  2033. },
  2034. _space: function() {
  2035. var used = [],
  2036. inst = this;
  2037. each( spaces, function( spaceName, space ) {
  2038. if ( inst[ space.cache ] ) {
  2039. used.push( spaceName );
  2040. }
  2041. } );
  2042. return used.pop();
  2043. },
  2044. transition: function( other, distance ) {
  2045. var end = color( other ),
  2046. spaceName = end._space(),
  2047. space = spaces[ spaceName ],
  2048. startColor = this.alpha() === 0 ? color( "transparent" ) : this,
  2049. start = startColor[ space.cache ] || space.to( startColor._rgba ),
  2050. result = start.slice();
  2051. end = end[ space.cache ];
  2052. each( space.props, function( key, prop ) {
  2053. var index = prop.idx,
  2054. startValue = start[ index ],
  2055. endValue = end[ index ],
  2056. type = propTypes[ prop.type ] || {};
  2057. // If null, don't override start value
  2058. if ( endValue === null ) {
  2059. return;
  2060. }
  2061. // If null - use end
  2062. if ( startValue === null ) {
  2063. result[ index ] = endValue;
  2064. } else {
  2065. if ( type.mod ) {
  2066. if ( endValue - startValue > type.mod / 2 ) {
  2067. startValue += type.mod;
  2068. } else if ( startValue - endValue > type.mod / 2 ) {
  2069. startValue -= type.mod;
  2070. }
  2071. }
  2072. result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
  2073. }
  2074. } );
  2075. return this[ spaceName ]( result );
  2076. },
  2077. blend: function( opaque ) {
  2078. // If we are already opaque - return ourself
  2079. if ( this._rgba[ 3 ] === 1 ) {
  2080. return this;
  2081. }
  2082. var rgb = this._rgba.slice(),
  2083. a = rgb.pop(),
  2084. blend = color( opaque )._rgba;
  2085. return color( jQuery.map( rgb, function( v, i ) {
  2086. return ( 1 - a ) * blend[ i ] + a * v;
  2087. } ) );
  2088. },
  2089. toRgbaString: function() {
  2090. var prefix = "rgba(",
  2091. rgba = jQuery.map( this._rgba, function( v, i ) {
  2092. return v == null ? ( i > 2 ? 1 : 0 ) : v;
  2093. } );
  2094. if ( rgba[ 3 ] === 1 ) {
  2095. rgba.pop();
  2096. prefix = "rgb(";
  2097. }
  2098. return prefix + rgba.join() + ")";
  2099. },
  2100. toHslaString: function() {
  2101. var prefix = "hsla(",
  2102. hsla = jQuery.map( this.hsla(), function( v, i ) {
  2103. if ( v == null ) {
  2104. v = i > 2 ? 1 : 0;
  2105. }
  2106. // Catch 1 and 2
  2107. if ( i && i < 3 ) {
  2108. v = Math.round( v * 100 ) + "%";
  2109. }
  2110. return v;
  2111. } );
  2112. if ( hsla[ 3 ] === 1 ) {
  2113. hsla.pop();
  2114. prefix = "hsl(";
  2115. }
  2116. return prefix + hsla.join() + ")";
  2117. },
  2118. toHexString: function( includeAlpha ) {
  2119. var rgba = this._rgba.slice(),
  2120. alpha = rgba.pop();
  2121. if ( includeAlpha ) {
  2122. rgba.push( ~~( alpha * 255 ) );
  2123. }
  2124. return "#" + jQuery.map( rgba, function( v ) {
  2125. // Default to 0 when nulls exist
  2126. v = ( v || 0 ).toString( 16 );
  2127. return v.length === 1 ? "0" + v : v;
  2128. } ).join( "" );
  2129. },
  2130. toString: function() {
  2131. return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
  2132. }
  2133. } );
  2134. color.fn.parse.prototype = color.fn;
  2135. // Hsla conversions adapted from:
  2136. // https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
  2137. function hue2rgb( p, q, h ) {
  2138. h = ( h + 1 ) % 1;
  2139. if ( h * 6 < 1 ) {
  2140. return p + ( q - p ) * h * 6;
  2141. }
  2142. if ( h * 2 < 1 ) {
  2143. return q;
  2144. }
  2145. if ( h * 3 < 2 ) {
  2146. return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
  2147. }
  2148. return p;
  2149. }
  2150. spaces.hsla.to = function( rgba ) {
  2151. if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
  2152. return [ null, null, null, rgba[ 3 ] ];
  2153. }
  2154. var r = rgba[ 0 ] / 255,
  2155. g = rgba[ 1 ] / 255,
  2156. b = rgba[ 2 ] / 255,
  2157. a = rgba[ 3 ],
  2158. max = Math.max( r, g, b ),
  2159. min = Math.min( r, g, b ),
  2160. diff = max - min,
  2161. add = max + min,
  2162. l = add * 0.5,
  2163. h, s;
  2164. if ( min === max ) {
  2165. h = 0;
  2166. } else if ( r === max ) {
  2167. h = ( 60 * ( g - b ) / diff ) + 360;
  2168. } else if ( g === max ) {
  2169. h = ( 60 * ( b - r ) / diff ) + 120;
  2170. } else {
  2171. h = ( 60 * ( r - g ) / diff ) + 240;
  2172. }
  2173. // Chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
  2174. // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
  2175. if ( diff === 0 ) {
  2176. s = 0;
  2177. } else if ( l <= 0.5 ) {
  2178. s = diff / add;
  2179. } else {
  2180. s = diff / ( 2 - add );
  2181. }
  2182. return [ Math.round( h ) % 360, s, l, a == null ? 1 : a ];
  2183. };
  2184. spaces.hsla.from = function( hsla ) {
  2185. if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
  2186. return [ null, null, null, hsla[ 3 ] ];
  2187. }
  2188. var h = hsla[ 0 ] / 360,
  2189. s = hsla[ 1 ],
  2190. l = hsla[ 2 ],
  2191. a = hsla[ 3 ],
  2192. q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
  2193. p = 2 * l - q;
  2194. return [
  2195. Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
  2196. Math.round( hue2rgb( p, q, h ) * 255 ),
  2197. Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
  2198. a
  2199. ];
  2200. };
  2201. each( spaces, function( spaceName, space ) {
  2202. var props = space.props,
  2203. cache = space.cache,
  2204. to = space.to,
  2205. from = space.from;
  2206. // Makes rgba() and hsla()
  2207. color.fn[ spaceName ] = function( value ) {
  2208. // Generate a cache for this space if it doesn't exist
  2209. if ( to && !this[ cache ] ) {
  2210. this[ cache ] = to( this._rgba );
  2211. }
  2212. if ( value === undefined ) {
  2213. return this[ cache ].slice();
  2214. }
  2215. var ret,
  2216. type = jQuery.type( value ),
  2217. arr = ( type === "array" || type === "object" ) ? value : arguments,
  2218. local = this[ cache ].slice();
  2219. each( props, function( key, prop ) {
  2220. var val = arr[ type === "object" ? key : prop.idx ];
  2221. if ( val == null ) {
  2222. val = local[ prop.idx ];
  2223. }
  2224. local[ prop.idx ] = clamp( val, prop );
  2225. } );
  2226. if ( from ) {
  2227. ret = color( from( local ) );
  2228. ret[ cache ] = local;
  2229. return ret;
  2230. } else {
  2231. return color( local );
  2232. }
  2233. };
  2234. // Makes red() green() blue() alpha() hue() saturation() lightness()
  2235. each( props, function( key, prop ) {
  2236. // Alpha is included in more than one space
  2237. if ( color.fn[ key ] ) {
  2238. return;
  2239. }
  2240. color.fn[ key ] = function( value ) {
  2241. var vtype = jQuery.type( value ),
  2242. fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
  2243. local = this[ fn ](),
  2244. cur = local[ prop.idx ],
  2245. match;
  2246. if ( vtype === "undefined" ) {
  2247. return cur;
  2248. }
  2249. if ( vtype === "function" ) {
  2250. value = value.call( this, cur );
  2251. vtype = jQuery.type( value );
  2252. }
  2253. if ( value == null && prop.empty ) {
  2254. return this;
  2255. }
  2256. if ( vtype === "string" ) {
  2257. match = rplusequals.exec( value );
  2258. if ( match ) {
  2259. value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
  2260. }
  2261. }
  2262. local[ prop.idx ] = value;
  2263. return this[ fn ]( local );
  2264. };
  2265. } );
  2266. } );
  2267. // Add cssHook and .fx.step function for each named hook.
  2268. // accept a space separated string of properties
  2269. color.hook = function( hook ) {
  2270. var hooks = hook.split( " " );
  2271. each( hooks, function( i, hook ) {
  2272. jQuery.cssHooks[ hook ] = {
  2273. set: function( elem, value ) {
  2274. var parsed, curElem,
  2275. backgroundColor = "";
  2276. if ( value !== "transparent" && ( jQuery.type( value ) !== "string" ||
  2277. ( parsed = stringParse( value ) ) ) ) {
  2278. value = color( parsed || value );
  2279. if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
  2280. curElem = hook === "backgroundColor" ? elem.parentNode : elem;
  2281. while (
  2282. ( backgroundColor === "" || backgroundColor === "transparent" ) &&
  2283. curElem && curElem.style
  2284. ) {
  2285. try {
  2286. backgroundColor = jQuery.css( curElem, "backgroundColor" );
  2287. curElem = curElem.parentNode;
  2288. } catch ( e ) {
  2289. }
  2290. }
  2291. value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
  2292. backgroundColor :
  2293. "_default" );
  2294. }
  2295. value = value.toRgbaString();
  2296. }
  2297. try {
  2298. elem.style[ hook ] = value;
  2299. } catch ( e ) {
  2300. // Wrapped to prevent IE from throwing errors on "invalid" values like
  2301. // 'auto' or 'inherit'
  2302. }
  2303. }
  2304. };
  2305. jQuery.fx.step[ hook ] = function( fx ) {
  2306. if ( !fx.colorInit ) {
  2307. fx.start = color( fx.elem, hook );
  2308. fx.end = color( fx.end );
  2309. fx.colorInit = true;
  2310. }
  2311. jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
  2312. };
  2313. } );
  2314. };
  2315. color.hook( stepHooks );
  2316. jQuery.cssHooks.borderColor = {
  2317. expand: function( value ) {
  2318. var expanded = {};
  2319. each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
  2320. expanded[ "border" + part + "Color" ] = value;
  2321. } );
  2322. return expanded;
  2323. }
  2324. };
  2325. // Basic color names only.
  2326. // Usage of any of the other color names requires adding yourself or including
  2327. // jquery.color.svg-names.js.
  2328. colors = jQuery.Color.names = {
  2329. // 4.1. Basic color keywords
  2330. aqua: "#00ffff",
  2331. black: "#000000",
  2332. blue: "#0000ff",
  2333. fuchsia: "#ff00ff",
  2334. gray: "#808080",
  2335. green: "#008000",
  2336. lime: "#00ff00",
  2337. maroon: "#800000",
  2338. navy: "#000080",
  2339. olive: "#808000",
  2340. purple: "#800080",
  2341. red: "#ff0000",
  2342. silver: "#c0c0c0",
  2343. teal: "#008080",
  2344. white: "#ffffff",
  2345. yellow: "#ffff00",
  2346. // 4.2.3. "transparent" color keyword
  2347. transparent: [ null, null, null, 0 ],
  2348. _default: "#ffffff"
  2349. };
  2350. } )( jQuery );
  2351. /******************************************************************************/
  2352. /****************************** CLASS ANIMATIONS ******************************/
  2353. /******************************************************************************/
  2354. ( function() {
  2355. var classAnimationActions = [ "add", "remove", "toggle" ],
  2356. shorthandStyles = {
  2357. border: 1,
  2358. borderBottom: 1,
  2359. borderColor: 1,
  2360. borderLeft: 1,
  2361. borderRight: 1,
  2362. borderTop: 1,
  2363. borderWidth: 1,
  2364. margin: 1,
  2365. padding: 1
  2366. };
  2367. $.each(
  2368. [ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ],
  2369. function( _, prop ) {
  2370. $.fx.step[ prop ] = function( fx ) {
  2371. if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
  2372. jQuery.style( fx.elem, prop, fx.end );
  2373. fx.setAttr = true;
  2374. }
  2375. };
  2376. }
  2377. );
  2378. function getElementStyles( elem ) {
  2379. var key, len,
  2380. style = elem.ownerDocument.defaultView ?
  2381. elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
  2382. elem.currentStyle,
  2383. styles = {};
  2384. if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
  2385. len = style.length;
  2386. while ( len-- ) {
  2387. key = style[ len ];
  2388. if ( typeof style[ key ] === "string" ) {
  2389. styles[ $.camelCase( key ) ] = style[ key ];
  2390. }
  2391. }
  2392. // Support: Opera, IE <9
  2393. } else {
  2394. for ( key in style ) {
  2395. if ( typeof style[ key ] === "string" ) {
  2396. styles[ key ] = style[ key ];
  2397. }
  2398. }
  2399. }
  2400. return styles;
  2401. }
  2402. function styleDifference( oldStyle, newStyle ) {
  2403. var diff = {},
  2404. name, value;
  2405. for ( name in newStyle ) {
  2406. value = newStyle[ name ];
  2407. if ( oldStyle[ name ] !== value ) {
  2408. if ( !shorthandStyles[ name ] ) {
  2409. if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
  2410. diff[ name ] = value;
  2411. }
  2412. }
  2413. }
  2414. }
  2415. return diff;
  2416. }
  2417. // Support: jQuery <1.8
  2418. if ( !$.fn.addBack ) {
  2419. $.fn.addBack = function( selector ) {
  2420. return this.add( selector == null ?
  2421. this.prevObject : this.prevObject.filter( selector )
  2422. );
  2423. };
  2424. }
  2425. $.effects.animateClass = function( value, duration, easing, callback ) {
  2426. var o = $.speed( duration, easing, callback );
  2427. return this.queue( function() {
  2428. var animated = $( this ),
  2429. baseClass = animated.attr( "class" ) || "",
  2430. applyClassChange,
  2431. allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
  2432. // Map the animated objects to store the original styles.
  2433. allAnimations = allAnimations.map( function() {
  2434. var el = $( this );
  2435. return {
  2436. el: el,
  2437. start: getElementStyles( this )
  2438. };
  2439. } );
  2440. // Apply class change
  2441. applyClassChange = function() {
  2442. $.each( classAnimationActions, function( i, action ) {
  2443. if ( value[ action ] ) {
  2444. animated[ action + "Class" ]( value[ action ] );
  2445. }
  2446. } );
  2447. };
  2448. applyClassChange();
  2449. // Map all animated objects again - calculate new styles and diff
  2450. allAnimations = allAnimations.map( function() {
  2451. this.end = getElementStyles( this.el[ 0 ] );
  2452. this.diff = styleDifference( this.start, this.end );
  2453. return this;
  2454. } );
  2455. // Apply original class
  2456. animated.attr( "class", baseClass );
  2457. // Map all animated objects again - this time collecting a promise
  2458. allAnimations = allAnimations.map( function() {
  2459. var styleInfo = this,
  2460. dfd = $.Deferred(),
  2461. opts = $.extend( {}, o, {
  2462. queue: false,
  2463. complete: function() {
  2464. dfd.resolve( styleInfo );
  2465. }
  2466. } );
  2467. this.el.animate( this.diff, opts );
  2468. return dfd.promise();
  2469. } );
  2470. // Once all animations have completed:
  2471. $.when.apply( $, allAnimations.get() ).done( function() {
  2472. // Set the final class
  2473. applyClassChange();
  2474. // For each animated element,
  2475. // clear all css properties that were animated
  2476. $.each( arguments, function() {
  2477. var el = this.el;
  2478. $.each( this.diff, function( key ) {
  2479. el.css( key, "" );
  2480. } );
  2481. } );
  2482. // This is guarnteed to be there if you use jQuery.speed()
  2483. // it also handles dequeuing the next anim...
  2484. o.complete.call( animated[ 0 ] );
  2485. } );
  2486. } );
  2487. };
  2488. $.fn.extend( {
  2489. addClass: ( function( orig ) {
  2490. return function( classNames, speed, easing, callback ) {
  2491. return speed ?
  2492. $.effects.animateClass.call( this,
  2493. { add: classNames }, speed, easing, callback ) :
  2494. orig.apply( this, arguments );
  2495. };
  2496. } )( $.fn.addClass ),
  2497. removeClass: ( function( orig ) {
  2498. return function( classNames, speed, easing, callback ) {
  2499. return arguments.length > 1 ?
  2500. $.effects.animateClass.call( this,
  2501. { remove: classNames }, speed, easing, callback ) :
  2502. orig.apply( this, arguments );
  2503. };
  2504. } )( $.fn.removeClass ),
  2505. toggleClass: ( function( orig ) {
  2506. return function( classNames, force, speed, easing, callback ) {
  2507. if ( typeof force === "boolean" || force === undefined ) {
  2508. if ( !speed ) {
  2509. // Without speed parameter
  2510. return orig.apply( this, arguments );
  2511. } else {
  2512. return $.effects.animateClass.call( this,
  2513. ( force ? { add: classNames } : { remove: classNames } ),
  2514. speed, easing, callback );
  2515. }
  2516. } else {
  2517. // Without force parameter
  2518. return $.effects.animateClass.call( this,
  2519. { toggle: classNames }, force, speed, easing );
  2520. }
  2521. };
  2522. } )( $.fn.toggleClass ),
  2523. switchClass: function( remove, add, speed, easing, callback ) {
  2524. return $.effects.animateClass.call( this, {
  2525. add: add,
  2526. remove: remove
  2527. }, speed, easing, callback );
  2528. }
  2529. } );
  2530. } )();
  2531. /******************************************************************************/
  2532. /*********************************** EFFECTS **********************************/
  2533. /******************************************************************************/
  2534. ( function() {
  2535. if ( $.expr && $.expr.filters && $.expr.filters.animated ) {
  2536. $.expr.filters.animated = ( function( orig ) {
  2537. return function( elem ) {
  2538. return !!$( elem ).data( dataSpaceAnimated ) || orig( elem );
  2539. };
  2540. } )( $.expr.filters.animated );
  2541. }
  2542. if ( $.uiBackCompat !== false ) {
  2543. $.extend( $.effects, {
  2544. // Saves a set of properties in a data storage
  2545. save: function( element, set ) {
  2546. var i = 0, length = set.length;
  2547. for ( ; i < length; i++ ) {
  2548. if ( set[ i ] !== null ) {
  2549. element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
  2550. }
  2551. }
  2552. },
  2553. // Restores a set of previously saved properties from a data storage
  2554. restore: function( element, set ) {
  2555. var val, i = 0, length = set.length;
  2556. for ( ; i < length; i++ ) {
  2557. if ( set[ i ] !== null ) {
  2558. val = element.data( dataSpace + set[ i ] );
  2559. element.css( set[ i ], val );
  2560. }
  2561. }
  2562. },
  2563. setMode: function( el, mode ) {
  2564. if ( mode === "toggle" ) {
  2565. mode = el.is( ":hidden" ) ? "show" : "hide";
  2566. }
  2567. return mode;
  2568. },
  2569. // Wraps the element around a wrapper that copies position properties
  2570. createWrapper: function( element ) {
  2571. // If the element is already wrapped, return it
  2572. if ( element.parent().is( ".ui-effects-wrapper" ) ) {
  2573. return element.parent();
  2574. }
  2575. // Wrap the element
  2576. var props = {
  2577. width: element.outerWidth( true ),
  2578. height: element.outerHeight( true ),
  2579. "float": element.css( "float" )
  2580. },
  2581. wrapper = $( "<div></div>" )
  2582. .addClass( "ui-effects-wrapper" )
  2583. .css( {
  2584. fontSize: "100%",
  2585. background: "transparent",
  2586. border: "none",
  2587. margin: 0,
  2588. padding: 0
  2589. } ),
  2590. // Store the size in case width/height are defined in % - Fixes #5245
  2591. size = {
  2592. width: element.width(),
  2593. height: element.height()
  2594. },
  2595. active = document.activeElement;
  2596. // Support: Firefox
  2597. // Firefox incorrectly exposes anonymous content
  2598. // https://bugzilla.mozilla.org/show_bug.cgi?id=561664
  2599. try {
  2600. active.id;
  2601. } catch ( e ) {
  2602. active = document.body;
  2603. }
  2604. element.wrap( wrapper );
  2605. // Fixes #7595 - Elements lose focus when wrapped.
  2606. if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
  2607. $( active ).trigger( "focus" );
  2608. }
  2609. // Hotfix for jQuery 1.4 since some change in wrap() seems to actually
  2610. // lose the reference to the wrapped element
  2611. wrapper = element.parent();
  2612. // Transfer positioning properties to the wrapper
  2613. if ( element.css( "position" ) === "static" ) {
  2614. wrapper.css( { position: "relative" } );
  2615. element.css( { position: "relative" } );
  2616. } else {
  2617. $.extend( props, {
  2618. position: element.css( "position" ),
  2619. zIndex: element.css( "z-index" )
  2620. } );
  2621. $.each( [ "top", "left", "bottom", "right" ], function( i, pos ) {
  2622. props[ pos ] = element.css( pos );
  2623. if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
  2624. props[ pos ] = "auto";
  2625. }
  2626. } );
  2627. element.css( {
  2628. position: "relative",
  2629. top: 0,
  2630. left: 0,
  2631. right: "auto",
  2632. bottom: "auto"
  2633. } );
  2634. }
  2635. element.css( size );
  2636. return wrapper.css( props ).show();
  2637. },
  2638. removeWrapper: function( element ) {
  2639. var active = document.activeElement;
  2640. if ( element.parent().is( ".ui-effects-wrapper" ) ) {
  2641. element.parent().replaceWith( element );
  2642. // Fixes #7595 - Elements lose focus when wrapped.
  2643. if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
  2644. $( active ).trigger( "focus" );
  2645. }
  2646. }
  2647. return element;
  2648. }
  2649. } );
  2650. }
  2651. $.extend( $.effects, {
  2652. version: "1.12.1",
  2653. define: function( name, mode, effect ) {
  2654. if ( !effect ) {
  2655. effect = mode;
  2656. mode = "effect";
  2657. }
  2658. $.effects.effect[ name ] = effect;
  2659. $.effects.effect[ name ].mode = mode;
  2660. return effect;
  2661. },
  2662. scaledDimensions: function( element, percent, direction ) {
  2663. if ( percent === 0 ) {
  2664. return {
  2665. height: 0,
  2666. width: 0,
  2667. outerHeight: 0,
  2668. outerWidth: 0
  2669. };
  2670. }
  2671. var x = direction !== "horizontal" ? ( ( percent || 100 ) / 100 ) : 1,
  2672. y = direction !== "vertical" ? ( ( percent || 100 ) / 100 ) : 1;
  2673. return {
  2674. height: element.height() * y,
  2675. width: element.width() * x,
  2676. outerHeight: element.outerHeight() * y,
  2677. outerWidth: element.outerWidth() * x
  2678. };
  2679. },
  2680. clipToBox: function( animation ) {
  2681. return {
  2682. width: animation.clip.right - animation.clip.left,
  2683. height: animation.clip.bottom - animation.clip.top,
  2684. left: animation.clip.left,
  2685. top: animation.clip.top
  2686. };
  2687. },
  2688. // Injects recently queued functions to be first in line (after "inprogress")
  2689. unshift: function( element, queueLength, count ) {
  2690. var queue = element.queue();
  2691. if ( queueLength > 1 ) {
  2692. queue.splice.apply( queue,
  2693. [ 1, 0 ].concat( queue.splice( queueLength, count ) ) );
  2694. }
  2695. element.dequeue();
  2696. },
  2697. saveStyle: function( element ) {
  2698. element.data( dataSpaceStyle, element[ 0 ].style.cssText );
  2699. },
  2700. restoreStyle: function( element ) {
  2701. element[ 0 ].style.cssText = element.data( dataSpaceStyle ) || "";
  2702. element.removeData( dataSpaceStyle );
  2703. },
  2704. mode: function( element, mode ) {
  2705. var hidden = element.is( ":hidden" );
  2706. if ( mode === "toggle" ) {
  2707. mode = hidden ? "show" : "hide";
  2708. }
  2709. if ( hidden ? mode === "hide" : mode === "show" ) {
  2710. mode = "none";
  2711. }
  2712. return mode;
  2713. },
  2714. // Translates a [top,left] array into a baseline value
  2715. getBaseline: function( origin, original ) {
  2716. var y, x;
  2717. switch ( origin[ 0 ] ) {
  2718. case "top":
  2719. y = 0;
  2720. break;
  2721. case "middle":
  2722. y = 0.5;
  2723. break;
  2724. case "bottom":
  2725. y = 1;
  2726. break;
  2727. default:
  2728. y = origin[ 0 ] / original.height;
  2729. }
  2730. switch ( origin[ 1 ] ) {
  2731. case "left":
  2732. x = 0;
  2733. break;
  2734. case "center":
  2735. x = 0.5;
  2736. break;
  2737. case "right":
  2738. x = 1;
  2739. break;
  2740. default:
  2741. x = origin[ 1 ] / original.width;
  2742. }
  2743. return {
  2744. x: x,
  2745. y: y
  2746. };
  2747. },
  2748. // Creates a placeholder element so that the original element can be made absolute
  2749. createPlaceholder: function( element ) {
  2750. var placeholder,
  2751. cssPosition = element.css( "position" ),
  2752. position = element.position();
  2753. // Lock in margins first to account for form elements, which
  2754. // will change margin if you explicitly set height
  2755. // see: http://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380
  2756. // Support: Safari
  2757. element.css( {
  2758. marginTop: element.css( "marginTop" ),
  2759. marginBottom: element.css( "marginBottom" ),
  2760. marginLeft: element.css( "marginLeft" ),
  2761. marginRight: element.css( "marginRight" )
  2762. } )
  2763. .outerWidth( element.outerWidth() )
  2764. .outerHeight( element.outerHeight() );
  2765. if ( /^(static|relative)/.test( cssPosition ) ) {
  2766. cssPosition = "absolute";
  2767. placeholder = $( "<" + element[ 0 ].nodeName + ">" ).insertAfter( element ).css( {
  2768. // Convert inline to inline block to account for inline elements
  2769. // that turn to inline block based on content (like img)
  2770. display: /^(inline|ruby)/.test( element.css( "display" ) ) ?
  2771. "inline-block" :
  2772. "block",
  2773. visibility: "hidden",
  2774. // Margins need to be set to account for margin collapse
  2775. marginTop: element.css( "marginTop" ),
  2776. marginBottom: element.css( "marginBottom" ),
  2777. marginLeft: element.css( "marginLeft" ),
  2778. marginRight: element.css( "marginRight" ),
  2779. "float": element.css( "float" )
  2780. } )
  2781. .outerWidth( element.outerWidth() )
  2782. .outerHeight( element.outerHeight() )
  2783. .addClass( "ui-effects-placeholder" );
  2784. element.data( dataSpace + "placeholder", placeholder );
  2785. }
  2786. element.css( {
  2787. position: cssPosition,
  2788. left: position.left,
  2789. top: position.top
  2790. } );
  2791. return placeholder;
  2792. },
  2793. removePlaceholder: function( element ) {
  2794. var dataKey = dataSpace + "placeholder",
  2795. placeholder = element.data( dataKey );
  2796. if ( placeholder ) {
  2797. placeholder.remove();
  2798. element.removeData( dataKey );
  2799. }
  2800. },
  2801. // Removes a placeholder if it exists and restores
  2802. // properties that were modified during placeholder creation
  2803. cleanUp: function( element ) {
  2804. $.effects.restoreStyle( element );
  2805. $.effects.removePlaceholder( element );
  2806. },
  2807. setTransition: function( element, list, factor, value ) {
  2808. value = value || {};
  2809. $.each( list, function( i, x ) {
  2810. var unit = element.cssUnit( x );
  2811. if ( unit[ 0 ] > 0 ) {
  2812. value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
  2813. }
  2814. } );
  2815. return value;
  2816. }
  2817. } );
  2818. // Return an effect options object for the given parameters:
  2819. function _normalizeArguments( effect, options, speed, callback ) {
  2820. // Allow passing all options as the first parameter
  2821. if ( $.isPlainObject( effect ) ) {
  2822. options = effect;
  2823. effect = effect.effect;
  2824. }
  2825. // Convert to an object
  2826. effect = { effect: effect };
  2827. // Catch (effect, null, ...)
  2828. if ( options == null ) {
  2829. options = {};
  2830. }
  2831. // Catch (effect, callback)
  2832. if ( $.isFunction( options ) ) {
  2833. callback = options;
  2834. speed = null;
  2835. options = {};
  2836. }
  2837. // Catch (effect, speed, ?)
  2838. if ( typeof options === "number" || $.fx.speeds[ options ] ) {
  2839. callback = speed;
  2840. speed = options;
  2841. options = {};
  2842. }
  2843. // Catch (effect, options, callback)
  2844. if ( $.isFunction( speed ) ) {
  2845. callback = speed;
  2846. speed = null;
  2847. }
  2848. // Add options to effect
  2849. if ( options ) {
  2850. $.extend( effect, options );
  2851. }
  2852. speed = speed || options.duration;
  2853. effect.duration = $.fx.off ? 0 :
  2854. typeof speed === "number" ? speed :
  2855. speed in $.fx.speeds ? $.fx.speeds[ speed ] :
  2856. $.fx.speeds._default;
  2857. effect.complete = callback || options.complete;
  2858. return effect;
  2859. }
  2860. function standardAnimationOption( option ) {
  2861. // Valid standard speeds (nothing, number, named speed)
  2862. if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
  2863. return true;
  2864. }
  2865. // Invalid strings - treat as "normal" speed
  2866. if ( typeof option === "string" && !$.effects.effect[ option ] ) {
  2867. return true;
  2868. }
  2869. // Complete callback
  2870. if ( $.isFunction( option ) ) {
  2871. return true;
  2872. }
  2873. // Options hash (but not naming an effect)
  2874. if ( typeof option === "object" && !option.effect ) {
  2875. return true;
  2876. }
  2877. // Didn't match any standard API
  2878. return false;
  2879. }
  2880. $.fn.extend( {
  2881. effect: function( /* effect, options, speed, callback */ ) {
  2882. var args = _normalizeArguments.apply( this, arguments ),
  2883. effectMethod = $.effects.effect[ args.effect ],
  2884. defaultMode = effectMethod.mode,
  2885. queue = args.queue,
  2886. queueName = queue || "fx",
  2887. complete = args.complete,
  2888. mode = args.mode,
  2889. modes = [],
  2890. prefilter = function( next ) {
  2891. var el = $( this ),
  2892. normalizedMode = $.effects.mode( el, mode ) || defaultMode;
  2893. // Sentinel for duck-punching the :animated psuedo-selector
  2894. el.data( dataSpaceAnimated, true );
  2895. // Save effect mode for later use,
  2896. // we can't just call $.effects.mode again later,
  2897. // as the .show() below destroys the initial state
  2898. modes.push( normalizedMode );
  2899. // See $.uiBackCompat inside of run() for removal of defaultMode in 1.13
  2900. if ( defaultMode && ( normalizedMode === "show" ||
  2901. ( normalizedMode === defaultMode && normalizedMode === "hide" ) ) ) {
  2902. el.show();
  2903. }
  2904. if ( !defaultMode || normalizedMode !== "none" ) {
  2905. $.effects.saveStyle( el );
  2906. }
  2907. if ( $.isFunction( next ) ) {
  2908. next();
  2909. }
  2910. };
  2911. if ( $.fx.off || !effectMethod ) {
  2912. // Delegate to the original method (e.g., .show()) if possible
  2913. if ( mode ) {
  2914. return this[ mode ]( args.duration, complete );
  2915. } else {
  2916. return this.each( function() {
  2917. if ( complete ) {
  2918. complete.call( this );
  2919. }
  2920. } );
  2921. }
  2922. }
  2923. function run( next ) {
  2924. var elem = $( this );
  2925. function cleanup() {
  2926. elem.removeData( dataSpaceAnimated );
  2927. $.effects.cleanUp( elem );
  2928. if ( args.mode === "hide" ) {
  2929. elem.hide();
  2930. }
  2931. done();
  2932. }
  2933. function done() {
  2934. if ( $.isFunction( complete ) ) {
  2935. complete.call( elem[ 0 ] );
  2936. }
  2937. if ( $.isFunction( next ) ) {
  2938. next();
  2939. }
  2940. }
  2941. // Override mode option on a per element basis,
  2942. // as toggle can be either show or hide depending on element state
  2943. args.mode = modes.shift();
  2944. if ( $.uiBackCompat !== false && !defaultMode ) {
  2945. if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
  2946. // Call the core method to track "olddisplay" properly
  2947. elem[ mode ]();
  2948. done();
  2949. } else {
  2950. effectMethod.call( elem[ 0 ], args, done );
  2951. }
  2952. } else {
  2953. if ( args.mode === "none" ) {
  2954. // Call the core method to track "olddisplay" properly
  2955. elem[ mode ]();
  2956. done();
  2957. } else {
  2958. effectMethod.call( elem[ 0 ], args, cleanup );
  2959. }
  2960. }
  2961. }
  2962. // Run prefilter on all elements first to ensure that
  2963. // any showing or hiding happens before placeholder creation,
  2964. // which ensures that any layout changes are correctly captured.
  2965. return queue === false ?
  2966. this.each( prefilter ).each( run ) :
  2967. this.queue( queueName, prefilter ).queue( queueName, run );
  2968. },
  2969. show: ( function( orig ) {
  2970. return function( option ) {
  2971. if ( standardAnimationOption( option ) ) {
  2972. return orig.apply( this, arguments );
  2973. } else {
  2974. var args = _normalizeArguments.apply( this, arguments );
  2975. args.mode = "show";
  2976. return this.effect.call( this, args );
  2977. }
  2978. };
  2979. } )( $.fn.show ),
  2980. hide: ( function( orig ) {
  2981. return function( option ) {
  2982. if ( standardAnimationOption( option ) ) {
  2983. return orig.apply( this, arguments );
  2984. } else {
  2985. var args = _normalizeArguments.apply( this, arguments );
  2986. args.mode = "hide";
  2987. return this.effect.call( this, args );
  2988. }
  2989. };
  2990. } )( $.fn.hide ),
  2991. toggle: ( function( orig ) {
  2992. return function( option ) {
  2993. if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
  2994. return orig.apply( this, arguments );
  2995. } else {
  2996. var args = _normalizeArguments.apply( this, arguments );
  2997. args.mode = "toggle";
  2998. return this.effect.call( this, args );
  2999. }
  3000. };
  3001. } )( $.fn.toggle ),
  3002. cssUnit: function( key ) {
  3003. var style = this.css( key ),
  3004. val = [];
  3005. $.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
  3006. if ( style.indexOf( unit ) > 0 ) {
  3007. val = [ parseFloat( style ), unit ];
  3008. }
  3009. } );
  3010. return val;
  3011. },
  3012. cssClip: function( clipObj ) {
  3013. if ( clipObj ) {
  3014. return this.css( "clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " +
  3015. clipObj.bottom + "px " + clipObj.left + "px)" );
  3016. }
  3017. return parseClip( this.css( "clip" ), this );
  3018. },
  3019. transfer: function( options, done ) {
  3020. var element = $( this ),
  3021. target = $( options.to ),
  3022. targetFixed = target.css( "position" ) === "fixed",
  3023. body = $( "body" ),
  3024. fixTop = targetFixed ? body.scrollTop() : 0,
  3025. fixLeft = targetFixed ? body.scrollLeft() : 0,
  3026. endPosition = target.offset(),
  3027. animation = {
  3028. top: endPosition.top - fixTop,
  3029. left: endPosition.left - fixLeft,
  3030. height: target.innerHeight(),
  3031. width: target.innerWidth()
  3032. },
  3033. startPosition = element.offset(),
  3034. transfer = $( "<div class='ui-effects-transfer'></div>" )
  3035. .appendTo( "body" )
  3036. .addClass( options.className )
  3037. .css( {
  3038. top: startPosition.top - fixTop,
  3039. left: startPosition.left - fixLeft,
  3040. height: element.innerHeight(),
  3041. width: element.innerWidth(),
  3042. position: targetFixed ? "fixed" : "absolute"
  3043. } )
  3044. .animate( animation, options.duration, options.easing, function() {
  3045. transfer.remove();
  3046. if ( $.isFunction( done ) ) {
  3047. done();
  3048. }
  3049. } );
  3050. }
  3051. } );
  3052. function parseClip( str, element ) {
  3053. var outerWidth = element.outerWidth(),
  3054. outerHeight = element.outerHeight(),
  3055. clipRegex = /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,
  3056. values = clipRegex.exec( str ) || [ "", 0, outerWidth, outerHeight, 0 ];
  3057. return {
  3058. top: parseFloat( values[ 1 ] ) || 0,
  3059. right: values[ 2 ] === "auto" ? outerWidth : parseFloat( values[ 2 ] ),
  3060. bottom: values[ 3 ] === "auto" ? outerHeight : parseFloat( values[ 3 ] ),
  3061. left: parseFloat( values[ 4 ] ) || 0
  3062. };
  3063. }
  3064. $.fx.step.clip = function( fx ) {
  3065. if ( !fx.clipInit ) {
  3066. fx.start = $( fx.elem ).cssClip();
  3067. if ( typeof fx.end === "string" ) {
  3068. fx.end = parseClip( fx.end, fx.elem );
  3069. }
  3070. fx.clipInit = true;
  3071. }
  3072. $( fx.elem ).cssClip( {
  3073. top: fx.pos * ( fx.end.top - fx.start.top ) + fx.start.top,
  3074. right: fx.pos * ( fx.end.right - fx.start.right ) + fx.start.right,
  3075. bottom: fx.pos * ( fx.end.bottom - fx.start.bottom ) + fx.start.bottom,
  3076. left: fx.pos * ( fx.end.left - fx.start.left ) + fx.start.left
  3077. } );
  3078. };
  3079. } )();
  3080. /******************************************************************************/
  3081. /*********************************** EASING ***********************************/
  3082. /******************************************************************************/
  3083. ( function() {
  3084. // Based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
  3085. var baseEasings = {};
  3086. $.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
  3087. baseEasings[ name ] = function( p ) {
  3088. return Math.pow( p, i + 2 );
  3089. };
  3090. } );
  3091. $.extend( baseEasings, {
  3092. Sine: function( p ) {
  3093. return 1 - Math.cos( p * Math.PI / 2 );
  3094. },
  3095. Circ: function( p ) {
  3096. return 1 - Math.sqrt( 1 - p * p );
  3097. },
  3098. Elastic: function( p ) {
  3099. return p === 0 || p === 1 ? p :
  3100. -Math.pow( 2, 8 * ( p - 1 ) ) * Math.sin( ( ( p - 1 ) * 80 - 7.5 ) * Math.PI / 15 );
  3101. },
  3102. Back: function( p ) {
  3103. return p * p * ( 3 * p - 2 );
  3104. },
  3105. Bounce: function( p ) {
  3106. var pow2,
  3107. bounce = 4;
  3108. while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
  3109. return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
  3110. }
  3111. } );
  3112. $.each( baseEasings, function( name, easeIn ) {
  3113. $.easing[ "easeIn" + name ] = easeIn;
  3114. $.easing[ "easeOut" + name ] = function( p ) {
  3115. return 1 - easeIn( 1 - p );
  3116. };
  3117. $.easing[ "easeInOut" + name ] = function( p ) {
  3118. return p < 0.5 ?
  3119. easeIn( p * 2 ) / 2 :
  3120. 1 - easeIn( p * -2 + 2 ) / 2;
  3121. };
  3122. } );
  3123. } )();
  3124. var effect = $.effects;
  3125. /*!
  3126. * jQuery UI Effects Blind 1.12.1
  3127. * http://jqueryui.com
  3128. *
  3129. * Copyright jQuery Foundation and other contributors
  3130. * Released under the MIT license.
  3131. * http://jquery.org/license
  3132. */
  3133. //>>label: Blind Effect
  3134. //>>group: Effects
  3135. //>>description: Blinds the element.
  3136. //>>docs: http://api.jqueryui.com/blind-effect/
  3137. //>>demos: http://jqueryui.com/effect/
  3138. var effectsEffectBlind = $.effects.define( "blind", "hide", function( options, done ) {
  3139. var map = {
  3140. up: [ "bottom", "top" ],
  3141. vertical: [ "bottom", "top" ],
  3142. down: [ "top", "bottom" ],
  3143. left: [ "right", "left" ],
  3144. horizontal: [ "right", "left" ],
  3145. right: [ "left", "right" ]
  3146. },
  3147. element = $( this ),
  3148. direction = options.direction || "up",
  3149. start = element.cssClip(),
  3150. animate = { clip: $.extend( {}, start ) },
  3151. placeholder = $.effects.createPlaceholder( element );
  3152. animate.clip[ map[ direction ][ 0 ] ] = animate.clip[ map[ direction ][ 1 ] ];
  3153. if ( options.mode === "show" ) {
  3154. element.cssClip( animate.clip );
  3155. if ( placeholder ) {
  3156. placeholder.css( $.effects.clipToBox( animate ) );
  3157. }
  3158. animate.clip = start;
  3159. }
  3160. if ( placeholder ) {
  3161. placeholder.animate( $.effects.clipToBox( animate ), options.duration, options.easing );
  3162. }
  3163. element.animate( animate, {
  3164. queue: false,
  3165. duration: options.duration,
  3166. easing: options.easing,
  3167. complete: done
  3168. } );
  3169. } );
  3170. /*!
  3171. * jQuery UI Effects Bounce 1.12.1
  3172. * http://jqueryui.com
  3173. *
  3174. * Copyright jQuery Foundation and other contributors
  3175. * Released under the MIT license.
  3176. * http://jquery.org/license
  3177. */
  3178. //>>label: Bounce Effect
  3179. //>>group: Effects
  3180. //>>description: Bounces an element horizontally or vertically n times.
  3181. //>>docs: http://api.jqueryui.com/bounce-effect/
  3182. //>>demos: http://jqueryui.com/effect/
  3183. var effectsEffectBounce = $.effects.define( "bounce", function( options, done ) {
  3184. var upAnim, downAnim, refValue,
  3185. element = $( this ),
  3186. // Defaults:
  3187. mode = options.mode,
  3188. hide = mode === "hide",
  3189. show = mode === "show",
  3190. direction = options.direction || "up",
  3191. distance = options.distance,
  3192. times = options.times || 5,
  3193. // Number of internal animations
  3194. anims = times * 2 + ( show || hide ? 1 : 0 ),
  3195. speed = options.duration / anims,
  3196. easing = options.easing,
  3197. // Utility:
  3198. ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
  3199. motion = ( direction === "up" || direction === "left" ),
  3200. i = 0,
  3201. queuelen = element.queue().length;
  3202. $.effects.createPlaceholder( element );
  3203. refValue = element.css( ref );
  3204. // Default distance for the BIGGEST bounce is the outer Distance / 3
  3205. if ( !distance ) {
  3206. distance = element[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
  3207. }
  3208. if ( show ) {
  3209. downAnim = { opacity: 1 };
  3210. downAnim[ ref ] = refValue;
  3211. // If we are showing, force opacity 0 and set the initial position
  3212. // then do the "first" animation
  3213. element
  3214. .css( "opacity", 0 )
  3215. .css( ref, motion ? -distance * 2 : distance * 2 )
  3216. .animate( downAnim, speed, easing );
  3217. }
  3218. // Start at the smallest distance if we are hiding
  3219. if ( hide ) {
  3220. distance = distance / Math.pow( 2, times - 1 );
  3221. }
  3222. downAnim = {};
  3223. downAnim[ ref ] = refValue;
  3224. // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
  3225. for ( ; i < times; i++ ) {
  3226. upAnim = {};
  3227. upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
  3228. element
  3229. .animate( upAnim, speed, easing )
  3230. .animate( downAnim, speed, easing );
  3231. distance = hide ? distance * 2 : distance / 2;
  3232. }
  3233. // Last Bounce when Hiding
  3234. if ( hide ) {
  3235. upAnim = { opacity: 0 };
  3236. upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
  3237. element.animate( upAnim, speed, easing );
  3238. }
  3239. element.queue( done );
  3240. $.effects.unshift( element, queuelen, anims + 1 );
  3241. } );
  3242. /*!
  3243. * jQuery UI Effects Clip 1.12.1
  3244. * http://jqueryui.com
  3245. *
  3246. * Copyright jQuery Foundation and other contributors
  3247. * Released under the MIT license.
  3248. * http://jquery.org/license
  3249. */
  3250. //>>label: Clip Effect
  3251. //>>group: Effects
  3252. //>>description: Clips the element on and off like an old TV.
  3253. //>>docs: http://api.jqueryui.com/clip-effect/
  3254. //>>demos: http://jqueryui.com/effect/
  3255. var effectsEffectClip = $.effects.define( "clip", "hide", function( options, done ) {
  3256. var start,
  3257. animate = {},
  3258. element = $( this ),
  3259. direction = options.direction || "vertical",
  3260. both = direction === "both",
  3261. horizontal = both || direction === "horizontal",
  3262. vertical = both || direction === "vertical";
  3263. start = element.cssClip();
  3264. animate.clip = {
  3265. top: vertical ? ( start.bottom - start.top ) / 2 : start.top,
  3266. right: horizontal ? ( start.right - start.left ) / 2 : start.right,
  3267. bottom: vertical ? ( start.bottom - start.top ) / 2 : start.bottom,
  3268. left: horizontal ? ( start.right - start.left ) / 2 : start.left
  3269. };
  3270. $.effects.createPlaceholder( element );
  3271. if ( options.mode === "show" ) {
  3272. element.cssClip( animate.clip );
  3273. animate.clip = start;
  3274. }
  3275. element.animate( animate, {
  3276. queue: false,
  3277. duration: options.duration,
  3278. easing: options.easing,
  3279. complete: done
  3280. } );
  3281. } );
  3282. /*!
  3283. * jQuery UI Effects Drop 1.12.1
  3284. * http://jqueryui.com
  3285. *
  3286. * Copyright jQuery Foundation and other contributors
  3287. * Released under the MIT license.
  3288. * http://jquery.org/license
  3289. */
  3290. //>>label: Drop Effect
  3291. //>>group: Effects
  3292. //>>description: Moves an element in one direction and hides it at the same time.
  3293. //>>docs: http://api.jqueryui.com/drop-effect/
  3294. //>>demos: http://jqueryui.com/effect/
  3295. var effectsEffectDrop = $.effects.define( "drop", "hide", function( options, done ) {
  3296. var distance,
  3297. element = $( this ),
  3298. mode = options.mode,
  3299. show = mode === "show",
  3300. direction = options.direction || "left",
  3301. ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
  3302. motion = ( direction === "up" || direction === "left" ) ? "-=" : "+=",
  3303. oppositeMotion = ( motion === "+=" ) ? "-=" : "+=",
  3304. animation = {
  3305. opacity: 0
  3306. };
  3307. $.effects.createPlaceholder( element );
  3308. distance = options.distance ||
  3309. element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
  3310. animation[ ref ] = motion + distance;
  3311. if ( show ) {
  3312. element.css( animation );
  3313. animation[ ref ] = oppositeMotion + distance;
  3314. animation.opacity = 1;
  3315. }
  3316. // Animate
  3317. element.animate( animation, {
  3318. queue: false,
  3319. duration: options.duration,
  3320. easing: options.easing,
  3321. complete: done
  3322. } );
  3323. } );
  3324. /*!
  3325. * jQuery UI Effects Explode 1.12.1
  3326. * http://jqueryui.com
  3327. *
  3328. * Copyright jQuery Foundation and other contributors
  3329. * Released under the MIT license.
  3330. * http://jquery.org/license
  3331. */
  3332. //>>label: Explode Effect
  3333. //>>group: Effects
  3334. // jscs:disable maximumLineLength
  3335. //>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness.
  3336. // jscs:enable maximumLineLength
  3337. //>>docs: http://api.jqueryui.com/explode-effect/
  3338. //>>demos: http://jqueryui.com/effect/
  3339. var effectsEffectExplode = $.effects.define( "explode", "hide", function( options, done ) {
  3340. var i, j, left, top, mx, my,
  3341. rows = options.pieces ? Math.round( Math.sqrt( options.pieces ) ) : 3,
  3342. cells = rows,
  3343. element = $( this ),
  3344. mode = options.mode,
  3345. show = mode === "show",
  3346. // Show and then visibility:hidden the element before calculating offset
  3347. offset = element.show().css( "visibility", "hidden" ).offset(),
  3348. // Width and height of a piece
  3349. width = Math.ceil( element.outerWidth() / cells ),
  3350. height = Math.ceil( element.outerHeight() / rows ),
  3351. pieces = [];
  3352. // Children animate complete:
  3353. function childComplete() {
  3354. pieces.push( this );
  3355. if ( pieces.length === rows * cells ) {
  3356. animComplete();
  3357. }
  3358. }
  3359. // Clone the element for each row and cell.
  3360. for ( i = 0; i < rows; i++ ) { // ===>
  3361. top = offset.top + i * height;
  3362. my = i - ( rows - 1 ) / 2;
  3363. for ( j = 0; j < cells; j++ ) { // |||
  3364. left = offset.left + j * width;
  3365. mx = j - ( cells - 1 ) / 2;
  3366. // Create a clone of the now hidden main element that will be absolute positioned
  3367. // within a wrapper div off the -left and -top equal to size of our pieces
  3368. element
  3369. .clone()
  3370. .appendTo( "body" )
  3371. .wrap( "<div></div>" )
  3372. .css( {
  3373. position: "absolute",
  3374. visibility: "visible",
  3375. left: -j * width,
  3376. top: -i * height
  3377. } )
  3378. // Select the wrapper - make it overflow: hidden and absolute positioned based on
  3379. // where the original was located +left and +top equal to the size of pieces
  3380. .parent()
  3381. .addClass( "ui-effects-explode" )
  3382. .css( {
  3383. position: "absolute",
  3384. overflow: "hidden",
  3385. width: width,
  3386. height: height,
  3387. left: left + ( show ? mx * width : 0 ),
  3388. top: top + ( show ? my * height : 0 ),
  3389. opacity: show ? 0 : 1
  3390. } )
  3391. .animate( {
  3392. left: left + ( show ? 0 : mx * width ),
  3393. top: top + ( show ? 0 : my * height ),
  3394. opacity: show ? 1 : 0
  3395. }, options.duration || 500, options.easing, childComplete );
  3396. }
  3397. }
  3398. function animComplete() {
  3399. element.css( {
  3400. visibility: "visible"
  3401. } );
  3402. $( pieces ).remove();
  3403. done();
  3404. }
  3405. } );
  3406. /*!
  3407. * jQuery UI Effects Fade 1.12.1
  3408. * http://jqueryui.com
  3409. *
  3410. * Copyright jQuery Foundation and other contributors
  3411. * Released under the MIT license.
  3412. * http://jquery.org/license
  3413. */
  3414. //>>label: Fade Effect
  3415. //>>group: Effects
  3416. //>>description: Fades the element.
  3417. //>>docs: http://api.jqueryui.com/fade-effect/
  3418. //>>demos: http://jqueryui.com/effect/
  3419. var effectsEffectFade = $.effects.define( "fade", "toggle", function( options, done ) {
  3420. var show = options.mode === "show";
  3421. $( this )
  3422. .css( "opacity", show ? 0 : 1 )
  3423. .animate( {
  3424. opacity: show ? 1 : 0
  3425. }, {
  3426. queue: false,
  3427. duration: options.duration,
  3428. easing: options.easing,
  3429. complete: done
  3430. } );
  3431. } );
  3432. /*!
  3433. * jQuery UI Effects Fold 1.12.1
  3434. * http://jqueryui.com
  3435. *
  3436. * Copyright jQuery Foundation and other contributors
  3437. * Released under the MIT license.
  3438. * http://jquery.org/license
  3439. */
  3440. //>>label: Fold Effect
  3441. //>>group: Effects
  3442. //>>description: Folds an element first horizontally and then vertically.
  3443. //>>docs: http://api.jqueryui.com/fold-effect/
  3444. //>>demos: http://jqueryui.com/effect/
  3445. var effectsEffectFold = $.effects.define( "fold", "hide", function( options, done ) {
  3446. // Create element
  3447. var element = $( this ),
  3448. mode = options.mode,
  3449. show = mode === "show",
  3450. hide = mode === "hide",
  3451. size = options.size || 15,
  3452. percent = /([0-9]+)%/.exec( size ),
  3453. horizFirst = !!options.horizFirst,
  3454. ref = horizFirst ? [ "right", "bottom" ] : [ "bottom", "right" ],
  3455. duration = options.duration / 2,
  3456. placeholder = $.effects.createPlaceholder( element ),
  3457. start = element.cssClip(),
  3458. animation1 = { clip: $.extend( {}, start ) },
  3459. animation2 = { clip: $.extend( {}, start ) },
  3460. distance = [ start[ ref[ 0 ] ], start[ ref[ 1 ] ] ],
  3461. queuelen = element.queue().length;
  3462. if ( percent ) {
  3463. size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
  3464. }
  3465. animation1.clip[ ref[ 0 ] ] = size;
  3466. animation2.clip[ ref[ 0 ] ] = size;
  3467. animation2.clip[ ref[ 1 ] ] = 0;
  3468. if ( show ) {
  3469. element.cssClip( animation2.clip );
  3470. if ( placeholder ) {
  3471. placeholder.css( $.effects.clipToBox( animation2 ) );
  3472. }
  3473. animation2.clip = start;
  3474. }
  3475. // Animate
  3476. element
  3477. .queue( function( next ) {
  3478. if ( placeholder ) {
  3479. placeholder
  3480. .animate( $.effects.clipToBox( animation1 ), duration, options.easing )
  3481. .animate( $.effects.clipToBox( animation2 ), duration, options.easing );
  3482. }
  3483. next();
  3484. } )
  3485. .animate( animation1, duration, options.easing )
  3486. .animate( animation2, duration, options.easing )
  3487. .queue( done );
  3488. $.effects.unshift( element, queuelen, 4 );
  3489. } );
  3490. /*!
  3491. * jQuery UI Effects Highlight 1.12.1
  3492. * http://jqueryui.com
  3493. *
  3494. * Copyright jQuery Foundation and other contributors
  3495. * Released under the MIT license.
  3496. * http://jquery.org/license
  3497. */
  3498. //>>label: Highlight Effect
  3499. //>>group: Effects
  3500. //>>description: Highlights the background of an element in a defined color for a custom duration.
  3501. //>>docs: http://api.jqueryui.com/highlight-effect/
  3502. //>>demos: http://jqueryui.com/effect/
  3503. var effectsEffectHighlight = $.effects.define( "highlight", "show", function( options, done ) {
  3504. var element = $( this ),
  3505. animation = {
  3506. backgroundColor: element.css( "backgroundColor" )
  3507. };
  3508. if ( options.mode === "hide" ) {
  3509. animation.opacity = 0;
  3510. }
  3511. $.effects.saveStyle( element );
  3512. element
  3513. .css( {
  3514. backgroundImage: "none",
  3515. backgroundColor: options.color || "#ffff99"
  3516. } )
  3517. .animate( animation, {
  3518. queue: false,
  3519. duration: options.duration,
  3520. easing: options.easing,
  3521. complete: done
  3522. } );
  3523. } );
  3524. /*!
  3525. * jQuery UI Effects Size 1.12.1
  3526. * http://jqueryui.com
  3527. *
  3528. * Copyright jQuery Foundation and other contributors
  3529. * Released under the MIT license.
  3530. * http://jquery.org/license
  3531. */
  3532. //>>label: Size Effect
  3533. //>>group: Effects
  3534. //>>description: Resize an element to a specified width and height.
  3535. //>>docs: http://api.jqueryui.com/size-effect/
  3536. //>>demos: http://jqueryui.com/effect/
  3537. var effectsEffectSize = $.effects.define( "size", function( options, done ) {
  3538. // Create element
  3539. var baseline, factor, temp,
  3540. element = $( this ),
  3541. // Copy for children
  3542. cProps = [ "fontSize" ],
  3543. vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
  3544. hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
  3545. // Set options
  3546. mode = options.mode,
  3547. restore = mode !== "effect",
  3548. scale = options.scale || "both",
  3549. origin = options.origin || [ "middle", "center" ],
  3550. position = element.css( "position" ),
  3551. pos = element.position(),
  3552. original = $.effects.scaledDimensions( element ),
  3553. from = options.from || original,
  3554. to = options.to || $.effects.scaledDimensions( element, 0 );
  3555. $.effects.createPlaceholder( element );
  3556. if ( mode === "show" ) {
  3557. temp = from;
  3558. from = to;
  3559. to = temp;
  3560. }
  3561. // Set scaling factor
  3562. factor = {
  3563. from: {
  3564. y: from.height / original.height,
  3565. x: from.width / original.width
  3566. },
  3567. to: {
  3568. y: to.height / original.height,
  3569. x: to.width / original.width
  3570. }
  3571. };
  3572. // Scale the css box
  3573. if ( scale === "box" || scale === "both" ) {
  3574. // Vertical props scaling
  3575. if ( factor.from.y !== factor.to.y ) {
  3576. from = $.effects.setTransition( element, vProps, factor.from.y, from );
  3577. to = $.effects.setTransition( element, vProps, factor.to.y, to );
  3578. }
  3579. // Horizontal props scaling
  3580. if ( factor.from.x !== factor.to.x ) {
  3581. from = $.effects.setTransition( element, hProps, factor.from.x, from );
  3582. to = $.effects.setTransition( element, hProps, factor.to.x, to );
  3583. }
  3584. }
  3585. // Scale the content
  3586. if ( scale === "content" || scale === "both" ) {
  3587. // Vertical props scaling
  3588. if ( factor.from.y !== factor.to.y ) {
  3589. from = $.effects.setTransition( element, cProps, factor.from.y, from );
  3590. to = $.effects.setTransition( element, cProps, factor.to.y, to );
  3591. }
  3592. }
  3593. // Adjust the position properties based on the provided origin points
  3594. if ( origin ) {
  3595. baseline = $.effects.getBaseline( origin, original );
  3596. from.top = ( original.outerHeight - from.outerHeight ) * baseline.y + pos.top;
  3597. from.left = ( original.outerWidth - from.outerWidth ) * baseline.x + pos.left;
  3598. to.top = ( original.outerHeight - to.outerHeight ) * baseline.y + pos.top;
  3599. to.left = ( original.outerWidth - to.outerWidth ) * baseline.x + pos.left;
  3600. }
  3601. element.css( from );
  3602. // Animate the children if desired
  3603. if ( scale === "content" || scale === "both" ) {
  3604. vProps = vProps.concat( [ "marginTop", "marginBottom" ] ).concat( cProps );
  3605. hProps = hProps.concat( [ "marginLeft", "marginRight" ] );
  3606. // Only animate children with width attributes specified
  3607. // TODO: is this right? should we include anything with css width specified as well
  3608. element.find( "*[width]" ).each( function() {
  3609. var child = $( this ),
  3610. childOriginal = $.effects.scaledDimensions( child ),
  3611. childFrom = {
  3612. height: childOriginal.height * factor.from.y,
  3613. width: childOriginal.width * factor.from.x,
  3614. outerHeight: childOriginal.outerHeight * factor.from.y,
  3615. outerWidth: childOriginal.outerWidth * factor.from.x
  3616. },
  3617. childTo = {
  3618. height: childOriginal.height * factor.to.y,
  3619. width: childOriginal.width * factor.to.x,
  3620. outerHeight: childOriginal.height * factor.to.y,
  3621. outerWidth: childOriginal.width * factor.to.x
  3622. };
  3623. // Vertical props scaling
  3624. if ( factor.from.y !== factor.to.y ) {
  3625. childFrom = $.effects.setTransition( child, vProps, factor.from.y, childFrom );
  3626. childTo = $.effects.setTransition( child, vProps, factor.to.y, childTo );
  3627. }
  3628. // Horizontal props scaling
  3629. if ( factor.from.x !== factor.to.x ) {
  3630. childFrom = $.effects.setTransition( child, hProps, factor.from.x, childFrom );
  3631. childTo = $.effects.setTransition( child, hProps, factor.to.x, childTo );
  3632. }
  3633. if ( restore ) {
  3634. $.effects.saveStyle( child );
  3635. }
  3636. // Animate children
  3637. child.css( childFrom );
  3638. child.animate( childTo, options.duration, options.easing, function() {
  3639. // Restore children
  3640. if ( restore ) {
  3641. $.effects.restoreStyle( child );
  3642. }
  3643. } );
  3644. } );
  3645. }
  3646. // Animate
  3647. element.animate( to, {
  3648. queue: false,
  3649. duration: options.duration,
  3650. easing: options.easing,
  3651. complete: function() {
  3652. var offset = element.offset();
  3653. if ( to.opacity === 0 ) {
  3654. element.css( "opacity", from.opacity );
  3655. }
  3656. if ( !restore ) {
  3657. element
  3658. .css( "position", position === "static" ? "relative" : position )
  3659. .offset( offset );
  3660. // Need to save style here so that automatic style restoration
  3661. // doesn't restore to the original styles from before the animation.
  3662. $.effects.saveStyle( element );
  3663. }
  3664. done();
  3665. }
  3666. } );
  3667. } );
  3668. /*!
  3669. * jQuery UI Effects Scale 1.12.1
  3670. * http://jqueryui.com
  3671. *
  3672. * Copyright jQuery Foundation and other contributors
  3673. * Released under the MIT license.
  3674. * http://jquery.org/license
  3675. */
  3676. //>>label: Scale Effect
  3677. //>>group: Effects
  3678. //>>description: Grows or shrinks an element and its content.
  3679. //>>docs: http://api.jqueryui.com/scale-effect/
  3680. //>>demos: http://jqueryui.com/effect/
  3681. var effectsEffectScale = $.effects.define( "scale", function( options, done ) {
  3682. // Create element
  3683. var el = $( this ),
  3684. mode = options.mode,
  3685. percent = parseInt( options.percent, 10 ) ||
  3686. ( parseInt( options.percent, 10 ) === 0 ? 0 : ( mode !== "effect" ? 0 : 100 ) ),
  3687. newOptions = $.extend( true, {
  3688. from: $.effects.scaledDimensions( el ),
  3689. to: $.effects.scaledDimensions( el, percent, options.direction || "both" ),
  3690. origin: options.origin || [ "middle", "center" ]
  3691. }, options );
  3692. // Fade option to support puff
  3693. if ( options.fade ) {
  3694. newOptions.from.opacity = 1;
  3695. newOptions.to.opacity = 0;
  3696. }
  3697. $.effects.effect.size.call( this, newOptions, done );
  3698. } );
  3699. /*!
  3700. * jQuery UI Effects Puff 1.12.1
  3701. * http://jqueryui.com
  3702. *
  3703. * Copyright jQuery Foundation and other contributors
  3704. * Released under the MIT license.
  3705. * http://jquery.org/license
  3706. */
  3707. //>>label: Puff Effect
  3708. //>>group: Effects
  3709. //>>description: Creates a puff effect by scaling the element up and hiding it at the same time.
  3710. //>>docs: http://api.jqueryui.com/puff-effect/
  3711. //>>demos: http://jqueryui.com/effect/
  3712. var effectsEffectPuff = $.effects.define( "puff", "hide", function( options, done ) {
  3713. var newOptions = $.extend( true, {}, options, {
  3714. fade: true,
  3715. percent: parseInt( options.percent, 10 ) || 150
  3716. } );
  3717. $.effects.effect.scale.call( this, newOptions, done );
  3718. } );
  3719. /*!
  3720. * jQuery UI Effects Pulsate 1.12.1
  3721. * http://jqueryui.com
  3722. *
  3723. * Copyright jQuery Foundation and other contributors
  3724. * Released under the MIT license.
  3725. * http://jquery.org/license
  3726. */
  3727. //>>label: Pulsate Effect
  3728. //>>group: Effects
  3729. //>>description: Pulsates an element n times by changing the opacity to zero and back.
  3730. //>>docs: http://api.jqueryui.com/pulsate-effect/
  3731. //>>demos: http://jqueryui.com/effect/
  3732. var effectsEffectPulsate = $.effects.define( "pulsate", "show", function( options, done ) {
  3733. var element = $( this ),
  3734. mode = options.mode,
  3735. show = mode === "show",
  3736. hide = mode === "hide",
  3737. showhide = show || hide,
  3738. // Showing or hiding leaves off the "last" animation
  3739. anims = ( ( options.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
  3740. duration = options.duration / anims,
  3741. animateTo = 0,
  3742. i = 1,
  3743. queuelen = element.queue().length;
  3744. if ( show || !element.is( ":visible" ) ) {
  3745. element.css( "opacity", 0 ).show();
  3746. animateTo = 1;
  3747. }
  3748. // Anims - 1 opacity "toggles"
  3749. for ( ; i < anims; i++ ) {
  3750. element.animate( { opacity: animateTo }, duration, options.easing );
  3751. animateTo = 1 - animateTo;
  3752. }
  3753. element.animate( { opacity: animateTo }, duration, options.easing );
  3754. element.queue( done );
  3755. $.effects.unshift( element, queuelen, anims + 1 );
  3756. } );
  3757. /*!
  3758. * jQuery UI Effects Shake 1.12.1
  3759. * http://jqueryui.com
  3760. *
  3761. * Copyright jQuery Foundation and other contributors
  3762. * Released under the MIT license.
  3763. * http://jquery.org/license
  3764. */
  3765. //>>label: Shake Effect
  3766. //>>group: Effects
  3767. //>>description: Shakes an element horizontally or vertically n times.
  3768. //>>docs: http://api.jqueryui.com/shake-effect/
  3769. //>>demos: http://jqueryui.com/effect/
  3770. var effectsEffectShake = $.effects.define( "shake", function( options, done ) {
  3771. var i = 1,
  3772. element = $( this ),
  3773. direction = options.direction || "left",
  3774. distance = options.distance || 20,
  3775. times = options.times || 3,
  3776. anims = times * 2 + 1,
  3777. speed = Math.round( options.duration / anims ),
  3778. ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
  3779. positiveMotion = ( direction === "up" || direction === "left" ),
  3780. animation = {},
  3781. animation1 = {},
  3782. animation2 = {},
  3783. queuelen = element.queue().length;
  3784. $.effects.createPlaceholder( element );
  3785. // Animation
  3786. animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
  3787. animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
  3788. animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
  3789. // Animate
  3790. element.animate( animation, speed, options.easing );
  3791. // Shakes
  3792. for ( ; i < times; i++ ) {
  3793. element
  3794. .animate( animation1, speed, options.easing )
  3795. .animate( animation2, speed, options.easing );
  3796. }
  3797. element
  3798. .animate( animation1, speed, options.easing )
  3799. .animate( animation, speed / 2, options.easing )
  3800. .queue( done );
  3801. $.effects.unshift( element, queuelen, anims + 1 );
  3802. } );
  3803. /*!
  3804. * jQuery UI Effects Slide 1.12.1
  3805. * http://jqueryui.com
  3806. *
  3807. * Copyright jQuery Foundation and other contributors
  3808. * Released under the MIT license.
  3809. * http://jquery.org/license
  3810. */
  3811. //>>label: Slide Effect
  3812. //>>group: Effects
  3813. //>>description: Slides an element in and out of the viewport.
  3814. //>>docs: http://api.jqueryui.com/slide-effect/
  3815. //>>demos: http://jqueryui.com/effect/
  3816. var effectsEffectSlide = $.effects.define( "slide", "show", function( options, done ) {
  3817. var startClip, startRef,
  3818. element = $( this ),
  3819. map = {
  3820. up: [ "bottom", "top" ],
  3821. down: [ "top", "bottom" ],
  3822. left: [ "right", "left" ],
  3823. right: [ "left", "right" ]
  3824. },
  3825. mode = options.mode,
  3826. direction = options.direction || "left",
  3827. ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
  3828. positiveMotion = ( direction === "up" || direction === "left" ),
  3829. distance = options.distance ||
  3830. element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ),
  3831. animation = {};
  3832. $.effects.createPlaceholder( element );
  3833. startClip = element.cssClip();
  3834. startRef = element.position()[ ref ];
  3835. // Define hide animation
  3836. animation[ ref ] = ( positiveMotion ? -1 : 1 ) * distance + startRef;
  3837. animation.clip = element.cssClip();
  3838. animation.clip[ map[ direction ][ 1 ] ] = animation.clip[ map[ direction ][ 0 ] ];
  3839. // Reverse the animation if we're showing
  3840. if ( mode === "show" ) {
  3841. element.cssClip( animation.clip );
  3842. element.css( ref, animation[ ref ] );
  3843. animation.clip = startClip;
  3844. animation[ ref ] = startRef;
  3845. }
  3846. // Actually animate
  3847. element.animate( animation, {
  3848. queue: false,
  3849. duration: options.duration,
  3850. easing: options.easing,
  3851. complete: done
  3852. } );
  3853. } );
  3854. /*!
  3855. * jQuery UI Effects Transfer 1.12.1
  3856. * http://jqueryui.com
  3857. *
  3858. * Copyright jQuery Foundation and other contributors
  3859. * Released under the MIT license.
  3860. * http://jquery.org/license
  3861. */
  3862. //>>label: Transfer Effect
  3863. //>>group: Effects
  3864. //>>description: Displays a transfer effect from one element to another.
  3865. //>>docs: http://api.jqueryui.com/transfer-effect/
  3866. //>>demos: http://jqueryui.com/effect/
  3867. var effect;
  3868. if ( $.uiBackCompat !== false ) {
  3869. effect = $.effects.define( "transfer", function( options, done ) {
  3870. $( this ).transfer( options, done );
  3871. } );
  3872. }
  3873. var effectsEffectTransfer = effect;
  3874. /*!
  3875. * jQuery UI Focusable 1.12.1
  3876. * http://jqueryui.com
  3877. *
  3878. * Copyright jQuery Foundation and other contributors
  3879. * Released under the MIT license.
  3880. * http://jquery.org/license
  3881. */
  3882. //>>label: :focusable Selector
  3883. //>>group: Core
  3884. //>>description: Selects elements which can be focused.
  3885. //>>docs: http://api.jqueryui.com/focusable-selector/
  3886. // Selectors
  3887. $.ui.focusable = function( element, hasTabindex ) {
  3888. var map, mapName, img, focusableIfVisible, fieldset,
  3889. nodeName = element.nodeName.toLowerCase();
  3890. if ( "area" === nodeName ) {
  3891. map = element.parentNode;
  3892. mapName = map.name;
  3893. if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
  3894. return false;
  3895. }
  3896. img = $( "img[usemap='#" + mapName + "']" );
  3897. return img.length > 0 && img.is( ":visible" );
  3898. }
  3899. if ( /^(input|select|textarea|button|object)$/.test( nodeName ) ) {
  3900. focusableIfVisible = !element.disabled;
  3901. if ( focusableIfVisible ) {
  3902. // Form controls within a disabled fieldset are disabled.
  3903. // However, controls within the fieldset's legend do not get disabled.
  3904. // Since controls generally aren't placed inside legends, we skip
  3905. // this portion of the check.
  3906. fieldset = $( element ).closest( "fieldset" )[ 0 ];
  3907. if ( fieldset ) {
  3908. focusableIfVisible = !fieldset.disabled;
  3909. }
  3910. }
  3911. } else if ( "a" === nodeName ) {
  3912. focusableIfVisible = element.href || hasTabindex;
  3913. } else {
  3914. focusableIfVisible = hasTabindex;
  3915. }
  3916. return focusableIfVisible && $( element ).is( ":visible" ) && visible( $( element ) );
  3917. };
  3918. // Support: IE 8 only
  3919. // IE 8 doesn't resolve inherit to visible/hidden for computed values
  3920. function visible( element ) {
  3921. var visibility = element.css( "visibility" );
  3922. while ( visibility === "inherit" ) {
  3923. element = element.parent();
  3924. visibility = element.css( "visibility" );
  3925. }
  3926. return visibility !== "hidden";
  3927. }
  3928. $.extend( $.expr[ ":" ], {
  3929. focusable: function( element ) {
  3930. return $.ui.focusable( element, $.attr( element, "tabindex" ) != null );
  3931. }
  3932. } );
  3933. var focusable = $.ui.focusable;
  3934. // Support: IE8 Only
  3935. // IE8 does not support the form attribute and when it is supplied. It overwrites the form prop
  3936. // with a string, so we need to find the proper form.
  3937. var form = $.fn.form = function() {
  3938. return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form );
  3939. };
  3940. /*!
  3941. * jQuery UI Form Reset Mixin 1.12.1
  3942. * http://jqueryui.com
  3943. *
  3944. * Copyright jQuery Foundation and other contributors
  3945. * Released under the MIT license.
  3946. * http://jquery.org/license
  3947. */
  3948. //>>label: Form Reset Mixin
  3949. //>>group: Core
  3950. //>>description: Refresh input widgets when their form is reset
  3951. //>>docs: http://api.jqueryui.com/form-reset-mixin/
  3952. var formResetMixin = $.ui.formResetMixin = {
  3953. _formResetHandler: function() {
  3954. var form = $( this );
  3955. // Wait for the form reset to actually happen before refreshing
  3956. setTimeout( function() {
  3957. var instances = form.data( "ui-form-reset-instances" );
  3958. $.each( instances, function() {
  3959. this.refresh();
  3960. } );
  3961. } );
  3962. },
  3963. _bindFormResetHandler: function() {
  3964. this.form = this.element.form();
  3965. if ( !this.form.length ) {
  3966. return;
  3967. }
  3968. var instances = this.form.data( "ui-form-reset-instances" ) || [];
  3969. if ( !instances.length ) {
  3970. // We don't use _on() here because we use a single event handler per form
  3971. this.form.on( "reset.ui-form-reset", this._formResetHandler );
  3972. }
  3973. instances.push( this );
  3974. this.form.data( "ui-form-reset-instances", instances );
  3975. },
  3976. _unbindFormResetHandler: function() {
  3977. if ( !this.form.length ) {
  3978. return;
  3979. }
  3980. var instances = this.form.data( "ui-form-reset-instances" );
  3981. instances.splice( $.inArray( this, instances ), 1 );
  3982. if ( instances.length ) {
  3983. this.form.data( "ui-form-reset-instances", instances );
  3984. } else {
  3985. this.form
  3986. .removeData( "ui-form-reset-instances" )
  3987. .off( "reset.ui-form-reset" );
  3988. }
  3989. }
  3990. };
  3991. /*!
  3992. * jQuery UI Support for jQuery core 1.7.x 1.12.1
  3993. * http://jqueryui.com
  3994. *
  3995. * Copyright jQuery Foundation and other contributors
  3996. * Released under the MIT license.
  3997. * http://jquery.org/license
  3998. *
  3999. */
  4000. //>>label: jQuery 1.7 Support
  4001. //>>group: Core
  4002. //>>description: Support version 1.7.x of jQuery core
  4003. // Support: jQuery 1.7 only
  4004. // Not a great way to check versions, but since we only support 1.7+ and only
  4005. // need to detect <1.8, this is a simple check that should suffice. Checking
  4006. // for "1.7." would be a bit safer, but the version string is 1.7, not 1.7.0
  4007. // and we'll never reach 1.70.0 (if we do, we certainly won't be supporting
  4008. // 1.7 anymore). See #11197 for why we're not using feature detection.
  4009. if ( $.fn.jquery.substring( 0, 3 ) === "1.7" ) {
  4010. // Setters for .innerWidth(), .innerHeight(), .outerWidth(), .outerHeight()
  4011. // Unlike jQuery Core 1.8+, these only support numeric values to set the
  4012. // dimensions in pixels
  4013. $.each( [ "Width", "Height" ], function( i, name ) {
  4014. var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
  4015. type = name.toLowerCase(),
  4016. orig = {
  4017. innerWidth: $.fn.innerWidth,
  4018. innerHeight: $.fn.innerHeight,
  4019. outerWidth: $.fn.outerWidth,
  4020. outerHeight: $.fn.outerHeight
  4021. };
  4022. function reduce( elem, size, border, margin ) {
  4023. $.each( side, function() {
  4024. size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
  4025. if ( border ) {
  4026. size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
  4027. }
  4028. if ( margin ) {
  4029. size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
  4030. }
  4031. } );
  4032. return size;
  4033. }
  4034. $.fn[ "inner" + name ] = function( size ) {
  4035. if ( size === undefined ) {
  4036. return orig[ "inner" + name ].call( this );
  4037. }
  4038. return this.each( function() {
  4039. $( this ).css( type, reduce( this, size ) + "px" );
  4040. } );
  4041. };
  4042. $.fn[ "outer" + name ] = function( size, margin ) {
  4043. if ( typeof size !== "number" ) {
  4044. return orig[ "outer" + name ].call( this, size );
  4045. }
  4046. return this.each( function() {
  4047. $( this ).css( type, reduce( this, size, true, margin ) + "px" );
  4048. } );
  4049. };
  4050. } );
  4051. $.fn.addBack = function( selector ) {
  4052. return this.add( selector == null ?
  4053. this.prevObject : this.prevObject.filter( selector )
  4054. );
  4055. };
  4056. }
  4057. ;
  4058. /*!
  4059. * jQuery UI Keycode 1.12.1
  4060. * http://jqueryui.com
  4061. *
  4062. * Copyright jQuery Foundation and other contributors
  4063. * Released under the MIT license.
  4064. * http://jquery.org/license
  4065. */
  4066. //>>label: Keycode
  4067. //>>group: Core
  4068. //>>description: Provide keycodes as keynames
  4069. //>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/
  4070. var keycode = $.ui.keyCode = {
  4071. BACKSPACE: 8,
  4072. COMMA: 188,
  4073. DELETE: 46,
  4074. DOWN: 40,
  4075. END: 35,
  4076. ENTER: 13,
  4077. ESCAPE: 27,
  4078. HOME: 36,
  4079. LEFT: 37,
  4080. PAGE_DOWN: 34,
  4081. PAGE_UP: 33,
  4082. PERIOD: 190,
  4083. RIGHT: 39,
  4084. SPACE: 32,
  4085. TAB: 9,
  4086. UP: 38
  4087. };
  4088. // Internal use only
  4089. var escapeSelector = $.ui.escapeSelector = ( function() {
  4090. var selectorEscape = /([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;
  4091. return function( selector ) {
  4092. return selector.replace( selectorEscape, "\\$1" );
  4093. };
  4094. } )();
  4095. /*!
  4096. * jQuery UI Labels 1.12.1
  4097. * http://jqueryui.com
  4098. *
  4099. * Copyright jQuery Foundation and other contributors
  4100. * Released under the MIT license.
  4101. * http://jquery.org/license
  4102. */
  4103. //>>label: labels
  4104. //>>group: Core
  4105. //>>description: Find all the labels associated with a given input
  4106. //>>docs: http://api.jqueryui.com/labels/
  4107. var labels = $.fn.labels = function() {
  4108. var ancestor, selector, id, labels, ancestors;
  4109. // Check control.labels first
  4110. if ( this[ 0 ].labels && this[ 0 ].labels.length ) {
  4111. return this.pushStack( this[ 0 ].labels );
  4112. }
  4113. // Support: IE <= 11, FF <= 37, Android <= 2.3 only
  4114. // Above browsers do not support control.labels. Everything below is to support them
  4115. // as well as document fragments. control.labels does not work on document fragments
  4116. labels = this.eq( 0 ).parents( "label" );
  4117. // Look for the label based on the id
  4118. id = this.attr( "id" );
  4119. if ( id ) {
  4120. // We don't search against the document in case the element
  4121. // is disconnected from the DOM
  4122. ancestor = this.eq( 0 ).parents().last();
  4123. // Get a full set of top level ancestors
  4124. ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() );
  4125. // Create a selector for the label based on the id
  4126. selector = "label[for='" + $.ui.escapeSelector( id ) + "']";
  4127. labels = labels.add( ancestors.find( selector ).addBack( selector ) );
  4128. }
  4129. // Return whatever we have found for labels
  4130. return this.pushStack( labels );
  4131. };
  4132. /*!
  4133. * jQuery UI Scroll Parent 1.12.1
  4134. * http://jqueryui.com
  4135. *
  4136. * Copyright jQuery Foundation and other contributors
  4137. * Released under the MIT license.
  4138. * http://jquery.org/license
  4139. */
  4140. //>>label: scrollParent
  4141. //>>group: Core
  4142. //>>description: Get the closest ancestor element that is scrollable.
  4143. //>>docs: http://api.jqueryui.com/scrollParent/
  4144. var scrollParent = $.fn.scrollParent = function( includeHidden ) {
  4145. var position = this.css( "position" ),
  4146. excludeStaticParent = position === "absolute",
  4147. overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
  4148. scrollParent = this.parents().filter( function() {
  4149. var parent = $( this );
  4150. if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
  4151. return false;
  4152. }
  4153. return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) +
  4154. parent.css( "overflow-x" ) );
  4155. } ).eq( 0 );
  4156. return position === "fixed" || !scrollParent.length ?
  4157. $( this[ 0 ].ownerDocument || document ) :
  4158. scrollParent;
  4159. };
  4160. /*!
  4161. * jQuery UI Tabbable 1.12.1
  4162. * http://jqueryui.com
  4163. *
  4164. * Copyright jQuery Foundation and other contributors
  4165. * Released under the MIT license.
  4166. * http://jquery.org/license
  4167. */
  4168. //>>label: :tabbable Selector
  4169. //>>group: Core
  4170. //>>description: Selects elements which can be tabbed to.
  4171. //>>docs: http://api.jqueryui.com/tabbable-selector/
  4172. var tabbable = $.extend( $.expr[ ":" ], {
  4173. tabbable: function( element ) {
  4174. var tabIndex = $.attr( element, "tabindex" ),
  4175. hasTabindex = tabIndex != null;
  4176. return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex );
  4177. }
  4178. } );
  4179. /*!
  4180. * jQuery UI Unique ID 1.12.1
  4181. * http://jqueryui.com
  4182. *
  4183. * Copyright jQuery Foundation and other contributors
  4184. * Released under the MIT license.
  4185. * http://jquery.org/license
  4186. */
  4187. //>>label: uniqueId
  4188. //>>group: Core
  4189. //>>description: Functions to generate and remove uniqueId's
  4190. //>>docs: http://api.jqueryui.com/uniqueId/
  4191. var uniqueId = $.fn.extend( {
  4192. uniqueId: ( function() {
  4193. var uuid = 0;
  4194. return function() {
  4195. return this.each( function() {
  4196. if ( !this.id ) {
  4197. this.id = "ui-id-" + ( ++uuid );
  4198. }
  4199. } );
  4200. };
  4201. } )(),
  4202. removeUniqueId: function() {
  4203. return this.each( function() {
  4204. if ( /^ui-id-\d+$/.test( this.id ) ) {
  4205. $( this ).removeAttr( "id" );
  4206. }
  4207. } );
  4208. }
  4209. } );
  4210. /*!
  4211. * jQuery UI Accordion 1.12.1
  4212. * http://jqueryui.com
  4213. *
  4214. * Copyright jQuery Foundation and other contributors
  4215. * Released under the MIT license.
  4216. * http://jquery.org/license
  4217. */
  4218. //>>label: Accordion
  4219. //>>group: Widgets
  4220. // jscs:disable maximumLineLength
  4221. //>>description: Displays collapsible content panels for presenting information in a limited amount of space.
  4222. // jscs:enable maximumLineLength
  4223. //>>docs: http://api.jqueryui.com/accordion/
  4224. //>>demos: http://jqueryui.com/accordion/
  4225. //>>css.structure: ../../themes/base/core.css
  4226. //>>css.structure: ../../themes/base/accordion.css
  4227. //>>css.theme: ../../themes/base/theme.css
  4228. var widgetsAccordion = $.widget( "ui.accordion", {
  4229. version: "1.12.1",
  4230. options: {
  4231. active: 0,
  4232. animate: {},
  4233. classes: {
  4234. "ui-accordion-header": "ui-corner-top",
  4235. "ui-accordion-header-collapsed": "ui-corner-all",
  4236. "ui-accordion-content": "ui-corner-bottom"
  4237. },
  4238. collapsible: false,
  4239. event: "click",
  4240. header: "> li > :first-child, > :not(li):even",
  4241. heightStyle: "auto",
  4242. icons: {
  4243. activeHeader: "ui-icon-triangle-1-s",
  4244. header: "ui-icon-triangle-1-e"
  4245. },
  4246. // Callbacks
  4247. activate: null,
  4248. beforeActivate: null
  4249. },
  4250. hideProps: {
  4251. borderTopWidth: "hide",
  4252. borderBottomWidth: "hide",
  4253. paddingTop: "hide",
  4254. paddingBottom: "hide",
  4255. height: "hide"
  4256. },
  4257. showProps: {
  4258. borderTopWidth: "show",
  4259. borderBottomWidth: "show",
  4260. paddingTop: "show",
  4261. paddingBottom: "show",
  4262. height: "show"
  4263. },
  4264. _create: function() {
  4265. var options = this.options;
  4266. this.prevShow = this.prevHide = $();
  4267. this._addClass( "ui-accordion", "ui-widget ui-helper-reset" );
  4268. this.element.attr( "role", "tablist" );
  4269. // Don't allow collapsible: false and active: false / null
  4270. if ( !options.collapsible && ( options.active === false || options.active == null ) ) {
  4271. options.active = 0;
  4272. }
  4273. this._processPanels();
  4274. // handle negative values
  4275. if ( options.active < 0 ) {
  4276. options.active += this.headers.length;
  4277. }
  4278. this._refresh();
  4279. },
  4280. _getCreateEventData: function() {
  4281. return {
  4282. header: this.active,
  4283. panel: !this.active.length ? $() : this.active.next()
  4284. };
  4285. },
  4286. _createIcons: function() {
  4287. var icon, children,
  4288. icons = this.options.icons;
  4289. if ( icons ) {
  4290. icon = $( "<span>" );
  4291. this._addClass( icon, "ui-accordion-header-icon", "ui-icon " + icons.header );
  4292. icon.prependTo( this.headers );
  4293. children = this.active.children( ".ui-accordion-header-icon" );
  4294. this._removeClass( children, icons.header )
  4295. ._addClass( children, null, icons.activeHeader )
  4296. ._addClass( this.headers, "ui-accordion-icons" );
  4297. }
  4298. },
  4299. _destroyIcons: function() {
  4300. this._removeClass( this.headers, "ui-accordion-icons" );
  4301. this.headers.children( ".ui-accordion-header-icon" ).remove();
  4302. },
  4303. _destroy: function() {
  4304. var contents;
  4305. // Clean up main element
  4306. this.element.removeAttr( "role" );
  4307. // Clean up headers
  4308. this.headers
  4309. .removeAttr( "role aria-expanded aria-selected aria-controls tabIndex" )
  4310. .removeUniqueId();
  4311. this._destroyIcons();
  4312. // Clean up content panels
  4313. contents = this.headers.next()
  4314. .css( "display", "" )
  4315. .removeAttr( "role aria-hidden aria-labelledby" )
  4316. .removeUniqueId();
  4317. if ( this.options.heightStyle !== "content" ) {
  4318. contents.css( "height", "" );
  4319. }
  4320. },
  4321. _setOption: function( key, value ) {
  4322. if ( key === "active" ) {
  4323. // _activate() will handle invalid values and update this.options
  4324. this._activate( value );
  4325. return;
  4326. }
  4327. if ( key === "event" ) {
  4328. if ( this.options.event ) {
  4329. this._off( this.headers, this.options.event );
  4330. }
  4331. this._setupEvents( value );
  4332. }
  4333. this._super( key, value );
  4334. // Setting collapsible: false while collapsed; open first panel
  4335. if ( key === "collapsible" && !value && this.options.active === false ) {
  4336. this._activate( 0 );
  4337. }
  4338. if ( key === "icons" ) {
  4339. this._destroyIcons();
  4340. if ( value ) {
  4341. this._createIcons();
  4342. }
  4343. }
  4344. },
  4345. _setOptionDisabled: function( value ) {
  4346. this._super( value );
  4347. this.element.attr( "aria-disabled", value );
  4348. // Support: IE8 Only
  4349. // #5332 / #6059 - opacity doesn't cascade to positioned elements in IE
  4350. // so we need to add the disabled class to the headers and panels
  4351. this._toggleClass( null, "ui-state-disabled", !!value );
  4352. this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled",
  4353. !!value );
  4354. },
  4355. _keydown: function( event ) {
  4356. if ( event.altKey || event.ctrlKey ) {
  4357. return;
  4358. }
  4359. var keyCode = $.ui.keyCode,
  4360. length = this.headers.length,
  4361. currentIndex = this.headers.index( event.target ),
  4362. toFocus = false;
  4363. switch ( event.keyCode ) {
  4364. case keyCode.RIGHT:
  4365. case keyCode.DOWN:
  4366. toFocus = this.headers[ ( currentIndex + 1 ) % length ];
  4367. break;
  4368. case keyCode.LEFT:
  4369. case keyCode.UP:
  4370. toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
  4371. break;
  4372. case keyCode.SPACE:
  4373. case keyCode.ENTER:
  4374. this._eventHandler( event );
  4375. break;
  4376. case keyCode.HOME:
  4377. toFocus = this.headers[ 0 ];
  4378. break;
  4379. case keyCode.END:
  4380. toFocus = this.headers[ length - 1 ];
  4381. break;
  4382. }
  4383. if ( toFocus ) {
  4384. $( event.target ).attr( "tabIndex", -1 );
  4385. $( toFocus ).attr( "tabIndex", 0 );
  4386. $( toFocus ).trigger( "focus" );
  4387. event.preventDefault();
  4388. }
  4389. },
  4390. _panelKeyDown: function( event ) {
  4391. if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
  4392. $( event.currentTarget ).prev().trigger( "focus" );
  4393. }
  4394. },
  4395. refresh: function() {
  4396. var options = this.options;
  4397. this._processPanels();
  4398. // Was collapsed or no panel
  4399. if ( ( options.active === false && options.collapsible === true ) ||
  4400. !this.headers.length ) {
  4401. options.active = false;
  4402. this.active = $();
  4403. // active false only when collapsible is true
  4404. } else if ( options.active === false ) {
  4405. this._activate( 0 );
  4406. // was active, but active panel is gone
  4407. } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
  4408. // all remaining panel are disabled
  4409. if ( this.headers.length === this.headers.find( ".ui-state-disabled" ).length ) {
  4410. options.active = false;
  4411. this.active = $();
  4412. // activate previous panel
  4413. } else {
  4414. this._activate( Math.max( 0, options.active - 1 ) );
  4415. }
  4416. // was active, active panel still exists
  4417. } else {
  4418. // make sure active index is correct
  4419. options.active = this.headers.index( this.active );
  4420. }
  4421. this._destroyIcons();
  4422. this._refresh();
  4423. },
  4424. _processPanels: function() {
  4425. var prevHeaders = this.headers,
  4426. prevPanels = this.panels;
  4427. this.headers = this.element.find( this.options.header );
  4428. this._addClass( this.headers, "ui-accordion-header ui-accordion-header-collapsed",
  4429. "ui-state-default" );
  4430. this.panels = this.headers.next().filter( ":not(.ui-accordion-content-active)" ).hide();
  4431. this._addClass( this.panels, "ui-accordion-content", "ui-helper-reset ui-widget-content" );
  4432. // Avoid memory leaks (#10056)
  4433. if ( prevPanels ) {
  4434. this._off( prevHeaders.not( this.headers ) );
  4435. this._off( prevPanels.not( this.panels ) );
  4436. }
  4437. },
  4438. _refresh: function() {
  4439. var maxHeight,
  4440. options = this.options,
  4441. heightStyle = options.heightStyle,
  4442. parent = this.element.parent();
  4443. this.active = this._findActive( options.active );
  4444. this._addClass( this.active, "ui-accordion-header-active", "ui-state-active" )
  4445. ._removeClass( this.active, "ui-accordion-header-collapsed" );
  4446. this._addClass( this.active.next(), "ui-accordion-content-active" );
  4447. this.active.next().show();
  4448. this.headers
  4449. .attr( "role", "tab" )
  4450. .each( function() {
  4451. var header = $( this ),
  4452. headerId = header.uniqueId().attr( "id" ),
  4453. panel = header.next(),
  4454. panelId = panel.uniqueId().attr( "id" );
  4455. header.attr( "aria-controls", panelId );
  4456. panel.attr( "aria-labelledby", headerId );
  4457. } )
  4458. .next()
  4459. .attr( "role", "tabpanel" );
  4460. this.headers
  4461. .not( this.active )
  4462. .attr( {
  4463. "aria-selected": "false",
  4464. "aria-expanded": "false",
  4465. tabIndex: -1
  4466. } )
  4467. .next()
  4468. .attr( {
  4469. "aria-hidden": "true"
  4470. } )
  4471. .hide();
  4472. // Make sure at least one header is in the tab order
  4473. if ( !this.active.length ) {
  4474. this.headers.eq( 0 ).attr( "tabIndex", 0 );
  4475. } else {
  4476. this.active.attr( {
  4477. "aria-selected": "true",
  4478. "aria-expanded": "true",
  4479. tabIndex: 0
  4480. } )
  4481. .next()
  4482. .attr( {
  4483. "aria-hidden": "false"
  4484. } );
  4485. }
  4486. this._createIcons();
  4487. this._setupEvents( options.event );
  4488. if ( heightStyle === "fill" ) {
  4489. maxHeight = parent.height();
  4490. this.element.siblings( ":visible" ).each( function() {
  4491. var elem = $( this ),
  4492. position = elem.css( "position" );
  4493. if ( position === "absolute" || position === "fixed" ) {
  4494. return;
  4495. }
  4496. maxHeight -= elem.outerHeight( true );
  4497. } );
  4498. this.headers.each( function() {
  4499. maxHeight -= $( this ).outerHeight( true );
  4500. } );
  4501. this.headers.next()
  4502. .each( function() {
  4503. $( this ).height( Math.max( 0, maxHeight -
  4504. $( this ).innerHeight() + $( this ).height() ) );
  4505. } )
  4506. .css( "overflow", "auto" );
  4507. } else if ( heightStyle === "auto" ) {
  4508. maxHeight = 0;
  4509. this.headers.next()
  4510. .each( function() {
  4511. var isVisible = $( this ).is( ":visible" );
  4512. if ( !isVisible ) {
  4513. $( this ).show();
  4514. }
  4515. maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
  4516. if ( !isVisible ) {
  4517. $( this ).hide();
  4518. }
  4519. } )
  4520. .height( maxHeight );
  4521. }
  4522. },
  4523. _activate: function( index ) {
  4524. var active = this._findActive( index )[ 0 ];
  4525. // Trying to activate the already active panel
  4526. if ( active === this.active[ 0 ] ) {
  4527. return;
  4528. }
  4529. // Trying to collapse, simulate a click on the currently active header
  4530. active = active || this.active[ 0 ];
  4531. this._eventHandler( {
  4532. target: active,
  4533. currentTarget: active,
  4534. preventDefault: $.noop
  4535. } );
  4536. },
  4537. _findActive: function( selector ) {
  4538. return typeof selector === "number" ? this.headers.eq( selector ) : $();
  4539. },
  4540. _setupEvents: function( event ) {
  4541. var events = {
  4542. keydown: "_keydown"
  4543. };
  4544. if ( event ) {
  4545. $.each( event.split( " " ), function( index, eventName ) {
  4546. events[ eventName ] = "_eventHandler";
  4547. } );
  4548. }
  4549. this._off( this.headers.add( this.headers.next() ) );
  4550. this._on( this.headers, events );
  4551. this._on( this.headers.next(), { keydown: "_panelKeyDown" } );
  4552. this._hoverable( this.headers );
  4553. this._focusable( this.headers );
  4554. },
  4555. _eventHandler: function( event ) {
  4556. var activeChildren, clickedChildren,
  4557. options = this.options,
  4558. active = this.active,
  4559. clicked = $( event.currentTarget ),
  4560. clickedIsActive = clicked[ 0 ] === active[ 0 ],
  4561. collapsing = clickedIsActive && options.collapsible,
  4562. toShow = collapsing ? $() : clicked.next(),
  4563. toHide = active.next(),
  4564. eventData = {
  4565. oldHeader: active,
  4566. oldPanel: toHide,
  4567. newHeader: collapsing ? $() : clicked,
  4568. newPanel: toShow
  4569. };
  4570. event.preventDefault();
  4571. if (
  4572. // click on active header, but not collapsible
  4573. ( clickedIsActive && !options.collapsible ) ||
  4574. // allow canceling activation
  4575. ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
  4576. return;
  4577. }
  4578. options.active = collapsing ? false : this.headers.index( clicked );
  4579. // When the call to ._toggle() comes after the class changes
  4580. // it causes a very odd bug in IE 8 (see #6720)
  4581. this.active = clickedIsActive ? $() : clicked;
  4582. this._toggle( eventData );
  4583. // Switch classes
  4584. // corner classes on the previously active header stay after the animation
  4585. this._removeClass( active, "ui-accordion-header-active", "ui-state-active" );
  4586. if ( options.icons ) {
  4587. activeChildren = active.children( ".ui-accordion-header-icon" );
  4588. this._removeClass( activeChildren, null, options.icons.activeHeader )
  4589. ._addClass( activeChildren, null, options.icons.header );
  4590. }
  4591. if ( !clickedIsActive ) {
  4592. this._removeClass( clicked, "ui-accordion-header-collapsed" )
  4593. ._addClass( clicked, "ui-accordion-header-active", "ui-state-active" );
  4594. if ( options.icons ) {
  4595. clickedChildren = clicked.children( ".ui-accordion-header-icon" );
  4596. this._removeClass( clickedChildren, null, options.icons.header )
  4597. ._addClass( clickedChildren, null, options.icons.activeHeader );
  4598. }
  4599. this._addClass( clicked.next(), "ui-accordion-content-active" );
  4600. }
  4601. },
  4602. _toggle: function( data ) {
  4603. var toShow = data.newPanel,
  4604. toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
  4605. // Handle activating a panel during the animation for another activation
  4606. this.prevShow.add( this.prevHide ).stop( true, true );
  4607. this.prevShow = toShow;
  4608. this.prevHide = toHide;
  4609. if ( this.options.animate ) {
  4610. this._animate( toShow, toHide, data );
  4611. } else {
  4612. toHide.hide();
  4613. toShow.show();
  4614. this._toggleComplete( data );
  4615. }
  4616. toHide.attr( {
  4617. "aria-hidden": "true"
  4618. } );
  4619. toHide.prev().attr( {
  4620. "aria-selected": "false",
  4621. "aria-expanded": "false"
  4622. } );
  4623. // if we're switching panels, remove the old header from the tab order
  4624. // if we're opening from collapsed state, remove the previous header from the tab order
  4625. // if we're collapsing, then keep the collapsing header in the tab order
  4626. if ( toShow.length && toHide.length ) {
  4627. toHide.prev().attr( {
  4628. "tabIndex": -1,
  4629. "aria-expanded": "false"
  4630. } );
  4631. } else if ( toShow.length ) {
  4632. this.headers.filter( function() {
  4633. return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
  4634. } )
  4635. .attr( "tabIndex", -1 );
  4636. }
  4637. toShow
  4638. .attr( "aria-hidden", "false" )
  4639. .prev()
  4640. .attr( {
  4641. "aria-selected": "true",
  4642. "aria-expanded": "true",
  4643. tabIndex: 0
  4644. } );
  4645. },
  4646. _animate: function( toShow, toHide, data ) {
  4647. var total, easing, duration,
  4648. that = this,
  4649. adjust = 0,
  4650. boxSizing = toShow.css( "box-sizing" ),
  4651. down = toShow.length &&
  4652. ( !toHide.length || ( toShow.index() < toHide.index() ) ),
  4653. animate = this.options.animate || {},
  4654. options = down && animate.down || animate,
  4655. complete = function() {
  4656. that._toggleComplete( data );
  4657. };
  4658. if ( typeof options === "number" ) {
  4659. duration = options;
  4660. }
  4661. if ( typeof options === "string" ) {
  4662. easing = options;
  4663. }
  4664. // fall back from options to animation in case of partial down settings
  4665. easing = easing || options.easing || animate.easing;
  4666. duration = duration || options.duration || animate.duration;
  4667. if ( !toHide.length ) {
  4668. return toShow.animate( this.showProps, duration, easing, complete );
  4669. }
  4670. if ( !toShow.length ) {
  4671. return toHide.animate( this.hideProps, duration, easing, complete );
  4672. }
  4673. total = toShow.show().outerHeight();
  4674. toHide.animate( this.hideProps, {
  4675. duration: duration,
  4676. easing: easing,
  4677. step: function( now, fx ) {
  4678. fx.now = Math.round( now );
  4679. }
  4680. } );
  4681. toShow
  4682. .hide()
  4683. .animate( this.showProps, {
  4684. duration: duration,
  4685. easing: easing,
  4686. complete: complete,
  4687. step: function( now, fx ) {
  4688. fx.now = Math.round( now );
  4689. if ( fx.prop !== "height" ) {
  4690. if ( boxSizing === "content-box" ) {
  4691. adjust += fx.now;
  4692. }
  4693. } else if ( that.options.heightStyle !== "content" ) {
  4694. fx.now = Math.round( total - toHide.outerHeight() - adjust );
  4695. adjust = 0;
  4696. }
  4697. }
  4698. } );
  4699. },
  4700. _toggleComplete: function( data ) {
  4701. var toHide = data.oldPanel,
  4702. prev = toHide.prev();
  4703. this._removeClass( toHide, "ui-accordion-content-active" );
  4704. this._removeClass( prev, "ui-accordion-header-active" )
  4705. ._addClass( prev, "ui-accordion-header-collapsed" );
  4706. // Work around for rendering bug in IE (#5421)
  4707. if ( toHide.length ) {
  4708. toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
  4709. }
  4710. this._trigger( "activate", null, data );
  4711. }
  4712. } );
  4713. var safeActiveElement = $.ui.safeActiveElement = function( document ) {
  4714. var activeElement;
  4715. // Support: IE 9 only
  4716. // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
  4717. try {
  4718. activeElement = document.activeElement;
  4719. } catch ( error ) {
  4720. activeElement = document.body;
  4721. }
  4722. // Support: IE 9 - 11 only
  4723. // IE may return null instead of an element
  4724. // Interestingly, this only seems to occur when NOT in an iframe
  4725. if ( !activeElement ) {
  4726. activeElement = document.body;
  4727. }
  4728. // Support: IE 11 only
  4729. // IE11 returns a seemingly empty object in some cases when accessing
  4730. // document.activeElement from an <iframe>
  4731. if ( !activeElement.nodeName ) {
  4732. activeElement = document.body;
  4733. }
  4734. return activeElement;
  4735. };
  4736. /*!
  4737. * jQuery UI Menu 1.12.1
  4738. * http://jqueryui.com
  4739. *
  4740. * Copyright jQuery Foundation and other contributors
  4741. * Released under the MIT license.
  4742. * http://jquery.org/license
  4743. */
  4744. //>>label: Menu
  4745. //>>group: Widgets
  4746. //>>description: Creates nestable menus.
  4747. //>>docs: http://api.jqueryui.com/menu/
  4748. //>>demos: http://jqueryui.com/menu/
  4749. //>>css.structure: ../../themes/base/core.css
  4750. //>>css.structure: ../../themes/base/menu.css
  4751. //>>css.theme: ../../themes/base/theme.css
  4752. var widgetsMenu = $.widget( "ui.menu", {
  4753. version: "1.12.1",
  4754. defaultElement: "<ul>",
  4755. delay: 300,
  4756. options: {
  4757. icons: {
  4758. submenu: "ui-icon-caret-1-e"
  4759. },
  4760. items: "> *",
  4761. menus: "ul",
  4762. position: {
  4763. my: "left top",
  4764. at: "right top"
  4765. },
  4766. role: "menu",
  4767. // Callbacks
  4768. blur: null,
  4769. focus: null,
  4770. select: null
  4771. },
  4772. _create: function() {
  4773. this.activeMenu = this.element;
  4774. // Flag used to prevent firing of the click handler
  4775. // as the event bubbles up through nested menus
  4776. this.mouseHandled = false;
  4777. this.element
  4778. .uniqueId()
  4779. .attr( {
  4780. role: this.options.role,
  4781. tabIndex: 0
  4782. } );
  4783. this._addClass( "ui-menu", "ui-widget ui-widget-content" );
  4784. this._on( {
  4785. // Prevent focus from sticking to links inside menu after clicking
  4786. // them (focus should always stay on UL during navigation).
  4787. "mousedown .ui-menu-item": function( event ) {
  4788. event.preventDefault();
  4789. },
  4790. "click .ui-menu-item": function( event ) {
  4791. var target = $( event.target );
  4792. var active = $( $.ui.safeActiveElement( this.document[ 0 ] ) );
  4793. if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
  4794. this.select( event );
  4795. // Only set the mouseHandled flag if the event will bubble, see #9469.
  4796. if ( !event.isPropagationStopped() ) {
  4797. this.mouseHandled = true;
  4798. }
  4799. // Open submenu on click
  4800. if ( target.has( ".ui-menu" ).length ) {
  4801. this.expand( event );
  4802. } else if ( !this.element.is( ":focus" ) &&
  4803. active.closest( ".ui-menu" ).length ) {
  4804. // Redirect focus to the menu
  4805. this.element.trigger( "focus", [ true ] );
  4806. // If the active item is on the top level, let it stay active.
  4807. // Otherwise, blur the active item since it is no longer visible.
  4808. if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
  4809. clearTimeout( this.timer );
  4810. }
  4811. }
  4812. }
  4813. },
  4814. "mouseenter .ui-menu-item": function( event ) {
  4815. // Ignore mouse events while typeahead is active, see #10458.
  4816. // Prevents focusing the wrong item when typeahead causes a scroll while the mouse
  4817. // is over an item in the menu
  4818. if ( this.previousFilter ) {
  4819. return;
  4820. }
  4821. var actualTarget = $( event.target ).closest( ".ui-menu-item" ),
  4822. target = $( event.currentTarget );
  4823. // Ignore bubbled events on parent items, see #11641
  4824. if ( actualTarget[ 0 ] !== target[ 0 ] ) {
  4825. return;
  4826. }
  4827. // Remove ui-state-active class from siblings of the newly focused menu item
  4828. // to avoid a jump caused by adjacent elements both having a class with a border
  4829. this._removeClass( target.siblings().children( ".ui-state-active" ),
  4830. null, "ui-state-active" );
  4831. this.focus( event, target );
  4832. },
  4833. mouseleave: "collapseAll",
  4834. "mouseleave .ui-menu": "collapseAll",
  4835. focus: function( event, keepActiveItem ) {
  4836. // If there's already an active item, keep it active
  4837. // If not, activate the first item
  4838. var item = this.active || this.element.find( this.options.items ).eq( 0 );
  4839. if ( !keepActiveItem ) {
  4840. this.focus( event, item );
  4841. }
  4842. },
  4843. blur: function( event ) {
  4844. this._delay( function() {
  4845. var notContained = !$.contains(
  4846. this.element[ 0 ],
  4847. $.ui.safeActiveElement( this.document[ 0 ] )
  4848. );
  4849. if ( notContained ) {
  4850. this.collapseAll( event );
  4851. }
  4852. } );
  4853. },
  4854. keydown: "_keydown"
  4855. } );
  4856. this.refresh();
  4857. // Clicks outside of a menu collapse any open menus
  4858. this._on( this.document, {
  4859. click: function( event ) {
  4860. if ( this._closeOnDocumentClick( event ) ) {
  4861. this.collapseAll( event );
  4862. }
  4863. // Reset the mouseHandled flag
  4864. this.mouseHandled = false;
  4865. }
  4866. } );
  4867. },
  4868. _destroy: function() {
  4869. var items = this.element.find( ".ui-menu-item" )
  4870. .removeAttr( "role aria-disabled" ),
  4871. submenus = items.children( ".ui-menu-item-wrapper" )
  4872. .removeUniqueId()
  4873. .removeAttr( "tabIndex role aria-haspopup" );
  4874. // Destroy (sub)menus
  4875. this.element
  4876. .removeAttr( "aria-activedescendant" )
  4877. .find( ".ui-menu" ).addBack()
  4878. .removeAttr( "role aria-labelledby aria-expanded aria-hidden aria-disabled " +
  4879. "tabIndex" )
  4880. .removeUniqueId()
  4881. .show();
  4882. submenus.children().each( function() {
  4883. var elem = $( this );
  4884. if ( elem.data( "ui-menu-submenu-caret" ) ) {
  4885. elem.remove();
  4886. }
  4887. } );
  4888. },
  4889. _keydown: function( event ) {
  4890. var match, prev, character, skip,
  4891. preventDefault = true;
  4892. switch ( event.keyCode ) {
  4893. case $.ui.keyCode.PAGE_UP:
  4894. this.previousPage( event );
  4895. break;
  4896. case $.ui.keyCode.PAGE_DOWN:
  4897. this.nextPage( event );
  4898. break;
  4899. case $.ui.keyCode.HOME:
  4900. this._move( "first", "first", event );
  4901. break;
  4902. case $.ui.keyCode.END:
  4903. this._move( "last", "last", event );
  4904. break;
  4905. case $.ui.keyCode.UP:
  4906. this.previous( event );
  4907. break;
  4908. case $.ui.keyCode.DOWN:
  4909. this.next( event );
  4910. break;
  4911. case $.ui.keyCode.LEFT:
  4912. this.collapse( event );
  4913. break;
  4914. case $.ui.keyCode.RIGHT:
  4915. if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
  4916. this.expand( event );
  4917. }
  4918. break;
  4919. case $.ui.keyCode.ENTER:
  4920. case $.ui.keyCode.SPACE:
  4921. this._activate( event );
  4922. break;
  4923. case $.ui.keyCode.ESCAPE:
  4924. this.collapse( event );
  4925. break;
  4926. default:
  4927. preventDefault = false;
  4928. prev = this.previousFilter || "";
  4929. skip = false;
  4930. // Support number pad values
  4931. character = event.keyCode >= 96 && event.keyCode <= 105 ?
  4932. ( event.keyCode - 96 ).toString() : String.fromCharCode( event.keyCode );
  4933. clearTimeout( this.filterTimer );
  4934. if ( character === prev ) {
  4935. skip = true;
  4936. } else {
  4937. character = prev + character;
  4938. }
  4939. match = this._filterMenuItems( character );
  4940. match = skip && match.index( this.active.next() ) !== -1 ?
  4941. this.active.nextAll( ".ui-menu-item" ) :
  4942. match;
  4943. // If no matches on the current filter, reset to the last character pressed
  4944. // to move down the menu to the first item that starts with that character
  4945. if ( !match.length ) {
  4946. character = String.fromCharCode( event.keyCode );
  4947. match = this._filterMenuItems( character );
  4948. }
  4949. if ( match.length ) {
  4950. this.focus( event, match );
  4951. this.previousFilter = character;
  4952. this.filterTimer = this._delay( function() {
  4953. delete this.previousFilter;
  4954. }, 1000 );
  4955. } else {
  4956. delete this.previousFilter;
  4957. }
  4958. }
  4959. if ( preventDefault ) {
  4960. event.preventDefault();
  4961. }
  4962. },
  4963. _activate: function( event ) {
  4964. if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
  4965. if ( this.active.children( "[aria-haspopup='true']" ).length ) {
  4966. this.expand( event );
  4967. } else {
  4968. this.select( event );
  4969. }
  4970. }
  4971. },
  4972. refresh: function() {
  4973. var menus, items, newSubmenus, newItems, newWrappers,
  4974. that = this,
  4975. icon = this.options.icons.submenu,
  4976. submenus = this.element.find( this.options.menus );
  4977. this._toggleClass( "ui-menu-icons", null, !!this.element.find( ".ui-icon" ).length );
  4978. // Initialize nested menus
  4979. newSubmenus = submenus.filter( ":not(.ui-menu)" )
  4980. .hide()
  4981. .attr( {
  4982. role: this.options.role,
  4983. "aria-hidden": "true",
  4984. "aria-expanded": "false"
  4985. } )
  4986. .each( function() {
  4987. var menu = $( this ),
  4988. item = menu.prev(),
  4989. submenuCaret = $( "<span>" ).data( "ui-menu-submenu-caret", true );
  4990. that._addClass( submenuCaret, "ui-menu-icon", "ui-icon " + icon );
  4991. item
  4992. .attr( "aria-haspopup", "true" )
  4993. .prepend( submenuCaret );
  4994. menu.attr( "aria-labelledby", item.attr( "id" ) );
  4995. } );
  4996. this._addClass( newSubmenus, "ui-menu", "ui-widget ui-widget-content ui-front" );
  4997. menus = submenus.add( this.element );
  4998. items = menus.find( this.options.items );
  4999. // Initialize menu-items containing spaces and/or dashes only as dividers
  5000. items.not( ".ui-menu-item" ).each( function() {
  5001. var item = $( this );
  5002. if ( that._isDivider( item ) ) {
  5003. that._addClass( item, "ui-menu-divider", "ui-widget-content" );
  5004. }
  5005. } );
  5006. // Don't refresh list items that are already adapted
  5007. newItems = items.not( ".ui-menu-item, .ui-menu-divider" );
  5008. newWrappers = newItems.children()
  5009. .not( ".ui-menu" )
  5010. .uniqueId()
  5011. .attr( {
  5012. tabIndex: -1,
  5013. role: this._itemRole()
  5014. } );
  5015. this._addClass( newItems, "ui-menu-item" )
  5016. ._addClass( newWrappers, "ui-menu-item-wrapper" );
  5017. // Add aria-disabled attribute to any disabled menu item
  5018. items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
  5019. // If the active item has been removed, blur the menu
  5020. if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
  5021. this.blur();
  5022. }
  5023. },
  5024. _itemRole: function() {
  5025. return {
  5026. menu: "menuitem",
  5027. listbox: "option"
  5028. }[ this.options.role ];
  5029. },
  5030. _setOption: function( key, value ) {
  5031. if ( key === "icons" ) {
  5032. var icons = this.element.find( ".ui-menu-icon" );
  5033. this._removeClass( icons, null, this.options.icons.submenu )
  5034. ._addClass( icons, null, value.submenu );
  5035. }
  5036. this._super( key, value );
  5037. },
  5038. _setOptionDisabled: function( value ) {
  5039. this._super( value );
  5040. this.element.attr( "aria-disabled", String( value ) );
  5041. this._toggleClass( null, "ui-state-disabled", !!value );
  5042. },
  5043. focus: function( event, item ) {
  5044. var nested, focused, activeParent;
  5045. this.blur( event, event && event.type === "focus" );
  5046. this._scrollIntoView( item );
  5047. this.active = item.first();
  5048. focused = this.active.children( ".ui-menu-item-wrapper" );
  5049. this._addClass( focused, null, "ui-state-active" );
  5050. // Only update aria-activedescendant if there's a role
  5051. // otherwise we assume focus is managed elsewhere
  5052. if ( this.options.role ) {
  5053. this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
  5054. }
  5055. // Highlight active parent menu item, if any
  5056. activeParent = this.active
  5057. .parent()
  5058. .closest( ".ui-menu-item" )
  5059. .children( ".ui-menu-item-wrapper" );
  5060. this._addClass( activeParent, null, "ui-state-active" );
  5061. if ( event && event.type === "keydown" ) {
  5062. this._close();
  5063. } else {
  5064. this.timer = this._delay( function() {
  5065. this._close();
  5066. }, this.delay );
  5067. }
  5068. nested = item.children( ".ui-menu" );
  5069. if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
  5070. this._startOpening( nested );
  5071. }
  5072. this.activeMenu = item.parent();
  5073. this._trigger( "focus", event, { item: item } );
  5074. },
  5075. _scrollIntoView: function( item ) {
  5076. var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
  5077. if ( this._hasScroll() ) {
  5078. borderTop = parseFloat( $.css( this.activeMenu[ 0 ], "borderTopWidth" ) ) || 0;
  5079. paddingTop = parseFloat( $.css( this.activeMenu[ 0 ], "paddingTop" ) ) || 0;
  5080. offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
  5081. scroll = this.activeMenu.scrollTop();
  5082. elementHeight = this.activeMenu.height();
  5083. itemHeight = item.outerHeight();
  5084. if ( offset < 0 ) {
  5085. this.activeMenu.scrollTop( scroll + offset );
  5086. } else if ( offset + itemHeight > elementHeight ) {
  5087. this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
  5088. }
  5089. }
  5090. },
  5091. blur: function( event, fromFocus ) {
  5092. if ( !fromFocus ) {
  5093. clearTimeout( this.timer );
  5094. }
  5095. if ( !this.active ) {
  5096. return;
  5097. }
  5098. this._removeClass( this.active.children( ".ui-menu-item-wrapper" ),
  5099. null, "ui-state-active" );
  5100. this._trigger( "blur", event, { item: this.active } );
  5101. this.active = null;
  5102. },
  5103. _startOpening: function( submenu ) {
  5104. clearTimeout( this.timer );
  5105. // Don't open if already open fixes a Firefox bug that caused a .5 pixel
  5106. // shift in the submenu position when mousing over the caret icon
  5107. if ( submenu.attr( "aria-hidden" ) !== "true" ) {
  5108. return;
  5109. }
  5110. this.timer = this._delay( function() {
  5111. this._close();
  5112. this._open( submenu );
  5113. }, this.delay );
  5114. },
  5115. _open: function( submenu ) {
  5116. var position = $.extend( {
  5117. of: this.active
  5118. }, this.options.position );
  5119. clearTimeout( this.timer );
  5120. this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
  5121. .hide()
  5122. .attr( "aria-hidden", "true" );
  5123. submenu
  5124. .show()
  5125. .removeAttr( "aria-hidden" )
  5126. .attr( "aria-expanded", "true" )
  5127. .position( position );
  5128. },
  5129. collapseAll: function( event, all ) {
  5130. clearTimeout( this.timer );
  5131. this.timer = this._delay( function() {
  5132. // If we were passed an event, look for the submenu that contains the event
  5133. var currentMenu = all ? this.element :
  5134. $( event && event.target ).closest( this.element.find( ".ui-menu" ) );
  5135. // If we found no valid submenu ancestor, use the main menu to close all
  5136. // sub menus anyway
  5137. if ( !currentMenu.length ) {
  5138. currentMenu = this.element;
  5139. }
  5140. this._close( currentMenu );
  5141. this.blur( event );
  5142. // Work around active item staying active after menu is blurred
  5143. this._removeClass( currentMenu.find( ".ui-state-active" ), null, "ui-state-active" );
  5144. this.activeMenu = currentMenu;
  5145. }, this.delay );
  5146. },
  5147. // With no arguments, closes the currently active menu - if nothing is active
  5148. // it closes all menus. If passed an argument, it will search for menus BELOW
  5149. _close: function( startMenu ) {
  5150. if ( !startMenu ) {
  5151. startMenu = this.active ? this.active.parent() : this.element;
  5152. }
  5153. startMenu.find( ".ui-menu" )
  5154. .hide()
  5155. .attr( "aria-hidden", "true" )
  5156. .attr( "aria-expanded", "false" );
  5157. },
  5158. _closeOnDocumentClick: function( event ) {
  5159. return !$( event.target ).closest( ".ui-menu" ).length;
  5160. },
  5161. _isDivider: function( item ) {
  5162. // Match hyphen, em dash, en dash
  5163. return !/[^\-\u2014\u2013\s]/.test( item.text() );
  5164. },
  5165. collapse: function( event ) {
  5166. var newItem = this.active &&
  5167. this.active.parent().closest( ".ui-menu-item", this.element );
  5168. if ( newItem && newItem.length ) {
  5169. this._close();
  5170. this.focus( event, newItem );
  5171. }
  5172. },
  5173. expand: function( event ) {
  5174. var newItem = this.active &&
  5175. this.active
  5176. .children( ".ui-menu " )
  5177. .find( this.options.items )
  5178. .first();
  5179. if ( newItem && newItem.length ) {
  5180. this._open( newItem.parent() );
  5181. // Delay so Firefox will not hide activedescendant change in expanding submenu from AT
  5182. this._delay( function() {
  5183. this.focus( event, newItem );
  5184. } );
  5185. }
  5186. },
  5187. next: function( event ) {
  5188. this._move( "next", "first", event );
  5189. },
  5190. previous: function( event ) {
  5191. this._move( "prev", "last", event );
  5192. },
  5193. isFirstItem: function() {
  5194. return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
  5195. },
  5196. isLastItem: function() {
  5197. return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
  5198. },
  5199. _move: function( direction, filter, event ) {
  5200. var next;
  5201. if ( this.active ) {
  5202. if ( direction === "first" || direction === "last" ) {
  5203. next = this.active
  5204. [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
  5205. .eq( -1 );
  5206. } else {
  5207. next = this.active
  5208. [ direction + "All" ]( ".ui-menu-item" )
  5209. .eq( 0 );
  5210. }
  5211. }
  5212. if ( !next || !next.length || !this.active ) {
  5213. next = this.activeMenu.find( this.options.items )[ filter ]();
  5214. }
  5215. this.focus( event, next );
  5216. },
  5217. nextPage: function( event ) {
  5218. var item, base, height;
  5219. if ( !this.active ) {
  5220. this.next( event );
  5221. return;
  5222. }
  5223. if ( this.isLastItem() ) {
  5224. return;
  5225. }
  5226. if ( this._hasScroll() ) {
  5227. base = this.active.offset().top;
  5228. height = this.element.height();
  5229. this.active.nextAll( ".ui-menu-item" ).each( function() {
  5230. item = $( this );
  5231. return item.offset().top - base - height < 0;
  5232. } );
  5233. this.focus( event, item );
  5234. } else {
  5235. this.focus( event, this.activeMenu.find( this.options.items )
  5236. [ !this.active ? "first" : "last" ]() );
  5237. }
  5238. },
  5239. previousPage: function( event ) {
  5240. var item, base, height;
  5241. if ( !this.active ) {
  5242. this.next( event );
  5243. return;
  5244. }
  5245. if ( this.isFirstItem() ) {
  5246. return;
  5247. }
  5248. if ( this._hasScroll() ) {
  5249. base = this.active.offset().top;
  5250. height = this.element.height();
  5251. this.active.prevAll( ".ui-menu-item" ).each( function() {
  5252. item = $( this );
  5253. return item.offset().top - base + height > 0;
  5254. } );
  5255. this.focus( event, item );
  5256. } else {
  5257. this.focus( event, this.activeMenu.find( this.options.items ).first() );
  5258. }
  5259. },
  5260. _hasScroll: function() {
  5261. return this.element.outerHeight() < this.element.prop( "scrollHeight" );
  5262. },
  5263. select: function( event ) {
  5264. // TODO: It should never be possible to not have an active item at this
  5265. // point, but the tests don't trigger mouseenter before click.
  5266. this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
  5267. var ui = { item: this.active };
  5268. if ( !this.active.has( ".ui-menu" ).length ) {
  5269. this.collapseAll( event, true );
  5270. }
  5271. this._trigger( "select", event, ui );
  5272. },
  5273. _filterMenuItems: function( character ) {
  5274. var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
  5275. regex = new RegExp( "^" + escapedCharacter, "i" );
  5276. return this.activeMenu
  5277. .find( this.options.items )
  5278. // Only match on items, not dividers or other content (#10571)
  5279. .filter( ".ui-menu-item" )
  5280. .filter( function() {
  5281. return regex.test(
  5282. $.trim( $( this ).children( ".ui-menu-item-wrapper" ).text() ) );
  5283. } );
  5284. }
  5285. } );
  5286. /*!
  5287. * jQuery UI Autocomplete 1.12.1
  5288. * http://jqueryui.com
  5289. *
  5290. * Copyright jQuery Foundation and other contributors
  5291. * Released under the MIT license.
  5292. * http://jquery.org/license
  5293. */
  5294. //>>label: Autocomplete
  5295. //>>group: Widgets
  5296. //>>description: Lists suggested words as the user is typing.
  5297. //>>docs: http://api.jqueryui.com/autocomplete/
  5298. //>>demos: http://jqueryui.com/autocomplete/
  5299. //>>css.structure: ../../themes/base/core.css
  5300. //>>css.structure: ../../themes/base/autocomplete.css
  5301. //>>css.theme: ../../themes/base/theme.css
  5302. $.widget( "ui.autocomplete", {
  5303. version: "1.12.1",
  5304. defaultElement: "<input>",
  5305. options: {
  5306. appendTo: null,
  5307. autoFocus: false,
  5308. delay: 300,
  5309. minLength: 1,
  5310. position: {
  5311. my: "left top",
  5312. at: "left bottom",
  5313. collision: "none"
  5314. },
  5315. source: null,
  5316. // Callbacks
  5317. change: null,
  5318. close: null,
  5319. focus: null,
  5320. open: null,
  5321. response: null,
  5322. search: null,
  5323. select: null
  5324. },
  5325. requestIndex: 0,
  5326. pending: 0,
  5327. _create: function() {
  5328. // Some browsers only repeat keydown events, not keypress events,
  5329. // so we use the suppressKeyPress flag to determine if we've already
  5330. // handled the keydown event. #7269
  5331. // Unfortunately the code for & in keypress is the same as the up arrow,
  5332. // so we use the suppressKeyPressRepeat flag to avoid handling keypress
  5333. // events when we know the keydown event was used to modify the
  5334. // search term. #7799
  5335. var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
  5336. nodeName = this.element[ 0 ].nodeName.toLowerCase(),
  5337. isTextarea = nodeName === "textarea",
  5338. isInput = nodeName === "input";
  5339. // Textareas are always multi-line
  5340. // Inputs are always single-line, even if inside a contentEditable element
  5341. // IE also treats inputs as contentEditable
  5342. // All other element types are determined by whether or not they're contentEditable
  5343. this.isMultiLine = isTextarea || !isInput && this._isContentEditable( this.element );
  5344. this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
  5345. this.isNewMenu = true;
  5346. this._addClass( "ui-autocomplete-input" );
  5347. this.element.attr( "autocomplete", "off" );
  5348. this._on( this.element, {
  5349. keydown: function( event ) {
  5350. if ( this.element.prop( "readOnly" ) ) {
  5351. suppressKeyPress = true;
  5352. suppressInput = true;
  5353. suppressKeyPressRepeat = true;
  5354. return;
  5355. }
  5356. suppressKeyPress = false;
  5357. suppressInput = false;
  5358. suppressKeyPressRepeat = false;
  5359. var keyCode = $.ui.keyCode;
  5360. switch ( event.keyCode ) {
  5361. case keyCode.PAGE_UP:
  5362. suppressKeyPress = true;
  5363. this._move( "previousPage", event );
  5364. break;
  5365. case keyCode.PAGE_DOWN:
  5366. suppressKeyPress = true;
  5367. this._move( "nextPage", event );
  5368. break;
  5369. case keyCode.UP:
  5370. suppressKeyPress = true;
  5371. this._keyEvent( "previous", event );
  5372. break;
  5373. case keyCode.DOWN:
  5374. suppressKeyPress = true;
  5375. this._keyEvent( "next", event );
  5376. break;
  5377. case keyCode.ENTER:
  5378. // when menu is open and has focus
  5379. if ( this.menu.active ) {
  5380. // #6055 - Opera still allows the keypress to occur
  5381. // which causes forms to submit
  5382. suppressKeyPress = true;
  5383. event.preventDefault();
  5384. this.menu.select( event );
  5385. }
  5386. break;
  5387. case keyCode.TAB:
  5388. if ( this.menu.active ) {
  5389. this.menu.select( event );
  5390. }
  5391. break;
  5392. case keyCode.ESCAPE:
  5393. if ( this.menu.element.is( ":visible" ) ) {
  5394. if ( !this.isMultiLine ) {
  5395. this._value( this.term );
  5396. }
  5397. this.close( event );
  5398. // Different browsers have different default behavior for escape
  5399. // Single press can mean undo or clear
  5400. // Double press in IE means clear the whole form
  5401. event.preventDefault();
  5402. }
  5403. break;
  5404. default:
  5405. suppressKeyPressRepeat = true;
  5406. // search timeout should be triggered before the input value is changed
  5407. this._searchTimeout( event );
  5408. break;
  5409. }
  5410. },
  5411. keypress: function( event ) {
  5412. if ( suppressKeyPress ) {
  5413. suppressKeyPress = false;
  5414. if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
  5415. event.preventDefault();
  5416. }
  5417. return;
  5418. }
  5419. if ( suppressKeyPressRepeat ) {
  5420. return;
  5421. }
  5422. // Replicate some key handlers to allow them to repeat in Firefox and Opera
  5423. var keyCode = $.ui.keyCode;
  5424. switch ( event.keyCode ) {
  5425. case keyCode.PAGE_UP:
  5426. this._move( "previousPage", event );
  5427. break;
  5428. case keyCode.PAGE_DOWN:
  5429. this._move( "nextPage", event );
  5430. break;
  5431. case keyCode.UP:
  5432. this._keyEvent( "previous", event );
  5433. break;
  5434. case keyCode.DOWN:
  5435. this._keyEvent( "next", event );
  5436. break;
  5437. }
  5438. },
  5439. input: function( event ) {
  5440. if ( suppressInput ) {
  5441. suppressInput = false;
  5442. event.preventDefault();
  5443. return;
  5444. }
  5445. this._searchTimeout( event );
  5446. },
  5447. focus: function() {
  5448. this.selectedItem = null;
  5449. this.previous = this._value();
  5450. },
  5451. blur: function( event ) {
  5452. if ( this.cancelBlur ) {
  5453. delete this.cancelBlur;
  5454. return;
  5455. }
  5456. clearTimeout( this.searching );
  5457. this.close( event );
  5458. this._change( event );
  5459. }
  5460. } );
  5461. this._initSource();
  5462. this.menu = $( "<ul>" )
  5463. .appendTo( this._appendTo() )
  5464. .menu( {
  5465. // disable ARIA support, the live region takes care of that
  5466. role: null
  5467. } )
  5468. .hide()
  5469. .menu( "instance" );
  5470. this._addClass( this.menu.element, "ui-autocomplete", "ui-front" );
  5471. this._on( this.menu.element, {
  5472. mousedown: function( event ) {
  5473. // prevent moving focus out of the text field
  5474. event.preventDefault();
  5475. // IE doesn't prevent moving focus even with event.preventDefault()
  5476. // so we set a flag to know when we should ignore the blur event
  5477. this.cancelBlur = true;
  5478. this._delay( function() {
  5479. delete this.cancelBlur;
  5480. // Support: IE 8 only
  5481. // Right clicking a menu item or selecting text from the menu items will
  5482. // result in focus moving out of the input. However, we've already received
  5483. // and ignored the blur event because of the cancelBlur flag set above. So
  5484. // we restore focus to ensure that the menu closes properly based on the user's
  5485. // next actions.
  5486. if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {
  5487. this.element.trigger( "focus" );
  5488. }
  5489. } );
  5490. },
  5491. menufocus: function( event, ui ) {
  5492. var label, item;
  5493. // support: Firefox
  5494. // Prevent accidental activation of menu items in Firefox (#7024 #9118)
  5495. if ( this.isNewMenu ) {
  5496. this.isNewMenu = false;
  5497. if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
  5498. this.menu.blur();
  5499. this.document.one( "mousemove", function() {
  5500. $( event.target ).trigger( event.originalEvent );
  5501. } );
  5502. return;
  5503. }
  5504. }
  5505. item = ui.item.data( "ui-autocomplete-item" );
  5506. if ( false !== this._trigger( "focus", event, { item: item } ) ) {
  5507. // use value to match what will end up in the input, if it was a key event
  5508. if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
  5509. this._value( item.value );
  5510. }
  5511. }
  5512. // Announce the value in the liveRegion
  5513. label = ui.item.attr( "aria-label" ) || item.value;
  5514. if ( label && $.trim( label ).length ) {
  5515. this.liveRegion.children().hide();
  5516. $( "<div>" ).text( label ).appendTo( this.liveRegion );
  5517. }
  5518. },
  5519. menuselect: function( event, ui ) {
  5520. var item = ui.item.data( "ui-autocomplete-item" ),
  5521. previous = this.previous;
  5522. // Only trigger when focus was lost (click on menu)
  5523. if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {
  5524. this.element.trigger( "focus" );
  5525. this.previous = previous;
  5526. // #6109 - IE triggers two focus events and the second
  5527. // is asynchronous, so we need to reset the previous
  5528. // term synchronously and asynchronously :-(
  5529. this._delay( function() {
  5530. this.previous = previous;
  5531. this.selectedItem = item;
  5532. } );
  5533. }
  5534. if ( false !== this._trigger( "select", event, { item: item } ) ) {
  5535. this._value( item.value );
  5536. }
  5537. // reset the term after the select event
  5538. // this allows custom select handling to work properly
  5539. this.term = this._value();
  5540. this.close( event );
  5541. this.selectedItem = item;
  5542. }
  5543. } );
  5544. this.liveRegion = $( "<div>", {
  5545. role: "status",
  5546. "aria-live": "assertive",
  5547. "aria-relevant": "additions"
  5548. } )
  5549. .appendTo( this.document[ 0 ].body );
  5550. this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" );
  5551. // Turning off autocomplete prevents the browser from remembering the
  5552. // value when navigating through history, so we re-enable autocomplete
  5553. // if the page is unloaded before the widget is destroyed. #7790
  5554. this._on( this.window, {
  5555. beforeunload: function() {
  5556. this.element.removeAttr( "autocomplete" );
  5557. }
  5558. } );
  5559. },
  5560. _destroy: function() {
  5561. clearTimeout( this.searching );
  5562. this.element.removeAttr( "autocomplete" );
  5563. this.menu.element.remove();
  5564. this.liveRegion.remove();
  5565. },
  5566. _setOption: function( key, value ) {
  5567. this._super( key, value );
  5568. if ( key === "source" ) {
  5569. this._initSource();
  5570. }
  5571. if ( key === "appendTo" ) {
  5572. this.menu.element.appendTo( this._appendTo() );
  5573. }
  5574. if ( key === "disabled" && value && this.xhr ) {
  5575. this.xhr.abort();
  5576. }
  5577. },
  5578. _isEventTargetInWidget: function( event ) {
  5579. var menuElement = this.menu.element[ 0 ];
  5580. return event.target === this.element[ 0 ] ||
  5581. event.target === menuElement ||
  5582. $.contains( menuElement, event.target );
  5583. },
  5584. _closeOnClickOutside: function( event ) {
  5585. if ( !this._isEventTargetInWidget( event ) ) {
  5586. this.close();
  5587. }
  5588. },
  5589. _appendTo: function() {
  5590. var element = this.options.appendTo;
  5591. if ( element ) {
  5592. element = element.jquery || element.nodeType ?
  5593. $( element ) :
  5594. this.document.find( element ).eq( 0 );
  5595. }
  5596. if ( !element || !element[ 0 ] ) {
  5597. element = this.element.closest( ".ui-front, dialog" );
  5598. }
  5599. if ( !element.length ) {
  5600. element = this.document[ 0 ].body;
  5601. }
  5602. return element;
  5603. },
  5604. _initSource: function() {
  5605. var array, url,
  5606. that = this;
  5607. if ( $.isArray( this.options.source ) ) {
  5608. array = this.options.source;
  5609. this.source = function( request, response ) {
  5610. response( $.ui.autocomplete.filter( array, request.term ) );
  5611. };
  5612. } else if ( typeof this.options.source === "string" ) {
  5613. url = this.options.source;
  5614. this.source = function( request, response ) {
  5615. if ( that.xhr ) {
  5616. that.xhr.abort();
  5617. }
  5618. that.xhr = $.ajax( {
  5619. url: url,
  5620. data: request,
  5621. dataType: "json",
  5622. success: function( data ) {
  5623. response( data );
  5624. },
  5625. error: function() {
  5626. response( [] );
  5627. }
  5628. } );
  5629. };
  5630. } else {
  5631. this.source = this.options.source;
  5632. }
  5633. },
  5634. _searchTimeout: function( event ) {
  5635. clearTimeout( this.searching );
  5636. this.searching = this._delay( function() {
  5637. // Search if the value has changed, or if the user retypes the same value (see #7434)
  5638. var equalValues = this.term === this._value(),
  5639. menuVisible = this.menu.element.is( ":visible" ),
  5640. modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
  5641. if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
  5642. this.selectedItem = null;
  5643. this.search( null, event );
  5644. }
  5645. }, this.options.delay );
  5646. },
  5647. search: function( value, event ) {
  5648. value = value != null ? value : this._value();
  5649. // Always save the actual value, not the one passed as an argument
  5650. this.term = this._value();
  5651. if ( value.length < this.options.minLength ) {
  5652. return this.close( event );
  5653. }
  5654. if ( this._trigger( "search", event ) === false ) {
  5655. return;
  5656. }
  5657. return this._search( value );
  5658. },
  5659. _search: function( value ) {
  5660. this.pending++;
  5661. this._addClass( "ui-autocomplete-loading" );
  5662. this.cancelSearch = false;
  5663. this.source( { term: value }, this._response() );
  5664. },
  5665. _response: function() {
  5666. var index = ++this.requestIndex;
  5667. return $.proxy( function( content ) {
  5668. if ( index === this.requestIndex ) {
  5669. this.__response( content );
  5670. }
  5671. this.pending--;
  5672. if ( !this.pending ) {
  5673. this._removeClass( "ui-autocomplete-loading" );
  5674. }
  5675. }, this );
  5676. },
  5677. __response: function( content ) {
  5678. if ( content ) {
  5679. content = this._normalize( content );
  5680. }
  5681. this._trigger( "response", null, { content: content } );
  5682. if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
  5683. this._suggest( content );
  5684. this._trigger( "open" );
  5685. } else {
  5686. // use ._close() instead of .close() so we don't cancel future searches
  5687. this._close();
  5688. }
  5689. },
  5690. close: function( event ) {
  5691. this.cancelSearch = true;
  5692. this._close( event );
  5693. },
  5694. _close: function( event ) {
  5695. // Remove the handler that closes the menu on outside clicks
  5696. this._off( this.document, "mousedown" );
  5697. if ( this.menu.element.is( ":visible" ) ) {
  5698. this.menu.element.hide();
  5699. this.menu.blur();
  5700. this.isNewMenu = true;
  5701. this._trigger( "close", event );
  5702. }
  5703. },
  5704. _change: function( event ) {
  5705. if ( this.previous !== this._value() ) {
  5706. this._trigger( "change", event, { item: this.selectedItem } );
  5707. }
  5708. },
  5709. _normalize: function( items ) {
  5710. // assume all items have the right format when the first item is complete
  5711. if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
  5712. return items;
  5713. }
  5714. return $.map( items, function( item ) {
  5715. if ( typeof item === "string" ) {
  5716. return {
  5717. label: item,
  5718. value: item
  5719. };
  5720. }
  5721. return $.extend( {}, item, {
  5722. label: item.label || item.value,
  5723. value: item.value || item.label
  5724. } );
  5725. } );
  5726. },
  5727. _suggest: function( items ) {
  5728. var ul = this.menu.element.empty();
  5729. this._renderMenu( ul, items );
  5730. this.isNewMenu = true;
  5731. this.menu.refresh();
  5732. // Size and position menu
  5733. ul.show();
  5734. this._resizeMenu();
  5735. ul.position( $.extend( {
  5736. of: this.element
  5737. }, this.options.position ) );
  5738. if ( this.options.autoFocus ) {
  5739. this.menu.next();
  5740. }
  5741. // Listen for interactions outside of the widget (#6642)
  5742. this._on( this.document, {
  5743. mousedown: "_closeOnClickOutside"
  5744. } );
  5745. },
  5746. _resizeMenu: function() {
  5747. var ul = this.menu.element;
  5748. ul.outerWidth( Math.max(
  5749. // Firefox wraps long text (possibly a rounding bug)
  5750. // so we add 1px to avoid the wrapping (#7513)
  5751. ul.width( "" ).outerWidth() + 1,
  5752. this.element.outerWidth()
  5753. ) );
  5754. },
  5755. _renderMenu: function( ul, items ) {
  5756. var that = this;
  5757. $.each( items, function( index, item ) {
  5758. that._renderItemData( ul, item );
  5759. } );
  5760. },
  5761. _renderItemData: function( ul, item ) {
  5762. return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
  5763. },
  5764. _renderItem: function( ul, item ) {
  5765. return $( "<li>" )
  5766. .append( $( "<div>" ).text( item.label ) )
  5767. .appendTo( ul );
  5768. },
  5769. _move: function( direction, event ) {
  5770. if ( !this.menu.element.is( ":visible" ) ) {
  5771. this.search( null, event );
  5772. return;
  5773. }
  5774. if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
  5775. this.menu.isLastItem() && /^next/.test( direction ) ) {
  5776. if ( !this.isMultiLine ) {
  5777. this._value( this.term );
  5778. }
  5779. this.menu.blur();
  5780. return;
  5781. }
  5782. this.menu[ direction ]( event );
  5783. },
  5784. widget: function() {
  5785. return this.menu.element;
  5786. },
  5787. _value: function() {
  5788. return this.valueMethod.apply( this.element, arguments );
  5789. },
  5790. _keyEvent: function( keyEvent, event ) {
  5791. if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
  5792. this._move( keyEvent, event );
  5793. // Prevents moving cursor to beginning/end of the text field in some browsers
  5794. event.preventDefault();
  5795. }
  5796. },
  5797. // Support: Chrome <=50
  5798. // We should be able to just use this.element.prop( "isContentEditable" )
  5799. // but hidden elements always report false in Chrome.
  5800. // https://code.google.com/p/chromium/issues/detail?id=313082
  5801. _isContentEditable: function( element ) {
  5802. if ( !element.length ) {
  5803. return false;
  5804. }
  5805. var editable = element.prop( "contentEditable" );
  5806. if ( editable === "inherit" ) {
  5807. return this._isContentEditable( element.parent() );
  5808. }
  5809. return editable === "true";
  5810. }
  5811. } );
  5812. $.extend( $.ui.autocomplete, {
  5813. escapeRegex: function( value ) {
  5814. return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
  5815. },
  5816. filter: function( array, term ) {
  5817. var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
  5818. return $.grep( array, function( value ) {
  5819. return matcher.test( value.label || value.value || value );
  5820. } );
  5821. }
  5822. } );
  5823. // Live region extension, adding a `messages` option
  5824. // NOTE: This is an experimental API. We are still investigating
  5825. // a full solution for string manipulation and internationalization.
  5826. $.widget( "ui.autocomplete", $.ui.autocomplete, {
  5827. options: {
  5828. messages: {
  5829. noResults: "No search results.",
  5830. results: function( amount ) {
  5831. return amount + ( amount > 1 ? " results are" : " result is" ) +
  5832. " available, use up and down arrow keys to navigate.";
  5833. }
  5834. }
  5835. },
  5836. __response: function( content ) {
  5837. var message;
  5838. this._superApply( arguments );
  5839. if ( this.options.disabled || this.cancelSearch ) {
  5840. return;
  5841. }
  5842. if ( content && content.length ) {
  5843. message = this.options.messages.results( content.length );
  5844. } else {
  5845. message = this.options.messages.noResults;
  5846. }
  5847. this.liveRegion.children().hide();
  5848. $( "<div>" ).text( message ).appendTo( this.liveRegion );
  5849. }
  5850. } );
  5851. var widgetsAutocomplete = $.ui.autocomplete;
  5852. /*!
  5853. * jQuery UI Controlgroup 1.12.1
  5854. * http://jqueryui.com
  5855. *
  5856. * Copyright jQuery Foundation and other contributors
  5857. * Released under the MIT license.
  5858. * http://jquery.org/license
  5859. */
  5860. //>>label: Controlgroup
  5861. //>>group: Widgets
  5862. //>>description: Visually groups form control widgets
  5863. //>>docs: http://api.jqueryui.com/controlgroup/
  5864. //>>demos: http://jqueryui.com/controlgroup/
  5865. //>>css.structure: ../../themes/base/core.css
  5866. //>>css.structure: ../../themes/base/controlgroup.css
  5867. //>>css.theme: ../../themes/base/theme.css
  5868. var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g;
  5869. var widgetsControlgroup = $.widget( "ui.controlgroup", {
  5870. version: "1.12.1",
  5871. defaultElement: "<div>",
  5872. options: {
  5873. direction: "horizontal",
  5874. disabled: null,
  5875. onlyVisible: true,
  5876. items: {
  5877. "button": "input[type=button], input[type=submit], input[type=reset], button, a",
  5878. "controlgroupLabel": ".ui-controlgroup-label",
  5879. "checkboxradio": "input[type='checkbox'], input[type='radio']",
  5880. "selectmenu": "select",
  5881. "spinner": ".ui-spinner-input"
  5882. }
  5883. },
  5884. _create: function() {
  5885. this._enhance();
  5886. },
  5887. // To support the enhanced option in jQuery Mobile, we isolate DOM manipulation
  5888. _enhance: function() {
  5889. this.element.attr( "role", "toolbar" );
  5890. this.refresh();
  5891. },
  5892. _destroy: function() {
  5893. this._callChildMethod( "destroy" );
  5894. this.childWidgets.removeData( "ui-controlgroup-data" );
  5895. this.element.removeAttr( "role" );
  5896. if ( this.options.items.controlgroupLabel ) {
  5897. this.element
  5898. .find( this.options.items.controlgroupLabel )
  5899. .find( ".ui-controlgroup-label-contents" )
  5900. .contents().unwrap();
  5901. }
  5902. },
  5903. _initWidgets: function() {
  5904. var that = this,
  5905. childWidgets = [];
  5906. // First we iterate over each of the items options
  5907. $.each( this.options.items, function( widget, selector ) {
  5908. var labels;
  5909. var options = {};
  5910. // Make sure the widget has a selector set
  5911. if ( !selector ) {
  5912. return;
  5913. }
  5914. if ( widget === "controlgroupLabel" ) {
  5915. labels = that.element.find( selector );
  5916. labels.each( function() {
  5917. var element = $( this );
  5918. if ( element.children( ".ui-controlgroup-label-contents" ).length ) {
  5919. return;
  5920. }
  5921. element.contents()
  5922. .wrapAll( "<span class='ui-controlgroup-label-contents'></span>" );
  5923. } );
  5924. that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" );
  5925. childWidgets = childWidgets.concat( labels.get() );
  5926. return;
  5927. }
  5928. // Make sure the widget actually exists
  5929. if ( !$.fn[ widget ] ) {
  5930. return;
  5931. }
  5932. // We assume everything is in the middle to start because we can't determine
  5933. // first / last elements until all enhancments are done.
  5934. if ( that[ "_" + widget + "Options" ] ) {
  5935. options = that[ "_" + widget + "Options" ]( "middle" );
  5936. } else {
  5937. options = { classes: {} };
  5938. }
  5939. // Find instances of this widget inside controlgroup and init them
  5940. that.element
  5941. .find( selector )
  5942. .each( function() {
  5943. var element = $( this );
  5944. var instance = element[ widget ]( "instance" );
  5945. // We need to clone the default options for this type of widget to avoid
  5946. // polluting the variable options which has a wider scope than a single widget.
  5947. var instanceOptions = $.widget.extend( {}, options );
  5948. // If the button is the child of a spinner ignore it
  5949. // TODO: Find a more generic solution
  5950. if ( widget === "button" && element.parent( ".ui-spinner" ).length ) {
  5951. return;
  5952. }
  5953. // Create the widget if it doesn't exist
  5954. if ( !instance ) {
  5955. instance = element[ widget ]()[ widget ]( "instance" );
  5956. }
  5957. if ( instance ) {
  5958. instanceOptions.classes =
  5959. that._resolveClassesValues( instanceOptions.classes, instance );
  5960. }
  5961. element[ widget ]( instanceOptions );
  5962. // Store an instance of the controlgroup to be able to reference
  5963. // from the outermost element for changing options and refresh
  5964. var widgetElement = element[ widget ]( "widget" );
  5965. $.data( widgetElement[ 0 ], "ui-controlgroup-data",
  5966. instance ? instance : element[ widget ]( "instance" ) );
  5967. childWidgets.push( widgetElement[ 0 ] );
  5968. } );
  5969. } );
  5970. this.childWidgets = $( $.unique( childWidgets ) );
  5971. this._addClass( this.childWidgets, "ui-controlgroup-item" );
  5972. },
  5973. _callChildMethod: function( method ) {
  5974. this.childWidgets.each( function() {
  5975. var element = $( this ),
  5976. data = element.data( "ui-controlgroup-data" );
  5977. if ( data && data[ method ] ) {
  5978. data[ method ]();
  5979. }
  5980. } );
  5981. },
  5982. _updateCornerClass: function( element, position ) {
  5983. var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";
  5984. var add = this._buildSimpleOptions( position, "label" ).classes.label;
  5985. this._removeClass( element, null, remove );
  5986. this._addClass( element, null, add );
  5987. },
  5988. _buildSimpleOptions: function( position, key ) {
  5989. var direction = this.options.direction === "vertical";
  5990. var result = {
  5991. classes: {}
  5992. };
  5993. result.classes[ key ] = {
  5994. "middle": "",
  5995. "first": "ui-corner-" + ( direction ? "top" : "left" ),
  5996. "last": "ui-corner-" + ( direction ? "bottom" : "right" ),
  5997. "only": "ui-corner-all"
  5998. }[ position ];
  5999. return result;
  6000. },
  6001. _spinnerOptions: function( position ) {
  6002. var options = this._buildSimpleOptions( position, "ui-spinner" );
  6003. options.classes[ "ui-spinner-up" ] = "";
  6004. options.classes[ "ui-spinner-down" ] = "";
  6005. return options;
  6006. },
  6007. _buttonOptions: function( position ) {
  6008. return this._buildSimpleOptions( position, "ui-button" );
  6009. },
  6010. _checkboxradioOptions: function( position ) {
  6011. return this._buildSimpleOptions( position, "ui-checkboxradio-label" );
  6012. },
  6013. _selectmenuOptions: function( position ) {
  6014. var direction = this.options.direction === "vertical";
  6015. return {
  6016. width: direction ? "auto" : false,
  6017. classes: {
  6018. middle: {
  6019. "ui-selectmenu-button-open": "",
  6020. "ui-selectmenu-button-closed": ""
  6021. },
  6022. first: {
  6023. "ui-selectmenu-button-open": "ui-corner-" + ( direction ? "top" : "tl" ),
  6024. "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "top" : "left" )
  6025. },
  6026. last: {
  6027. "ui-selectmenu-button-open": direction ? "" : "ui-corner-tr",
  6028. "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" )
  6029. },
  6030. only: {
  6031. "ui-selectmenu-button-open": "ui-corner-top",
  6032. "ui-selectmenu-button-closed": "ui-corner-all"
  6033. }
  6034. }[ position ]
  6035. };
  6036. },
  6037. _resolveClassesValues: function( classes, instance ) {
  6038. var result = {};
  6039. $.each( classes, function( key ) {
  6040. var current = instance.options.classes[ key ] || "";
  6041. current = $.trim( current.replace( controlgroupCornerRegex, "" ) );
  6042. result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " );
  6043. } );
  6044. return result;
  6045. },
  6046. _setOption: function( key, value ) {
  6047. if ( key === "direction" ) {
  6048. this._removeClass( "ui-controlgroup-" + this.options.direction );
  6049. }
  6050. this._super( key, value );
  6051. if ( key === "disabled" ) {
  6052. this._callChildMethod( value ? "disable" : "enable" );
  6053. return;
  6054. }
  6055. this.refresh();
  6056. },
  6057. refresh: function() {
  6058. var children,
  6059. that = this;
  6060. this._addClass( "ui-controlgroup ui-controlgroup-" + this.options.direction );
  6061. if ( this.options.direction === "horizontal" ) {
  6062. this._addClass( null, "ui-helper-clearfix" );
  6063. }
  6064. this._initWidgets();
  6065. children = this.childWidgets;
  6066. // We filter here because we need to track all childWidgets not just the visible ones
  6067. if ( this.options.onlyVisible ) {
  6068. children = children.filter( ":visible" );
  6069. }
  6070. if ( children.length ) {
  6071. // We do this last because we need to make sure all enhancment is done
  6072. // before determining first and last
  6073. $.each( [ "first", "last" ], function( index, value ) {
  6074. var instance = children[ value ]().data( "ui-controlgroup-data" );
  6075. if ( instance && that[ "_" + instance.widgetName + "Options" ] ) {
  6076. var options = that[ "_" + instance.widgetName + "Options" ](
  6077. children.length === 1 ? "only" : value
  6078. );
  6079. options.classes = that._resolveClassesValues( options.classes, instance );
  6080. instance.element[ instance.widgetName ]( options );
  6081. } else {
  6082. that._updateCornerClass( children[ value ](), value );
  6083. }
  6084. } );
  6085. // Finally call the refresh method on each of the child widgets.
  6086. this._callChildMethod( "refresh" );
  6087. }
  6088. }
  6089. } );
  6090. /*!
  6091. * jQuery UI Checkboxradio 1.12.1
  6092. * http://jqueryui.com
  6093. *
  6094. * Copyright jQuery Foundation and other contributors
  6095. * Released under the MIT license.
  6096. * http://jquery.org/license
  6097. */
  6098. //>>label: Checkboxradio
  6099. //>>group: Widgets
  6100. //>>description: Enhances a form with multiple themeable checkboxes or radio buttons.
  6101. //>>docs: http://api.jqueryui.com/checkboxradio/
  6102. //>>demos: http://jqueryui.com/checkboxradio/
  6103. //>>css.structure: ../../themes/base/core.css
  6104. //>>css.structure: ../../themes/base/button.css
  6105. //>>css.structure: ../../themes/base/checkboxradio.css
  6106. //>>css.theme: ../../themes/base/theme.css
  6107. $.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
  6108. version: "1.12.1",
  6109. options: {
  6110. disabled: null,
  6111. label: null,
  6112. icon: true,
  6113. classes: {
  6114. "ui-checkboxradio-label": "ui-corner-all",
  6115. "ui-checkboxradio-icon": "ui-corner-all"
  6116. }
  6117. },
  6118. _getCreateOptions: function() {
  6119. var disabled, labels;
  6120. var that = this;
  6121. var options = this._super() || {};
  6122. // We read the type here, because it makes more sense to throw a element type error first,
  6123. // rather then the error for lack of a label. Often if its the wrong type, it
  6124. // won't have a label (e.g. calling on a div, btn, etc)
  6125. this._readType();
  6126. labels = this.element.labels();
  6127. // If there are multiple labels, use the last one
  6128. this.label = $( labels[ labels.length - 1 ] );
  6129. if ( !this.label.length ) {
  6130. $.error( "No label found for checkboxradio widget" );
  6131. }
  6132. this.originalLabel = "";
  6133. // We need to get the label text but this may also need to make sure it does not contain the
  6134. // input itself.
  6135. this.label.contents().not( this.element[ 0 ] ).each( function() {
  6136. // The label contents could be text, html, or a mix. We concat each element to get a
  6137. // string representation of the label, without the input as part of it.
  6138. that.originalLabel += this.nodeType === 3 ? $( this ).text() : this.outerHTML;
  6139. } );
  6140. // Set the label option if we found label text
  6141. if ( this.originalLabel ) {
  6142. options.label = this.originalLabel;
  6143. }
  6144. disabled = this.element[ 0 ].disabled;
  6145. if ( disabled != null ) {
  6146. options.disabled = disabled;
  6147. }
  6148. return options;
  6149. },
  6150. _create: function() {
  6151. var checked = this.element[ 0 ].checked;
  6152. this._bindFormResetHandler();
  6153. if ( this.options.disabled == null ) {
  6154. this.options.disabled = this.element[ 0 ].disabled;
  6155. }
  6156. this._setOption( "disabled", this.options.disabled );
  6157. this._addClass( "ui-checkboxradio", "ui-helper-hidden-accessible" );
  6158. this._addClass( this.label, "ui-checkboxradio-label", "ui-button ui-widget" );
  6159. if ( this.type === "radio" ) {
  6160. this._addClass( this.label, "ui-checkboxradio-radio-label" );
  6161. }
  6162. if ( this.options.label && this.options.label !== this.originalLabel ) {
  6163. this._updateLabel();
  6164. } else if ( this.originalLabel ) {
  6165. this.options.label = this.originalLabel;
  6166. }
  6167. this._enhance();
  6168. if ( checked ) {
  6169. this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" );
  6170. if ( this.icon ) {
  6171. this._addClass( this.icon, null, "ui-state-hover" );
  6172. }
  6173. }
  6174. this._on( {
  6175. change: "_toggleClasses",
  6176. focus: function() {
  6177. this._addClass( this.label, null, "ui-state-focus ui-visual-focus" );
  6178. },
  6179. blur: function() {
  6180. this._removeClass( this.label, null, "ui-state-focus ui-visual-focus" );
  6181. }
  6182. } );
  6183. },
  6184. _readType: function() {
  6185. var nodeName = this.element[ 0 ].nodeName.toLowerCase();
  6186. this.type = this.element[ 0 ].type;
  6187. if ( nodeName !== "input" || !/radio|checkbox/.test( this.type ) ) {
  6188. $.error( "Can't create checkboxradio on element.nodeName=" + nodeName +
  6189. " and element.type=" + this.type );
  6190. }
  6191. },
  6192. // Support jQuery Mobile enhanced option
  6193. _enhance: function() {
  6194. this._updateIcon( this.element[ 0 ].checked );
  6195. },
  6196. widget: function() {
  6197. return this.label;
  6198. },
  6199. _getRadioGroup: function() {
  6200. var group;
  6201. var name = this.element[ 0 ].name;
  6202. var nameSelector = "input[name='" + $.ui.escapeSelector( name ) + "']";
  6203. if ( !name ) {
  6204. return $( [] );
  6205. }
  6206. if ( this.form.length ) {
  6207. group = $( this.form[ 0 ].elements ).filter( nameSelector );
  6208. } else {
  6209. // Not inside a form, check all inputs that also are not inside a form
  6210. group = $( nameSelector ).filter( function() {
  6211. return $( this ).form().length === 0;
  6212. } );
  6213. }
  6214. return group.not( this.element );
  6215. },
  6216. _toggleClasses: function() {
  6217. var checked = this.element[ 0 ].checked;
  6218. this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
  6219. if ( this.options.icon && this.type === "checkbox" ) {
  6220. this._toggleClass( this.icon, null, "ui-icon-check ui-state-checked", checked )
  6221. ._toggleClass( this.icon, null, "ui-icon-blank", !checked );
  6222. }
  6223. if ( this.type === "radio" ) {
  6224. this._getRadioGroup()
  6225. .each( function() {
  6226. var instance = $( this ).checkboxradio( "instance" );
  6227. if ( instance ) {
  6228. instance._removeClass( instance.label,
  6229. "ui-checkboxradio-checked", "ui-state-active" );
  6230. }
  6231. } );
  6232. }
  6233. },
  6234. _destroy: function() {
  6235. this._unbindFormResetHandler();
  6236. if ( this.icon ) {
  6237. this.icon.remove();
  6238. this.iconSpace.remove();
  6239. }
  6240. },
  6241. _setOption: function( key, value ) {
  6242. // We don't allow the value to be set to nothing
  6243. if ( key === "label" && !value ) {
  6244. return;
  6245. }
  6246. this._super( key, value );
  6247. if ( key === "disabled" ) {
  6248. this._toggleClass( this.label, null, "ui-state-disabled", value );
  6249. this.element[ 0 ].disabled = value;
  6250. // Don't refresh when setting disabled
  6251. return;
  6252. }
  6253. this.refresh();
  6254. },
  6255. _updateIcon: function( checked ) {
  6256. var toAdd = "ui-icon ui-icon-background ";
  6257. if ( this.options.icon ) {
  6258. if ( !this.icon ) {
  6259. this.icon = $( "<span>" );
  6260. this.iconSpace = $( "<span> </span>" );
  6261. this._addClass( this.iconSpace, "ui-checkboxradio-icon-space" );
  6262. }
  6263. if ( this.type === "checkbox" ) {
  6264. toAdd += checked ? "ui-icon-check ui-state-checked" : "ui-icon-blank";
  6265. this._removeClass( this.icon, null, checked ? "ui-icon-blank" : "ui-icon-check" );
  6266. } else {
  6267. toAdd += "ui-icon-blank";
  6268. }
  6269. this._addClass( this.icon, "ui-checkboxradio-icon", toAdd );
  6270. if ( !checked ) {
  6271. this._removeClass( this.icon, null, "ui-icon-check ui-state-checked" );
  6272. }
  6273. this.icon.prependTo( this.label ).after( this.iconSpace );
  6274. } else if ( this.icon !== undefined ) {
  6275. this.icon.remove();
  6276. this.iconSpace.remove();
  6277. delete this.icon;
  6278. }
  6279. },
  6280. _updateLabel: function() {
  6281. // Remove the contents of the label ( minus the icon, icon space, and input )
  6282. var contents = this.label.contents().not( this.element[ 0 ] );
  6283. if ( this.icon ) {
  6284. contents = contents.not( this.icon[ 0 ] );
  6285. }
  6286. if ( this.iconSpace ) {
  6287. contents = contents.not( this.iconSpace[ 0 ] );
  6288. }
  6289. contents.remove();
  6290. this.label.append( this.options.label );
  6291. },
  6292. refresh: function() {
  6293. var checked = this.element[ 0 ].checked,
  6294. isDisabled = this.element[ 0 ].disabled;
  6295. this._updateIcon( checked );
  6296. this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
  6297. if ( this.options.label !== null ) {
  6298. this._updateLabel();
  6299. }
  6300. if ( isDisabled !== this.options.disabled ) {
  6301. this._setOptions( { "disabled": isDisabled } );
  6302. }
  6303. }
  6304. } ] );
  6305. var widgetsCheckboxradio = $.ui.checkboxradio;
  6306. /*!
  6307. * jQuery UI Button 1.12.1
  6308. * http://jqueryui.com
  6309. *
  6310. * Copyright jQuery Foundation and other contributors
  6311. * Released under the MIT license.
  6312. * http://jquery.org/license
  6313. */
  6314. //>>label: Button
  6315. //>>group: Widgets
  6316. //>>description: Enhances a form with themeable buttons.
  6317. //>>docs: http://api.jqueryui.com/button/
  6318. //>>demos: http://jqueryui.com/button/
  6319. //>>css.structure: ../../themes/base/core.css
  6320. //>>css.structure: ../../themes/base/button.css
  6321. //>>css.theme: ../../themes/base/theme.css
  6322. $.widget( "ui.button", {
  6323. version: "1.12.1",
  6324. defaultElement: "<button>",
  6325. options: {
  6326. classes: {
  6327. "ui-button": "ui-corner-all"
  6328. },
  6329. disabled: null,
  6330. icon: null,
  6331. iconPosition: "beginning",
  6332. label: null,
  6333. showLabel: true
  6334. },
  6335. _getCreateOptions: function() {
  6336. var disabled,
  6337. // This is to support cases like in jQuery Mobile where the base widget does have
  6338. // an implementation of _getCreateOptions
  6339. options = this._super() || {};
  6340. this.isInput = this.element.is( "input" );
  6341. disabled = this.element[ 0 ].disabled;
  6342. if ( disabled != null ) {
  6343. options.disabled = disabled;
  6344. }
  6345. this.originalLabel = this.isInput ? this.element.val() : this.element.html();
  6346. if ( this.originalLabel ) {
  6347. options.label = this.originalLabel;
  6348. }
  6349. return options;
  6350. },
  6351. _create: function() {
  6352. if ( !this.option.showLabel & !this.options.icon ) {
  6353. this.options.showLabel = true;
  6354. }
  6355. // We have to check the option again here even though we did in _getCreateOptions,
  6356. // because null may have been passed on init which would override what was set in
  6357. // _getCreateOptions
  6358. if ( this.options.disabled == null ) {
  6359. this.options.disabled = this.element[ 0 ].disabled || false;
  6360. }
  6361. this.hasTitle = !!this.element.attr( "title" );
  6362. // Check to see if the label needs to be set or if its already correct
  6363. if ( this.options.label && this.options.label !== this.originalLabel ) {
  6364. if ( this.isInput ) {
  6365. this.element.val( this.options.label );
  6366. } else {
  6367. this.element.html( this.options.label );
  6368. }
  6369. }
  6370. this._addClass( "ui-button", "ui-widget" );
  6371. this._setOption( "disabled", this.options.disabled );
  6372. this._enhance();
  6373. if ( this.element.is( "a" ) ) {
  6374. this._on( {
  6375. "keyup": function( event ) {
  6376. if ( event.keyCode === $.ui.keyCode.SPACE ) {
  6377. event.preventDefault();
  6378. // Support: PhantomJS <= 1.9, IE 8 Only
  6379. // If a native click is available use it so we actually cause navigation
  6380. // otherwise just trigger a click event
  6381. if ( this.element[ 0 ].click ) {
  6382. this.element[ 0 ].click();
  6383. } else {
  6384. this.element.trigger( "click" );
  6385. }
  6386. }
  6387. }
  6388. } );
  6389. }
  6390. },
  6391. _enhance: function() {
  6392. if ( !this.element.is( "button" ) ) {
  6393. this.element.attr( "role", "button" );
  6394. }
  6395. if ( this.options.icon ) {
  6396. this._updateIcon( "icon", this.options.icon );
  6397. this._updateTooltip();
  6398. }
  6399. },
  6400. _updateTooltip: function() {
  6401. this.title = this.element.attr( "title" );
  6402. if ( !this.options.showLabel && !this.title ) {
  6403. this.element.attr( "title", this.options.label );
  6404. }
  6405. },
  6406. _updateIcon: function( option, value ) {
  6407. var icon = option !== "iconPosition",
  6408. position = icon ? this.options.iconPosition : value,
  6409. displayBlock = position === "top" || position === "bottom";
  6410. // Create icon
  6411. if ( !this.icon ) {
  6412. this.icon = $( "<span>" );
  6413. this._addClass( this.icon, "ui-button-icon", "ui-icon" );
  6414. if ( !this.options.showLabel ) {
  6415. this._addClass( "ui-button-icon-only" );
  6416. }
  6417. } else if ( icon ) {
  6418. // If we are updating the icon remove the old icon class
  6419. this._removeClass( this.icon, null, this.options.icon );
  6420. }
  6421. // If we are updating the icon add the new icon class
  6422. if ( icon ) {
  6423. this._addClass( this.icon, null, value );
  6424. }
  6425. this._attachIcon( position );
  6426. // If the icon is on top or bottom we need to add the ui-widget-icon-block class and remove
  6427. // the iconSpace if there is one.
  6428. if ( displayBlock ) {
  6429. this._addClass( this.icon, null, "ui-widget-icon-block" );
  6430. if ( this.iconSpace ) {
  6431. this.iconSpace.remove();
  6432. }
  6433. } else {
  6434. // Position is beginning or end so remove the ui-widget-icon-block class and add the
  6435. // space if it does not exist
  6436. if ( !this.iconSpace ) {
  6437. this.iconSpace = $( "<span> </span>" );
  6438. this._addClass( this.iconSpace, "ui-button-icon-space" );
  6439. }
  6440. this._removeClass( this.icon, null, "ui-wiget-icon-block" );
  6441. this._attachIconSpace( position );
  6442. }
  6443. },
  6444. _destroy: function() {
  6445. this.element.removeAttr( "role" );
  6446. if ( this.icon ) {
  6447. this.icon.remove();
  6448. }
  6449. if ( this.iconSpace ) {
  6450. this.iconSpace.remove();
  6451. }
  6452. if ( !this.hasTitle ) {
  6453. this.element.removeAttr( "title" );
  6454. }
  6455. },
  6456. _attachIconSpace: function( iconPosition ) {
  6457. this.icon[ /^(?:end|bottom)/.test( iconPosition ) ? "before" : "after" ]( this.iconSpace );
  6458. },
  6459. _attachIcon: function( iconPosition ) {
  6460. this.element[ /^(?:end|bottom)/.test( iconPosition ) ? "append" : "prepend" ]( this.icon );
  6461. },
  6462. _setOptions: function( options ) {
  6463. var newShowLabel = options.showLabel === undefined ?
  6464. this.options.showLabel :
  6465. options.showLabel,
  6466. newIcon = options.icon === undefined ? this.options.icon : options.icon;
  6467. if ( !newShowLabel && !newIcon ) {
  6468. options.showLabel = true;
  6469. }
  6470. this._super( options );
  6471. },
  6472. _setOption: function( key, value ) {
  6473. if ( key === "icon" ) {
  6474. if ( value ) {
  6475. this._updateIcon( key, value );
  6476. } else if ( this.icon ) {
  6477. this.icon.remove();
  6478. if ( this.iconSpace ) {
  6479. this.iconSpace.remove();
  6480. }
  6481. }
  6482. }
  6483. if ( key === "iconPosition" ) {
  6484. this._updateIcon( key, value );
  6485. }
  6486. // Make sure we can't end up with a button that has neither text nor icon
  6487. if ( key === "showLabel" ) {
  6488. this._toggleClass( "ui-button-icon-only", null, !value );
  6489. this._updateTooltip();
  6490. }
  6491. if ( key === "label" ) {
  6492. if ( this.isInput ) {
  6493. this.element.val( value );
  6494. } else {
  6495. // If there is an icon, append it, else nothing then append the value
  6496. // this avoids removal of the icon when setting label text
  6497. this.element.html( value );
  6498. if ( this.icon ) {
  6499. this._attachIcon( this.options.iconPosition );
  6500. this._attachIconSpace( this.options.iconPosition );
  6501. }
  6502. }
  6503. }
  6504. this._super( key, value );
  6505. if ( key === "disabled" ) {
  6506. this._toggleClass( null, "ui-state-disabled", value );
  6507. this.element[ 0 ].disabled = value;
  6508. if ( value ) {
  6509. this.element.blur();
  6510. }
  6511. }
  6512. },
  6513. refresh: function() {
  6514. // Make sure to only check disabled if its an element that supports this otherwise
  6515. // check for the disabled class to determine state
  6516. var isDisabled = this.element.is( "input, button" ) ?
  6517. this.element[ 0 ].disabled : this.element.hasClass( "ui-button-disabled" );
  6518. if ( isDisabled !== this.options.disabled ) {
  6519. this._setOptions( { disabled: isDisabled } );
  6520. }
  6521. this._updateTooltip();
  6522. }
  6523. } );
  6524. // DEPRECATED
  6525. if ( $.uiBackCompat !== false ) {
  6526. // Text and Icons options
  6527. $.widget( "ui.button", $.ui.button, {
  6528. options: {
  6529. text: true,
  6530. icons: {
  6531. primary: null,
  6532. secondary: null
  6533. }
  6534. },
  6535. _create: function() {
  6536. if ( this.options.showLabel && !this.options.text ) {
  6537. this.options.showLabel = this.options.text;
  6538. }
  6539. if ( !this.options.showLabel && this.options.text ) {
  6540. this.options.text = this.options.showLabel;
  6541. }
  6542. if ( !this.options.icon && ( this.options.icons.primary ||
  6543. this.options.icons.secondary ) ) {
  6544. if ( this.options.icons.primary ) {
  6545. this.options.icon = this.options.icons.primary;
  6546. } else {
  6547. this.options.icon = this.options.icons.secondary;
  6548. this.options.iconPosition = "end";
  6549. }
  6550. } else if ( this.options.icon ) {
  6551. this.options.icons.primary = this.options.icon;
  6552. }
  6553. this._super();
  6554. },
  6555. _setOption: function( key, value ) {
  6556. if ( key === "text" ) {
  6557. this._super( "showLabel", value );
  6558. return;
  6559. }
  6560. if ( key === "showLabel" ) {
  6561. this.options.text = value;
  6562. }
  6563. if ( key === "icon" ) {
  6564. this.options.icons.primary = value;
  6565. }
  6566. if ( key === "icons" ) {
  6567. if ( value.primary ) {
  6568. this._super( "icon", value.primary );
  6569. this._super( "iconPosition", "beginning" );
  6570. } else if ( value.secondary ) {
  6571. this._super( "icon", value.secondary );
  6572. this._super( "iconPosition", "end" );
  6573. }
  6574. }
  6575. this._superApply( arguments );
  6576. }
  6577. } );
  6578. $.fn.button = ( function( orig ) {
  6579. return function() {
  6580. if ( !this.length || ( this.length && this[ 0 ].tagName !== "INPUT" ) ||
  6581. ( this.length && this[ 0 ].tagName === "INPUT" && (
  6582. this.attr( "type" ) !== "checkbox" && this.attr( "type" ) !== "radio"
  6583. ) ) ) {
  6584. return orig.apply( this, arguments );
  6585. }
  6586. if ( !$.ui.checkboxradio ) {
  6587. $.error( "Checkboxradio widget missing" );
  6588. }
  6589. if ( arguments.length === 0 ) {
  6590. return this.checkboxradio( {
  6591. "icon": false
  6592. } );
  6593. }
  6594. return this.checkboxradio.apply( this, arguments );
  6595. };
  6596. } )( $.fn.button );
  6597. $.fn.buttonset = function() {
  6598. if ( !$.ui.controlgroup ) {
  6599. $.error( "Controlgroup widget missing" );
  6600. }
  6601. if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" && arguments[ 2 ] ) {
  6602. return this.controlgroup.apply( this,
  6603. [ arguments[ 0 ], "items.button", arguments[ 2 ] ] );
  6604. }
  6605. if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" ) {
  6606. return this.controlgroup.apply( this, [ arguments[ 0 ], "items.button" ] );
  6607. }
  6608. if ( typeof arguments[ 0 ] === "object" && arguments[ 0 ].items ) {
  6609. arguments[ 0 ].items = {
  6610. button: arguments[ 0 ].items
  6611. };
  6612. }
  6613. return this.controlgroup.apply( this, arguments );
  6614. };
  6615. }
  6616. var widgetsButton = $.ui.button;
  6617. // jscs:disable maximumLineLength
  6618. /* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
  6619. /*!
  6620. * jQuery UI Datepicker 1.12.1
  6621. * http://jqueryui.com
  6622. *
  6623. * Copyright jQuery Foundation and other contributors
  6624. * Released under the MIT license.
  6625. * http://jquery.org/license
  6626. */
  6627. //>>label: Datepicker
  6628. //>>group: Widgets
  6629. //>>description: Displays a calendar from an input or inline for selecting dates.
  6630. //>>docs: http://api.jqueryui.com/datepicker/
  6631. //>>demos: http://jqueryui.com/datepicker/
  6632. //>>css.structure: ../../themes/base/core.css
  6633. //>>css.structure: ../../themes/base/datepicker.css
  6634. //>>css.theme: ../../themes/base/theme.css
  6635. $.extend( $.ui, { datepicker: { version: "1.12.1" } } );
  6636. var datepicker_instActive;
  6637. function datepicker_getZindex( elem ) {
  6638. var position, value;
  6639. while ( elem.length && elem[ 0 ] !== document ) {
  6640. // Ignore z-index if position is set to a value where z-index is ignored by the browser
  6641. // This makes behavior of this function consistent across browsers
  6642. // WebKit always returns auto if the element is positioned
  6643. position = elem.css( "position" );
  6644. if ( position === "absolute" || position === "relative" || position === "fixed" ) {
  6645. // IE returns 0 when zIndex is not specified
  6646. // other browsers return a string
  6647. // we ignore the case of nested elements with an explicit value of 0
  6648. // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
  6649. value = parseInt( elem.css( "zIndex" ), 10 );
  6650. if ( !isNaN( value ) && value !== 0 ) {
  6651. return value;
  6652. }
  6653. }
  6654. elem = elem.parent();
  6655. }
  6656. return 0;
  6657. }
  6658. /* Date picker manager.
  6659. Use the singleton instance of this class, $.datepicker, to interact with the date picker.
  6660. Settings for (groups of) date pickers are maintained in an instance object,
  6661. allowing multiple different settings on the same page. */
  6662. function Datepicker() {
  6663. this._curInst = null; // The current instance in use
  6664. this._keyEvent = false; // If the last event was a key event
  6665. this._disabledInputs = []; // List of date picker inputs that have been disabled
  6666. this._datepickerShowing = false; // True if the popup picker is showing , false if not
  6667. this._inDialog = false; // True if showing within a "dialog", false if not
  6668. this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
  6669. this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
  6670. this._appendClass = "ui-datepicker-append"; // The name of the append marker class
  6671. this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
  6672. this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
  6673. this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
  6674. this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
  6675. this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
  6676. this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
  6677. this.regional = []; // Available regional settings, indexed by language code
  6678. this.regional[ "" ] = { // Default regional settings
  6679. closeText: "Done", // Display text for close link
  6680. prevText: "Prev", // Display text for previous month link
  6681. nextText: "Next", // Display text for next month link
  6682. currentText: "Today", // Display text for current month link
  6683. monthNames: [ "January","February","March","April","May","June",
  6684. "July","August","September","October","November","December" ], // Names of months for drop-down and formatting
  6685. monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], // For formatting
  6686. dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], // For formatting
  6687. dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], // For formatting
  6688. dayNamesMin: [ "Su","Mo","Tu","We","Th","Fr","Sa" ], // Column headings for days starting at Sunday
  6689. weekHeader: "Wk", // Column header for week of the year
  6690. dateFormat: "mm/dd/yy", // See format options on parseDate
  6691. firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
  6692. isRTL: false, // True if right-to-left language, false if left-to-right
  6693. showMonthAfterYear: false, // True if the year select precedes month, false for month then year
  6694. yearSuffix: "" // Additional text to append to the year in the month headers
  6695. };
  6696. this._defaults = { // Global defaults for all the date picker instances
  6697. showOn: "focus", // "focus" for popup on focus,
  6698. // "button" for trigger button, or "both" for either
  6699. showAnim: "fadeIn", // Name of jQuery animation for popup
  6700. showOptions: {}, // Options for enhanced animations
  6701. defaultDate: null, // Used when field is blank: actual date,
  6702. // +/-number for offset from today, null for today
  6703. appendText: "", // Display text following the input box, e.g. showing the format
  6704. buttonText: "...", // Text for trigger button
  6705. buttonImage: "", // URL for trigger button image
  6706. buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
  6707. hideIfNoPrevNext: false, // True to hide next/previous month links
  6708. // if not applicable, false to just disable them
  6709. navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
  6710. gotoCurrent: false, // True if today link goes back to current selection instead
  6711. changeMonth: false, // True if month can be selected directly, false if only prev/next
  6712. changeYear: false, // True if year can be selected directly, false if only prev/next
  6713. yearRange: "c-10:c+10", // Range of years to display in drop-down,
  6714. // either relative to today's year (-nn:+nn), relative to currently displayed year
  6715. // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
  6716. showOtherMonths: false, // True to show dates in other months, false to leave blank
  6717. selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
  6718. showWeek: false, // True to show week of the year, false to not show it
  6719. calculateWeek: this.iso8601Week, // How to calculate the week of the year,
  6720. // takes a Date and returns the number of the week for it
  6721. shortYearCutoff: "+10", // Short year values < this are in the current century,
  6722. // > this are in the previous century,
  6723. // string value starting with "+" for current year + value
  6724. minDate: null, // The earliest selectable date, or null for no limit
  6725. maxDate: null, // The latest selectable date, or null for no limit
  6726. duration: "fast", // Duration of display/closure
  6727. beforeShowDay: null, // Function that takes a date and returns an array with
  6728. // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
  6729. // [2] = cell title (optional), e.g. $.datepicker.noWeekends
  6730. beforeShow: null, // Function that takes an input field and
  6731. // returns a set of custom settings for the date picker
  6732. onSelect: null, // Define a callback function when a date is selected
  6733. onChangeMonthYear: null, // Define a callback function when the month or year is changed
  6734. onClose: null, // Define a callback function when the datepicker is closed
  6735. numberOfMonths: 1, // Number of months to show at a time
  6736. showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
  6737. stepMonths: 1, // Number of months to step back/forward
  6738. stepBigMonths: 12, // Number of months to step back/forward for the big links
  6739. altField: "", // Selector for an alternate field to store selected dates into
  6740. altFormat: "", // The date format to use for the alternate field
  6741. constrainInput: true, // The input is constrained by the current date format
  6742. showButtonPanel: false, // True to show button panel, false to not show it
  6743. autoSize: false, // True to size the input for the date format, false to leave as is
  6744. disabled: false // The initial disabled state
  6745. };
  6746. $.extend( this._defaults, this.regional[ "" ] );
  6747. this.regional.en = $.extend( true, {}, this.regional[ "" ] );
  6748. this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
  6749. this.dpDiv = datepicker_bindHover( $( "<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) );
  6750. }
  6751. $.extend( Datepicker.prototype, {
  6752. /* Class name added to elements to indicate already configured with a date picker. */
  6753. markerClassName: "hasDatepicker",
  6754. //Keep track of the maximum number of rows displayed (see #7043)
  6755. maxRows: 4,
  6756. // TODO rename to "widget" when switching to widget factory
  6757. _widgetDatepicker: function() {
  6758. return this.dpDiv;
  6759. },
  6760. /* Override the default settings for all instances of the date picker.
  6761. * @param settings object - the new settings to use as defaults (anonymous object)
  6762. * @return the manager object
  6763. */
  6764. setDefaults: function( settings ) {
  6765. datepicker_extendRemove( this._defaults, settings || {} );
  6766. return this;
  6767. },
  6768. /* Attach the date picker to a jQuery selection.
  6769. * @param target element - the target input field or division or span
  6770. * @param settings object - the new settings to use for this date picker instance (anonymous)
  6771. */
  6772. _attachDatepicker: function( target, settings ) {
  6773. var nodeName, inline, inst;
  6774. nodeName = target.nodeName.toLowerCase();
  6775. inline = ( nodeName === "div" || nodeName === "span" );
  6776. if ( !target.id ) {
  6777. this.uuid += 1;
  6778. target.id = "dp" + this.uuid;
  6779. }
  6780. inst = this._newInst( $( target ), inline );
  6781. inst.settings = $.extend( {}, settings || {} );
  6782. if ( nodeName === "input" ) {
  6783. this._connectDatepicker( target, inst );
  6784. } else if ( inline ) {
  6785. this._inlineDatepicker( target, inst );
  6786. }
  6787. },
  6788. /* Create a new instance object. */
  6789. _newInst: function( target, inline ) {
  6790. var id = target[ 0 ].id.replace( /([^A-Za-z0-9_\-])/g, "\\\\$1" ); // escape jQuery meta chars
  6791. return { id: id, input: target, // associated target
  6792. selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
  6793. drawMonth: 0, drawYear: 0, // month being drawn
  6794. inline: inline, // is datepicker inline or not
  6795. dpDiv: ( !inline ? this.dpDiv : // presentation div
  6796. datepicker_bindHover( $( "<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) ) ) };
  6797. },
  6798. /* Attach the date picker to an input field. */
  6799. _connectDatepicker: function( target, inst ) {
  6800. var input = $( target );
  6801. inst.append = $( [] );
  6802. inst.trigger = $( [] );
  6803. if ( input.hasClass( this.markerClassName ) ) {
  6804. return;
  6805. }
  6806. this._attachments( input, inst );
  6807. input.addClass( this.markerClassName ).on( "keydown", this._doKeyDown ).
  6808. on( "keypress", this._doKeyPress ).on( "keyup", this._doKeyUp );
  6809. this._autoSize( inst );
  6810. $.data( target, "datepicker", inst );
  6811. //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
  6812. if ( inst.settings.disabled ) {
  6813. this._disableDatepicker( target );
  6814. }
  6815. },
  6816. /* Make attachments based on settings. */
  6817. _attachments: function( input, inst ) {
  6818. var showOn, buttonText, buttonImage,
  6819. appendText = this._get( inst, "appendText" ),
  6820. isRTL = this._get( inst, "isRTL" );
  6821. if ( inst.append ) {
  6822. inst.append.remove();
  6823. }
  6824. if ( appendText ) {
  6825. inst.append = $( "<span class='" + this._appendClass + "'>" + appendText + "</span>" );
  6826. input[ isRTL ? "before" : "after" ]( inst.append );
  6827. }
  6828. input.off( "focus", this._showDatepicker );
  6829. if ( inst.trigger ) {
  6830. inst.trigger.remove();
  6831. }
  6832. showOn = this._get( inst, "showOn" );
  6833. if ( showOn === "focus" || showOn === "both" ) { // pop-up date picker when in the marked field
  6834. input.on( "focus", this._showDatepicker );
  6835. }
  6836. if ( showOn === "button" || showOn === "both" ) { // pop-up date picker when button clicked
  6837. buttonText = this._get( inst, "buttonText" );
  6838. buttonImage = this._get( inst, "buttonImage" );
  6839. inst.trigger = $( this._get( inst, "buttonImageOnly" ) ?
  6840. $( "<img/>" ).addClass( this._triggerClass ).
  6841. attr( { src: buttonImage, alt: buttonText, title: buttonText } ) :
  6842. $( "<button type='button'></button>" ).addClass( this._triggerClass ).
  6843. html( !buttonImage ? buttonText : $( "<img/>" ).attr(
  6844. { src:buttonImage, alt:buttonText, title:buttonText } ) ) );
  6845. input[ isRTL ? "before" : "after" ]( inst.trigger );
  6846. inst.trigger.on( "click", function() {
  6847. if ( $.datepicker._datepickerShowing && $.datepicker._lastInput === input[ 0 ] ) {
  6848. $.datepicker._hideDatepicker();
  6849. } else if ( $.datepicker._datepickerShowing && $.datepicker._lastInput !== input[ 0 ] ) {
  6850. $.datepicker._hideDatepicker();
  6851. $.datepicker._showDatepicker( input[ 0 ] );
  6852. } else {
  6853. $.datepicker._showDatepicker( input[ 0 ] );
  6854. }
  6855. return false;
  6856. } );
  6857. }
  6858. },
  6859. /* Apply the maximum length for the date format. */
  6860. _autoSize: function( inst ) {
  6861. if ( this._get( inst, "autoSize" ) && !inst.inline ) {
  6862. var findMax, max, maxI, i,
  6863. date = new Date( 2009, 12 - 1, 20 ), // Ensure double digits
  6864. dateFormat = this._get( inst, "dateFormat" );
  6865. if ( dateFormat.match( /[DM]/ ) ) {
  6866. findMax = function( names ) {
  6867. max = 0;
  6868. maxI = 0;
  6869. for ( i = 0; i < names.length; i++ ) {
  6870. if ( names[ i ].length > max ) {
  6871. max = names[ i ].length;
  6872. maxI = i;
  6873. }
  6874. }
  6875. return maxI;
  6876. };
  6877. date.setMonth( findMax( this._get( inst, ( dateFormat.match( /MM/ ) ?
  6878. "monthNames" : "monthNamesShort" ) ) ) );
  6879. date.setDate( findMax( this._get( inst, ( dateFormat.match( /DD/ ) ?
  6880. "dayNames" : "dayNamesShort" ) ) ) + 20 - date.getDay() );
  6881. }
  6882. inst.input.attr( "size", this._formatDate( inst, date ).length );
  6883. }
  6884. },
  6885. /* Attach an inline date picker to a div. */
  6886. _inlineDatepicker: function( target, inst ) {
  6887. var divSpan = $( target );
  6888. if ( divSpan.hasClass( this.markerClassName ) ) {
  6889. return;
  6890. }
  6891. divSpan.addClass( this.markerClassName ).append( inst.dpDiv );
  6892. $.data( target, "datepicker", inst );
  6893. this._setDate( inst, this._getDefaultDate( inst ), true );
  6894. this._updateDatepicker( inst );
  6895. this._updateAlternate( inst );
  6896. //If disabled option is true, disable the datepicker before showing it (see ticket #5665)
  6897. if ( inst.settings.disabled ) {
  6898. this._disableDatepicker( target );
  6899. }
  6900. // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
  6901. // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
  6902. inst.dpDiv.css( "display", "block" );
  6903. },
  6904. /* Pop-up the date picker in a "dialog" box.
  6905. * @param input element - ignored
  6906. * @param date string or Date - the initial date to display
  6907. * @param onSelect function - the function to call when a date is selected
  6908. * @param settings object - update the dialog date picker instance's settings (anonymous object)
  6909. * @param pos int[2] - coordinates for the dialog's position within the screen or
  6910. * event - with x/y coordinates or
  6911. * leave empty for default (screen centre)
  6912. * @return the manager object
  6913. */
  6914. _dialogDatepicker: function( input, date, onSelect, settings, pos ) {
  6915. var id, browserWidth, browserHeight, scrollX, scrollY,
  6916. inst = this._dialogInst; // internal instance
  6917. if ( !inst ) {
  6918. this.uuid += 1;
  6919. id = "dp" + this.uuid;
  6920. this._dialogInput = $( "<input type='text' id='" + id +
  6921. "' style='position: absolute; top: -100px; width: 0px;'/>" );
  6922. this._dialogInput.on( "keydown", this._doKeyDown );
  6923. $( "body" ).append( this._dialogInput );
  6924. inst = this._dialogInst = this._newInst( this._dialogInput, false );
  6925. inst.settings = {};
  6926. $.data( this._dialogInput[ 0 ], "datepicker", inst );
  6927. }
  6928. datepicker_extendRemove( inst.settings, settings || {} );
  6929. date = ( date && date.constructor === Date ? this._formatDate( inst, date ) : date );
  6930. this._dialogInput.val( date );
  6931. this._pos = ( pos ? ( pos.length ? pos : [ pos.pageX, pos.pageY ] ) : null );
  6932. if ( !this._pos ) {
  6933. browserWidth = document.documentElement.clientWidth;
  6934. browserHeight = document.documentElement.clientHeight;
  6935. scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
  6936. scrollY = document.documentElement.scrollTop || document.body.scrollTop;
  6937. this._pos = // should use actual width/height below
  6938. [ ( browserWidth / 2 ) - 100 + scrollX, ( browserHeight / 2 ) - 150 + scrollY ];
  6939. }
  6940. // Move input on screen for focus, but hidden behind dialog
  6941. this._dialogInput.css( "left", ( this._pos[ 0 ] + 20 ) + "px" ).css( "top", this._pos[ 1 ] + "px" );
  6942. inst.settings.onSelect = onSelect;
  6943. this._inDialog = true;
  6944. this.dpDiv.addClass( this._dialogClass );
  6945. this._showDatepicker( this._dialogInput[ 0 ] );
  6946. if ( $.blockUI ) {
  6947. $.blockUI( this.dpDiv );
  6948. }
  6949. $.data( this._dialogInput[ 0 ], "datepicker", inst );
  6950. return this;
  6951. },
  6952. /* Detach a datepicker from its control.
  6953. * @param target element - the target input field or division or span
  6954. */
  6955. _destroyDatepicker: function( target ) {
  6956. var nodeName,
  6957. $target = $( target ),
  6958. inst = $.data( target, "datepicker" );
  6959. if ( !$target.hasClass( this.markerClassName ) ) {
  6960. return;
  6961. }
  6962. nodeName = target.nodeName.toLowerCase();
  6963. $.removeData( target, "datepicker" );
  6964. if ( nodeName === "input" ) {
  6965. inst.append.remove();
  6966. inst.trigger.remove();
  6967. $target.removeClass( this.markerClassName ).
  6968. off( "focus", this._showDatepicker ).
  6969. off( "keydown", this._doKeyDown ).
  6970. off( "keypress", this._doKeyPress ).
  6971. off( "keyup", this._doKeyUp );
  6972. } else if ( nodeName === "div" || nodeName === "span" ) {
  6973. $target.removeClass( this.markerClassName ).empty();
  6974. }
  6975. if ( datepicker_instActive === inst ) {
  6976. datepicker_instActive = null;
  6977. }
  6978. },
  6979. /* Enable the date picker to a jQuery selection.
  6980. * @param target element - the target input field or division or span
  6981. */
  6982. _enableDatepicker: function( target ) {
  6983. var nodeName, inline,
  6984. $target = $( target ),
  6985. inst = $.data( target, "datepicker" );
  6986. if ( !$target.hasClass( this.markerClassName ) ) {
  6987. return;
  6988. }
  6989. nodeName = target.nodeName.toLowerCase();
  6990. if ( nodeName === "input" ) {
  6991. target.disabled = false;
  6992. inst.trigger.filter( "button" ).
  6993. each( function() { this.disabled = false; } ).end().
  6994. filter( "img" ).css( { opacity: "1.0", cursor: "" } );
  6995. } else if ( nodeName === "div" || nodeName === "span" ) {
  6996. inline = $target.children( "." + this._inlineClass );
  6997. inline.children().removeClass( "ui-state-disabled" );
  6998. inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ).
  6999. prop( "disabled", false );
  7000. }
  7001. this._disabledInputs = $.map( this._disabledInputs,
  7002. function( value ) { return ( value === target ? null : value ); } ); // delete entry
  7003. },
  7004. /* Disable the date picker to a jQuery selection.
  7005. * @param target element - the target input field or division or span
  7006. */
  7007. _disableDatepicker: function( target ) {
  7008. var nodeName, inline,
  7009. $target = $( target ),
  7010. inst = $.data( target, "datepicker" );
  7011. if ( !$target.hasClass( this.markerClassName ) ) {
  7012. return;
  7013. }
  7014. nodeName = target.nodeName.toLowerCase();
  7015. if ( nodeName === "input" ) {
  7016. target.disabled = true;
  7017. inst.trigger.filter( "button" ).
  7018. each( function() { this.disabled = true; } ).end().
  7019. filter( "img" ).css( { opacity: "0.5", cursor: "default" } );
  7020. } else if ( nodeName === "div" || nodeName === "span" ) {
  7021. inline = $target.children( "." + this._inlineClass );
  7022. inline.children().addClass( "ui-state-disabled" );
  7023. inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ).
  7024. prop( "disabled", true );
  7025. }
  7026. this._disabledInputs = $.map( this._disabledInputs,
  7027. function( value ) { return ( value === target ? null : value ); } ); // delete entry
  7028. this._disabledInputs[ this._disabledInputs.length ] = target;
  7029. },
  7030. /* Is the first field in a jQuery collection disabled as a datepicker?
  7031. * @param target element - the target input field or division or span
  7032. * @return boolean - true if disabled, false if enabled
  7033. */
  7034. _isDisabledDatepicker: function( target ) {
  7035. if ( !target ) {
  7036. return false;
  7037. }
  7038. for ( var i = 0; i < this._disabledInputs.length; i++ ) {
  7039. if ( this._disabledInputs[ i ] === target ) {
  7040. return true;
  7041. }
  7042. }
  7043. return false;
  7044. },
  7045. /* Retrieve the instance data for the target control.
  7046. * @param target element - the target input field or division or span
  7047. * @return object - the associated instance data
  7048. * @throws error if a jQuery problem getting data
  7049. */
  7050. _getInst: function( target ) {
  7051. try {
  7052. return $.data( target, "datepicker" );
  7053. }
  7054. catch ( err ) {
  7055. throw "Missing instance data for this datepicker";
  7056. }
  7057. },
  7058. /* Update or retrieve the settings for a date picker attached to an input field or division.
  7059. * @param target element - the target input field or division or span
  7060. * @param name object - the new settings to update or
  7061. * string - the name of the setting to change or retrieve,
  7062. * when retrieving also "all" for all instance settings or
  7063. * "defaults" for all global defaults
  7064. * @param value any - the new value for the setting
  7065. * (omit if above is an object or to retrieve a value)
  7066. */
  7067. _optionDatepicker: function( target, name, value ) {
  7068. var settings, date, minDate, maxDate,
  7069. inst = this._getInst( target );
  7070. if ( arguments.length === 2 && typeof name === "string" ) {
  7071. return ( name === "defaults" ? $.extend( {}, $.datepicker._defaults ) :
  7072. ( inst ? ( name === "all" ? $.extend( {}, inst.settings ) :
  7073. this._get( inst, name ) ) : null ) );
  7074. }
  7075. settings = name || {};
  7076. if ( typeof name === "string" ) {
  7077. settings = {};
  7078. settings[ name ] = value;
  7079. }
  7080. if ( inst ) {
  7081. if ( this._curInst === inst ) {
  7082. this._hideDatepicker();
  7083. }
  7084. date = this._getDateDatepicker( target, true );
  7085. minDate = this._getMinMaxDate( inst, "min" );
  7086. maxDate = this._getMinMaxDate( inst, "max" );
  7087. datepicker_extendRemove( inst.settings, settings );
  7088. // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
  7089. if ( minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined ) {
  7090. inst.settings.minDate = this._formatDate( inst, minDate );
  7091. }
  7092. if ( maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined ) {
  7093. inst.settings.maxDate = this._formatDate( inst, maxDate );
  7094. }
  7095. if ( "disabled" in settings ) {
  7096. if ( settings.disabled ) {
  7097. this._disableDatepicker( target );
  7098. } else {
  7099. this._enableDatepicker( target );
  7100. }
  7101. }
  7102. this._attachments( $( target ), inst );
  7103. this._autoSize( inst );
  7104. this._setDate( inst, date );
  7105. this._updateAlternate( inst );
  7106. this._updateDatepicker( inst );
  7107. }
  7108. },
  7109. // Change method deprecated
  7110. _changeDatepicker: function( target, name, value ) {
  7111. this._optionDatepicker( target, name, value );
  7112. },
  7113. /* Redraw the date picker attached to an input field or division.
  7114. * @param target element - the target input field or division or span
  7115. */
  7116. _refreshDatepicker: function( target ) {
  7117. var inst = this._getInst( target );
  7118. if ( inst ) {
  7119. this._updateDatepicker( inst );
  7120. }
  7121. },
  7122. /* Set the dates for a jQuery selection.
  7123. * @param target element - the target input field or division or span
  7124. * @param date Date - the new date
  7125. */
  7126. _setDateDatepicker: function( target, date ) {
  7127. var inst = this._getInst( target );
  7128. if ( inst ) {
  7129. this._setDate( inst, date );
  7130. this._updateDatepicker( inst );
  7131. this._updateAlternate( inst );
  7132. }
  7133. },
  7134. /* Get the date(s) for the first entry in a jQuery selection.
  7135. * @param target element - the target input field or division or span
  7136. * @param noDefault boolean - true if no default date is to be used
  7137. * @return Date - the current date
  7138. */
  7139. _getDateDatepicker: function( target, noDefault ) {
  7140. var inst = this._getInst( target );
  7141. if ( inst && !inst.inline ) {
  7142. this._setDateFromField( inst, noDefault );
  7143. }
  7144. return ( inst ? this._getDate( inst ) : null );
  7145. },
  7146. /* Handle keystrokes. */
  7147. _doKeyDown: function( event ) {
  7148. var onSelect, dateStr, sel,
  7149. inst = $.datepicker._getInst( event.target ),
  7150. handled = true,
  7151. isRTL = inst.dpDiv.is( ".ui-datepicker-rtl" );
  7152. inst._keyEvent = true;
  7153. if ( $.datepicker._datepickerShowing ) {
  7154. switch ( event.keyCode ) {
  7155. case 9: $.datepicker._hideDatepicker();
  7156. handled = false;
  7157. break; // hide on tab out
  7158. case 13: sel = $( "td." + $.datepicker._dayOverClass + ":not(." +
  7159. $.datepicker._currentClass + ")", inst.dpDiv );
  7160. if ( sel[ 0 ] ) {
  7161. $.datepicker._selectDay( event.target, inst.selectedMonth, inst.selectedYear, sel[ 0 ] );
  7162. }
  7163. onSelect = $.datepicker._get( inst, "onSelect" );
  7164. if ( onSelect ) {
  7165. dateStr = $.datepicker._formatDate( inst );
  7166. // Trigger custom callback
  7167. onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] );
  7168. } else {
  7169. $.datepicker._hideDatepicker();
  7170. }
  7171. return false; // don't submit the form
  7172. case 27: $.datepicker._hideDatepicker();
  7173. break; // hide on escape
  7174. case 33: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
  7175. -$.datepicker._get( inst, "stepBigMonths" ) :
  7176. -$.datepicker._get( inst, "stepMonths" ) ), "M" );
  7177. break; // previous month/year on page up/+ ctrl
  7178. case 34: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
  7179. +$.datepicker._get( inst, "stepBigMonths" ) :
  7180. +$.datepicker._get( inst, "stepMonths" ) ), "M" );
  7181. break; // next month/year on page down/+ ctrl
  7182. case 35: if ( event.ctrlKey || event.metaKey ) {
  7183. $.datepicker._clearDate( event.target );
  7184. }
  7185. handled = event.ctrlKey || event.metaKey;
  7186. break; // clear on ctrl or command +end
  7187. case 36: if ( event.ctrlKey || event.metaKey ) {
  7188. $.datepicker._gotoToday( event.target );
  7189. }
  7190. handled = event.ctrlKey || event.metaKey;
  7191. break; // current on ctrl or command +home
  7192. case 37: if ( event.ctrlKey || event.metaKey ) {
  7193. $.datepicker._adjustDate( event.target, ( isRTL ? +1 : -1 ), "D" );
  7194. }
  7195. handled = event.ctrlKey || event.metaKey;
  7196. // -1 day on ctrl or command +left
  7197. if ( event.originalEvent.altKey ) {
  7198. $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
  7199. -$.datepicker._get( inst, "stepBigMonths" ) :
  7200. -$.datepicker._get( inst, "stepMonths" ) ), "M" );
  7201. }
  7202. // next month/year on alt +left on Mac
  7203. break;
  7204. case 38: if ( event.ctrlKey || event.metaKey ) {
  7205. $.datepicker._adjustDate( event.target, -7, "D" );
  7206. }
  7207. handled = event.ctrlKey || event.metaKey;
  7208. break; // -1 week on ctrl or command +up
  7209. case 39: if ( event.ctrlKey || event.metaKey ) {
  7210. $.datepicker._adjustDate( event.target, ( isRTL ? -1 : +1 ), "D" );
  7211. }
  7212. handled = event.ctrlKey || event.metaKey;
  7213. // +1 day on ctrl or command +right
  7214. if ( event.originalEvent.altKey ) {
  7215. $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
  7216. +$.datepicker._get( inst, "stepBigMonths" ) :
  7217. +$.datepicker._get( inst, "stepMonths" ) ), "M" );
  7218. }
  7219. // next month/year on alt +right
  7220. break;
  7221. case 40: if ( event.ctrlKey || event.metaKey ) {
  7222. $.datepicker._adjustDate( event.target, +7, "D" );
  7223. }
  7224. handled = event.ctrlKey || event.metaKey;
  7225. break; // +1 week on ctrl or command +down
  7226. default: handled = false;
  7227. }
  7228. } else if ( event.keyCode === 36 && event.ctrlKey ) { // display the date picker on ctrl+home
  7229. $.datepicker._showDatepicker( this );
  7230. } else {
  7231. handled = false;
  7232. }
  7233. if ( handled ) {
  7234. event.preventDefault();
  7235. event.stopPropagation();
  7236. }
  7237. },
  7238. /* Filter entered characters - based on date format. */
  7239. _doKeyPress: function( event ) {
  7240. var chars, chr,
  7241. inst = $.datepicker._getInst( event.target );
  7242. if ( $.datepicker._get( inst, "constrainInput" ) ) {
  7243. chars = $.datepicker._possibleChars( $.datepicker._get( inst, "dateFormat" ) );
  7244. chr = String.fromCharCode( event.charCode == null ? event.keyCode : event.charCode );
  7245. return event.ctrlKey || event.metaKey || ( chr < " " || !chars || chars.indexOf( chr ) > -1 );
  7246. }
  7247. },
  7248. /* Synchronise manual entry and field/alternate field. */
  7249. _doKeyUp: function( event ) {
  7250. var date,
  7251. inst = $.datepicker._getInst( event.target );
  7252. if ( inst.input.val() !== inst.lastVal ) {
  7253. try {
  7254. date = $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ),
  7255. ( inst.input ? inst.input.val() : null ),
  7256. $.datepicker._getFormatConfig( inst ) );
  7257. if ( date ) { // only if valid
  7258. $.datepicker._setDateFromField( inst );
  7259. $.datepicker._updateAlternate( inst );
  7260. $.datepicker._updateDatepicker( inst );
  7261. }
  7262. }
  7263. catch ( err ) {
  7264. }
  7265. }
  7266. return true;
  7267. },
  7268. /* Pop-up the date picker for a given input field.
  7269. * If false returned from beforeShow event handler do not show.
  7270. * @param input element - the input field attached to the date picker or
  7271. * event - if triggered by focus
  7272. */
  7273. _showDatepicker: function( input ) {
  7274. input = input.target || input;
  7275. if ( input.nodeName.toLowerCase() !== "input" ) { // find from button/image trigger
  7276. input = $( "input", input.parentNode )[ 0 ];
  7277. }
  7278. if ( $.datepicker._isDisabledDatepicker( input ) || $.datepicker._lastInput === input ) { // already here
  7279. return;
  7280. }
  7281. var inst, beforeShow, beforeShowSettings, isFixed,
  7282. offset, showAnim, duration;
  7283. inst = $.datepicker._getInst( input );
  7284. if ( $.datepicker._curInst && $.datepicker._curInst !== inst ) {
  7285. $.datepicker._curInst.dpDiv.stop( true, true );
  7286. if ( inst && $.datepicker._datepickerShowing ) {
  7287. $.datepicker._hideDatepicker( $.datepicker._curInst.input[ 0 ] );
  7288. }
  7289. }
  7290. beforeShow = $.datepicker._get( inst, "beforeShow" );
  7291. beforeShowSettings = beforeShow ? beforeShow.apply( input, [ input, inst ] ) : {};
  7292. if ( beforeShowSettings === false ) {
  7293. return;
  7294. }
  7295. datepicker_extendRemove( inst.settings, beforeShowSettings );
  7296. inst.lastVal = null;
  7297. $.datepicker._lastInput = input;
  7298. $.datepicker._setDateFromField( inst );
  7299. if ( $.datepicker._inDialog ) { // hide cursor
  7300. input.value = "";
  7301. }
  7302. if ( !$.datepicker._pos ) { // position below input
  7303. $.datepicker._pos = $.datepicker._findPos( input );
  7304. $.datepicker._pos[ 1 ] += input.offsetHeight; // add the height
  7305. }
  7306. isFixed = false;
  7307. $( input ).parents().each( function() {
  7308. isFixed |= $( this ).css( "position" ) === "fixed";
  7309. return !isFixed;
  7310. } );
  7311. offset = { left: $.datepicker._pos[ 0 ], top: $.datepicker._pos[ 1 ] };
  7312. $.datepicker._pos = null;
  7313. //to avoid flashes on Firefox
  7314. inst.dpDiv.empty();
  7315. // determine sizing offscreen
  7316. inst.dpDiv.css( { position: "absolute", display: "block", top: "-1000px" } );
  7317. $.datepicker._updateDatepicker( inst );
  7318. // fix width for dynamic number of date pickers
  7319. // and adjust position before showing
  7320. offset = $.datepicker._checkOffset( inst, offset, isFixed );
  7321. inst.dpDiv.css( { position: ( $.datepicker._inDialog && $.blockUI ?
  7322. "static" : ( isFixed ? "fixed" : "absolute" ) ), display: "none",
  7323. left: offset.left + "px", top: offset.top + "px" } );
  7324. if ( !inst.inline ) {
  7325. showAnim = $.datepicker._get( inst, "showAnim" );
  7326. duration = $.datepicker._get( inst, "duration" );
  7327. inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
  7328. $.datepicker._datepickerShowing = true;
  7329. if ( $.effects && $.effects.effect[ showAnim ] ) {
  7330. inst.dpDiv.show( showAnim, $.datepicker._get( inst, "showOptions" ), duration );
  7331. } else {
  7332. inst.dpDiv[ showAnim || "show" ]( showAnim ? duration : null );
  7333. }
  7334. if ( $.datepicker._shouldFocusInput( inst ) ) {
  7335. inst.input.trigger( "focus" );
  7336. }
  7337. $.datepicker._curInst = inst;
  7338. }
  7339. },
  7340. /* Generate the date picker content. */
  7341. _updateDatepicker: function( inst ) {
  7342. this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
  7343. datepicker_instActive = inst; // for delegate hover events
  7344. inst.dpDiv.empty().append( this._generateHTML( inst ) );
  7345. this._attachHandlers( inst );
  7346. var origyearshtml,
  7347. numMonths = this._getNumberOfMonths( inst ),
  7348. cols = numMonths[ 1 ],
  7349. width = 17,
  7350. activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" );
  7351. if ( activeCell.length > 0 ) {
  7352. datepicker_handleMouseover.apply( activeCell.get( 0 ) );
  7353. }
  7354. inst.dpDiv.removeClass( "ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4" ).width( "" );
  7355. if ( cols > 1 ) {
  7356. inst.dpDiv.addClass( "ui-datepicker-multi-" + cols ).css( "width", ( width * cols ) + "em" );
  7357. }
  7358. inst.dpDiv[ ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ? "add" : "remove" ) +
  7359. "Class" ]( "ui-datepicker-multi" );
  7360. inst.dpDiv[ ( this._get( inst, "isRTL" ) ? "add" : "remove" ) +
  7361. "Class" ]( "ui-datepicker-rtl" );
  7362. if ( inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
  7363. inst.input.trigger( "focus" );
  7364. }
  7365. // Deffered render of the years select (to avoid flashes on Firefox)
  7366. if ( inst.yearshtml ) {
  7367. origyearshtml = inst.yearshtml;
  7368. setTimeout( function() {
  7369. //assure that inst.yearshtml didn't change.
  7370. if ( origyearshtml === inst.yearshtml && inst.yearshtml ) {
  7371. inst.dpDiv.find( "select.ui-datepicker-year:first" ).replaceWith( inst.yearshtml );
  7372. }
  7373. origyearshtml = inst.yearshtml = null;
  7374. }, 0 );
  7375. }
  7376. },
  7377. // #6694 - don't focus the input if it's already focused
  7378. // this breaks the change event in IE
  7379. // Support: IE and jQuery <1.9
  7380. _shouldFocusInput: function( inst ) {
  7381. return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
  7382. },
  7383. /* Check positioning to remain on screen. */
  7384. _checkOffset: function( inst, offset, isFixed ) {
  7385. var dpWidth = inst.dpDiv.outerWidth(),
  7386. dpHeight = inst.dpDiv.outerHeight(),
  7387. inputWidth = inst.input ? inst.input.outerWidth() : 0,
  7388. inputHeight = inst.input ? inst.input.outerHeight() : 0,
  7389. viewWidth = document.documentElement.clientWidth + ( isFixed ? 0 : $( document ).scrollLeft() ),
  7390. viewHeight = document.documentElement.clientHeight + ( isFixed ? 0 : $( document ).scrollTop() );
  7391. offset.left -= ( this._get( inst, "isRTL" ) ? ( dpWidth - inputWidth ) : 0 );
  7392. offset.left -= ( isFixed && offset.left === inst.input.offset().left ) ? $( document ).scrollLeft() : 0;
  7393. offset.top -= ( isFixed && offset.top === ( inst.input.offset().top + inputHeight ) ) ? $( document ).scrollTop() : 0;
  7394. // Now check if datepicker is showing outside window viewport - move to a better place if so.
  7395. offset.left -= Math.min( offset.left, ( offset.left + dpWidth > viewWidth && viewWidth > dpWidth ) ?
  7396. Math.abs( offset.left + dpWidth - viewWidth ) : 0 );
  7397. offset.top -= Math.min( offset.top, ( offset.top + dpHeight > viewHeight && viewHeight > dpHeight ) ?
  7398. Math.abs( dpHeight + inputHeight ) : 0 );
  7399. return offset;
  7400. },
  7401. /* Find an object's position on the screen. */
  7402. _findPos: function( obj ) {
  7403. var position,
  7404. inst = this._getInst( obj ),
  7405. isRTL = this._get( inst, "isRTL" );
  7406. while ( obj && ( obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden( obj ) ) ) {
  7407. obj = obj[ isRTL ? "previousSibling" : "nextSibling" ];
  7408. }
  7409. position = $( obj ).offset();
  7410. return [ position.left, position.top ];
  7411. },
  7412. /* Hide the date picker from view.
  7413. * @param input element - the input field attached to the date picker
  7414. */
  7415. _hideDatepicker: function( input ) {
  7416. var showAnim, duration, postProcess, onClose,
  7417. inst = this._curInst;
  7418. if ( !inst || ( input && inst !== $.data( input, "datepicker" ) ) ) {
  7419. return;
  7420. }
  7421. if ( this._datepickerShowing ) {
  7422. showAnim = this._get( inst, "showAnim" );
  7423. duration = this._get( inst, "duration" );
  7424. postProcess = function() {
  7425. $.datepicker._tidyDialog( inst );
  7426. };
  7427. // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
  7428. if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
  7429. inst.dpDiv.hide( showAnim, $.datepicker._get( inst, "showOptions" ), duration, postProcess );
  7430. } else {
  7431. inst.dpDiv[ ( showAnim === "slideDown" ? "slideUp" :
  7432. ( showAnim === "fadeIn" ? "fadeOut" : "hide" ) ) ]( ( showAnim ? duration : null ), postProcess );
  7433. }
  7434. if ( !showAnim ) {
  7435. postProcess();
  7436. }
  7437. this._datepickerShowing = false;
  7438. onClose = this._get( inst, "onClose" );
  7439. if ( onClose ) {
  7440. onClose.apply( ( inst.input ? inst.input[ 0 ] : null ), [ ( inst.input ? inst.input.val() : "" ), inst ] );
  7441. }
  7442. this._lastInput = null;
  7443. if ( this._inDialog ) {
  7444. this._dialogInput.css( { position: "absolute", left: "0", top: "-100px" } );
  7445. if ( $.blockUI ) {
  7446. $.unblockUI();
  7447. $( "body" ).append( this.dpDiv );
  7448. }
  7449. }
  7450. this._inDialog = false;
  7451. }
  7452. },
  7453. /* Tidy up after a dialog display. */
  7454. _tidyDialog: function( inst ) {
  7455. inst.dpDiv.removeClass( this._dialogClass ).off( ".ui-datepicker-calendar" );
  7456. },
  7457. /* Close date picker if clicked elsewhere. */
  7458. _checkExternalClick: function( event ) {
  7459. if ( !$.datepicker._curInst ) {
  7460. return;
  7461. }
  7462. var $target = $( event.target ),
  7463. inst = $.datepicker._getInst( $target[ 0 ] );
  7464. if ( ( ( $target[ 0 ].id !== $.datepicker._mainDivId &&
  7465. $target.parents( "#" + $.datepicker._mainDivId ).length === 0 &&
  7466. !$target.hasClass( $.datepicker.markerClassName ) &&
  7467. !$target.closest( "." + $.datepicker._triggerClass ).length &&
  7468. $.datepicker._datepickerShowing && !( $.datepicker._inDialog && $.blockUI ) ) ) ||
  7469. ( $target.hasClass( $.datepicker.markerClassName ) && $.datepicker._curInst !== inst ) ) {
  7470. $.datepicker._hideDatepicker();
  7471. }
  7472. },
  7473. /* Adjust one of the date sub-fields. */
  7474. _adjustDate: function( id, offset, period ) {
  7475. var target = $( id ),
  7476. inst = this._getInst( target[ 0 ] );
  7477. if ( this._isDisabledDatepicker( target[ 0 ] ) ) {
  7478. return;
  7479. }
  7480. this._adjustInstDate( inst, offset +
  7481. ( period === "M" ? this._get( inst, "showCurrentAtPos" ) : 0 ), // undo positioning
  7482. period );
  7483. this._updateDatepicker( inst );
  7484. },
  7485. /* Action for current link. */
  7486. _gotoToday: function( id ) {
  7487. var date,
  7488. target = $( id ),
  7489. inst = this._getInst( target[ 0 ] );
  7490. if ( this._get( inst, "gotoCurrent" ) && inst.currentDay ) {
  7491. inst.selectedDay = inst.currentDay;
  7492. inst.drawMonth = inst.selectedMonth = inst.currentMonth;
  7493. inst.drawYear = inst.selectedYear = inst.currentYear;
  7494. } else {
  7495. date = new Date();
  7496. inst.selectedDay = date.getDate();
  7497. inst.drawMonth = inst.selectedMonth = date.getMonth();
  7498. inst.drawYear = inst.selectedYear = date.getFullYear();
  7499. }
  7500. this._notifyChange( inst );
  7501. this._adjustDate( target );
  7502. },
  7503. /* Action for selecting a new month/year. */
  7504. _selectMonthYear: function( id, select, period ) {
  7505. var target = $( id ),
  7506. inst = this._getInst( target[ 0 ] );
  7507. inst[ "selected" + ( period === "M" ? "Month" : "Year" ) ] =
  7508. inst[ "draw" + ( period === "M" ? "Month" : "Year" ) ] =
  7509. parseInt( select.options[ select.selectedIndex ].value, 10 );
  7510. this._notifyChange( inst );
  7511. this._adjustDate( target );
  7512. },
  7513. /* Action for selecting a day. */
  7514. _selectDay: function( id, month, year, td ) {
  7515. var inst,
  7516. target = $( id );
  7517. if ( $( td ).hasClass( this._unselectableClass ) || this._isDisabledDatepicker( target[ 0 ] ) ) {
  7518. return;
  7519. }
  7520. inst = this._getInst( target[ 0 ] );
  7521. inst.selectedDay = inst.currentDay = $( "a", td ).html();
  7522. inst.selectedMonth = inst.currentMonth = month;
  7523. inst.selectedYear = inst.currentYear = year;
  7524. this._selectDate( id, this._formatDate( inst,
  7525. inst.currentDay, inst.currentMonth, inst.currentYear ) );
  7526. },
  7527. /* Erase the input field and hide the date picker. */
  7528. _clearDate: function( id ) {
  7529. var target = $( id );
  7530. this._selectDate( target, "" );
  7531. },
  7532. /* Update the input field with the selected date. */
  7533. _selectDate: function( id, dateStr ) {
  7534. var onSelect,
  7535. target = $( id ),
  7536. inst = this._getInst( target[ 0 ] );
  7537. dateStr = ( dateStr != null ? dateStr : this._formatDate( inst ) );
  7538. if ( inst.input ) {
  7539. inst.input.val( dateStr );
  7540. }
  7541. this._updateAlternate( inst );
  7542. onSelect = this._get( inst, "onSelect" );
  7543. if ( onSelect ) {
  7544. onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] ); // trigger custom callback
  7545. } else if ( inst.input ) {
  7546. inst.input.trigger( "change" ); // fire the change event
  7547. }
  7548. if ( inst.inline ) {
  7549. this._updateDatepicker( inst );
  7550. } else {
  7551. this._hideDatepicker();
  7552. this._lastInput = inst.input[ 0 ];
  7553. if ( typeof( inst.input[ 0 ] ) !== "object" ) {
  7554. inst.input.trigger( "focus" ); // restore focus
  7555. }
  7556. this._lastInput = null;
  7557. }
  7558. },
  7559. /* Update any alternate field to synchronise with the main field. */
  7560. _updateAlternate: function( inst ) {
  7561. var altFormat, date, dateStr,
  7562. altField = this._get( inst, "altField" );
  7563. if ( altField ) { // update alternate field too
  7564. altFormat = this._get( inst, "altFormat" ) || this._get( inst, "dateFormat" );
  7565. date = this._getDate( inst );
  7566. dateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) );
  7567. $( altField ).val( dateStr );
  7568. }
  7569. },
  7570. /* Set as beforeShowDay function to prevent selection of weekends.
  7571. * @param date Date - the date to customise
  7572. * @return [boolean, string] - is this date selectable?, what is its CSS class?
  7573. */
  7574. noWeekends: function( date ) {
  7575. var day = date.getDay();
  7576. return [ ( day > 0 && day < 6 ), "" ];
  7577. },
  7578. /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
  7579. * @param date Date - the date to get the week for
  7580. * @return number - the number of the week within the year that contains this date
  7581. */
  7582. iso8601Week: function( date ) {
  7583. var time,
  7584. checkDate = new Date( date.getTime() );
  7585. // Find Thursday of this week starting on Monday
  7586. checkDate.setDate( checkDate.getDate() + 4 - ( checkDate.getDay() || 7 ) );
  7587. time = checkDate.getTime();
  7588. checkDate.setMonth( 0 ); // Compare with Jan 1
  7589. checkDate.setDate( 1 );
  7590. return Math.floor( Math.round( ( time - checkDate ) / 86400000 ) / 7 ) + 1;
  7591. },
  7592. /* Parse a string value into a date object.
  7593. * See formatDate below for the possible formats.
  7594. *
  7595. * @param format string - the expected format of the date
  7596. * @param value string - the date in the above format
  7597. * @param settings Object - attributes include:
  7598. * shortYearCutoff number - the cutoff year for determining the century (optional)
  7599. * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
  7600. * dayNames string[7] - names of the days from Sunday (optional)
  7601. * monthNamesShort string[12] - abbreviated names of the months (optional)
  7602. * monthNames string[12] - names of the months (optional)
  7603. * @return Date - the extracted date value or null if value is blank
  7604. */
  7605. parseDate: function( format, value, settings ) {
  7606. if ( format == null || value == null ) {
  7607. throw "Invalid arguments";
  7608. }
  7609. value = ( typeof value === "object" ? value.toString() : value + "" );
  7610. if ( value === "" ) {
  7611. return null;
  7612. }
  7613. var iFormat, dim, extra,
  7614. iValue = 0,
  7615. shortYearCutoffTemp = ( settings ? settings.shortYearCutoff : null ) || this._defaults.shortYearCutoff,
  7616. shortYearCutoff = ( typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
  7617. new Date().getFullYear() % 100 + parseInt( shortYearCutoffTemp, 10 ) ),
  7618. dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,
  7619. dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,
  7620. monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,
  7621. monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,
  7622. year = -1,
  7623. month = -1,
  7624. day = -1,
  7625. doy = -1,
  7626. literal = false,
  7627. date,
  7628. // Check whether a format character is doubled
  7629. lookAhead = function( match ) {
  7630. var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
  7631. if ( matches ) {
  7632. iFormat++;
  7633. }
  7634. return matches;
  7635. },
  7636. // Extract a number from the string value
  7637. getNumber = function( match ) {
  7638. var isDoubled = lookAhead( match ),
  7639. size = ( match === "@" ? 14 : ( match === "!" ? 20 :
  7640. ( match === "y" && isDoubled ? 4 : ( match === "o" ? 3 : 2 ) ) ) ),
  7641. minSize = ( match === "y" ? size : 1 ),
  7642. digits = new RegExp( "^\\d{" + minSize + "," + size + "}" ),
  7643. num = value.substring( iValue ).match( digits );
  7644. if ( !num ) {
  7645. throw "Missing number at position " + iValue;
  7646. }
  7647. iValue += num[ 0 ].length;
  7648. return parseInt( num[ 0 ], 10 );
  7649. },
  7650. // Extract a name from the string value and convert to an index
  7651. getName = function( match, shortNames, longNames ) {
  7652. var index = -1,
  7653. names = $.map( lookAhead( match ) ? longNames : shortNames, function( v, k ) {
  7654. return [ [ k, v ] ];
  7655. } ).sort( function( a, b ) {
  7656. return -( a[ 1 ].length - b[ 1 ].length );
  7657. } );
  7658. $.each( names, function( i, pair ) {
  7659. var name = pair[ 1 ];
  7660. if ( value.substr( iValue, name.length ).toLowerCase() === name.toLowerCase() ) {
  7661. index = pair[ 0 ];
  7662. iValue += name.length;
  7663. return false;
  7664. }
  7665. } );
  7666. if ( index !== -1 ) {
  7667. return index + 1;
  7668. } else {
  7669. throw "Unknown name at position " + iValue;
  7670. }
  7671. },
  7672. // Confirm that a literal character matches the string value
  7673. checkLiteral = function() {
  7674. if ( value.charAt( iValue ) !== format.charAt( iFormat ) ) {
  7675. throw "Unexpected literal at position " + iValue;
  7676. }
  7677. iValue++;
  7678. };
  7679. for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
  7680. if ( literal ) {
  7681. if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
  7682. literal = false;
  7683. } else {
  7684. checkLiteral();
  7685. }
  7686. } else {
  7687. switch ( format.charAt( iFormat ) ) {
  7688. case "d":
  7689. day = getNumber( "d" );
  7690. break;
  7691. case "D":
  7692. getName( "D", dayNamesShort, dayNames );
  7693. break;
  7694. case "o":
  7695. doy = getNumber( "o" );
  7696. break;
  7697. case "m":
  7698. month = getNumber( "m" );
  7699. break;
  7700. case "M":
  7701. month = getName( "M", monthNamesShort, monthNames );
  7702. break;
  7703. case "y":
  7704. year = getNumber( "y" );
  7705. break;
  7706. case "@":
  7707. date = new Date( getNumber( "@" ) );
  7708. year = date.getFullYear();
  7709. month = date.getMonth() + 1;
  7710. day = date.getDate();
  7711. break;
  7712. case "!":
  7713. date = new Date( ( getNumber( "!" ) - this._ticksTo1970 ) / 10000 );
  7714. year = date.getFullYear();
  7715. month = date.getMonth() + 1;
  7716. day = date.getDate();
  7717. break;
  7718. case "'":
  7719. if ( lookAhead( "'" ) ) {
  7720. checkLiteral();
  7721. } else {
  7722. literal = true;
  7723. }
  7724. break;
  7725. default:
  7726. checkLiteral();
  7727. }
  7728. }
  7729. }
  7730. if ( iValue < value.length ) {
  7731. extra = value.substr( iValue );
  7732. if ( !/^\s+/.test( extra ) ) {
  7733. throw "Extra/unparsed characters found in date: " + extra;
  7734. }
  7735. }
  7736. if ( year === -1 ) {
  7737. year = new Date().getFullYear();
  7738. } else if ( year < 100 ) {
  7739. year += new Date().getFullYear() - new Date().getFullYear() % 100 +
  7740. ( year <= shortYearCutoff ? 0 : -100 );
  7741. }
  7742. if ( doy > -1 ) {
  7743. month = 1;
  7744. day = doy;
  7745. do {
  7746. dim = this._getDaysInMonth( year, month - 1 );
  7747. if ( day <= dim ) {
  7748. break;
  7749. }
  7750. month++;
  7751. day -= dim;
  7752. } while ( true );
  7753. }
  7754. date = this._daylightSavingAdjust( new Date( year, month - 1, day ) );
  7755. if ( date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day ) {
  7756. throw "Invalid date"; // E.g. 31/02/00
  7757. }
  7758. return date;
  7759. },
  7760. /* Standard date formats. */
  7761. ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
  7762. COOKIE: "D, dd M yy",
  7763. ISO_8601: "yy-mm-dd",
  7764. RFC_822: "D, d M y",
  7765. RFC_850: "DD, dd-M-y",
  7766. RFC_1036: "D, d M y",
  7767. RFC_1123: "D, d M yy",
  7768. RFC_2822: "D, d M yy",
  7769. RSS: "D, d M y", // RFC 822
  7770. TICKS: "!",
  7771. TIMESTAMP: "@",
  7772. W3C: "yy-mm-dd", // ISO 8601
  7773. _ticksTo1970: ( ( ( 1970 - 1 ) * 365 + Math.floor( 1970 / 4 ) - Math.floor( 1970 / 100 ) +
  7774. Math.floor( 1970 / 400 ) ) * 24 * 60 * 60 * 10000000 ),
  7775. /* Format a date object into a string value.
  7776. * The format can be combinations of the following:
  7777. * d - day of month (no leading zero)
  7778. * dd - day of month (two digit)
  7779. * o - day of year (no leading zeros)
  7780. * oo - day of year (three digit)
  7781. * D - day name short
  7782. * DD - day name long
  7783. * m - month of year (no leading zero)
  7784. * mm - month of year (two digit)
  7785. * M - month name short
  7786. * MM - month name long
  7787. * y - year (two digit)
  7788. * yy - year (four digit)
  7789. * @ - Unix timestamp (ms since 01/01/1970)
  7790. * ! - Windows ticks (100ns since 01/01/0001)
  7791. * "..." - literal text
  7792. * '' - single quote
  7793. *
  7794. * @param format string - the desired format of the date
  7795. * @param date Date - the date value to format
  7796. * @param settings Object - attributes include:
  7797. * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
  7798. * dayNames string[7] - names of the days from Sunday (optional)
  7799. * monthNamesShort string[12] - abbreviated names of the months (optional)
  7800. * monthNames string[12] - names of the months (optional)
  7801. * @return string - the date in the above format
  7802. */
  7803. formatDate: function( format, date, settings ) {
  7804. if ( !date ) {
  7805. return "";
  7806. }
  7807. var iFormat,
  7808. dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,
  7809. dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,
  7810. monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,
  7811. monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,
  7812. // Check whether a format character is doubled
  7813. lookAhead = function( match ) {
  7814. var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
  7815. if ( matches ) {
  7816. iFormat++;
  7817. }
  7818. return matches;
  7819. },
  7820. // Format a number, with leading zero if necessary
  7821. formatNumber = function( match, value, len ) {
  7822. var num = "" + value;
  7823. if ( lookAhead( match ) ) {
  7824. while ( num.length < len ) {
  7825. num = "0" + num;
  7826. }
  7827. }
  7828. return num;
  7829. },
  7830. // Format a name, short or long as requested
  7831. formatName = function( match, value, shortNames, longNames ) {
  7832. return ( lookAhead( match ) ? longNames[ value ] : shortNames[ value ] );
  7833. },
  7834. output = "",
  7835. literal = false;
  7836. if ( date ) {
  7837. for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
  7838. if ( literal ) {
  7839. if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
  7840. literal = false;
  7841. } else {
  7842. output += format.charAt( iFormat );
  7843. }
  7844. } else {
  7845. switch ( format.charAt( iFormat ) ) {
  7846. case "d":
  7847. output += formatNumber( "d", date.getDate(), 2 );
  7848. break;
  7849. case "D":
  7850. output += formatName( "D", date.getDay(), dayNamesShort, dayNames );
  7851. break;
  7852. case "o":
  7853. output += formatNumber( "o",
  7854. Math.round( ( new Date( date.getFullYear(), date.getMonth(), date.getDate() ).getTime() - new Date( date.getFullYear(), 0, 0 ).getTime() ) / 86400000 ), 3 );
  7855. break;
  7856. case "m":
  7857. output += formatNumber( "m", date.getMonth() + 1, 2 );
  7858. break;
  7859. case "M":
  7860. output += formatName( "M", date.getMonth(), monthNamesShort, monthNames );
  7861. break;
  7862. case "y":
  7863. output += ( lookAhead( "y" ) ? date.getFullYear() :
  7864. ( date.getFullYear() % 100 < 10 ? "0" : "" ) + date.getFullYear() % 100 );
  7865. break;
  7866. case "@":
  7867. output += date.getTime();
  7868. break;
  7869. case "!":
  7870. output += date.getTime() * 10000 + this._ticksTo1970;
  7871. break;
  7872. case "'":
  7873. if ( lookAhead( "'" ) ) {
  7874. output += "'";
  7875. } else {
  7876. literal = true;
  7877. }
  7878. break;
  7879. default:
  7880. output += format.charAt( iFormat );
  7881. }
  7882. }
  7883. }
  7884. }
  7885. return output;
  7886. },
  7887. /* Extract all possible characters from the date format. */
  7888. _possibleChars: function( format ) {
  7889. var iFormat,
  7890. chars = "",
  7891. literal = false,
  7892. // Check whether a format character is doubled
  7893. lookAhead = function( match ) {
  7894. var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
  7895. if ( matches ) {
  7896. iFormat++;
  7897. }
  7898. return matches;
  7899. };
  7900. for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
  7901. if ( literal ) {
  7902. if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
  7903. literal = false;
  7904. } else {
  7905. chars += format.charAt( iFormat );
  7906. }
  7907. } else {
  7908. switch ( format.charAt( iFormat ) ) {
  7909. case "d": case "m": case "y": case "@":
  7910. chars += "0123456789";
  7911. break;
  7912. case "D": case "M":
  7913. return null; // Accept anything
  7914. case "'":
  7915. if ( lookAhead( "'" ) ) {
  7916. chars += "'";
  7917. } else {
  7918. literal = true;
  7919. }
  7920. break;
  7921. default:
  7922. chars += format.charAt( iFormat );
  7923. }
  7924. }
  7925. }
  7926. return chars;
  7927. },
  7928. /* Get a setting value, defaulting if necessary. */
  7929. _get: function( inst, name ) {
  7930. return inst.settings[ name ] !== undefined ?
  7931. inst.settings[ name ] : this._defaults[ name ];
  7932. },
  7933. /* Parse existing date and initialise date picker. */
  7934. _setDateFromField: function( inst, noDefault ) {
  7935. if ( inst.input.val() === inst.lastVal ) {
  7936. return;
  7937. }
  7938. var dateFormat = this._get( inst, "dateFormat" ),
  7939. dates = inst.lastVal = inst.input ? inst.input.val() : null,
  7940. defaultDate = this._getDefaultDate( inst ),
  7941. date = defaultDate,
  7942. settings = this._getFormatConfig( inst );
  7943. try {
  7944. date = this.parseDate( dateFormat, dates, settings ) || defaultDate;
  7945. } catch ( event ) {
  7946. dates = ( noDefault ? "" : dates );
  7947. }
  7948. inst.selectedDay = date.getDate();
  7949. inst.drawMonth = inst.selectedMonth = date.getMonth();
  7950. inst.drawYear = inst.selectedYear = date.getFullYear();
  7951. inst.currentDay = ( dates ? date.getDate() : 0 );
  7952. inst.currentMonth = ( dates ? date.getMonth() : 0 );
  7953. inst.currentYear = ( dates ? date.getFullYear() : 0 );
  7954. this._adjustInstDate( inst );
  7955. },
  7956. /* Retrieve the default date shown on opening. */
  7957. _getDefaultDate: function( inst ) {
  7958. return this._restrictMinMax( inst,
  7959. this._determineDate( inst, this._get( inst, "defaultDate" ), new Date() ) );
  7960. },
  7961. /* A date may be specified as an exact value or a relative one. */
  7962. _determineDate: function( inst, date, defaultDate ) {
  7963. var offsetNumeric = function( offset ) {
  7964. var date = new Date();
  7965. date.setDate( date.getDate() + offset );
  7966. return date;
  7967. },
  7968. offsetString = function( offset ) {
  7969. try {
  7970. return $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ),
  7971. offset, $.datepicker._getFormatConfig( inst ) );
  7972. }
  7973. catch ( e ) {
  7974. // Ignore
  7975. }
  7976. var date = ( offset.toLowerCase().match( /^c/ ) ?
  7977. $.datepicker._getDate( inst ) : null ) || new Date(),
  7978. year = date.getFullYear(),
  7979. month = date.getMonth(),
  7980. day = date.getDate(),
  7981. pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
  7982. matches = pattern.exec( offset );
  7983. while ( matches ) {
  7984. switch ( matches[ 2 ] || "d" ) {
  7985. case "d" : case "D" :
  7986. day += parseInt( matches[ 1 ], 10 ); break;
  7987. case "w" : case "W" :
  7988. day += parseInt( matches[ 1 ], 10 ) * 7; break;
  7989. case "m" : case "M" :
  7990. month += parseInt( matches[ 1 ], 10 );
  7991. day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );
  7992. break;
  7993. case "y": case "Y" :
  7994. year += parseInt( matches[ 1 ], 10 );
  7995. day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );
  7996. break;
  7997. }
  7998. matches = pattern.exec( offset );
  7999. }
  8000. return new Date( year, month, day );
  8001. },
  8002. newDate = ( date == null || date === "" ? defaultDate : ( typeof date === "string" ? offsetString( date ) :
  8003. ( typeof date === "number" ? ( isNaN( date ) ? defaultDate : offsetNumeric( date ) ) : new Date( date.getTime() ) ) ) );
  8004. newDate = ( newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate );
  8005. if ( newDate ) {
  8006. newDate.setHours( 0 );
  8007. newDate.setMinutes( 0 );
  8008. newDate.setSeconds( 0 );
  8009. newDate.setMilliseconds( 0 );
  8010. }
  8011. return this._daylightSavingAdjust( newDate );
  8012. },
  8013. /* Handle switch to/from daylight saving.
  8014. * Hours may be non-zero on daylight saving cut-over:
  8015. * > 12 when midnight changeover, but then cannot generate
  8016. * midnight datetime, so jump to 1AM, otherwise reset.
  8017. * @param date (Date) the date to check
  8018. * @return (Date) the corrected date
  8019. */
  8020. _daylightSavingAdjust: function( date ) {
  8021. if ( !date ) {
  8022. return null;
  8023. }
  8024. date.setHours( date.getHours() > 12 ? date.getHours() + 2 : 0 );
  8025. return date;
  8026. },
  8027. /* Set the date(s) directly. */
  8028. _setDate: function( inst, date, noChange ) {
  8029. var clear = !date,
  8030. origMonth = inst.selectedMonth,
  8031. origYear = inst.selectedYear,
  8032. newDate = this._restrictMinMax( inst, this._determineDate( inst, date, new Date() ) );
  8033. inst.selectedDay = inst.currentDay = newDate.getDate();
  8034. inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
  8035. inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
  8036. if ( ( origMonth !== inst.selectedMonth || origYear !== inst.selectedYear ) && !noChange ) {
  8037. this._notifyChange( inst );
  8038. }
  8039. this._adjustInstDate( inst );
  8040. if ( inst.input ) {
  8041. inst.input.val( clear ? "" : this._formatDate( inst ) );
  8042. }
  8043. },
  8044. /* Retrieve the date(s) directly. */
  8045. _getDate: function( inst ) {
  8046. var startDate = ( !inst.currentYear || ( inst.input && inst.input.val() === "" ) ? null :
  8047. this._daylightSavingAdjust( new Date(
  8048. inst.currentYear, inst.currentMonth, inst.currentDay ) ) );
  8049. return startDate;
  8050. },
  8051. /* Attach the onxxx handlers. These are declared statically so
  8052. * they work with static code transformers like Caja.
  8053. */
  8054. _attachHandlers: function( inst ) {
  8055. var stepMonths = this._get( inst, "stepMonths" ),
  8056. id = "#" + inst.id.replace( /\\\\/g, "\\" );
  8057. inst.dpDiv.find( "[data-handler]" ).map( function() {
  8058. var handler = {
  8059. prev: function() {
  8060. $.datepicker._adjustDate( id, -stepMonths, "M" );
  8061. },
  8062. next: function() {
  8063. $.datepicker._adjustDate( id, +stepMonths, "M" );
  8064. },
  8065. hide: function() {
  8066. $.datepicker._hideDatepicker();
  8067. },
  8068. today: function() {
  8069. $.datepicker._gotoToday( id );
  8070. },
  8071. selectDay: function() {
  8072. $.datepicker._selectDay( id, +this.getAttribute( "data-month" ), +this.getAttribute( "data-year" ), this );
  8073. return false;
  8074. },
  8075. selectMonth: function() {
  8076. $.datepicker._selectMonthYear( id, this, "M" );
  8077. return false;
  8078. },
  8079. selectYear: function() {
  8080. $.datepicker._selectMonthYear( id, this, "Y" );
  8081. return false;
  8082. }
  8083. };
  8084. $( this ).on( this.getAttribute( "data-event" ), handler[ this.getAttribute( "data-handler" ) ] );
  8085. } );
  8086. },
  8087. /* Generate the HTML for the current state of the date picker. */
  8088. _generateHTML: function( inst ) {
  8089. var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
  8090. controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
  8091. monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
  8092. selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
  8093. cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
  8094. printDate, dRow, tbody, daySettings, otherMonth, unselectable,
  8095. tempDate = new Date(),
  8096. today = this._daylightSavingAdjust(
  8097. new Date( tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate() ) ), // clear time
  8098. isRTL = this._get( inst, "isRTL" ),
  8099. showButtonPanel = this._get( inst, "showButtonPanel" ),
  8100. hideIfNoPrevNext = this._get( inst, "hideIfNoPrevNext" ),
  8101. navigationAsDateFormat = this._get( inst, "navigationAsDateFormat" ),
  8102. numMonths = this._getNumberOfMonths( inst ),
  8103. showCurrentAtPos = this._get( inst, "showCurrentAtPos" ),
  8104. stepMonths = this._get( inst, "stepMonths" ),
  8105. isMultiMonth = ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ),
  8106. currentDate = this._daylightSavingAdjust( ( !inst.currentDay ? new Date( 9999, 9, 9 ) :
  8107. new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ),
  8108. minDate = this._getMinMaxDate( inst, "min" ),
  8109. maxDate = this._getMinMaxDate( inst, "max" ),
  8110. drawMonth = inst.drawMonth - showCurrentAtPos,
  8111. drawYear = inst.drawYear;
  8112. if ( drawMonth < 0 ) {
  8113. drawMonth += 12;
  8114. drawYear--;
  8115. }
  8116. if ( maxDate ) {
  8117. maxDraw = this._daylightSavingAdjust( new Date( maxDate.getFullYear(),
  8118. maxDate.getMonth() - ( numMonths[ 0 ] * numMonths[ 1 ] ) + 1, maxDate.getDate() ) );
  8119. maxDraw = ( minDate && maxDraw < minDate ? minDate : maxDraw );
  8120. while ( this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 ) ) > maxDraw ) {
  8121. drawMonth--;
  8122. if ( drawMonth < 0 ) {
  8123. drawMonth = 11;
  8124. drawYear--;
  8125. }
  8126. }
  8127. }
  8128. inst.drawMonth = drawMonth;
  8129. inst.drawYear = drawYear;
  8130. prevText = this._get( inst, "prevText" );
  8131. prevText = ( !navigationAsDateFormat ? prevText : this.formatDate( prevText,
  8132. this._daylightSavingAdjust( new Date( drawYear, drawMonth - stepMonths, 1 ) ),
  8133. this._getFormatConfig( inst ) ) );
  8134. prev = ( this._canAdjustMonth( inst, -1, drawYear, drawMonth ) ?
  8135. "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
  8136. " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w" ) + "'>" + prevText + "</span></a>" :
  8137. ( hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w" ) + "'>" + prevText + "</span></a>" ) );
  8138. nextText = this._get( inst, "nextText" );
  8139. nextText = ( !navigationAsDateFormat ? nextText : this.formatDate( nextText,
  8140. this._daylightSavingAdjust( new Date( drawYear, drawMonth + stepMonths, 1 ) ),
  8141. this._getFormatConfig( inst ) ) );
  8142. next = ( this._canAdjustMonth( inst, +1, drawYear, drawMonth ) ?
  8143. "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
  8144. " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e" ) + "'>" + nextText + "</span></a>" :
  8145. ( hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e" ) + "'>" + nextText + "</span></a>" ) );
  8146. currentText = this._get( inst, "currentText" );
  8147. gotoDate = ( this._get( inst, "gotoCurrent" ) && inst.currentDay ? currentDate : today );
  8148. currentText = ( !navigationAsDateFormat ? currentText :
  8149. this.formatDate( currentText, gotoDate, this._getFormatConfig( inst ) ) );
  8150. controls = ( !inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" +
  8151. this._get( inst, "closeText" ) + "</button>" : "" );
  8152. buttonPanel = ( showButtonPanel ) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + ( isRTL ? controls : "" ) +
  8153. ( this._isInRange( inst, gotoDate ) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" +
  8154. ">" + currentText + "</button>" : "" ) + ( isRTL ? "" : controls ) + "</div>" : "";
  8155. firstDay = parseInt( this._get( inst, "firstDay" ), 10 );
  8156. firstDay = ( isNaN( firstDay ) ? 0 : firstDay );
  8157. showWeek = this._get( inst, "showWeek" );
  8158. dayNames = this._get( inst, "dayNames" );
  8159. dayNamesMin = this._get( inst, "dayNamesMin" );
  8160. monthNames = this._get( inst, "monthNames" );
  8161. monthNamesShort = this._get( inst, "monthNamesShort" );
  8162. beforeShowDay = this._get( inst, "beforeShowDay" );
  8163. showOtherMonths = this._get( inst, "showOtherMonths" );
  8164. selectOtherMonths = this._get( inst, "selectOtherMonths" );
  8165. defaultDate = this._getDefaultDate( inst );
  8166. html = "";
  8167. for ( row = 0; row < numMonths[ 0 ]; row++ ) {
  8168. group = "";
  8169. this.maxRows = 4;
  8170. for ( col = 0; col < numMonths[ 1 ]; col++ ) {
  8171. selectedDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, inst.selectedDay ) );
  8172. cornerClass = " ui-corner-all";
  8173. calender = "";
  8174. if ( isMultiMonth ) {
  8175. calender += "<div class='ui-datepicker-group";
  8176. if ( numMonths[ 1 ] > 1 ) {
  8177. switch ( col ) {
  8178. case 0: calender += " ui-datepicker-group-first";
  8179. cornerClass = " ui-corner-" + ( isRTL ? "right" : "left" ); break;
  8180. case numMonths[ 1 ] - 1: calender += " ui-datepicker-group-last";
  8181. cornerClass = " ui-corner-" + ( isRTL ? "left" : "right" ); break;
  8182. default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
  8183. }
  8184. }
  8185. calender += "'>";
  8186. }
  8187. calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
  8188. ( /all|left/.test( cornerClass ) && row === 0 ? ( isRTL ? next : prev ) : "" ) +
  8189. ( /all|right/.test( cornerClass ) && row === 0 ? ( isRTL ? prev : next ) : "" ) +
  8190. this._generateMonthYearHeader( inst, drawMonth, drawYear, minDate, maxDate,
  8191. row > 0 || col > 0, monthNames, monthNamesShort ) + // draw month headers
  8192. "</div><table class='ui-datepicker-calendar'><thead>" +
  8193. "<tr>";
  8194. thead = ( showWeek ? "<th class='ui-datepicker-week-col'>" + this._get( inst, "weekHeader" ) + "</th>" : "" );
  8195. for ( dow = 0; dow < 7; dow++ ) { // days of the week
  8196. day = ( dow + firstDay ) % 7;
  8197. thead += "<th scope='col'" + ( ( dow + firstDay + 6 ) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "" ) + ">" +
  8198. "<span title='" + dayNames[ day ] + "'>" + dayNamesMin[ day ] + "</span></th>";
  8199. }
  8200. calender += thead + "</tr></thead><tbody>";
  8201. daysInMonth = this._getDaysInMonth( drawYear, drawMonth );
  8202. if ( drawYear === inst.selectedYear && drawMonth === inst.selectedMonth ) {
  8203. inst.selectedDay = Math.min( inst.selectedDay, daysInMonth );
  8204. }
  8205. leadDays = ( this._getFirstDayOfMonth( drawYear, drawMonth ) - firstDay + 7 ) % 7;
  8206. curRows = Math.ceil( ( leadDays + daysInMonth ) / 7 ); // calculate the number of rows to generate
  8207. numRows = ( isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows ); //If multiple months, use the higher number of rows (see #7043)
  8208. this.maxRows = numRows;
  8209. printDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 - leadDays ) );
  8210. for ( dRow = 0; dRow < numRows; dRow++ ) { // create date picker rows
  8211. calender += "<tr>";
  8212. tbody = ( !showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
  8213. this._get( inst, "calculateWeek" )( printDate ) + "</td>" );
  8214. for ( dow = 0; dow < 7; dow++ ) { // create date picker days
  8215. daySettings = ( beforeShowDay ?
  8216. beforeShowDay.apply( ( inst.input ? inst.input[ 0 ] : null ), [ printDate ] ) : [ true, "" ] );
  8217. otherMonth = ( printDate.getMonth() !== drawMonth );
  8218. unselectable = ( otherMonth && !selectOtherMonths ) || !daySettings[ 0 ] ||
  8219. ( minDate && printDate < minDate ) || ( maxDate && printDate > maxDate );
  8220. tbody += "<td class='" +
  8221. ( ( dow + firstDay + 6 ) % 7 >= 5 ? " ui-datepicker-week-end" : "" ) + // highlight weekends
  8222. ( otherMonth ? " ui-datepicker-other-month" : "" ) + // highlight days from other months
  8223. ( ( printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent ) || // user pressed key
  8224. ( defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime() ) ?
  8225. // or defaultDate is current printedDate and defaultDate is selectedDate
  8226. " " + this._dayOverClass : "" ) + // highlight selected day
  8227. ( unselectable ? " " + this._unselectableClass + " ui-state-disabled" : "" ) + // highlight unselectable days
  8228. ( otherMonth && !showOtherMonths ? "" : " " + daySettings[ 1 ] + // highlight custom dates
  8229. ( printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "" ) + // highlight selected day
  8230. ( printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "" ) ) + "'" + // highlight today (if different)
  8231. ( ( !otherMonth || showOtherMonths ) && daySettings[ 2 ] ? " title='" + daySettings[ 2 ].replace( /'/g, "&#39;" ) + "'" : "" ) + // cell title
  8232. ( unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'" ) + ">" + // actions
  8233. ( otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
  8234. ( unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
  8235. ( printDate.getTime() === today.getTime() ? " ui-state-highlight" : "" ) +
  8236. ( printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "" ) + // highlight selected day
  8237. ( otherMonth ? " ui-priority-secondary" : "" ) + // distinguish dates from other months
  8238. "' href='#'>" + printDate.getDate() + "</a>" ) ) + "</td>"; // display selectable date
  8239. printDate.setDate( printDate.getDate() + 1 );
  8240. printDate = this._daylightSavingAdjust( printDate );
  8241. }
  8242. calender += tbody + "</tr>";
  8243. }
  8244. drawMonth++;
  8245. if ( drawMonth > 11 ) {
  8246. drawMonth = 0;
  8247. drawYear++;
  8248. }
  8249. calender += "</tbody></table>" + ( isMultiMonth ? "</div>" +
  8250. ( ( numMonths[ 0 ] > 0 && col === numMonths[ 1 ] - 1 ) ? "<div class='ui-datepicker-row-break'></div>" : "" ) : "" );
  8251. group += calender;
  8252. }
  8253. html += group;
  8254. }
  8255. html += buttonPanel;
  8256. inst._keyEvent = false;
  8257. return html;
  8258. },
  8259. /* Generate the month and year header. */
  8260. _generateMonthYearHeader: function( inst, drawMonth, drawYear, minDate, maxDate,
  8261. secondary, monthNames, monthNamesShort ) {
  8262. var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
  8263. changeMonth = this._get( inst, "changeMonth" ),
  8264. changeYear = this._get( inst, "changeYear" ),
  8265. showMonthAfterYear = this._get( inst, "showMonthAfterYear" ),
  8266. html = "<div class='ui-datepicker-title'>",
  8267. monthHtml = "";
  8268. // Month selection
  8269. if ( secondary || !changeMonth ) {
  8270. monthHtml += "<span class='ui-datepicker-month'>" + monthNames[ drawMonth ] + "</span>";
  8271. } else {
  8272. inMinYear = ( minDate && minDate.getFullYear() === drawYear );
  8273. inMaxYear = ( maxDate && maxDate.getFullYear() === drawYear );
  8274. monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
  8275. for ( month = 0; month < 12; month++ ) {
  8276. if ( ( !inMinYear || month >= minDate.getMonth() ) && ( !inMaxYear || month <= maxDate.getMonth() ) ) {
  8277. monthHtml += "<option value='" + month + "'" +
  8278. ( month === drawMonth ? " selected='selected'" : "" ) +
  8279. ">" + monthNamesShort[ month ] + "</option>";
  8280. }
  8281. }
  8282. monthHtml += "</select>";
  8283. }
  8284. if ( !showMonthAfterYear ) {
  8285. html += monthHtml + ( secondary || !( changeMonth && changeYear ) ? "&#xa0;" : "" );
  8286. }
  8287. // Year selection
  8288. if ( !inst.yearshtml ) {
  8289. inst.yearshtml = "";
  8290. if ( secondary || !changeYear ) {
  8291. html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
  8292. } else {
  8293. // determine range of years to display
  8294. years = this._get( inst, "yearRange" ).split( ":" );
  8295. thisYear = new Date().getFullYear();
  8296. determineYear = function( value ) {
  8297. var year = ( value.match( /c[+\-].*/ ) ? drawYear + parseInt( value.substring( 1 ), 10 ) :
  8298. ( value.match( /[+\-].*/ ) ? thisYear + parseInt( value, 10 ) :
  8299. parseInt( value, 10 ) ) );
  8300. return ( isNaN( year ) ? thisYear : year );
  8301. };
  8302. year = determineYear( years[ 0 ] );
  8303. endYear = Math.max( year, determineYear( years[ 1 ] || "" ) );
  8304. year = ( minDate ? Math.max( year, minDate.getFullYear() ) : year );
  8305. endYear = ( maxDate ? Math.min( endYear, maxDate.getFullYear() ) : endYear );
  8306. inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
  8307. for ( ; year <= endYear; year++ ) {
  8308. inst.yearshtml += "<option value='" + year + "'" +
  8309. ( year === drawYear ? " selected='selected'" : "" ) +
  8310. ">" + year + "</option>";
  8311. }
  8312. inst.yearshtml += "</select>";
  8313. html += inst.yearshtml;
  8314. inst.yearshtml = null;
  8315. }
  8316. }
  8317. html += this._get( inst, "yearSuffix" );
  8318. if ( showMonthAfterYear ) {
  8319. html += ( secondary || !( changeMonth && changeYear ) ? "&#xa0;" : "" ) + monthHtml;
  8320. }
  8321. html += "</div>"; // Close datepicker_header
  8322. return html;
  8323. },
  8324. /* Adjust one of the date sub-fields. */
  8325. _adjustInstDate: function( inst, offset, period ) {
  8326. var year = inst.selectedYear + ( period === "Y" ? offset : 0 ),
  8327. month = inst.selectedMonth + ( period === "M" ? offset : 0 ),
  8328. day = Math.min( inst.selectedDay, this._getDaysInMonth( year, month ) ) + ( period === "D" ? offset : 0 ),
  8329. date = this._restrictMinMax( inst, this._daylightSavingAdjust( new Date( year, month, day ) ) );
  8330. inst.selectedDay = date.getDate();
  8331. inst.drawMonth = inst.selectedMonth = date.getMonth();
  8332. inst.drawYear = inst.selectedYear = date.getFullYear();
  8333. if ( period === "M" || period === "Y" ) {
  8334. this._notifyChange( inst );
  8335. }
  8336. },
  8337. /* Ensure a date is within any min/max bounds. */
  8338. _restrictMinMax: function( inst, date ) {
  8339. var minDate = this._getMinMaxDate( inst, "min" ),
  8340. maxDate = this._getMinMaxDate( inst, "max" ),
  8341. newDate = ( minDate && date < minDate ? minDate : date );
  8342. return ( maxDate && newDate > maxDate ? maxDate : newDate );
  8343. },
  8344. /* Notify change of month/year. */
  8345. _notifyChange: function( inst ) {
  8346. var onChange = this._get( inst, "onChangeMonthYear" );
  8347. if ( onChange ) {
  8348. onChange.apply( ( inst.input ? inst.input[ 0 ] : null ),
  8349. [ inst.selectedYear, inst.selectedMonth + 1, inst ] );
  8350. }
  8351. },
  8352. /* Determine the number of months to show. */
  8353. _getNumberOfMonths: function( inst ) {
  8354. var numMonths = this._get( inst, "numberOfMonths" );
  8355. return ( numMonths == null ? [ 1, 1 ] : ( typeof numMonths === "number" ? [ 1, numMonths ] : numMonths ) );
  8356. },
  8357. /* Determine the current maximum date - ensure no time components are set. */
  8358. _getMinMaxDate: function( inst, minMax ) {
  8359. return this._determineDate( inst, this._get( inst, minMax + "Date" ), null );
  8360. },
  8361. /* Find the number of days in a given month. */
  8362. _getDaysInMonth: function( year, month ) {
  8363. return 32 - this._daylightSavingAdjust( new Date( year, month, 32 ) ).getDate();
  8364. },
  8365. /* Find the day of the week of the first of a month. */
  8366. _getFirstDayOfMonth: function( year, month ) {
  8367. return new Date( year, month, 1 ).getDay();
  8368. },
  8369. /* Determines if we should allow a "next/prev" month display change. */
  8370. _canAdjustMonth: function( inst, offset, curYear, curMonth ) {
  8371. var numMonths = this._getNumberOfMonths( inst ),
  8372. date = this._daylightSavingAdjust( new Date( curYear,
  8373. curMonth + ( offset < 0 ? offset : numMonths[ 0 ] * numMonths[ 1 ] ), 1 ) );
  8374. if ( offset < 0 ) {
  8375. date.setDate( this._getDaysInMonth( date.getFullYear(), date.getMonth() ) );
  8376. }
  8377. return this._isInRange( inst, date );
  8378. },
  8379. /* Is the given date in the accepted range? */
  8380. _isInRange: function( inst, date ) {
  8381. var yearSplit, currentYear,
  8382. minDate = this._getMinMaxDate( inst, "min" ),
  8383. maxDate = this._getMinMaxDate( inst, "max" ),
  8384. minYear = null,
  8385. maxYear = null,
  8386. years = this._get( inst, "yearRange" );
  8387. if ( years ) {
  8388. yearSplit = years.split( ":" );
  8389. currentYear = new Date().getFullYear();
  8390. minYear = parseInt( yearSplit[ 0 ], 10 );
  8391. maxYear = parseInt( yearSplit[ 1 ], 10 );
  8392. if ( yearSplit[ 0 ].match( /[+\-].*/ ) ) {
  8393. minYear += currentYear;
  8394. }
  8395. if ( yearSplit[ 1 ].match( /[+\-].*/ ) ) {
  8396. maxYear += currentYear;
  8397. }
  8398. }
  8399. return ( ( !minDate || date.getTime() >= minDate.getTime() ) &&
  8400. ( !maxDate || date.getTime() <= maxDate.getTime() ) &&
  8401. ( !minYear || date.getFullYear() >= minYear ) &&
  8402. ( !maxYear || date.getFullYear() <= maxYear ) );
  8403. },
  8404. /* Provide the configuration settings for formatting/parsing. */
  8405. _getFormatConfig: function( inst ) {
  8406. var shortYearCutoff = this._get( inst, "shortYearCutoff" );
  8407. shortYearCutoff = ( typeof shortYearCutoff !== "string" ? shortYearCutoff :
  8408. new Date().getFullYear() % 100 + parseInt( shortYearCutoff, 10 ) );
  8409. return { shortYearCutoff: shortYearCutoff,
  8410. dayNamesShort: this._get( inst, "dayNamesShort" ), dayNames: this._get( inst, "dayNames" ),
  8411. monthNamesShort: this._get( inst, "monthNamesShort" ), monthNames: this._get( inst, "monthNames" ) };
  8412. },
  8413. /* Format the given date for display. */
  8414. _formatDate: function( inst, day, month, year ) {
  8415. if ( !day ) {
  8416. inst.currentDay = inst.selectedDay;
  8417. inst.currentMonth = inst.selectedMonth;
  8418. inst.currentYear = inst.selectedYear;
  8419. }
  8420. var date = ( day ? ( typeof day === "object" ? day :
  8421. this._daylightSavingAdjust( new Date( year, month, day ) ) ) :
  8422. this._daylightSavingAdjust( new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) );
  8423. return this.formatDate( this._get( inst, "dateFormat" ), date, this._getFormatConfig( inst ) );
  8424. }
  8425. } );
  8426. /*
  8427. * Bind hover events for datepicker elements.
  8428. * Done via delegate so the binding only occurs once in the lifetime of the parent div.
  8429. * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
  8430. */
  8431. function datepicker_bindHover( dpDiv ) {
  8432. var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
  8433. return dpDiv.on( "mouseout", selector, function() {
  8434. $( this ).removeClass( "ui-state-hover" );
  8435. if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) {
  8436. $( this ).removeClass( "ui-datepicker-prev-hover" );
  8437. }
  8438. if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) {
  8439. $( this ).removeClass( "ui-datepicker-next-hover" );
  8440. }
  8441. } )
  8442. .on( "mouseover", selector, datepicker_handleMouseover );
  8443. }
  8444. function datepicker_handleMouseover() {
  8445. if ( !$.datepicker._isDisabledDatepicker( datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[ 0 ] : datepicker_instActive.input[ 0 ] ) ) {
  8446. $( this ).parents( ".ui-datepicker-calendar" ).find( "a" ).removeClass( "ui-state-hover" );
  8447. $( this ).addClass( "ui-state-hover" );
  8448. if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) {
  8449. $( this ).addClass( "ui-datepicker-prev-hover" );
  8450. }
  8451. if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) {
  8452. $( this ).addClass( "ui-datepicker-next-hover" );
  8453. }
  8454. }
  8455. }
  8456. /* jQuery extend now ignores nulls! */
  8457. function datepicker_extendRemove( target, props ) {
  8458. $.extend( target, props );
  8459. for ( var name in props ) {
  8460. if ( props[ name ] == null ) {
  8461. target[ name ] = props[ name ];
  8462. }
  8463. }
  8464. return target;
  8465. }
  8466. /* Invoke the datepicker functionality.
  8467. @param options string - a command, optionally followed by additional parameters or
  8468. Object - settings for attaching new datepicker functionality
  8469. @return jQuery object */
  8470. $.fn.datepicker = function( options ) {
  8471. /* Verify an empty collection wasn't passed - Fixes #6976 */
  8472. if ( !this.length ) {
  8473. return this;
  8474. }
  8475. /* Initialise the date picker. */
  8476. if ( !$.datepicker.initialized ) {
  8477. $( document ).on( "mousedown", $.datepicker._checkExternalClick );
  8478. $.datepicker.initialized = true;
  8479. }
  8480. /* Append datepicker main container to body if not exist. */
  8481. if ( $( "#" + $.datepicker._mainDivId ).length === 0 ) {
  8482. $( "body" ).append( $.datepicker.dpDiv );
  8483. }
  8484. var otherArgs = Array.prototype.slice.call( arguments, 1 );
  8485. if ( typeof options === "string" && ( options === "isDisabled" || options === "getDate" || options === "widget" ) ) {
  8486. return $.datepicker[ "_" + options + "Datepicker" ].
  8487. apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );
  8488. }
  8489. if ( options === "option" && arguments.length === 2 && typeof arguments[ 1 ] === "string" ) {
  8490. return $.datepicker[ "_" + options + "Datepicker" ].
  8491. apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );
  8492. }
  8493. return this.each( function() {
  8494. typeof options === "string" ?
  8495. $.datepicker[ "_" + options + "Datepicker" ].
  8496. apply( $.datepicker, [ this ].concat( otherArgs ) ) :
  8497. $.datepicker._attachDatepicker( this, options );
  8498. } );
  8499. };
  8500. $.datepicker = new Datepicker(); // singleton instance
  8501. $.datepicker.initialized = false;
  8502. $.datepicker.uuid = new Date().getTime();
  8503. $.datepicker.version = "1.12.1";
  8504. var widgetsDatepicker = $.datepicker;
  8505. // This file is deprecated
  8506. var ie = $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
  8507. /*!
  8508. * jQuery UI Mouse 1.12.1
  8509. * http://jqueryui.com
  8510. *
  8511. * Copyright jQuery Foundation and other contributors
  8512. * Released under the MIT license.
  8513. * http://jquery.org/license
  8514. */
  8515. //>>label: Mouse
  8516. //>>group: Widgets
  8517. //>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
  8518. //>>docs: http://api.jqueryui.com/mouse/
  8519. var mouseHandled = false;
  8520. $( document ).on( "mouseup", function() {
  8521. mouseHandled = false;
  8522. } );
  8523. var widgetsMouse = $.widget( "ui.mouse", {
  8524. version: "1.12.1",
  8525. options: {
  8526. cancel: "input, textarea, button, select, option",
  8527. distance: 1,
  8528. delay: 0
  8529. },
  8530. _mouseInit: function() {
  8531. var that = this;
  8532. this.element
  8533. .on( "mousedown." + this.widgetName, function( event ) {
  8534. return that._mouseDown( event );
  8535. } )
  8536. .on( "click." + this.widgetName, function( event ) {
  8537. if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) {
  8538. $.removeData( event.target, that.widgetName + ".preventClickEvent" );
  8539. event.stopImmediatePropagation();
  8540. return false;
  8541. }
  8542. } );
  8543. this.started = false;
  8544. },
  8545. // TODO: make sure destroying one instance of mouse doesn't mess with
  8546. // other instances of mouse
  8547. _mouseDestroy: function() {
  8548. this.element.off( "." + this.widgetName );
  8549. if ( this._mouseMoveDelegate ) {
  8550. this.document
  8551. .off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
  8552. .off( "mouseup." + this.widgetName, this._mouseUpDelegate );
  8553. }
  8554. },
  8555. _mouseDown: function( event ) {
  8556. // don't let more than one widget handle mouseStart
  8557. if ( mouseHandled ) {
  8558. return;
  8559. }
  8560. this._mouseMoved = false;
  8561. // We may have missed mouseup (out of window)
  8562. ( this._mouseStarted && this._mouseUp( event ) );
  8563. this._mouseDownEvent = event;
  8564. var that = this,
  8565. btnIsLeft = ( event.which === 1 ),
  8566. // event.target.nodeName works around a bug in IE 8 with
  8567. // disabled inputs (#7620)
  8568. elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ?
  8569. $( event.target ).closest( this.options.cancel ).length : false );
  8570. if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
  8571. return true;
  8572. }
  8573. this.mouseDelayMet = !this.options.delay;
  8574. if ( !this.mouseDelayMet ) {
  8575. this._mouseDelayTimer = setTimeout( function() {
  8576. that.mouseDelayMet = true;
  8577. }, this.options.delay );
  8578. }
  8579. if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
  8580. this._mouseStarted = ( this._mouseStart( event ) !== false );
  8581. if ( !this._mouseStarted ) {
  8582. event.preventDefault();
  8583. return true;
  8584. }
  8585. }
  8586. // Click event may never have fired (Gecko & Opera)
  8587. if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) {
  8588. $.removeData( event.target, this.widgetName + ".preventClickEvent" );
  8589. }
  8590. // These delegates are required to keep context
  8591. this._mouseMoveDelegate = function( event ) {
  8592. return that._mouseMove( event );
  8593. };
  8594. this._mouseUpDelegate = function( event ) {
  8595. return that._mouseUp( event );
  8596. };
  8597. this.document
  8598. .on( "mousemove." + this.widgetName, this._mouseMoveDelegate )
  8599. .on( "mouseup." + this.widgetName, this._mouseUpDelegate );
  8600. event.preventDefault();
  8601. mouseHandled = true;
  8602. return true;
  8603. },
  8604. _mouseMove: function( event ) {
  8605. // Only check for mouseups outside the document if you've moved inside the document
  8606. // at least once. This prevents the firing of mouseup in the case of IE<9, which will
  8607. // fire a mousemove event if content is placed under the cursor. See #7778
  8608. // Support: IE <9
  8609. if ( this._mouseMoved ) {
  8610. // IE mouseup check - mouseup happened when mouse was out of window
  8611. if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) &&
  8612. !event.button ) {
  8613. return this._mouseUp( event );
  8614. // Iframe mouseup check - mouseup occurred in another document
  8615. } else if ( !event.which ) {
  8616. // Support: Safari <=8 - 9
  8617. // Safari sets which to 0 if you press any of the following keys
  8618. // during a drag (#14461)
  8619. if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
  8620. event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
  8621. this.ignoreMissingWhich = true;
  8622. } else if ( !this.ignoreMissingWhich ) {
  8623. return this._mouseUp( event );
  8624. }
  8625. }
  8626. }
  8627. if ( event.which || event.button ) {
  8628. this._mouseMoved = true;
  8629. }
  8630. if ( this._mouseStarted ) {
  8631. this._mouseDrag( event );
  8632. return event.preventDefault();
  8633. }
  8634. if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
  8635. this._mouseStarted =
  8636. ( this._mouseStart( this._mouseDownEvent, event ) !== false );
  8637. ( this._mouseStarted ? this._mouseDrag( event ) : this._mouseUp( event ) );
  8638. }
  8639. return !this._mouseStarted;
  8640. },
  8641. _mouseUp: function( event ) {
  8642. this.document
  8643. .off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
  8644. .off( "mouseup." + this.widgetName, this._mouseUpDelegate );
  8645. if ( this._mouseStarted ) {
  8646. this._mouseStarted = false;
  8647. if ( event.target === this._mouseDownEvent.target ) {
  8648. $.data( event.target, this.widgetName + ".preventClickEvent", true );
  8649. }
  8650. this._mouseStop( event );
  8651. }
  8652. if ( this._mouseDelayTimer ) {
  8653. clearTimeout( this._mouseDelayTimer );
  8654. delete this._mouseDelayTimer;
  8655. }
  8656. this.ignoreMissingWhich = false;
  8657. mouseHandled = false;
  8658. event.preventDefault();
  8659. },
  8660. _mouseDistanceMet: function( event ) {
  8661. return ( Math.max(
  8662. Math.abs( this._mouseDownEvent.pageX - event.pageX ),
  8663. Math.abs( this._mouseDownEvent.pageY - event.pageY )
  8664. ) >= this.options.distance
  8665. );
  8666. },
  8667. _mouseDelayMet: function( /* event */ ) {
  8668. return this.mouseDelayMet;
  8669. },
  8670. // These are placeholder methods, to be overriden by extending plugin
  8671. _mouseStart: function( /* event */ ) {},
  8672. _mouseDrag: function( /* event */ ) {},
  8673. _mouseStop: function( /* event */ ) {},
  8674. _mouseCapture: function( /* event */ ) { return true; }
  8675. } );
  8676. // $.ui.plugin is deprecated. Use $.widget() extensions instead.
  8677. var plugin = $.ui.plugin = {
  8678. add: function( module, option, set ) {
  8679. var i,
  8680. proto = $.ui[ module ].prototype;
  8681. for ( i in set ) {
  8682. proto.plugins[ i ] = proto.plugins[ i ] || [];
  8683. proto.plugins[ i ].push( [ option, set[ i ] ] );
  8684. }
  8685. },
  8686. call: function( instance, name, args, allowDisconnected ) {
  8687. var i,
  8688. set = instance.plugins[ name ];
  8689. if ( !set ) {
  8690. return;
  8691. }
  8692. if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode ||
  8693. instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
  8694. return;
  8695. }
  8696. for ( i = 0; i < set.length; i++ ) {
  8697. if ( instance.options[ set[ i ][ 0 ] ] ) {
  8698. set[ i ][ 1 ].apply( instance.element, args );
  8699. }
  8700. }
  8701. }
  8702. };
  8703. var safeBlur = $.ui.safeBlur = function( element ) {
  8704. // Support: IE9 - 10 only
  8705. // If the <body> is blurred, IE will switch windows, see #9420
  8706. if ( element && element.nodeName.toLowerCase() !== "body" ) {
  8707. $( element ).trigger( "blur" );
  8708. }
  8709. };
  8710. /*!
  8711. * jQuery UI Draggable 1.12.1
  8712. * http://jqueryui.com
  8713. *
  8714. * Copyright jQuery Foundation and other contributors
  8715. * Released under the MIT license.
  8716. * http://jquery.org/license
  8717. */
  8718. //>>label: Draggable
  8719. //>>group: Interactions
  8720. //>>description: Enables dragging functionality for any element.
  8721. //>>docs: http://api.jqueryui.com/draggable/
  8722. //>>demos: http://jqueryui.com/draggable/
  8723. //>>css.structure: ../../themes/base/draggable.css
  8724. $.widget( "ui.draggable", $.ui.mouse, {
  8725. version: "1.12.1",
  8726. widgetEventPrefix: "drag",
  8727. options: {
  8728. addClasses: true,
  8729. appendTo: "parent",
  8730. axis: false,
  8731. connectToSortable: false,
  8732. containment: false,
  8733. cursor: "auto",
  8734. cursorAt: false,
  8735. grid: false,
  8736. handle: false,
  8737. helper: "original",
  8738. iframeFix: false,
  8739. opacity: false,
  8740. refreshPositions: false,
  8741. revert: false,
  8742. revertDuration: 500,
  8743. scope: "default",
  8744. scroll: true,
  8745. scrollSensitivity: 20,
  8746. scrollSpeed: 20,
  8747. snap: false,
  8748. snapMode: "both",
  8749. snapTolerance: 20,
  8750. stack: false,
  8751. zIndex: false,
  8752. // Callbacks
  8753. drag: null,
  8754. start: null,
  8755. stop: null
  8756. },
  8757. _create: function() {
  8758. if ( this.options.helper === "original" ) {
  8759. this._setPositionRelative();
  8760. }
  8761. if ( this.options.addClasses ) {
  8762. this._addClass( "ui-draggable" );
  8763. }
  8764. this._setHandleClassName();
  8765. this._mouseInit();
  8766. },
  8767. _setOption: function( key, value ) {
  8768. this._super( key, value );
  8769. if ( key === "handle" ) {
  8770. this._removeHandleClassName();
  8771. this._setHandleClassName();
  8772. }
  8773. },
  8774. _destroy: function() {
  8775. if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
  8776. this.destroyOnClear = true;
  8777. return;
  8778. }
  8779. this._removeHandleClassName();
  8780. this._mouseDestroy();
  8781. },
  8782. _mouseCapture: function( event ) {
  8783. var o = this.options;
  8784. // Among others, prevent a drag on a resizable-handle
  8785. if ( this.helper || o.disabled ||
  8786. $( event.target ).closest( ".ui-resizable-handle" ).length > 0 ) {
  8787. return false;
  8788. }
  8789. //Quit if we're not on a valid handle
  8790. this.handle = this._getHandle( event );
  8791. if ( !this.handle ) {
  8792. return false;
  8793. }
  8794. this._blurActiveElement( event );
  8795. this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
  8796. return true;
  8797. },
  8798. _blockFrames: function( selector ) {
  8799. this.iframeBlocks = this.document.find( selector ).map( function() {
  8800. var iframe = $( this );
  8801. return $( "<div>" )
  8802. .css( "position", "absolute" )
  8803. .appendTo( iframe.parent() )
  8804. .outerWidth( iframe.outerWidth() )
  8805. .outerHeight( iframe.outerHeight() )
  8806. .offset( iframe.offset() )[ 0 ];
  8807. } );
  8808. },
  8809. _unblockFrames: function() {
  8810. if ( this.iframeBlocks ) {
  8811. this.iframeBlocks.remove();
  8812. delete this.iframeBlocks;
  8813. }
  8814. },
  8815. _blurActiveElement: function( event ) {
  8816. var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
  8817. target = $( event.target );
  8818. // Don't blur if the event occurred on an element that is within
  8819. // the currently focused element
  8820. // See #10527, #12472
  8821. if ( target.closest( activeElement ).length ) {
  8822. return;
  8823. }
  8824. // Blur any element that currently has focus, see #4261
  8825. $.ui.safeBlur( activeElement );
  8826. },
  8827. _mouseStart: function( event ) {
  8828. var o = this.options;
  8829. //Create and append the visible helper
  8830. this.helper = this._createHelper( event );
  8831. this._addClass( this.helper, "ui-draggable-dragging" );
  8832. //Cache the helper size
  8833. this._cacheHelperProportions();
  8834. //If ddmanager is used for droppables, set the global draggable
  8835. if ( $.ui.ddmanager ) {
  8836. $.ui.ddmanager.current = this;
  8837. }
  8838. /*
  8839. * - Position generation -
  8840. * This block generates everything position related - it's the core of draggables.
  8841. */
  8842. //Cache the margins of the original element
  8843. this._cacheMargins();
  8844. //Store the helper's css position
  8845. this.cssPosition = this.helper.css( "position" );
  8846. this.scrollParent = this.helper.scrollParent( true );
  8847. this.offsetParent = this.helper.offsetParent();
  8848. this.hasFixedAncestor = this.helper.parents().filter( function() {
  8849. return $( this ).css( "position" ) === "fixed";
  8850. } ).length > 0;
  8851. //The element's absolute position on the page minus margins
  8852. this.positionAbs = this.element.offset();
  8853. this._refreshOffsets( event );
  8854. //Generate the original position
  8855. this.originalPosition = this.position = this._generatePosition( event, false );
  8856. this.originalPageX = event.pageX;
  8857. this.originalPageY = event.pageY;
  8858. //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
  8859. ( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) );
  8860. //Set a containment if given in the options
  8861. this._setContainment();
  8862. //Trigger event + callbacks
  8863. if ( this._trigger( "start", event ) === false ) {
  8864. this._clear();
  8865. return false;
  8866. }
  8867. //Recache the helper size
  8868. this._cacheHelperProportions();
  8869. //Prepare the droppable offsets
  8870. if ( $.ui.ddmanager && !o.dropBehaviour ) {
  8871. $.ui.ddmanager.prepareOffsets( this, event );
  8872. }
  8873. // Execute the drag once - this causes the helper not to be visible before getting its
  8874. // correct position
  8875. this._mouseDrag( event, true );
  8876. // If the ddmanager is used for droppables, inform the manager that dragging has started
  8877. // (see #5003)
  8878. if ( $.ui.ddmanager ) {
  8879. $.ui.ddmanager.dragStart( this, event );
  8880. }
  8881. return true;
  8882. },
  8883. _refreshOffsets: function( event ) {
  8884. this.offset = {
  8885. top: this.positionAbs.top - this.margins.top,
  8886. left: this.positionAbs.left - this.margins.left,
  8887. scroll: false,
  8888. parent: this._getParentOffset(),
  8889. relative: this._getRelativeOffset()
  8890. };
  8891. this.offset.click = {
  8892. left: event.pageX - this.offset.left,
  8893. top: event.pageY - this.offset.top
  8894. };
  8895. },
  8896. _mouseDrag: function( event, noPropagation ) {
  8897. // reset any necessary cached properties (see #5009)
  8898. if ( this.hasFixedAncestor ) {
  8899. this.offset.parent = this._getParentOffset();
  8900. }
  8901. //Compute the helpers position
  8902. this.position = this._generatePosition( event, true );
  8903. this.positionAbs = this._convertPositionTo( "absolute" );
  8904. //Call plugins and callbacks and use the resulting position if something is returned
  8905. if ( !noPropagation ) {
  8906. var ui = this._uiHash();
  8907. if ( this._trigger( "drag", event, ui ) === false ) {
  8908. this._mouseUp( new $.Event( "mouseup", event ) );
  8909. return false;
  8910. }
  8911. this.position = ui.position;
  8912. }
  8913. this.helper[ 0 ].style.left = this.position.left + "px";
  8914. this.helper[ 0 ].style.top = this.position.top + "px";
  8915. if ( $.ui.ddmanager ) {
  8916. $.ui.ddmanager.drag( this, event );
  8917. }
  8918. return false;
  8919. },
  8920. _mouseStop: function( event ) {
  8921. //If we are using droppables, inform the manager about the drop
  8922. var that = this,
  8923. dropped = false;
  8924. if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
  8925. dropped = $.ui.ddmanager.drop( this, event );
  8926. }
  8927. //if a drop comes from outside (a sortable)
  8928. if ( this.dropped ) {
  8929. dropped = this.dropped;
  8930. this.dropped = false;
  8931. }
  8932. if ( ( this.options.revert === "invalid" && !dropped ) ||
  8933. ( this.options.revert === "valid" && dropped ) ||
  8934. this.options.revert === true || ( $.isFunction( this.options.revert ) &&
  8935. this.options.revert.call( this.element, dropped ) )
  8936. ) {
  8937. $( this.helper ).animate(
  8938. this.originalPosition,
  8939. parseInt( this.options.revertDuration, 10 ),
  8940. function() {
  8941. if ( that._trigger( "stop", event ) !== false ) {
  8942. that._clear();
  8943. }
  8944. }
  8945. );
  8946. } else {
  8947. if ( this._trigger( "stop", event ) !== false ) {
  8948. this._clear();
  8949. }
  8950. }
  8951. return false;
  8952. },
  8953. _mouseUp: function( event ) {
  8954. this._unblockFrames();
  8955. // If the ddmanager is used for droppables, inform the manager that dragging has stopped
  8956. // (see #5003)
  8957. if ( $.ui.ddmanager ) {
  8958. $.ui.ddmanager.dragStop( this, event );
  8959. }
  8960. // Only need to focus if the event occurred on the draggable itself, see #10527
  8961. if ( this.handleElement.is( event.target ) ) {
  8962. // The interaction is over; whether or not the click resulted in a drag,
  8963. // focus the element
  8964. this.element.trigger( "focus" );
  8965. }
  8966. return $.ui.mouse.prototype._mouseUp.call( this, event );
  8967. },
  8968. cancel: function() {
  8969. if ( this.helper.is( ".ui-draggable-dragging" ) ) {
  8970. this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) );
  8971. } else {
  8972. this._clear();
  8973. }
  8974. return this;
  8975. },
  8976. _getHandle: function( event ) {
  8977. return this.options.handle ?
  8978. !!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
  8979. true;
  8980. },
  8981. _setHandleClassName: function() {
  8982. this.handleElement = this.options.handle ?
  8983. this.element.find( this.options.handle ) : this.element;
  8984. this._addClass( this.handleElement, "ui-draggable-handle" );
  8985. },
  8986. _removeHandleClassName: function() {
  8987. this._removeClass( this.handleElement, "ui-draggable-handle" );
  8988. },
  8989. _createHelper: function( event ) {
  8990. var o = this.options,
  8991. helperIsFunction = $.isFunction( o.helper ),
  8992. helper = helperIsFunction ?
  8993. $( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
  8994. ( o.helper === "clone" ?
  8995. this.element.clone().removeAttr( "id" ) :
  8996. this.element );
  8997. if ( !helper.parents( "body" ).length ) {
  8998. helper.appendTo( ( o.appendTo === "parent" ?
  8999. this.element[ 0 ].parentNode :
  9000. o.appendTo ) );
  9001. }
  9002. // Http://bugs.jqueryui.com/ticket/9446
  9003. // a helper function can return the original element
  9004. // which wouldn't have been set to relative in _create
  9005. if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
  9006. this._setPositionRelative();
  9007. }
  9008. if ( helper[ 0 ] !== this.element[ 0 ] &&
  9009. !( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) {
  9010. helper.css( "position", "absolute" );
  9011. }
  9012. return helper;
  9013. },
  9014. _setPositionRelative: function() {
  9015. if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
  9016. this.element[ 0 ].style.position = "relative";
  9017. }
  9018. },
  9019. _adjustOffsetFromHelper: function( obj ) {
  9020. if ( typeof obj === "string" ) {
  9021. obj = obj.split( " " );
  9022. }
  9023. if ( $.isArray( obj ) ) {
  9024. obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
  9025. }
  9026. if ( "left" in obj ) {
  9027. this.offset.click.left = obj.left + this.margins.left;
  9028. }
  9029. if ( "right" in obj ) {
  9030. this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
  9031. }
  9032. if ( "top" in obj ) {
  9033. this.offset.click.top = obj.top + this.margins.top;
  9034. }
  9035. if ( "bottom" in obj ) {
  9036. this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
  9037. }
  9038. },
  9039. _isRootNode: function( element ) {
  9040. return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
  9041. },
  9042. _getParentOffset: function() {
  9043. //Get the offsetParent and cache its position
  9044. var po = this.offsetParent.offset(),
  9045. document = this.document[ 0 ];
  9046. // This is a special case where we need to modify a offset calculated on start, since the
  9047. // following happened:
  9048. // 1. The position of the helper is absolute, so it's position is calculated based on the
  9049. // next positioned parent
  9050. // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
  9051. // the document, which means that the scroll is included in the initial calculation of the
  9052. // offset of the parent, and never recalculated upon drag
  9053. if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== document &&
  9054. $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
  9055. po.left += this.scrollParent.scrollLeft();
  9056. po.top += this.scrollParent.scrollTop();
  9057. }
  9058. if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
  9059. po = { top: 0, left: 0 };
  9060. }
  9061. return {
  9062. top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
  9063. left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
  9064. };
  9065. },
  9066. _getRelativeOffset: function() {
  9067. if ( this.cssPosition !== "relative" ) {
  9068. return { top: 0, left: 0 };
  9069. }
  9070. var p = this.element.position(),
  9071. scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
  9072. return {
  9073. top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
  9074. ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
  9075. left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
  9076. ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
  9077. };
  9078. },
  9079. _cacheMargins: function() {
  9080. this.margins = {
  9081. left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0 ),
  9082. top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ),
  9083. right: ( parseInt( this.element.css( "marginRight" ), 10 ) || 0 ),
  9084. bottom: ( parseInt( this.element.css( "marginBottom" ), 10 ) || 0 )
  9085. };
  9086. },
  9087. _cacheHelperProportions: function() {
  9088. this.helperProportions = {
  9089. width: this.helper.outerWidth(),
  9090. height: this.helper.outerHeight()
  9091. };
  9092. },
  9093. _setContainment: function() {
  9094. var isUserScrollable, c, ce,
  9095. o = this.options,
  9096. document = this.document[ 0 ];
  9097. this.relativeContainer = null;
  9098. if ( !o.containment ) {
  9099. this.containment = null;
  9100. return;
  9101. }
  9102. if ( o.containment === "window" ) {
  9103. this.containment = [
  9104. $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
  9105. $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
  9106. $( window ).scrollLeft() + $( window ).width() -
  9107. this.helperProportions.width - this.margins.left,
  9108. $( window ).scrollTop() +
  9109. ( $( window ).height() || document.body.parentNode.scrollHeight ) -
  9110. this.helperProportions.height - this.margins.top
  9111. ];
  9112. return;
  9113. }
  9114. if ( o.containment === "document" ) {
  9115. this.containment = [
  9116. 0,
  9117. 0,
  9118. $( document ).width() - this.helperProportions.width - this.margins.left,
  9119. ( $( document ).height() || document.body.parentNode.scrollHeight ) -
  9120. this.helperProportions.height - this.margins.top
  9121. ];
  9122. return;
  9123. }
  9124. if ( o.containment.constructor === Array ) {
  9125. this.containment = o.containment;
  9126. return;
  9127. }
  9128. if ( o.containment === "parent" ) {
  9129. o.containment = this.helper[ 0 ].parentNode;
  9130. }
  9131. c = $( o.containment );
  9132. ce = c[ 0 ];
  9133. if ( !ce ) {
  9134. return;
  9135. }
  9136. isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
  9137. this.containment = [
  9138. ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) +
  9139. ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
  9140. ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) +
  9141. ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
  9142. ( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
  9143. ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
  9144. ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
  9145. this.helperProportions.width -
  9146. this.margins.left -
  9147. this.margins.right,
  9148. ( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
  9149. ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
  9150. ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
  9151. this.helperProportions.height -
  9152. this.margins.top -
  9153. this.margins.bottom
  9154. ];
  9155. this.relativeContainer = c;
  9156. },
  9157. _convertPositionTo: function( d, pos ) {
  9158. if ( !pos ) {
  9159. pos = this.position;
  9160. }
  9161. var mod = d === "absolute" ? 1 : -1,
  9162. scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
  9163. return {
  9164. top: (
  9165. // The absolute mouse position
  9166. pos.top +
  9167. // Only for relative positioned nodes: Relative offset from element to offset parent
  9168. this.offset.relative.top * mod +
  9169. // The offsetParent's offset without borders (offset + border)
  9170. this.offset.parent.top * mod -
  9171. ( ( this.cssPosition === "fixed" ?
  9172. -this.offset.scroll.top :
  9173. ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod )
  9174. ),
  9175. left: (
  9176. // The absolute mouse position
  9177. pos.left +
  9178. // Only for relative positioned nodes: Relative offset from element to offset parent
  9179. this.offset.relative.left * mod +
  9180. // The offsetParent's offset without borders (offset + border)
  9181. this.offset.parent.left * mod -
  9182. ( ( this.cssPosition === "fixed" ?
  9183. -this.offset.scroll.left :
  9184. ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod )
  9185. )
  9186. };
  9187. },
  9188. _generatePosition: function( event, constrainPosition ) {
  9189. var containment, co, top, left,
  9190. o = this.options,
  9191. scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
  9192. pageX = event.pageX,
  9193. pageY = event.pageY;
  9194. // Cache the scroll
  9195. if ( !scrollIsRootNode || !this.offset.scroll ) {
  9196. this.offset.scroll = {
  9197. top: this.scrollParent.scrollTop(),
  9198. left: this.scrollParent.scrollLeft()
  9199. };
  9200. }
  9201. /*
  9202. * - Position constraining -
  9203. * Constrain the position to a mix of grid, containment.
  9204. */
  9205. // If we are not dragging yet, we won't check for options
  9206. if ( constrainPosition ) {
  9207. if ( this.containment ) {
  9208. if ( this.relativeContainer ) {
  9209. co = this.relativeContainer.offset();
  9210. containment = [
  9211. this.containment[ 0 ] + co.left,
  9212. this.containment[ 1 ] + co.top,
  9213. this.containment[ 2 ] + co.left,
  9214. this.containment[ 3 ] + co.top
  9215. ];
  9216. } else {
  9217. containment = this.containment;
  9218. }
  9219. if ( event.pageX - this.offset.click.left < containment[ 0 ] ) {
  9220. pageX = containment[ 0 ] + this.offset.click.left;
  9221. }
  9222. if ( event.pageY - this.offset.click.top < containment[ 1 ] ) {
  9223. pageY = containment[ 1 ] + this.offset.click.top;
  9224. }
  9225. if ( event.pageX - this.offset.click.left > containment[ 2 ] ) {
  9226. pageX = containment[ 2 ] + this.offset.click.left;
  9227. }
  9228. if ( event.pageY - this.offset.click.top > containment[ 3 ] ) {
  9229. pageY = containment[ 3 ] + this.offset.click.top;
  9230. }
  9231. }
  9232. if ( o.grid ) {
  9233. //Check for grid elements set to 0 to prevent divide by 0 error causing invalid
  9234. // argument errors in IE (see ticket #6950)
  9235. top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY -
  9236. this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] : this.originalPageY;
  9237. pageY = containment ? ( ( top - this.offset.click.top >= containment[ 1 ] ||
  9238. top - this.offset.click.top > containment[ 3 ] ) ?
  9239. top :
  9240. ( ( top - this.offset.click.top >= containment[ 1 ] ) ?
  9241. top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top;
  9242. left = o.grid[ 0 ] ? this.originalPageX +
  9243. Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ] :
  9244. this.originalPageX;
  9245. pageX = containment ? ( ( left - this.offset.click.left >= containment[ 0 ] ||
  9246. left - this.offset.click.left > containment[ 2 ] ) ?
  9247. left :
  9248. ( ( left - this.offset.click.left >= containment[ 0 ] ) ?
  9249. left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left;
  9250. }
  9251. if ( o.axis === "y" ) {
  9252. pageX = this.originalPageX;
  9253. }
  9254. if ( o.axis === "x" ) {
  9255. pageY = this.originalPageY;
  9256. }
  9257. }
  9258. return {
  9259. top: (
  9260. // The absolute mouse position
  9261. pageY -
  9262. // Click offset (relative to the element)
  9263. this.offset.click.top -
  9264. // Only for relative positioned nodes: Relative offset from element to offset parent
  9265. this.offset.relative.top -
  9266. // The offsetParent's offset without borders (offset + border)
  9267. this.offset.parent.top +
  9268. ( this.cssPosition === "fixed" ?
  9269. -this.offset.scroll.top :
  9270. ( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
  9271. ),
  9272. left: (
  9273. // The absolute mouse position
  9274. pageX -
  9275. // Click offset (relative to the element)
  9276. this.offset.click.left -
  9277. // Only for relative positioned nodes: Relative offset from element to offset parent
  9278. this.offset.relative.left -
  9279. // The offsetParent's offset without borders (offset + border)
  9280. this.offset.parent.left +
  9281. ( this.cssPosition === "fixed" ?
  9282. -this.offset.scroll.left :
  9283. ( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
  9284. )
  9285. };
  9286. },
  9287. _clear: function() {
  9288. this._removeClass( this.helper, "ui-draggable-dragging" );
  9289. if ( this.helper[ 0 ] !== this.element[ 0 ] && !this.cancelHelperRemoval ) {
  9290. this.helper.remove();
  9291. }
  9292. this.helper = null;
  9293. this.cancelHelperRemoval = false;
  9294. if ( this.destroyOnClear ) {
  9295. this.destroy();
  9296. }
  9297. },
  9298. // From now on bulk stuff - mainly helpers
  9299. _trigger: function( type, event, ui ) {
  9300. ui = ui || this._uiHash();
  9301. $.ui.plugin.call( this, type, [ event, ui, this ], true );
  9302. // Absolute position and offset (see #6884 ) have to be recalculated after plugins
  9303. if ( /^(drag|start|stop)/.test( type ) ) {
  9304. this.positionAbs = this._convertPositionTo( "absolute" );
  9305. ui.offset = this.positionAbs;
  9306. }
  9307. return $.Widget.prototype._trigger.call( this, type, event, ui );
  9308. },
  9309. plugins: {},
  9310. _uiHash: function() {
  9311. return {
  9312. helper: this.helper,
  9313. position: this.position,
  9314. originalPosition: this.originalPosition,
  9315. offset: this.positionAbs
  9316. };
  9317. }
  9318. } );
  9319. $.ui.plugin.add( "draggable", "connectToSortable", {
  9320. start: function( event, ui, draggable ) {
  9321. var uiSortable = $.extend( {}, ui, {
  9322. item: draggable.element
  9323. } );
  9324. draggable.sortables = [];
  9325. $( draggable.options.connectToSortable ).each( function() {
  9326. var sortable = $( this ).sortable( "instance" );
  9327. if ( sortable && !sortable.options.disabled ) {
  9328. draggable.sortables.push( sortable );
  9329. // RefreshPositions is called at drag start to refresh the containerCache
  9330. // which is used in drag. This ensures it's initialized and synchronized
  9331. // with any changes that might have happened on the page since initialization.
  9332. sortable.refreshPositions();
  9333. sortable._trigger( "activate", event, uiSortable );
  9334. }
  9335. } );
  9336. },
  9337. stop: function( event, ui, draggable ) {
  9338. var uiSortable = $.extend( {}, ui, {
  9339. item: draggable.element
  9340. } );
  9341. draggable.cancelHelperRemoval = false;
  9342. $.each( draggable.sortables, function() {
  9343. var sortable = this;
  9344. if ( sortable.isOver ) {
  9345. sortable.isOver = 0;
  9346. // Allow this sortable to handle removing the helper
  9347. draggable.cancelHelperRemoval = true;
  9348. sortable.cancelHelperRemoval = false;
  9349. // Use _storedCSS To restore properties in the sortable,
  9350. // as this also handles revert (#9675) since the draggable
  9351. // may have modified them in unexpected ways (#8809)
  9352. sortable._storedCSS = {
  9353. position: sortable.placeholder.css( "position" ),
  9354. top: sortable.placeholder.css( "top" ),
  9355. left: sortable.placeholder.css( "left" )
  9356. };
  9357. sortable._mouseStop( event );
  9358. // Once drag has ended, the sortable should return to using
  9359. // its original helper, not the shared helper from draggable
  9360. sortable.options.helper = sortable.options._helper;
  9361. } else {
  9362. // Prevent this Sortable from removing the helper.
  9363. // However, don't set the draggable to remove the helper
  9364. // either as another connected Sortable may yet handle the removal.
  9365. sortable.cancelHelperRemoval = true;
  9366. sortable._trigger( "deactivate", event, uiSortable );
  9367. }
  9368. } );
  9369. },
  9370. drag: function( event, ui, draggable ) {
  9371. $.each( draggable.sortables, function() {
  9372. var innermostIntersecting = false,
  9373. sortable = this;
  9374. // Copy over variables that sortable's _intersectsWith uses
  9375. sortable.positionAbs = draggable.positionAbs;
  9376. sortable.helperProportions = draggable.helperProportions;
  9377. sortable.offset.click = draggable.offset.click;
  9378. if ( sortable._intersectsWith( sortable.containerCache ) ) {
  9379. innermostIntersecting = true;
  9380. $.each( draggable.sortables, function() {
  9381. // Copy over variables that sortable's _intersectsWith uses
  9382. this.positionAbs = draggable.positionAbs;
  9383. this.helperProportions = draggable.helperProportions;
  9384. this.offset.click = draggable.offset.click;
  9385. if ( this !== sortable &&
  9386. this._intersectsWith( this.containerCache ) &&
  9387. $.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
  9388. innermostIntersecting = false;
  9389. }
  9390. return innermostIntersecting;
  9391. } );
  9392. }
  9393. if ( innermostIntersecting ) {
  9394. // If it intersects, we use a little isOver variable and set it once,
  9395. // so that the move-in stuff gets fired only once.
  9396. if ( !sortable.isOver ) {
  9397. sortable.isOver = 1;
  9398. // Store draggable's parent in case we need to reappend to it later.
  9399. draggable._parent = ui.helper.parent();
  9400. sortable.currentItem = ui.helper
  9401. .appendTo( sortable.element )
  9402. .data( "ui-sortable-item", true );
  9403. // Store helper option to later restore it
  9404. sortable.options._helper = sortable.options.helper;
  9405. sortable.options.helper = function() {
  9406. return ui.helper[ 0 ];
  9407. };
  9408. // Fire the start events of the sortable with our passed browser event,
  9409. // and our own helper (so it doesn't create a new one)
  9410. event.target = sortable.currentItem[ 0 ];
  9411. sortable._mouseCapture( event, true );
  9412. sortable._mouseStart( event, true, true );
  9413. // Because the browser event is way off the new appended portlet,
  9414. // modify necessary variables to reflect the changes
  9415. sortable.offset.click.top = draggable.offset.click.top;
  9416. sortable.offset.click.left = draggable.offset.click.left;
  9417. sortable.offset.parent.left -= draggable.offset.parent.left -
  9418. sortable.offset.parent.left;
  9419. sortable.offset.parent.top -= draggable.offset.parent.top -
  9420. sortable.offset.parent.top;
  9421. draggable._trigger( "toSortable", event );
  9422. // Inform draggable that the helper is in a valid drop zone,
  9423. // used solely in the revert option to handle "valid/invalid".
  9424. draggable.dropped = sortable.element;
  9425. // Need to refreshPositions of all sortables in the case that
  9426. // adding to one sortable changes the location of the other sortables (#9675)
  9427. $.each( draggable.sortables, function() {
  9428. this.refreshPositions();
  9429. } );
  9430. // Hack so receive/update callbacks work (mostly)
  9431. draggable.currentItem = draggable.element;
  9432. sortable.fromOutside = draggable;
  9433. }
  9434. if ( sortable.currentItem ) {
  9435. sortable._mouseDrag( event );
  9436. // Copy the sortable's position because the draggable's can potentially reflect
  9437. // a relative position, while sortable is always absolute, which the dragged
  9438. // element has now become. (#8809)
  9439. ui.position = sortable.position;
  9440. }
  9441. } else {
  9442. // If it doesn't intersect with the sortable, and it intersected before,
  9443. // we fake the drag stop of the sortable, but make sure it doesn't remove
  9444. // the helper by using cancelHelperRemoval.
  9445. if ( sortable.isOver ) {
  9446. sortable.isOver = 0;
  9447. sortable.cancelHelperRemoval = true;
  9448. // Calling sortable's mouseStop would trigger a revert,
  9449. // so revert must be temporarily false until after mouseStop is called.
  9450. sortable.options._revert = sortable.options.revert;
  9451. sortable.options.revert = false;
  9452. sortable._trigger( "out", event, sortable._uiHash( sortable ) );
  9453. sortable._mouseStop( event, true );
  9454. // Restore sortable behaviors that were modfied
  9455. // when the draggable entered the sortable area (#9481)
  9456. sortable.options.revert = sortable.options._revert;
  9457. sortable.options.helper = sortable.options._helper;
  9458. if ( sortable.placeholder ) {
  9459. sortable.placeholder.remove();
  9460. }
  9461. // Restore and recalculate the draggable's offset considering the sortable
  9462. // may have modified them in unexpected ways. (#8809, #10669)
  9463. ui.helper.appendTo( draggable._parent );
  9464. draggable._refreshOffsets( event );
  9465. ui.position = draggable._generatePosition( event, true );
  9466. draggable._trigger( "fromSortable", event );
  9467. // Inform draggable that the helper is no longer in a valid drop zone
  9468. draggable.dropped = false;
  9469. // Need to refreshPositions of all sortables just in case removing
  9470. // from one sortable changes the location of other sortables (#9675)
  9471. $.each( draggable.sortables, function() {
  9472. this.refreshPositions();
  9473. } );
  9474. }
  9475. }
  9476. } );
  9477. }
  9478. } );
  9479. $.ui.plugin.add( "draggable", "cursor", {
  9480. start: function( event, ui, instance ) {
  9481. var t = $( "body" ),
  9482. o = instance.options;
  9483. if ( t.css( "cursor" ) ) {
  9484. o._cursor = t.css( "cursor" );
  9485. }
  9486. t.css( "cursor", o.cursor );
  9487. },
  9488. stop: function( event, ui, instance ) {
  9489. var o = instance.options;
  9490. if ( o._cursor ) {
  9491. $( "body" ).css( "cursor", o._cursor );
  9492. }
  9493. }
  9494. } );
  9495. $.ui.plugin.add( "draggable", "opacity", {
  9496. start: function( event, ui, instance ) {
  9497. var t = $( ui.helper ),
  9498. o = instance.options;
  9499. if ( t.css( "opacity" ) ) {
  9500. o._opacity = t.css( "opacity" );
  9501. }
  9502. t.css( "opacity", o.opacity );
  9503. },
  9504. stop: function( event, ui, instance ) {
  9505. var o = instance.options;
  9506. if ( o._opacity ) {
  9507. $( ui.helper ).css( "opacity", o._opacity );
  9508. }
  9509. }
  9510. } );
  9511. $.ui.plugin.add( "draggable", "scroll", {
  9512. start: function( event, ui, i ) {
  9513. if ( !i.scrollParentNotHidden ) {
  9514. i.scrollParentNotHidden = i.helper.scrollParent( false );
  9515. }
  9516. if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] &&
  9517. i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
  9518. i.overflowOffset = i.scrollParentNotHidden.offset();
  9519. }
  9520. },
  9521. drag: function( event, ui, i ) {
  9522. var o = i.options,
  9523. scrolled = false,
  9524. scrollParent = i.scrollParentNotHidden[ 0 ],
  9525. document = i.document[ 0 ];
  9526. if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
  9527. if ( !o.axis || o.axis !== "x" ) {
  9528. if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY <
  9529. o.scrollSensitivity ) {
  9530. scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
  9531. } else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
  9532. scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
  9533. }
  9534. }
  9535. if ( !o.axis || o.axis !== "y" ) {
  9536. if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX <
  9537. o.scrollSensitivity ) {
  9538. scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
  9539. } else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
  9540. scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
  9541. }
  9542. }
  9543. } else {
  9544. if ( !o.axis || o.axis !== "x" ) {
  9545. if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity ) {
  9546. scrolled = $( document ).scrollTop( $( document ).scrollTop() - o.scrollSpeed );
  9547. } else if ( $( window ).height() - ( event.pageY - $( document ).scrollTop() ) <
  9548. o.scrollSensitivity ) {
  9549. scrolled = $( document ).scrollTop( $( document ).scrollTop() + o.scrollSpeed );
  9550. }
  9551. }
  9552. if ( !o.axis || o.axis !== "y" ) {
  9553. if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity ) {
  9554. scrolled = $( document ).scrollLeft(
  9555. $( document ).scrollLeft() - o.scrollSpeed
  9556. );
  9557. } else if ( $( window ).width() - ( event.pageX - $( document ).scrollLeft() ) <
  9558. o.scrollSensitivity ) {
  9559. scrolled = $( document ).scrollLeft(
  9560. $( document ).scrollLeft() + o.scrollSpeed
  9561. );
  9562. }
  9563. }
  9564. }
  9565. if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) {
  9566. $.ui.ddmanager.prepareOffsets( i, event );
  9567. }
  9568. }
  9569. } );
  9570. $.ui.plugin.add( "draggable", "snap", {
  9571. start: function( event, ui, i ) {
  9572. var o = i.options;
  9573. i.snapElements = [];
  9574. $( o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap )
  9575. .each( function() {
  9576. var $t = $( this ),
  9577. $o = $t.offset();
  9578. if ( this !== i.element[ 0 ] ) {
  9579. i.snapElements.push( {
  9580. item: this,
  9581. width: $t.outerWidth(), height: $t.outerHeight(),
  9582. top: $o.top, left: $o.left
  9583. } );
  9584. }
  9585. } );
  9586. },
  9587. drag: function( event, ui, inst ) {
  9588. var ts, bs, ls, rs, l, r, t, b, i, first,
  9589. o = inst.options,
  9590. d = o.snapTolerance,
  9591. x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
  9592. y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
  9593. for ( i = inst.snapElements.length - 1; i >= 0; i-- ) {
  9594. l = inst.snapElements[ i ].left - inst.margins.left;
  9595. r = l + inst.snapElements[ i ].width;
  9596. t = inst.snapElements[ i ].top - inst.margins.top;
  9597. b = t + inst.snapElements[ i ].height;
  9598. if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d ||
  9599. !$.contains( inst.snapElements[ i ].item.ownerDocument,
  9600. inst.snapElements[ i ].item ) ) {
  9601. if ( inst.snapElements[ i ].snapping ) {
  9602. ( inst.options.snap.release &&
  9603. inst.options.snap.release.call(
  9604. inst.element,
  9605. event,
  9606. $.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } )
  9607. ) );
  9608. }
  9609. inst.snapElements[ i ].snapping = false;
  9610. continue;
  9611. }
  9612. if ( o.snapMode !== "inner" ) {
  9613. ts = Math.abs( t - y2 ) <= d;
  9614. bs = Math.abs( b - y1 ) <= d;
  9615. ls = Math.abs( l - x2 ) <= d;
  9616. rs = Math.abs( r - x1 ) <= d;
  9617. if ( ts ) {
  9618. ui.position.top = inst._convertPositionTo( "relative", {
  9619. top: t - inst.helperProportions.height,
  9620. left: 0
  9621. } ).top;
  9622. }
  9623. if ( bs ) {
  9624. ui.position.top = inst._convertPositionTo( "relative", {
  9625. top: b,
  9626. left: 0
  9627. } ).top;
  9628. }
  9629. if ( ls ) {
  9630. ui.position.left = inst._convertPositionTo( "relative", {
  9631. top: 0,
  9632. left: l - inst.helperProportions.width
  9633. } ).left;
  9634. }
  9635. if ( rs ) {
  9636. ui.position.left = inst._convertPositionTo( "relative", {
  9637. top: 0,
  9638. left: r
  9639. } ).left;
  9640. }
  9641. }
  9642. first = ( ts || bs || ls || rs );
  9643. if ( o.snapMode !== "outer" ) {
  9644. ts = Math.abs( t - y1 ) <= d;
  9645. bs = Math.abs( b - y2 ) <= d;
  9646. ls = Math.abs( l - x1 ) <= d;
  9647. rs = Math.abs( r - x2 ) <= d;
  9648. if ( ts ) {
  9649. ui.position.top = inst._convertPositionTo( "relative", {
  9650. top: t,
  9651. left: 0
  9652. } ).top;
  9653. }
  9654. if ( bs ) {
  9655. ui.position.top = inst._convertPositionTo( "relative", {
  9656. top: b - inst.helperProportions.height,
  9657. left: 0
  9658. } ).top;
  9659. }
  9660. if ( ls ) {
  9661. ui.position.left = inst._convertPositionTo( "relative", {
  9662. top: 0,
  9663. left: l
  9664. } ).left;
  9665. }
  9666. if ( rs ) {
  9667. ui.position.left = inst._convertPositionTo( "relative", {
  9668. top: 0,
  9669. left: r - inst.helperProportions.width
  9670. } ).left;
  9671. }
  9672. }
  9673. if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) {
  9674. ( inst.options.snap.snap &&
  9675. inst.options.snap.snap.call(
  9676. inst.element,
  9677. event,
  9678. $.extend( inst._uiHash(), {
  9679. snapItem: inst.snapElements[ i ].item
  9680. } ) ) );
  9681. }
  9682. inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first );
  9683. }
  9684. }
  9685. } );
  9686. $.ui.plugin.add( "draggable", "stack", {
  9687. start: function( event, ui, instance ) {
  9688. var min,
  9689. o = instance.options,
  9690. group = $.makeArray( $( o.stack ) ).sort( function( a, b ) {
  9691. return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) -
  9692. ( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 );
  9693. } );
  9694. if ( !group.length ) { return; }
  9695. min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0;
  9696. $( group ).each( function( i ) {
  9697. $( this ).css( "zIndex", min + i );
  9698. } );
  9699. this.css( "zIndex", ( min + group.length ) );
  9700. }
  9701. } );
  9702. $.ui.plugin.add( "draggable", "zIndex", {
  9703. start: function( event, ui, instance ) {
  9704. var t = $( ui.helper ),
  9705. o = instance.options;
  9706. if ( t.css( "zIndex" ) ) {
  9707. o._zIndex = t.css( "zIndex" );
  9708. }
  9709. t.css( "zIndex", o.zIndex );
  9710. },
  9711. stop: function( event, ui, instance ) {
  9712. var o = instance.options;
  9713. if ( o._zIndex ) {
  9714. $( ui.helper ).css( "zIndex", o._zIndex );
  9715. }
  9716. }
  9717. } );
  9718. var widgetsDraggable = $.ui.draggable;
  9719. /*!
  9720. * jQuery UI Resizable 1.12.1
  9721. * http://jqueryui.com
  9722. *
  9723. * Copyright jQuery Foundation and other contributors
  9724. * Released under the MIT license.
  9725. * http://jquery.org/license
  9726. */
  9727. //>>label: Resizable
  9728. //>>group: Interactions
  9729. //>>description: Enables resize functionality for any element.
  9730. //>>docs: http://api.jqueryui.com/resizable/
  9731. //>>demos: http://jqueryui.com/resizable/
  9732. //>>css.structure: ../../themes/base/core.css
  9733. //>>css.structure: ../../themes/base/resizable.css
  9734. //>>css.theme: ../../themes/base/theme.css
  9735. $.widget( "ui.resizable", $.ui.mouse, {
  9736. version: "1.12.1",
  9737. widgetEventPrefix: "resize",
  9738. options: {
  9739. alsoResize: false,
  9740. animate: false,
  9741. animateDuration: "slow",
  9742. animateEasing: "swing",
  9743. aspectRatio: false,
  9744. autoHide: false,
  9745. classes: {
  9746. "ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se"
  9747. },
  9748. containment: false,
  9749. ghost: false,
  9750. grid: false,
  9751. handles: "e,s,se",
  9752. helper: false,
  9753. maxHeight: null,
  9754. maxWidth: null,
  9755. minHeight: 10,
  9756. minWidth: 10,
  9757. // See #7960
  9758. zIndex: 90,
  9759. // Callbacks
  9760. resize: null,
  9761. start: null,
  9762. stop: null
  9763. },
  9764. _num: function( value ) {
  9765. return parseFloat( value ) || 0;
  9766. },
  9767. _isNumber: function( value ) {
  9768. return !isNaN( parseFloat( value ) );
  9769. },
  9770. _hasScroll: function( el, a ) {
  9771. if ( $( el ).css( "overflow" ) === "hidden" ) {
  9772. return false;
  9773. }
  9774. var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
  9775. has = false;
  9776. if ( el[ scroll ] > 0 ) {
  9777. return true;
  9778. }
  9779. // TODO: determine which cases actually cause this to happen
  9780. // if the element doesn't have the scroll set, see if it's possible to
  9781. // set the scroll
  9782. el[ scroll ] = 1;
  9783. has = ( el[ scroll ] > 0 );
  9784. el[ scroll ] = 0;
  9785. return has;
  9786. },
  9787. _create: function() {
  9788. var margins,
  9789. o = this.options,
  9790. that = this;
  9791. this._addClass( "ui-resizable" );
  9792. $.extend( this, {
  9793. _aspectRatio: !!( o.aspectRatio ),
  9794. aspectRatio: o.aspectRatio,
  9795. originalElement: this.element,
  9796. _proportionallyResizeElements: [],
  9797. _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
  9798. } );
  9799. // Wrap the element if it cannot hold child nodes
  9800. if ( this.element[ 0 ].nodeName.match( /^(canvas|textarea|input|select|button|img)$/i ) ) {
  9801. this.element.wrap(
  9802. $( "<div class='ui-wrapper' style='overflow: hidden;'></div>" ).css( {
  9803. position: this.element.css( "position" ),
  9804. width: this.element.outerWidth(),
  9805. height: this.element.outerHeight(),
  9806. top: this.element.css( "top" ),
  9807. left: this.element.css( "left" )
  9808. } )
  9809. );
  9810. this.element = this.element.parent().data(
  9811. "ui-resizable", this.element.resizable( "instance" )
  9812. );
  9813. this.elementIsWrapper = true;
  9814. margins = {
  9815. marginTop: this.originalElement.css( "marginTop" ),
  9816. marginRight: this.originalElement.css( "marginRight" ),
  9817. marginBottom: this.originalElement.css( "marginBottom" ),
  9818. marginLeft: this.originalElement.css( "marginLeft" )
  9819. };
  9820. this.element.css( margins );
  9821. this.originalElement.css( "margin", 0 );
  9822. // support: Safari
  9823. // Prevent Safari textarea resize
  9824. this.originalResizeStyle = this.originalElement.css( "resize" );
  9825. this.originalElement.css( "resize", "none" );
  9826. this._proportionallyResizeElements.push( this.originalElement.css( {
  9827. position: "static",
  9828. zoom: 1,
  9829. display: "block"
  9830. } ) );
  9831. // Support: IE9
  9832. // avoid IE jump (hard set the margin)
  9833. this.originalElement.css( margins );
  9834. this._proportionallyResize();
  9835. }
  9836. this._setupHandles();
  9837. if ( o.autoHide ) {
  9838. $( this.element )
  9839. .on( "mouseenter", function() {
  9840. if ( o.disabled ) {
  9841. return;
  9842. }
  9843. that._removeClass( "ui-resizable-autohide" );
  9844. that._handles.show();
  9845. } )
  9846. .on( "mouseleave", function() {
  9847. if ( o.disabled ) {
  9848. return;
  9849. }
  9850. if ( !that.resizing ) {
  9851. that._addClass( "ui-resizable-autohide" );
  9852. that._handles.hide();
  9853. }
  9854. } );
  9855. }
  9856. this._mouseInit();
  9857. },
  9858. _destroy: function() {
  9859. this._mouseDestroy();
  9860. var wrapper,
  9861. _destroy = function( exp ) {
  9862. $( exp )
  9863. .removeData( "resizable" )
  9864. .removeData( "ui-resizable" )
  9865. .off( ".resizable" )
  9866. .find( ".ui-resizable-handle" )
  9867. .remove();
  9868. };
  9869. // TODO: Unwrap at same DOM position
  9870. if ( this.elementIsWrapper ) {
  9871. _destroy( this.element );
  9872. wrapper = this.element;
  9873. this.originalElement.css( {
  9874. position: wrapper.css( "position" ),
  9875. width: wrapper.outerWidth(),
  9876. height: wrapper.outerHeight(),
  9877. top: wrapper.css( "top" ),
  9878. left: wrapper.css( "left" )
  9879. } ).insertAfter( wrapper );
  9880. wrapper.remove();
  9881. }
  9882. this.originalElement.css( "resize", this.originalResizeStyle );
  9883. _destroy( this.originalElement );
  9884. return this;
  9885. },
  9886. _setOption: function( key, value ) {
  9887. this._super( key, value );
  9888. switch ( key ) {
  9889. case "handles":
  9890. this._removeHandles();
  9891. this._setupHandles();
  9892. break;
  9893. default:
  9894. break;
  9895. }
  9896. },
  9897. _setupHandles: function() {
  9898. var o = this.options, handle, i, n, hname, axis, that = this;
  9899. this.handles = o.handles ||
  9900. ( !$( ".ui-resizable-handle", this.element ).length ?
  9901. "e,s,se" : {
  9902. n: ".ui-resizable-n",
  9903. e: ".ui-resizable-e",
  9904. s: ".ui-resizable-s",
  9905. w: ".ui-resizable-w",
  9906. se: ".ui-resizable-se",
  9907. sw: ".ui-resizable-sw",
  9908. ne: ".ui-resizable-ne",
  9909. nw: ".ui-resizable-nw"
  9910. } );
  9911. this._handles = $();
  9912. if ( this.handles.constructor === String ) {
  9913. if ( this.handles === "all" ) {
  9914. this.handles = "n,e,s,w,se,sw,ne,nw";
  9915. }
  9916. n = this.handles.split( "," );
  9917. this.handles = {};
  9918. for ( i = 0; i < n.length; i++ ) {
  9919. handle = $.trim( n[ i ] );
  9920. hname = "ui-resizable-" + handle;
  9921. axis = $( "<div>" );
  9922. this._addClass( axis, "ui-resizable-handle " + hname );
  9923. axis.css( { zIndex: o.zIndex } );
  9924. this.handles[ handle ] = ".ui-resizable-" + handle;
  9925. this.element.append( axis );
  9926. }
  9927. }
  9928. this._renderAxis = function( target ) {
  9929. var i, axis, padPos, padWrapper;
  9930. target = target || this.element;
  9931. for ( i in this.handles ) {
  9932. if ( this.handles[ i ].constructor === String ) {
  9933. this.handles[ i ] = this.element.children( this.handles[ i ] ).first().show();
  9934. } else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
  9935. this.handles[ i ] = $( this.handles[ i ] );
  9936. this._on( this.handles[ i ], { "mousedown": that._mouseDown } );
  9937. }
  9938. if ( this.elementIsWrapper &&
  9939. this.originalElement[ 0 ]
  9940. .nodeName
  9941. .match( /^(textarea|input|select|button)$/i ) ) {
  9942. axis = $( this.handles[ i ], this.element );
  9943. padWrapper = /sw|ne|nw|se|n|s/.test( i ) ?
  9944. axis.outerHeight() :
  9945. axis.outerWidth();
  9946. padPos = [ "padding",
  9947. /ne|nw|n/.test( i ) ? "Top" :
  9948. /se|sw|s/.test( i ) ? "Bottom" :
  9949. /^e$/.test( i ) ? "Right" : "Left" ].join( "" );
  9950. target.css( padPos, padWrapper );
  9951. this._proportionallyResize();
  9952. }
  9953. this._handles = this._handles.add( this.handles[ i ] );
  9954. }
  9955. };
  9956. // TODO: make renderAxis a prototype function
  9957. this._renderAxis( this.element );
  9958. this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
  9959. this._handles.disableSelection();
  9960. this._handles.on( "mouseover", function() {
  9961. if ( !that.resizing ) {
  9962. if ( this.className ) {
  9963. axis = this.className.match( /ui-resizable-(se|sw|ne|nw|n|e|s|w)/i );
  9964. }
  9965. that.axis = axis && axis[ 1 ] ? axis[ 1 ] : "se";
  9966. }
  9967. } );
  9968. if ( o.autoHide ) {
  9969. this._handles.hide();
  9970. this._addClass( "ui-resizable-autohide" );
  9971. }
  9972. },
  9973. _removeHandles: function() {
  9974. this._handles.remove();
  9975. },
  9976. _mouseCapture: function( event ) {
  9977. var i, handle,
  9978. capture = false;
  9979. for ( i in this.handles ) {
  9980. handle = $( this.handles[ i ] )[ 0 ];
  9981. if ( handle === event.target || $.contains( handle, event.target ) ) {
  9982. capture = true;
  9983. }
  9984. }
  9985. return !this.options.disabled && capture;
  9986. },
  9987. _mouseStart: function( event ) {
  9988. var curleft, curtop, cursor,
  9989. o = this.options,
  9990. el = this.element;
  9991. this.resizing = true;
  9992. this._renderProxy();
  9993. curleft = this._num( this.helper.css( "left" ) );
  9994. curtop = this._num( this.helper.css( "top" ) );
  9995. if ( o.containment ) {
  9996. curleft += $( o.containment ).scrollLeft() || 0;
  9997. curtop += $( o.containment ).scrollTop() || 0;
  9998. }
  9999. this.offset = this.helper.offset();
  10000. this.position = { left: curleft, top: curtop };
  10001. this.size = this._helper ? {
  10002. width: this.helper.width(),
  10003. height: this.helper.height()
  10004. } : {
  10005. width: el.width(),
  10006. height: el.height()
  10007. };
  10008. this.originalSize = this._helper ? {
  10009. width: el.outerWidth(),
  10010. height: el.outerHeight()
  10011. } : {
  10012. width: el.width(),
  10013. height: el.height()
  10014. };
  10015. this.sizeDiff = {
  10016. width: el.outerWidth() - el.width(),
  10017. height: el.outerHeight() - el.height()
  10018. };
  10019. this.originalPosition = { left: curleft, top: curtop };
  10020. this.originalMousePosition = { left: event.pageX, top: event.pageY };
  10021. this.aspectRatio = ( typeof o.aspectRatio === "number" ) ?
  10022. o.aspectRatio :
  10023. ( ( this.originalSize.width / this.originalSize.height ) || 1 );
  10024. cursor = $( ".ui-resizable-" + this.axis ).css( "cursor" );
  10025. $( "body" ).css( "cursor", cursor === "auto" ? this.axis + "-resize" : cursor );
  10026. this._addClass( "ui-resizable-resizing" );
  10027. this._propagate( "start", event );
  10028. return true;
  10029. },
  10030. _mouseDrag: function( event ) {
  10031. var data, props,
  10032. smp = this.originalMousePosition,
  10033. a = this.axis,
  10034. dx = ( event.pageX - smp.left ) || 0,
  10035. dy = ( event.pageY - smp.top ) || 0,
  10036. trigger = this._change[ a ];
  10037. this._updatePrevProperties();
  10038. if ( !trigger ) {
  10039. return false;
  10040. }
  10041. data = trigger.apply( this, [ event, dx, dy ] );
  10042. this._updateVirtualBoundaries( event.shiftKey );
  10043. if ( this._aspectRatio || event.shiftKey ) {
  10044. data = this._updateRatio( data, event );
  10045. }
  10046. data = this._respectSize( data, event );
  10047. this._updateCache( data );
  10048. this._propagate( "resize", event );
  10049. props = this._applyChanges();
  10050. if ( !this._helper && this._proportionallyResizeElements.length ) {
  10051. this._proportionallyResize();
  10052. }
  10053. if ( !$.isEmptyObject( props ) ) {
  10054. this._updatePrevProperties();
  10055. this._trigger( "resize", event, this.ui() );
  10056. this._applyChanges();
  10057. }
  10058. return false;
  10059. },
  10060. _mouseStop: function( event ) {
  10061. this.resizing = false;
  10062. var pr, ista, soffseth, soffsetw, s, left, top,
  10063. o = this.options, that = this;
  10064. if ( this._helper ) {
  10065. pr = this._proportionallyResizeElements;
  10066. ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName );
  10067. soffseth = ista && this._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height;
  10068. soffsetw = ista ? 0 : that.sizeDiff.width;
  10069. s = {
  10070. width: ( that.helper.width() - soffsetw ),
  10071. height: ( that.helper.height() - soffseth )
  10072. };
  10073. left = ( parseFloat( that.element.css( "left" ) ) +
  10074. ( that.position.left - that.originalPosition.left ) ) || null;
  10075. top = ( parseFloat( that.element.css( "top" ) ) +
  10076. ( that.position.top - that.originalPosition.top ) ) || null;
  10077. if ( !o.animate ) {
  10078. this.element.css( $.extend( s, { top: top, left: left } ) );
  10079. }
  10080. that.helper.height( that.size.height );
  10081. that.helper.width( that.size.width );
  10082. if ( this._helper && !o.animate ) {
  10083. this._proportionallyResize();
  10084. }
  10085. }
  10086. $( "body" ).css( "cursor", "auto" );
  10087. this._removeClass( "ui-resizable-resizing" );
  10088. this._propagate( "stop", event );
  10089. if ( this._helper ) {
  10090. this.helper.remove();
  10091. }
  10092. return false;
  10093. },
  10094. _updatePrevProperties: function() {
  10095. this.prevPosition = {
  10096. top: this.position.top,
  10097. left: this.position.left
  10098. };
  10099. this.prevSize = {
  10100. width: this.size.width,
  10101. height: this.size.height
  10102. };
  10103. },
  10104. _applyChanges: function() {
  10105. var props = {};
  10106. if ( this.position.top !== this.prevPosition.top ) {
  10107. props.top = this.position.top + "px";
  10108. }
  10109. if ( this.position.left !== this.prevPosition.left ) {
  10110. props.left = this.position.left + "px";
  10111. }
  10112. if ( this.size.width !== this.prevSize.width ) {
  10113. props.width = this.size.width + "px";
  10114. }
  10115. if ( this.size.height !== this.prevSize.height ) {
  10116. props.height = this.size.height + "px";
  10117. }
  10118. this.helper.css( props );
  10119. return props;
  10120. },
  10121. _updateVirtualBoundaries: function( forceAspectRatio ) {
  10122. var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
  10123. o = this.options;
  10124. b = {
  10125. minWidth: this._isNumber( o.minWidth ) ? o.minWidth : 0,
  10126. maxWidth: this._isNumber( o.maxWidth ) ? o.maxWidth : Infinity,
  10127. minHeight: this._isNumber( o.minHeight ) ? o.minHeight : 0,
  10128. maxHeight: this._isNumber( o.maxHeight ) ? o.maxHeight : Infinity
  10129. };
  10130. if ( this._aspectRatio || forceAspectRatio ) {
  10131. pMinWidth = b.minHeight * this.aspectRatio;
  10132. pMinHeight = b.minWidth / this.aspectRatio;
  10133. pMaxWidth = b.maxHeight * this.aspectRatio;
  10134. pMaxHeight = b.maxWidth / this.aspectRatio;
  10135. if ( pMinWidth > b.minWidth ) {
  10136. b.minWidth = pMinWidth;
  10137. }
  10138. if ( pMinHeight > b.minHeight ) {
  10139. b.minHeight = pMinHeight;
  10140. }
  10141. if ( pMaxWidth < b.maxWidth ) {
  10142. b.maxWidth = pMaxWidth;
  10143. }
  10144. if ( pMaxHeight < b.maxHeight ) {
  10145. b.maxHeight = pMaxHeight;
  10146. }
  10147. }
  10148. this._vBoundaries = b;
  10149. },
  10150. _updateCache: function( data ) {
  10151. this.offset = this.helper.offset();
  10152. if ( this._isNumber( data.left ) ) {
  10153. this.position.left = data.left;
  10154. }
  10155. if ( this._isNumber( data.top ) ) {
  10156. this.position.top = data.top;
  10157. }
  10158. if ( this._isNumber( data.height ) ) {
  10159. this.size.height = data.height;
  10160. }
  10161. if ( this._isNumber( data.width ) ) {
  10162. this.size.width = data.width;
  10163. }
  10164. },
  10165. _updateRatio: function( data ) {
  10166. var cpos = this.position,
  10167. csize = this.size,
  10168. a = this.axis;
  10169. if ( this._isNumber( data.height ) ) {
  10170. data.width = ( data.height * this.aspectRatio );
  10171. } else if ( this._isNumber( data.width ) ) {
  10172. data.height = ( data.width / this.aspectRatio );
  10173. }
  10174. if ( a === "sw" ) {
  10175. data.left = cpos.left + ( csize.width - data.width );
  10176. data.top = null;
  10177. }
  10178. if ( a === "nw" ) {
  10179. data.top = cpos.top + ( csize.height - data.height );
  10180. data.left = cpos.left + ( csize.width - data.width );
  10181. }
  10182. return data;
  10183. },
  10184. _respectSize: function( data ) {
  10185. var o = this._vBoundaries,
  10186. a = this.axis,
  10187. ismaxw = this._isNumber( data.width ) && o.maxWidth && ( o.maxWidth < data.width ),
  10188. ismaxh = this._isNumber( data.height ) && o.maxHeight && ( o.maxHeight < data.height ),
  10189. isminw = this._isNumber( data.width ) && o.minWidth && ( o.minWidth > data.width ),
  10190. isminh = this._isNumber( data.height ) && o.minHeight && ( o.minHeight > data.height ),
  10191. dw = this.originalPosition.left + this.originalSize.width,
  10192. dh = this.originalPosition.top + this.originalSize.height,
  10193. cw = /sw|nw|w/.test( a ), ch = /nw|ne|n/.test( a );
  10194. if ( isminw ) {
  10195. data.width = o.minWidth;
  10196. }
  10197. if ( isminh ) {
  10198. data.height = o.minHeight;
  10199. }
  10200. if ( ismaxw ) {
  10201. data.width = o.maxWidth;
  10202. }
  10203. if ( ismaxh ) {
  10204. data.height = o.maxHeight;
  10205. }
  10206. if ( isminw && cw ) {
  10207. data.left = dw - o.minWidth;
  10208. }
  10209. if ( ismaxw && cw ) {
  10210. data.left = dw - o.maxWidth;
  10211. }
  10212. if ( isminh && ch ) {
  10213. data.top = dh - o.minHeight;
  10214. }
  10215. if ( ismaxh && ch ) {
  10216. data.top = dh - o.maxHeight;
  10217. }
  10218. // Fixing jump error on top/left - bug #2330
  10219. if ( !data.width && !data.height && !data.left && data.top ) {
  10220. data.top = null;
  10221. } else if ( !data.width && !data.height && !data.top && data.left ) {
  10222. data.left = null;
  10223. }
  10224. return data;
  10225. },
  10226. _getPaddingPlusBorderDimensions: function( element ) {
  10227. var i = 0,
  10228. widths = [],
  10229. borders = [
  10230. element.css( "borderTopWidth" ),
  10231. element.css( "borderRightWidth" ),
  10232. element.css( "borderBottomWidth" ),
  10233. element.css( "borderLeftWidth" )
  10234. ],
  10235. paddings = [
  10236. element.css( "paddingTop" ),
  10237. element.css( "paddingRight" ),
  10238. element.css( "paddingBottom" ),
  10239. element.css( "paddingLeft" )
  10240. ];
  10241. for ( ; i < 4; i++ ) {
  10242. widths[ i ] = ( parseFloat( borders[ i ] ) || 0 );
  10243. widths[ i ] += ( parseFloat( paddings[ i ] ) || 0 );
  10244. }
  10245. return {
  10246. height: widths[ 0 ] + widths[ 2 ],
  10247. width: widths[ 1 ] + widths[ 3 ]
  10248. };
  10249. },
  10250. _proportionallyResize: function() {
  10251. if ( !this._proportionallyResizeElements.length ) {
  10252. return;
  10253. }
  10254. var prel,
  10255. i = 0,
  10256. element = this.helper || this.element;
  10257. for ( ; i < this._proportionallyResizeElements.length; i++ ) {
  10258. prel = this._proportionallyResizeElements[ i ];
  10259. // TODO: Seems like a bug to cache this.outerDimensions
  10260. // considering that we are in a loop.
  10261. if ( !this.outerDimensions ) {
  10262. this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
  10263. }
  10264. prel.css( {
  10265. height: ( element.height() - this.outerDimensions.height ) || 0,
  10266. width: ( element.width() - this.outerDimensions.width ) || 0
  10267. } );
  10268. }
  10269. },
  10270. _renderProxy: function() {
  10271. var el = this.element, o = this.options;
  10272. this.elementOffset = el.offset();
  10273. if ( this._helper ) {
  10274. this.helper = this.helper || $( "<div style='overflow:hidden;'></div>" );
  10275. this._addClass( this.helper, this._helper );
  10276. this.helper.css( {
  10277. width: this.element.outerWidth(),
  10278. height: this.element.outerHeight(),
  10279. position: "absolute",
  10280. left: this.elementOffset.left + "px",
  10281. top: this.elementOffset.top + "px",
  10282. zIndex: ++o.zIndex //TODO: Don't modify option
  10283. } );
  10284. this.helper
  10285. .appendTo( "body" )
  10286. .disableSelection();
  10287. } else {
  10288. this.helper = this.element;
  10289. }
  10290. },
  10291. _change: {
  10292. e: function( event, dx ) {
  10293. return { width: this.originalSize.width + dx };
  10294. },
  10295. w: function( event, dx ) {
  10296. var cs = this.originalSize, sp = this.originalPosition;
  10297. return { left: sp.left + dx, width: cs.width - dx };
  10298. },
  10299. n: function( event, dx, dy ) {
  10300. var cs = this.originalSize, sp = this.originalPosition;
  10301. return { top: sp.top + dy, height: cs.height - dy };
  10302. },
  10303. s: function( event, dx, dy ) {
  10304. return { height: this.originalSize.height + dy };
  10305. },
  10306. se: function( event, dx, dy ) {
  10307. return $.extend( this._change.s.apply( this, arguments ),
  10308. this._change.e.apply( this, [ event, dx, dy ] ) );
  10309. },
  10310. sw: function( event, dx, dy ) {
  10311. return $.extend( this._change.s.apply( this, arguments ),
  10312. this._change.w.apply( this, [ event, dx, dy ] ) );
  10313. },
  10314. ne: function( event, dx, dy ) {
  10315. return $.extend( this._change.n.apply( this, arguments ),
  10316. this._change.e.apply( this, [ event, dx, dy ] ) );
  10317. },
  10318. nw: function( event, dx, dy ) {
  10319. return $.extend( this._change.n.apply( this, arguments ),
  10320. this._change.w.apply( this, [ event, dx, dy ] ) );
  10321. }
  10322. },
  10323. _propagate: function( n, event ) {
  10324. $.ui.plugin.call( this, n, [ event, this.ui() ] );
  10325. ( n !== "resize" && this._trigger( n, event, this.ui() ) );
  10326. },
  10327. plugins: {},
  10328. ui: function() {
  10329. return {
  10330. originalElement: this.originalElement,
  10331. element: this.element,
  10332. helper: this.helper,
  10333. position: this.position,
  10334. size: this.size,
  10335. originalSize: this.originalSize,
  10336. originalPosition: this.originalPosition
  10337. };
  10338. }
  10339. } );
  10340. /*
  10341. * Resizable Extensions
  10342. */
  10343. $.ui.plugin.add( "resizable", "animate", {
  10344. stop: function( event ) {
  10345. var that = $( this ).resizable( "instance" ),
  10346. o = that.options,
  10347. pr = that._proportionallyResizeElements,
  10348. ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ),
  10349. soffseth = ista && that._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height,
  10350. soffsetw = ista ? 0 : that.sizeDiff.width,
  10351. style = {
  10352. width: ( that.size.width - soffsetw ),
  10353. height: ( that.size.height - soffseth )
  10354. },
  10355. left = ( parseFloat( that.element.css( "left" ) ) +
  10356. ( that.position.left - that.originalPosition.left ) ) || null,
  10357. top = ( parseFloat( that.element.css( "top" ) ) +
  10358. ( that.position.top - that.originalPosition.top ) ) || null;
  10359. that.element.animate(
  10360. $.extend( style, top && left ? { top: top, left: left } : {} ), {
  10361. duration: o.animateDuration,
  10362. easing: o.animateEasing,
  10363. step: function() {
  10364. var data = {
  10365. width: parseFloat( that.element.css( "width" ) ),
  10366. height: parseFloat( that.element.css( "height" ) ),
  10367. top: parseFloat( that.element.css( "top" ) ),
  10368. left: parseFloat( that.element.css( "left" ) )
  10369. };
  10370. if ( pr && pr.length ) {
  10371. $( pr[ 0 ] ).css( { width: data.width, height: data.height } );
  10372. }
  10373. // Propagating resize, and updating values for each animation step
  10374. that._updateCache( data );
  10375. that._propagate( "resize", event );
  10376. }
  10377. }
  10378. );
  10379. }
  10380. } );
  10381. $.ui.plugin.add( "resizable", "containment", {
  10382. start: function() {
  10383. var element, p, co, ch, cw, width, height,
  10384. that = $( this ).resizable( "instance" ),
  10385. o = that.options,
  10386. el = that.element,
  10387. oc = o.containment,
  10388. ce = ( oc instanceof $ ) ?
  10389. oc.get( 0 ) :
  10390. ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
  10391. if ( !ce ) {
  10392. return;
  10393. }
  10394. that.containerElement = $( ce );
  10395. if ( /document/.test( oc ) || oc === document ) {
  10396. that.containerOffset = {
  10397. left: 0,
  10398. top: 0
  10399. };
  10400. that.containerPosition = {
  10401. left: 0,
  10402. top: 0
  10403. };
  10404. that.parentData = {
  10405. element: $( document ),
  10406. left: 0,
  10407. top: 0,
  10408. width: $( document ).width(),
  10409. height: $( document ).height() || document.body.parentNode.scrollHeight
  10410. };
  10411. } else {
  10412. element = $( ce );
  10413. p = [];
  10414. $( [ "Top", "Right", "Left", "Bottom" ] ).each( function( i, name ) {
  10415. p[ i ] = that._num( element.css( "padding" + name ) );
  10416. } );
  10417. that.containerOffset = element.offset();
  10418. that.containerPosition = element.position();
  10419. that.containerSize = {
  10420. height: ( element.innerHeight() - p[ 3 ] ),
  10421. width: ( element.innerWidth() - p[ 1 ] )
  10422. };
  10423. co = that.containerOffset;
  10424. ch = that.containerSize.height;
  10425. cw = that.containerSize.width;
  10426. width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw );
  10427. height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ;
  10428. that.parentData = {
  10429. element: ce,
  10430. left: co.left,
  10431. top: co.top,
  10432. width: width,
  10433. height: height
  10434. };
  10435. }
  10436. },
  10437. resize: function( event ) {
  10438. var woset, hoset, isParent, isOffsetRelative,
  10439. that = $( this ).resizable( "instance" ),
  10440. o = that.options,
  10441. co = that.containerOffset,
  10442. cp = that.position,
  10443. pRatio = that._aspectRatio || event.shiftKey,
  10444. cop = {
  10445. top: 0,
  10446. left: 0
  10447. },
  10448. ce = that.containerElement,
  10449. continueResize = true;
  10450. if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
  10451. cop = co;
  10452. }
  10453. if ( cp.left < ( that._helper ? co.left : 0 ) ) {
  10454. that.size.width = that.size.width +
  10455. ( that._helper ?
  10456. ( that.position.left - co.left ) :
  10457. ( that.position.left - cop.left ) );
  10458. if ( pRatio ) {
  10459. that.size.height = that.size.width / that.aspectRatio;
  10460. continueResize = false;
  10461. }
  10462. that.position.left = o.helper ? co.left : 0;
  10463. }
  10464. if ( cp.top < ( that._helper ? co.top : 0 ) ) {
  10465. that.size.height = that.size.height +
  10466. ( that._helper ?
  10467. ( that.position.top - co.top ) :
  10468. that.position.top );
  10469. if ( pRatio ) {
  10470. that.size.width = that.size.height * that.aspectRatio;
  10471. continueResize = false;
  10472. }
  10473. that.position.top = that._helper ? co.top : 0;
  10474. }
  10475. isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
  10476. isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
  10477. if ( isParent && isOffsetRelative ) {
  10478. that.offset.left = that.parentData.left + that.position.left;
  10479. that.offset.top = that.parentData.top + that.position.top;
  10480. } else {
  10481. that.offset.left = that.element.offset().left;
  10482. that.offset.top = that.element.offset().top;
  10483. }
  10484. woset = Math.abs( that.sizeDiff.width +
  10485. ( that._helper ?
  10486. that.offset.left - cop.left :
  10487. ( that.offset.left - co.left ) ) );
  10488. hoset = Math.abs( that.sizeDiff.height +
  10489. ( that._helper ?
  10490. that.offset.top - cop.top :
  10491. ( that.offset.top - co.top ) ) );
  10492. if ( woset + that.size.width >= that.parentData.width ) {
  10493. that.size.width = that.parentData.width - woset;
  10494. if ( pRatio ) {
  10495. that.size.height = that.size.width / that.aspectRatio;
  10496. continueResize = false;
  10497. }
  10498. }
  10499. if ( hoset + that.size.height >= that.parentData.height ) {
  10500. that.size.height = that.parentData.height - hoset;
  10501. if ( pRatio ) {
  10502. that.size.width = that.size.height * that.aspectRatio;
  10503. continueResize = false;
  10504. }
  10505. }
  10506. if ( !continueResize ) {
  10507. that.position.left = that.prevPosition.left;
  10508. that.position.top = that.prevPosition.top;
  10509. that.size.width = that.prevSize.width;
  10510. that.size.height = that.prevSize.height;
  10511. }
  10512. },
  10513. stop: function() {
  10514. var that = $( this ).resizable( "instance" ),
  10515. o = that.options,
  10516. co = that.containerOffset,
  10517. cop = that.containerPosition,
  10518. ce = that.containerElement,
  10519. helper = $( that.helper ),
  10520. ho = helper.offset(),
  10521. w = helper.outerWidth() - that.sizeDiff.width,
  10522. h = helper.outerHeight() - that.sizeDiff.height;
  10523. if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
  10524. $( this ).css( {
  10525. left: ho.left - cop.left - co.left,
  10526. width: w,
  10527. height: h
  10528. } );
  10529. }
  10530. if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
  10531. $( this ).css( {
  10532. left: ho.left - cop.left - co.left,
  10533. width: w,
  10534. height: h
  10535. } );
  10536. }
  10537. }
  10538. } );
  10539. $.ui.plugin.add( "resizable", "alsoResize", {
  10540. start: function() {
  10541. var that = $( this ).resizable( "instance" ),
  10542. o = that.options;
  10543. $( o.alsoResize ).each( function() {
  10544. var el = $( this );
  10545. el.data( "ui-resizable-alsoresize", {
  10546. width: parseFloat( el.width() ), height: parseFloat( el.height() ),
  10547. left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) )
  10548. } );
  10549. } );
  10550. },
  10551. resize: function( event, ui ) {
  10552. var that = $( this ).resizable( "instance" ),
  10553. o = that.options,
  10554. os = that.originalSize,
  10555. op = that.originalPosition,
  10556. delta = {
  10557. height: ( that.size.height - os.height ) || 0,
  10558. width: ( that.size.width - os.width ) || 0,
  10559. top: ( that.position.top - op.top ) || 0,
  10560. left: ( that.position.left - op.left ) || 0
  10561. };
  10562. $( o.alsoResize ).each( function() {
  10563. var el = $( this ), start = $( this ).data( "ui-resizable-alsoresize" ), style = {},
  10564. css = el.parents( ui.originalElement[ 0 ] ).length ?
  10565. [ "width", "height" ] :
  10566. [ "width", "height", "top", "left" ];
  10567. $.each( css, function( i, prop ) {
  10568. var sum = ( start[ prop ] || 0 ) + ( delta[ prop ] || 0 );
  10569. if ( sum && sum >= 0 ) {
  10570. style[ prop ] = sum || null;
  10571. }
  10572. } );
  10573. el.css( style );
  10574. } );
  10575. },
  10576. stop: function() {
  10577. $( this ).removeData( "ui-resizable-alsoresize" );
  10578. }
  10579. } );
  10580. $.ui.plugin.add( "resizable", "ghost", {
  10581. start: function() {
  10582. var that = $( this ).resizable( "instance" ), cs = that.size;
  10583. that.ghost = that.originalElement.clone();
  10584. that.ghost.css( {
  10585. opacity: 0.25,
  10586. display: "block",
  10587. position: "relative",
  10588. height: cs.height,
  10589. width: cs.width,
  10590. margin: 0,
  10591. left: 0,
  10592. top: 0
  10593. } );
  10594. that._addClass( that.ghost, "ui-resizable-ghost" );
  10595. // DEPRECATED
  10596. // TODO: remove after 1.12
  10597. if ( $.uiBackCompat !== false && typeof that.options.ghost === "string" ) {
  10598. // Ghost option
  10599. that.ghost.addClass( this.options.ghost );
  10600. }
  10601. that.ghost.appendTo( that.helper );
  10602. },
  10603. resize: function() {
  10604. var that = $( this ).resizable( "instance" );
  10605. if ( that.ghost ) {
  10606. that.ghost.css( {
  10607. position: "relative",
  10608. height: that.size.height,
  10609. width: that.size.width
  10610. } );
  10611. }
  10612. },
  10613. stop: function() {
  10614. var that = $( this ).resizable( "instance" );
  10615. if ( that.ghost && that.helper ) {
  10616. that.helper.get( 0 ).removeChild( that.ghost.get( 0 ) );
  10617. }
  10618. }
  10619. } );
  10620. $.ui.plugin.add( "resizable", "grid", {
  10621. resize: function() {
  10622. var outerDimensions,
  10623. that = $( this ).resizable( "instance" ),
  10624. o = that.options,
  10625. cs = that.size,
  10626. os = that.originalSize,
  10627. op = that.originalPosition,
  10628. a = that.axis,
  10629. grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
  10630. gridX = ( grid[ 0 ] || 1 ),
  10631. gridY = ( grid[ 1 ] || 1 ),
  10632. ox = Math.round( ( cs.width - os.width ) / gridX ) * gridX,
  10633. oy = Math.round( ( cs.height - os.height ) / gridY ) * gridY,
  10634. newWidth = os.width + ox,
  10635. newHeight = os.height + oy,
  10636. isMaxWidth = o.maxWidth && ( o.maxWidth < newWidth ),
  10637. isMaxHeight = o.maxHeight && ( o.maxHeight < newHeight ),
  10638. isMinWidth = o.minWidth && ( o.minWidth > newWidth ),
  10639. isMinHeight = o.minHeight && ( o.minHeight > newHeight );
  10640. o.grid = grid;
  10641. if ( isMinWidth ) {
  10642. newWidth += gridX;
  10643. }
  10644. if ( isMinHeight ) {
  10645. newHeight += gridY;
  10646. }
  10647. if ( isMaxWidth ) {
  10648. newWidth -= gridX;
  10649. }
  10650. if ( isMaxHeight ) {
  10651. newHeight -= gridY;
  10652. }
  10653. if ( /^(se|s|e)$/.test( a ) ) {
  10654. that.size.width = newWidth;
  10655. that.size.height = newHeight;
  10656. } else if ( /^(ne)$/.test( a ) ) {
  10657. that.size.width = newWidth;
  10658. that.size.height = newHeight;
  10659. that.position.top = op.top - oy;
  10660. } else if ( /^(sw)$/.test( a ) ) {
  10661. that.size.width = newWidth;
  10662. that.size.height = newHeight;
  10663. that.position.left = op.left - ox;
  10664. } else {
  10665. if ( newHeight - gridY <= 0 || newWidth - gridX <= 0 ) {
  10666. outerDimensions = that._getPaddingPlusBorderDimensions( this );
  10667. }
  10668. if ( newHeight - gridY > 0 ) {
  10669. that.size.height = newHeight;
  10670. that.position.top = op.top - oy;
  10671. } else {
  10672. newHeight = gridY - outerDimensions.height;
  10673. that.size.height = newHeight;
  10674. that.position.top = op.top + os.height - newHeight;
  10675. }
  10676. if ( newWidth - gridX > 0 ) {
  10677. that.size.width = newWidth;
  10678. that.position.left = op.left - ox;
  10679. } else {
  10680. newWidth = gridX - outerDimensions.width;
  10681. that.size.width = newWidth;
  10682. that.position.left = op.left + os.width - newWidth;
  10683. }
  10684. }
  10685. }
  10686. } );
  10687. var widgetsResizable = $.ui.resizable;
  10688. /*!
  10689. * jQuery UI Dialog 1.12.1
  10690. * http://jqueryui.com
  10691. *
  10692. * Copyright jQuery Foundation and other contributors
  10693. * Released under the MIT license.
  10694. * http://jquery.org/license
  10695. */
  10696. //>>label: Dialog
  10697. //>>group: Widgets
  10698. //>>description: Displays customizable dialog windows.
  10699. //>>docs: http://api.jqueryui.com/dialog/
  10700. //>>demos: http://jqueryui.com/dialog/
  10701. //>>css.structure: ../../themes/base/core.css
  10702. //>>css.structure: ../../themes/base/dialog.css
  10703. //>>css.theme: ../../themes/base/theme.css
  10704. $.widget( "ui.dialog", {
  10705. version: "1.12.1",
  10706. options: {
  10707. appendTo: "body",
  10708. autoOpen: true,
  10709. buttons: [],
  10710. classes: {
  10711. "ui-dialog": "ui-corner-all",
  10712. "ui-dialog-titlebar": "ui-corner-all"
  10713. },
  10714. closeOnEscape: true,
  10715. closeText: "Close",
  10716. draggable: true,
  10717. hide: null,
  10718. height: "auto",
  10719. maxHeight: null,
  10720. maxWidth: null,
  10721. minHeight: 150,
  10722. minWidth: 150,
  10723. modal: false,
  10724. position: {
  10725. my: "center",
  10726. at: "center",
  10727. of: window,
  10728. collision: "fit",
  10729. // Ensure the titlebar is always visible
  10730. using: function( pos ) {
  10731. var topOffset = $( this ).css( pos ).offset().top;
  10732. if ( topOffset < 0 ) {
  10733. $( this ).css( "top", pos.top - topOffset );
  10734. }
  10735. }
  10736. },
  10737. resizable: true,
  10738. show: null,
  10739. title: null,
  10740. width: 300,
  10741. // Callbacks
  10742. beforeClose: null,
  10743. close: null,
  10744. drag: null,
  10745. dragStart: null,
  10746. dragStop: null,
  10747. focus: null,
  10748. open: null,
  10749. resize: null,
  10750. resizeStart: null,
  10751. resizeStop: null
  10752. },
  10753. sizeRelatedOptions: {
  10754. buttons: true,
  10755. height: true,
  10756. maxHeight: true,
  10757. maxWidth: true,
  10758. minHeight: true,
  10759. minWidth: true,
  10760. width: true
  10761. },
  10762. resizableRelatedOptions: {
  10763. maxHeight: true,
  10764. maxWidth: true,
  10765. minHeight: true,
  10766. minWidth: true
  10767. },
  10768. _create: function() {
  10769. this.originalCss = {
  10770. display: this.element[ 0 ].style.display,
  10771. width: this.element[ 0 ].style.width,
  10772. minHeight: this.element[ 0 ].style.minHeight,
  10773. maxHeight: this.element[ 0 ].style.maxHeight,
  10774. height: this.element[ 0 ].style.height
  10775. };
  10776. this.originalPosition = {
  10777. parent: this.element.parent(),
  10778. index: this.element.parent().children().index( this.element )
  10779. };
  10780. this.originalTitle = this.element.attr( "title" );
  10781. if ( this.options.title == null && this.originalTitle != null ) {
  10782. this.options.title = this.originalTitle;
  10783. }
  10784. // Dialogs can't be disabled
  10785. if ( this.options.disabled ) {
  10786. this.options.disabled = false;
  10787. }
  10788. this._createWrapper();
  10789. this.element
  10790. .show()
  10791. .removeAttr( "title" )
  10792. .appendTo( this.uiDialog );
  10793. this._addClass( "ui-dialog-content", "ui-widget-content" );
  10794. this._createTitlebar();
  10795. this._createButtonPane();
  10796. if ( this.options.draggable && $.fn.draggable ) {
  10797. this._makeDraggable();
  10798. }
  10799. if ( this.options.resizable && $.fn.resizable ) {
  10800. this._makeResizable();
  10801. }
  10802. this._isOpen = false;
  10803. this._trackFocus();
  10804. },
  10805. _init: function() {
  10806. if ( this.options.autoOpen ) {
  10807. this.open();
  10808. }
  10809. },
  10810. _appendTo: function() {
  10811. var element = this.options.appendTo;
  10812. if ( element && ( element.jquery || element.nodeType ) ) {
  10813. return $( element );
  10814. }
  10815. return this.document.find( element || "body" ).eq( 0 );
  10816. },
  10817. _destroy: function() {
  10818. var next,
  10819. originalPosition = this.originalPosition;
  10820. this._untrackInstance();
  10821. this._destroyOverlay();
  10822. this.element
  10823. .removeUniqueId()
  10824. .css( this.originalCss )
  10825. // Without detaching first, the following becomes really slow
  10826. .detach();
  10827. this.uiDialog.remove();
  10828. if ( this.originalTitle ) {
  10829. this.element.attr( "title", this.originalTitle );
  10830. }
  10831. next = originalPosition.parent.children().eq( originalPosition.index );
  10832. // Don't try to place the dialog next to itself (#8613)
  10833. if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
  10834. next.before( this.element );
  10835. } else {
  10836. originalPosition.parent.append( this.element );
  10837. }
  10838. },
  10839. widget: function() {
  10840. return this.uiDialog;
  10841. },
  10842. disable: $.noop,
  10843. enable: $.noop,
  10844. close: function( event ) {
  10845. var that = this;
  10846. if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
  10847. return;
  10848. }
  10849. this._isOpen = false;
  10850. this._focusedElement = null;
  10851. this._destroyOverlay();
  10852. this._untrackInstance();
  10853. if ( !this.opener.filter( ":focusable" ).trigger( "focus" ).length ) {
  10854. // Hiding a focused element doesn't trigger blur in WebKit
  10855. // so in case we have nothing to focus on, explicitly blur the active element
  10856. // https://bugs.webkit.org/show_bug.cgi?id=47182
  10857. $.ui.safeBlur( $.ui.safeActiveElement( this.document[ 0 ] ) );
  10858. }
  10859. this._hide( this.uiDialog, this.options.hide, function() {
  10860. that._trigger( "close", event );
  10861. } );
  10862. },
  10863. isOpen: function() {
  10864. return this._isOpen;
  10865. },
  10866. moveToTop: function() {
  10867. this._moveToTop();
  10868. },
  10869. _moveToTop: function( event, silent ) {
  10870. var moved = false,
  10871. zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map( function() {
  10872. return +$( this ).css( "z-index" );
  10873. } ).get(),
  10874. zIndexMax = Math.max.apply( null, zIndices );
  10875. if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
  10876. this.uiDialog.css( "z-index", zIndexMax + 1 );
  10877. moved = true;
  10878. }
  10879. if ( moved && !silent ) {
  10880. this._trigger( "focus", event );
  10881. }
  10882. return moved;
  10883. },
  10884. open: function() {
  10885. var that = this;
  10886. if ( this._isOpen ) {
  10887. if ( this._moveToTop() ) {
  10888. this._focusTabbable();
  10889. }
  10890. return;
  10891. }
  10892. this._isOpen = true;
  10893. this.opener = $( $.ui.safeActiveElement( this.document[ 0 ] ) );
  10894. this._size();
  10895. this._position();
  10896. this._createOverlay();
  10897. this._moveToTop( null, true );
  10898. // Ensure the overlay is moved to the top with the dialog, but only when
  10899. // opening. The overlay shouldn't move after the dialog is open so that
  10900. // modeless dialogs opened after the modal dialog stack properly.
  10901. if ( this.overlay ) {
  10902. this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
  10903. }
  10904. this._show( this.uiDialog, this.options.show, function() {
  10905. that._focusTabbable();
  10906. that._trigger( "focus" );
  10907. } );
  10908. // Track the dialog immediately upon openening in case a focus event
  10909. // somehow occurs outside of the dialog before an element inside the
  10910. // dialog is focused (#10152)
  10911. this._makeFocusTarget();
  10912. this._trigger( "open" );
  10913. },
  10914. _focusTabbable: function() {
  10915. // Set focus to the first match:
  10916. // 1. An element that was focused previously
  10917. // 2. First element inside the dialog matching [autofocus]
  10918. // 3. Tabbable element inside the content element
  10919. // 4. Tabbable element inside the buttonpane
  10920. // 5. The close button
  10921. // 6. The dialog itself
  10922. var hasFocus = this._focusedElement;
  10923. if ( !hasFocus ) {
  10924. hasFocus = this.element.find( "[autofocus]" );
  10925. }
  10926. if ( !hasFocus.length ) {
  10927. hasFocus = this.element.find( ":tabbable" );
  10928. }
  10929. if ( !hasFocus.length ) {
  10930. hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
  10931. }
  10932. if ( !hasFocus.length ) {
  10933. hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
  10934. }
  10935. if ( !hasFocus.length ) {
  10936. hasFocus = this.uiDialog;
  10937. }
  10938. hasFocus.eq( 0 ).trigger( "focus" );
  10939. },
  10940. _keepFocus: function( event ) {
  10941. function checkFocus() {
  10942. var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
  10943. isActive = this.uiDialog[ 0 ] === activeElement ||
  10944. $.contains( this.uiDialog[ 0 ], activeElement );
  10945. if ( !isActive ) {
  10946. this._focusTabbable();
  10947. }
  10948. }
  10949. event.preventDefault();
  10950. checkFocus.call( this );
  10951. // support: IE
  10952. // IE <= 8 doesn't prevent moving focus even with event.preventDefault()
  10953. // so we check again later
  10954. this._delay( checkFocus );
  10955. },
  10956. _createWrapper: function() {
  10957. this.uiDialog = $( "<div>" )
  10958. .hide()
  10959. .attr( {
  10960. // Setting tabIndex makes the div focusable
  10961. tabIndex: -1,
  10962. role: "dialog"
  10963. } )
  10964. .appendTo( this._appendTo() );
  10965. this._addClass( this.uiDialog, "ui-dialog", "ui-widget ui-widget-content ui-front" );
  10966. this._on( this.uiDialog, {
  10967. keydown: function( event ) {
  10968. if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
  10969. event.keyCode === $.ui.keyCode.ESCAPE ) {
  10970. event.preventDefault();
  10971. this.close( event );
  10972. return;
  10973. }
  10974. // Prevent tabbing out of dialogs
  10975. if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
  10976. return;
  10977. }
  10978. var tabbables = this.uiDialog.find( ":tabbable" ),
  10979. first = tabbables.filter( ":first" ),
  10980. last = tabbables.filter( ":last" );
  10981. if ( ( event.target === last[ 0 ] || event.target === this.uiDialog[ 0 ] ) &&
  10982. !event.shiftKey ) {
  10983. this._delay( function() {
  10984. first.trigger( "focus" );
  10985. } );
  10986. event.preventDefault();
  10987. } else if ( ( event.target === first[ 0 ] ||
  10988. event.target === this.uiDialog[ 0 ] ) && event.shiftKey ) {
  10989. this._delay( function() {
  10990. last.trigger( "focus" );
  10991. } );
  10992. event.preventDefault();
  10993. }
  10994. },
  10995. mousedown: function( event ) {
  10996. if ( this._moveToTop( event ) ) {
  10997. this._focusTabbable();
  10998. }
  10999. }
  11000. } );
  11001. // We assume that any existing aria-describedby attribute means
  11002. // that the dialog content is marked up properly
  11003. // otherwise we brute force the content as the description
  11004. if ( !this.element.find( "[aria-describedby]" ).length ) {
  11005. this.uiDialog.attr( {
  11006. "aria-describedby": this.element.uniqueId().attr( "id" )
  11007. } );
  11008. }
  11009. },
  11010. _createTitlebar: function() {
  11011. var uiDialogTitle;
  11012. this.uiDialogTitlebar = $( "<div>" );
  11013. this._addClass( this.uiDialogTitlebar,
  11014. "ui-dialog-titlebar", "ui-widget-header ui-helper-clearfix" );
  11015. this._on( this.uiDialogTitlebar, {
  11016. mousedown: function( event ) {
  11017. // Don't prevent click on close button (#8838)
  11018. // Focusing a dialog that is partially scrolled out of view
  11019. // causes the browser to scroll it into view, preventing the click event
  11020. if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
  11021. // Dialog isn't getting focus when dragging (#8063)
  11022. this.uiDialog.trigger( "focus" );
  11023. }
  11024. }
  11025. } );
  11026. // Support: IE
  11027. // Use type="button" to prevent enter keypresses in textboxes from closing the
  11028. // dialog in IE (#9312)
  11029. this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
  11030. .button( {
  11031. label: $( "<a>" ).text( this.options.closeText ).html(),
  11032. icon: "ui-icon-closethick",
  11033. showLabel: false
  11034. } )
  11035. .appendTo( this.uiDialogTitlebar );
  11036. this._addClass( this.uiDialogTitlebarClose, "ui-dialog-titlebar-close" );
  11037. this._on( this.uiDialogTitlebarClose, {
  11038. click: function( event ) {
  11039. event.preventDefault();
  11040. this.close( event );
  11041. }
  11042. } );
  11043. uiDialogTitle = $( "<span>" ).uniqueId().prependTo( this.uiDialogTitlebar );
  11044. this._addClass( uiDialogTitle, "ui-dialog-title" );
  11045. this._title( uiDialogTitle );
  11046. this.uiDialogTitlebar.prependTo( this.uiDialog );
  11047. this.uiDialog.attr( {
  11048. "aria-labelledby": uiDialogTitle.attr( "id" )
  11049. } );
  11050. },
  11051. _title: function( title ) {
  11052. if ( this.options.title ) {
  11053. title.text( this.options.title );
  11054. } else {
  11055. title.html( "&#160;" );
  11056. }
  11057. },
  11058. _createButtonPane: function() {
  11059. this.uiDialogButtonPane = $( "<div>" );
  11060. this._addClass( this.uiDialogButtonPane, "ui-dialog-buttonpane",
  11061. "ui-widget-content ui-helper-clearfix" );
  11062. this.uiButtonSet = $( "<div>" )
  11063. .appendTo( this.uiDialogButtonPane );
  11064. this._addClass( this.uiButtonSet, "ui-dialog-buttonset" );
  11065. this._createButtons();
  11066. },
  11067. _createButtons: function() {
  11068. var that = this,
  11069. buttons = this.options.buttons;
  11070. // If we already have a button pane, remove it
  11071. this.uiDialogButtonPane.remove();
  11072. this.uiButtonSet.empty();
  11073. if ( $.isEmptyObject( buttons ) || ( $.isArray( buttons ) && !buttons.length ) ) {
  11074. this._removeClass( this.uiDialog, "ui-dialog-buttons" );
  11075. return;
  11076. }
  11077. $.each( buttons, function( name, props ) {
  11078. var click, buttonOptions;
  11079. props = $.isFunction( props ) ?
  11080. { click: props, text: name } :
  11081. props;
  11082. // Default to a non-submitting button
  11083. props = $.extend( { type: "button" }, props );
  11084. // Change the context for the click callback to be the main element
  11085. click = props.click;
  11086. buttonOptions = {
  11087. icon: props.icon,
  11088. iconPosition: props.iconPosition,
  11089. showLabel: props.showLabel,
  11090. // Deprecated options
  11091. icons: props.icons,
  11092. text: props.text
  11093. };
  11094. delete props.click;
  11095. delete props.icon;
  11096. delete props.iconPosition;
  11097. delete props.showLabel;
  11098. // Deprecated options
  11099. delete props.icons;
  11100. if ( typeof props.text === "boolean" ) {
  11101. delete props.text;
  11102. }
  11103. $( "<button></button>", props )
  11104. .button( buttonOptions )
  11105. .appendTo( that.uiButtonSet )
  11106. .on( "click", function() {
  11107. click.apply( that.element[ 0 ], arguments );
  11108. } );
  11109. } );
  11110. this._addClass( this.uiDialog, "ui-dialog-buttons" );
  11111. this.uiDialogButtonPane.appendTo( this.uiDialog );
  11112. },
  11113. _makeDraggable: function() {
  11114. var that = this,
  11115. options = this.options;
  11116. function filteredUi( ui ) {
  11117. return {
  11118. position: ui.position,
  11119. offset: ui.offset
  11120. };
  11121. }
  11122. this.uiDialog.draggable( {
  11123. cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
  11124. handle: ".ui-dialog-titlebar",
  11125. containment: "document",
  11126. start: function( event, ui ) {
  11127. that._addClass( $( this ), "ui-dialog-dragging" );
  11128. that._blockFrames();
  11129. that._trigger( "dragStart", event, filteredUi( ui ) );
  11130. },
  11131. drag: function( event, ui ) {
  11132. that._trigger( "drag", event, filteredUi( ui ) );
  11133. },
  11134. stop: function( event, ui ) {
  11135. var left = ui.offset.left - that.document.scrollLeft(),
  11136. top = ui.offset.top - that.document.scrollTop();
  11137. options.position = {
  11138. my: "left top",
  11139. at: "left" + ( left >= 0 ? "+" : "" ) + left + " " +
  11140. "top" + ( top >= 0 ? "+" : "" ) + top,
  11141. of: that.window
  11142. };
  11143. that._removeClass( $( this ), "ui-dialog-dragging" );
  11144. that._unblockFrames();
  11145. that._trigger( "dragStop", event, filteredUi( ui ) );
  11146. }
  11147. } );
  11148. },
  11149. _makeResizable: function() {
  11150. var that = this,
  11151. options = this.options,
  11152. handles = options.resizable,
  11153. // .ui-resizable has position: relative defined in the stylesheet
  11154. // but dialogs have to use absolute or fixed positioning
  11155. position = this.uiDialog.css( "position" ),
  11156. resizeHandles = typeof handles === "string" ?
  11157. handles :
  11158. "n,e,s,w,se,sw,ne,nw";
  11159. function filteredUi( ui ) {
  11160. return {
  11161. originalPosition: ui.originalPosition,
  11162. originalSize: ui.originalSize,
  11163. position: ui.position,
  11164. size: ui.size
  11165. };
  11166. }
  11167. this.uiDialog.resizable( {
  11168. cancel: ".ui-dialog-content",
  11169. containment: "document",
  11170. alsoResize: this.element,
  11171. maxWidth: options.maxWidth,
  11172. maxHeight: options.maxHeight,
  11173. minWidth: options.minWidth,
  11174. minHeight: this._minHeight(),
  11175. handles: resizeHandles,
  11176. start: function( event, ui ) {
  11177. that._addClass( $( this ), "ui-dialog-resizing" );
  11178. that._blockFrames();
  11179. that._trigger( "resizeStart", event, filteredUi( ui ) );
  11180. },
  11181. resize: function( event, ui ) {
  11182. that._trigger( "resize", event, filteredUi( ui ) );
  11183. },
  11184. stop: function( event, ui ) {
  11185. var offset = that.uiDialog.offset(),
  11186. left = offset.left - that.document.scrollLeft(),
  11187. top = offset.top - that.document.scrollTop();
  11188. options.height = that.uiDialog.height();
  11189. options.width = that.uiDialog.width();
  11190. options.position = {
  11191. my: "left top",
  11192. at: "left" + ( left >= 0 ? "+" : "" ) + left + " " +
  11193. "top" + ( top >= 0 ? "+" : "" ) + top,
  11194. of: that.window
  11195. };
  11196. that._removeClass( $( this ), "ui-dialog-resizing" );
  11197. that._unblockFrames();
  11198. that._trigger( "resizeStop", event, filteredUi( ui ) );
  11199. }
  11200. } )
  11201. .css( "position", position );
  11202. },
  11203. _trackFocus: function() {
  11204. this._on( this.widget(), {
  11205. focusin: function( event ) {
  11206. this._makeFocusTarget();
  11207. this._focusedElement = $( event.target );
  11208. }
  11209. } );
  11210. },
  11211. _makeFocusTarget: function() {
  11212. this._untrackInstance();
  11213. this._trackingInstances().unshift( this );
  11214. },
  11215. _untrackInstance: function() {
  11216. var instances = this._trackingInstances(),
  11217. exists = $.inArray( this, instances );
  11218. if ( exists !== -1 ) {
  11219. instances.splice( exists, 1 );
  11220. }
  11221. },
  11222. _trackingInstances: function() {
  11223. var instances = this.document.data( "ui-dialog-instances" );
  11224. if ( !instances ) {
  11225. instances = [];
  11226. this.document.data( "ui-dialog-instances", instances );
  11227. }
  11228. return instances;
  11229. },
  11230. _minHeight: function() {
  11231. var options = this.options;
  11232. return options.height === "auto" ?
  11233. options.minHeight :
  11234. Math.min( options.minHeight, options.height );
  11235. },
  11236. _position: function() {
  11237. // Need to show the dialog to get the actual offset in the position plugin
  11238. var isVisible = this.uiDialog.is( ":visible" );
  11239. if ( !isVisible ) {
  11240. this.uiDialog.show();
  11241. }
  11242. this.uiDialog.position( this.options.position );
  11243. if ( !isVisible ) {
  11244. this.uiDialog.hide();
  11245. }
  11246. },
  11247. _setOptions: function( options ) {
  11248. var that = this,
  11249. resize = false,
  11250. resizableOptions = {};
  11251. $.each( options, function( key, value ) {
  11252. that._setOption( key, value );
  11253. if ( key in that.sizeRelatedOptions ) {
  11254. resize = true;
  11255. }
  11256. if ( key in that.resizableRelatedOptions ) {
  11257. resizableOptions[ key ] = value;
  11258. }
  11259. } );
  11260. if ( resize ) {
  11261. this._size();
  11262. this._position();
  11263. }
  11264. if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
  11265. this.uiDialog.resizable( "option", resizableOptions );
  11266. }
  11267. },
  11268. _setOption: function( key, value ) {
  11269. var isDraggable, isResizable,
  11270. uiDialog = this.uiDialog;
  11271. if ( key === "disabled" ) {
  11272. return;
  11273. }
  11274. this._super( key, value );
  11275. if ( key === "appendTo" ) {
  11276. this.uiDialog.appendTo( this._appendTo() );
  11277. }
  11278. if ( key === "buttons" ) {
  11279. this._createButtons();
  11280. }
  11281. if ( key === "closeText" ) {
  11282. this.uiDialogTitlebarClose.button( {
  11283. // Ensure that we always pass a string
  11284. label: $( "<a>" ).text( "" + this.options.closeText ).html()
  11285. } );
  11286. }
  11287. if ( key === "draggable" ) {
  11288. isDraggable = uiDialog.is( ":data(ui-draggable)" );
  11289. if ( isDraggable && !value ) {
  11290. uiDialog.draggable( "destroy" );
  11291. }
  11292. if ( !isDraggable && value ) {
  11293. this._makeDraggable();
  11294. }
  11295. }
  11296. if ( key === "position" ) {
  11297. this._position();
  11298. }
  11299. if ( key === "resizable" ) {
  11300. // currently resizable, becoming non-resizable
  11301. isResizable = uiDialog.is( ":data(ui-resizable)" );
  11302. if ( isResizable && !value ) {
  11303. uiDialog.resizable( "destroy" );
  11304. }
  11305. // Currently resizable, changing handles
  11306. if ( isResizable && typeof value === "string" ) {
  11307. uiDialog.resizable( "option", "handles", value );
  11308. }
  11309. // Currently non-resizable, becoming resizable
  11310. if ( !isResizable && value !== false ) {
  11311. this._makeResizable();
  11312. }
  11313. }
  11314. if ( key === "title" ) {
  11315. this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
  11316. }
  11317. },
  11318. _size: function() {
  11319. // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
  11320. // divs will both have width and height set, so we need to reset them
  11321. var nonContentHeight, minContentHeight, maxContentHeight,
  11322. options = this.options;
  11323. // Reset content sizing
  11324. this.element.show().css( {
  11325. width: "auto",
  11326. minHeight: 0,
  11327. maxHeight: "none",
  11328. height: 0
  11329. } );
  11330. if ( options.minWidth > options.width ) {
  11331. options.width = options.minWidth;
  11332. }
  11333. // Reset wrapper sizing
  11334. // determine the height of all the non-content elements
  11335. nonContentHeight = this.uiDialog.css( {
  11336. height: "auto",
  11337. width: options.width
  11338. } )
  11339. .outerHeight();
  11340. minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
  11341. maxContentHeight = typeof options.maxHeight === "number" ?
  11342. Math.max( 0, options.maxHeight - nonContentHeight ) :
  11343. "none";
  11344. if ( options.height === "auto" ) {
  11345. this.element.css( {
  11346. minHeight: minContentHeight,
  11347. maxHeight: maxContentHeight,
  11348. height: "auto"
  11349. } );
  11350. } else {
  11351. this.element.height( Math.max( 0, options.height - nonContentHeight ) );
  11352. }
  11353. if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
  11354. this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
  11355. }
  11356. },
  11357. _blockFrames: function() {
  11358. this.iframeBlocks = this.document.find( "iframe" ).map( function() {
  11359. var iframe = $( this );
  11360. return $( "<div>" )
  11361. .css( {
  11362. position: "absolute",
  11363. width: iframe.outerWidth(),
  11364. height: iframe.outerHeight()
  11365. } )
  11366. .appendTo( iframe.parent() )
  11367. .offset( iframe.offset() )[ 0 ];
  11368. } );
  11369. },
  11370. _unblockFrames: function() {
  11371. if ( this.iframeBlocks ) {
  11372. this.iframeBlocks.remove();
  11373. delete this.iframeBlocks;
  11374. }
  11375. },
  11376. _allowInteraction: function( event ) {
  11377. if ( $( event.target ).closest( ".ui-dialog" ).length ) {
  11378. return true;
  11379. }
  11380. // TODO: Remove hack when datepicker implements
  11381. // the .ui-front logic (#8989)
  11382. return !!$( event.target ).closest( ".ui-datepicker" ).length;
  11383. },
  11384. _createOverlay: function() {
  11385. if ( !this.options.modal ) {
  11386. return;
  11387. }
  11388. // We use a delay in case the overlay is created from an
  11389. // event that we're going to be cancelling (#2804)
  11390. var isOpening = true;
  11391. this._delay( function() {
  11392. isOpening = false;
  11393. } );
  11394. if ( !this.document.data( "ui-dialog-overlays" ) ) {
  11395. // Prevent use of anchors and inputs
  11396. // Using _on() for an event handler shared across many instances is
  11397. // safe because the dialogs stack and must be closed in reverse order
  11398. this._on( this.document, {
  11399. focusin: function( event ) {
  11400. if ( isOpening ) {
  11401. return;
  11402. }
  11403. if ( !this._allowInteraction( event ) ) {
  11404. event.preventDefault();
  11405. this._trackingInstances()[ 0 ]._focusTabbable();
  11406. }
  11407. }
  11408. } );
  11409. }
  11410. this.overlay = $( "<div>" )
  11411. .appendTo( this._appendTo() );
  11412. this._addClass( this.overlay, null, "ui-widget-overlay ui-front" );
  11413. this._on( this.overlay, {
  11414. mousedown: "_keepFocus"
  11415. } );
  11416. this.document.data( "ui-dialog-overlays",
  11417. ( this.document.data( "ui-dialog-overlays" ) || 0 ) + 1 );
  11418. },
  11419. _destroyOverlay: function() {
  11420. if ( !this.options.modal ) {
  11421. return;
  11422. }
  11423. if ( this.overlay ) {
  11424. var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
  11425. if ( !overlays ) {
  11426. this._off( this.document, "focusin" );
  11427. this.document.removeData( "ui-dialog-overlays" );
  11428. } else {
  11429. this.document.data( "ui-dialog-overlays", overlays );
  11430. }
  11431. this.overlay.remove();
  11432. this.overlay = null;
  11433. }
  11434. }
  11435. } );
  11436. // DEPRECATED
  11437. // TODO: switch return back to widget declaration at top of file when this is removed
  11438. if ( $.uiBackCompat !== false ) {
  11439. // Backcompat for dialogClass option
  11440. $.widget( "ui.dialog", $.ui.dialog, {
  11441. options: {
  11442. dialogClass: ""
  11443. },
  11444. _createWrapper: function() {
  11445. this._super();
  11446. this.uiDialog.addClass( this.options.dialogClass );
  11447. },
  11448. _setOption: function( key, value ) {
  11449. if ( key === "dialogClass" ) {
  11450. this.uiDialog
  11451. .removeClass( this.options.dialogClass )
  11452. .addClass( value );
  11453. }
  11454. this._superApply( arguments );
  11455. }
  11456. } );
  11457. }
  11458. var widgetsDialog = $.ui.dialog;
  11459. /*!
  11460. * jQuery UI Droppable 1.12.1
  11461. * http://jqueryui.com
  11462. *
  11463. * Copyright jQuery Foundation and other contributors
  11464. * Released under the MIT license.
  11465. * http://jquery.org/license
  11466. */
  11467. //>>label: Droppable
  11468. //>>group: Interactions
  11469. //>>description: Enables drop targets for draggable elements.
  11470. //>>docs: http://api.jqueryui.com/droppable/
  11471. //>>demos: http://jqueryui.com/droppable/
  11472. $.widget( "ui.droppable", {
  11473. version: "1.12.1",
  11474. widgetEventPrefix: "drop",
  11475. options: {
  11476. accept: "*",
  11477. addClasses: true,
  11478. greedy: false,
  11479. scope: "default",
  11480. tolerance: "intersect",
  11481. // Callbacks
  11482. activate: null,
  11483. deactivate: null,
  11484. drop: null,
  11485. out: null,
  11486. over: null
  11487. },
  11488. _create: function() {
  11489. var proportions,
  11490. o = this.options,
  11491. accept = o.accept;
  11492. this.isover = false;
  11493. this.isout = true;
  11494. this.accept = $.isFunction( accept ) ? accept : function( d ) {
  11495. return d.is( accept );
  11496. };
  11497. this.proportions = function( /* valueToWrite */ ) {
  11498. if ( arguments.length ) {
  11499. // Store the droppable's proportions
  11500. proportions = arguments[ 0 ];
  11501. } else {
  11502. // Retrieve or derive the droppable's proportions
  11503. return proportions ?
  11504. proportions :
  11505. proportions = {
  11506. width: this.element[ 0 ].offsetWidth,
  11507. height: this.element[ 0 ].offsetHeight
  11508. };
  11509. }
  11510. };
  11511. this._addToManager( o.scope );
  11512. o.addClasses && this._addClass( "ui-droppable" );
  11513. },
  11514. _addToManager: function( scope ) {
  11515. // Add the reference and positions to the manager
  11516. $.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
  11517. $.ui.ddmanager.droppables[ scope ].push( this );
  11518. },
  11519. _splice: function( drop ) {
  11520. var i = 0;
  11521. for ( ; i < drop.length; i++ ) {
  11522. if ( drop[ i ] === this ) {
  11523. drop.splice( i, 1 );
  11524. }
  11525. }
  11526. },
  11527. _destroy: function() {
  11528. var drop = $.ui.ddmanager.droppables[ this.options.scope ];
  11529. this._splice( drop );
  11530. },
  11531. _setOption: function( key, value ) {
  11532. if ( key === "accept" ) {
  11533. this.accept = $.isFunction( value ) ? value : function( d ) {
  11534. return d.is( value );
  11535. };
  11536. } else if ( key === "scope" ) {
  11537. var drop = $.ui.ddmanager.droppables[ this.options.scope ];
  11538. this._splice( drop );
  11539. this._addToManager( value );
  11540. }
  11541. this._super( key, value );
  11542. },
  11543. _activate: function( event ) {
  11544. var draggable = $.ui.ddmanager.current;
  11545. this._addActiveClass();
  11546. if ( draggable ) {
  11547. this._trigger( "activate", event, this.ui( draggable ) );
  11548. }
  11549. },
  11550. _deactivate: function( event ) {
  11551. var draggable = $.ui.ddmanager.current;
  11552. this._removeActiveClass();
  11553. if ( draggable ) {
  11554. this._trigger( "deactivate", event, this.ui( draggable ) );
  11555. }
  11556. },
  11557. _over: function( event ) {
  11558. var draggable = $.ui.ddmanager.current;
  11559. // Bail if draggable and droppable are same element
  11560. if ( !draggable || ( draggable.currentItem ||
  11561. draggable.element )[ 0 ] === this.element[ 0 ] ) {
  11562. return;
  11563. }
  11564. if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem ||
  11565. draggable.element ) ) ) {
  11566. this._addHoverClass();
  11567. this._trigger( "over", event, this.ui( draggable ) );
  11568. }
  11569. },
  11570. _out: function( event ) {
  11571. var draggable = $.ui.ddmanager.current;
  11572. // Bail if draggable and droppable are same element
  11573. if ( !draggable || ( draggable.currentItem ||
  11574. draggable.element )[ 0 ] === this.element[ 0 ] ) {
  11575. return;
  11576. }
  11577. if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem ||
  11578. draggable.element ) ) ) {
  11579. this._removeHoverClass();
  11580. this._trigger( "out", event, this.ui( draggable ) );
  11581. }
  11582. },
  11583. _drop: function( event, custom ) {
  11584. var draggable = custom || $.ui.ddmanager.current,
  11585. childrenIntersection = false;
  11586. // Bail if draggable and droppable are same element
  11587. if ( !draggable || ( draggable.currentItem ||
  11588. draggable.element )[ 0 ] === this.element[ 0 ] ) {
  11589. return false;
  11590. }
  11591. this.element
  11592. .find( ":data(ui-droppable)" )
  11593. .not( ".ui-draggable-dragging" )
  11594. .each( function() {
  11595. var inst = $( this ).droppable( "instance" );
  11596. if (
  11597. inst.options.greedy &&
  11598. !inst.options.disabled &&
  11599. inst.options.scope === draggable.options.scope &&
  11600. inst.accept.call(
  11601. inst.element[ 0 ], ( draggable.currentItem || draggable.element )
  11602. ) &&
  11603. intersect(
  11604. draggable,
  11605. $.extend( inst, { offset: inst.element.offset() } ),
  11606. inst.options.tolerance, event
  11607. )
  11608. ) {
  11609. childrenIntersection = true;
  11610. return false; }
  11611. } );
  11612. if ( childrenIntersection ) {
  11613. return false;
  11614. }
  11615. if ( this.accept.call( this.element[ 0 ],
  11616. ( draggable.currentItem || draggable.element ) ) ) {
  11617. this._removeActiveClass();
  11618. this._removeHoverClass();
  11619. this._trigger( "drop", event, this.ui( draggable ) );
  11620. return this.element;
  11621. }
  11622. return false;
  11623. },
  11624. ui: function( c ) {
  11625. return {
  11626. draggable: ( c.currentItem || c.element ),
  11627. helper: c.helper,
  11628. position: c.position,
  11629. offset: c.positionAbs
  11630. };
  11631. },
  11632. // Extension points just to make backcompat sane and avoid duplicating logic
  11633. // TODO: Remove in 1.13 along with call to it below
  11634. _addHoverClass: function() {
  11635. this._addClass( "ui-droppable-hover" );
  11636. },
  11637. _removeHoverClass: function() {
  11638. this._removeClass( "ui-droppable-hover" );
  11639. },
  11640. _addActiveClass: function() {
  11641. this._addClass( "ui-droppable-active" );
  11642. },
  11643. _removeActiveClass: function() {
  11644. this._removeClass( "ui-droppable-active" );
  11645. }
  11646. } );
  11647. var intersect = $.ui.intersect = ( function() {
  11648. function isOverAxis( x, reference, size ) {
  11649. return ( x >= reference ) && ( x < ( reference + size ) );
  11650. }
  11651. return function( draggable, droppable, toleranceMode, event ) {
  11652. if ( !droppable.offset ) {
  11653. return false;
  11654. }
  11655. var x1 = ( draggable.positionAbs ||
  11656. draggable.position.absolute ).left + draggable.margins.left,
  11657. y1 = ( draggable.positionAbs ||
  11658. draggable.position.absolute ).top + draggable.margins.top,
  11659. x2 = x1 + draggable.helperProportions.width,
  11660. y2 = y1 + draggable.helperProportions.height,
  11661. l = droppable.offset.left,
  11662. t = droppable.offset.top,
  11663. r = l + droppable.proportions().width,
  11664. b = t + droppable.proportions().height;
  11665. switch ( toleranceMode ) {
  11666. case "fit":
  11667. return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
  11668. case "intersect":
  11669. return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
  11670. x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
  11671. t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
  11672. y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
  11673. case "pointer":
  11674. return isOverAxis( event.pageY, t, droppable.proportions().height ) &&
  11675. isOverAxis( event.pageX, l, droppable.proportions().width );
  11676. case "touch":
  11677. return (
  11678. ( y1 >= t && y1 <= b ) || // Top edge touching
  11679. ( y2 >= t && y2 <= b ) || // Bottom edge touching
  11680. ( y1 < t && y2 > b ) // Surrounded vertically
  11681. ) && (
  11682. ( x1 >= l && x1 <= r ) || // Left edge touching
  11683. ( x2 >= l && x2 <= r ) || // Right edge touching
  11684. ( x1 < l && x2 > r ) // Surrounded horizontally
  11685. );
  11686. default:
  11687. return false;
  11688. }
  11689. };
  11690. } )();
  11691. /*
  11692. This manager tracks offsets of draggables and droppables
  11693. */
  11694. $.ui.ddmanager = {
  11695. current: null,
  11696. droppables: { "default": [] },
  11697. prepareOffsets: function( t, event ) {
  11698. var i, j,
  11699. m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
  11700. type = event ? event.type : null, // workaround for #2317
  11701. list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
  11702. droppablesLoop: for ( i = 0; i < m.length; i++ ) {
  11703. // No disabled and non-accepted
  11704. if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ],
  11705. ( t.currentItem || t.element ) ) ) ) {
  11706. continue;
  11707. }
  11708. // Filter out elements in the current dragged item
  11709. for ( j = 0; j < list.length; j++ ) {
  11710. if ( list[ j ] === m[ i ].element[ 0 ] ) {
  11711. m[ i ].proportions().height = 0;
  11712. continue droppablesLoop;
  11713. }
  11714. }
  11715. m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
  11716. if ( !m[ i ].visible ) {
  11717. continue;
  11718. }
  11719. // Activate the droppable if used directly from draggables
  11720. if ( type === "mousedown" ) {
  11721. m[ i ]._activate.call( m[ i ], event );
  11722. }
  11723. m[ i ].offset = m[ i ].element.offset();
  11724. m[ i ].proportions( {
  11725. width: m[ i ].element[ 0 ].offsetWidth,
  11726. height: m[ i ].element[ 0 ].offsetHeight
  11727. } );
  11728. }
  11729. },
  11730. drop: function( draggable, event ) {
  11731. var dropped = false;
  11732. // Create a copy of the droppables in case the list changes during the drop (#9116)
  11733. $.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
  11734. if ( !this.options ) {
  11735. return;
  11736. }
  11737. if ( !this.options.disabled && this.visible &&
  11738. intersect( draggable, this, this.options.tolerance, event ) ) {
  11739. dropped = this._drop.call( this, event ) || dropped;
  11740. }
  11741. if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ],
  11742. ( draggable.currentItem || draggable.element ) ) ) {
  11743. this.isout = true;
  11744. this.isover = false;
  11745. this._deactivate.call( this, event );
  11746. }
  11747. } );
  11748. return dropped;
  11749. },
  11750. dragStart: function( draggable, event ) {
  11751. // Listen for scrolling so that if the dragging causes scrolling the position of the
  11752. // droppables can be recalculated (see #5003)
  11753. draggable.element.parentsUntil( "body" ).on( "scroll.droppable", function() {
  11754. if ( !draggable.options.refreshPositions ) {
  11755. $.ui.ddmanager.prepareOffsets( draggable, event );
  11756. }
  11757. } );
  11758. },
  11759. drag: function( draggable, event ) {
  11760. // If you have a highly dynamic page, you might try this option. It renders positions
  11761. // every time you move the mouse.
  11762. if ( draggable.options.refreshPositions ) {
  11763. $.ui.ddmanager.prepareOffsets( draggable, event );
  11764. }
  11765. // Run through all droppables and check their positions based on specific tolerance options
  11766. $.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
  11767. if ( this.options.disabled || this.greedyChild || !this.visible ) {
  11768. return;
  11769. }
  11770. var parentInstance, scope, parent,
  11771. intersects = intersect( draggable, this, this.options.tolerance, event ),
  11772. c = !intersects && this.isover ?
  11773. "isout" :
  11774. ( intersects && !this.isover ? "isover" : null );
  11775. if ( !c ) {
  11776. return;
  11777. }
  11778. if ( this.options.greedy ) {
  11779. // find droppable parents with same scope
  11780. scope = this.options.scope;
  11781. parent = this.element.parents( ":data(ui-droppable)" ).filter( function() {
  11782. return $( this ).droppable( "instance" ).options.scope === scope;
  11783. } );
  11784. if ( parent.length ) {
  11785. parentInstance = $( parent[ 0 ] ).droppable( "instance" );
  11786. parentInstance.greedyChild = ( c === "isover" );
  11787. }
  11788. }
  11789. // We just moved into a greedy child
  11790. if ( parentInstance && c === "isover" ) {
  11791. parentInstance.isover = false;
  11792. parentInstance.isout = true;
  11793. parentInstance._out.call( parentInstance, event );
  11794. }
  11795. this[ c ] = true;
  11796. this[ c === "isout" ? "isover" : "isout" ] = false;
  11797. this[ c === "isover" ? "_over" : "_out" ].call( this, event );
  11798. // We just moved out of a greedy child
  11799. if ( parentInstance && c === "isout" ) {
  11800. parentInstance.isout = false;
  11801. parentInstance.isover = true;
  11802. parentInstance._over.call( parentInstance, event );
  11803. }
  11804. } );
  11805. },
  11806. dragStop: function( draggable, event ) {
  11807. draggable.element.parentsUntil( "body" ).off( "scroll.droppable" );
  11808. // Call prepareOffsets one final time since IE does not fire return scroll events when
  11809. // overflow was caused by drag (see #5003)
  11810. if ( !draggable.options.refreshPositions ) {
  11811. $.ui.ddmanager.prepareOffsets( draggable, event );
  11812. }
  11813. }
  11814. };
  11815. // DEPRECATED
  11816. // TODO: switch return back to widget declaration at top of file when this is removed
  11817. if ( $.uiBackCompat !== false ) {
  11818. // Backcompat for activeClass and hoverClass options
  11819. $.widget( "ui.droppable", $.ui.droppable, {
  11820. options: {
  11821. hoverClass: false,
  11822. activeClass: false
  11823. },
  11824. _addActiveClass: function() {
  11825. this._super();
  11826. if ( this.options.activeClass ) {
  11827. this.element.addClass( this.options.activeClass );
  11828. }
  11829. },
  11830. _removeActiveClass: function() {
  11831. this._super();
  11832. if ( this.options.activeClass ) {
  11833. this.element.removeClass( this.options.activeClass );
  11834. }
  11835. },
  11836. _addHoverClass: function() {
  11837. this._super();
  11838. if ( this.options.hoverClass ) {
  11839. this.element.addClass( this.options.hoverClass );
  11840. }
  11841. },
  11842. _removeHoverClass: function() {
  11843. this._super();
  11844. if ( this.options.hoverClass ) {
  11845. this.element.removeClass( this.options.hoverClass );
  11846. }
  11847. }
  11848. } );
  11849. }
  11850. var widgetsDroppable = $.ui.droppable;
  11851. /*!
  11852. * jQuery UI Progressbar 1.12.1
  11853. * http://jqueryui.com
  11854. *
  11855. * Copyright jQuery Foundation and other contributors
  11856. * Released under the MIT license.
  11857. * http://jquery.org/license
  11858. */
  11859. //>>label: Progressbar
  11860. //>>group: Widgets
  11861. // jscs:disable maximumLineLength
  11862. //>>description: Displays a status indicator for loading state, standard percentage, and other progress indicators.
  11863. // jscs:enable maximumLineLength
  11864. //>>docs: http://api.jqueryui.com/progressbar/
  11865. //>>demos: http://jqueryui.com/progressbar/
  11866. //>>css.structure: ../../themes/base/core.css
  11867. //>>css.structure: ../../themes/base/progressbar.css
  11868. //>>css.theme: ../../themes/base/theme.css
  11869. var widgetsProgressbar = $.widget( "ui.progressbar", {
  11870. version: "1.12.1",
  11871. options: {
  11872. classes: {
  11873. "ui-progressbar": "ui-corner-all",
  11874. "ui-progressbar-value": "ui-corner-left",
  11875. "ui-progressbar-complete": "ui-corner-right"
  11876. },
  11877. max: 100,
  11878. value: 0,
  11879. change: null,
  11880. complete: null
  11881. },
  11882. min: 0,
  11883. _create: function() {
  11884. // Constrain initial value
  11885. this.oldValue = this.options.value = this._constrainedValue();
  11886. this.element.attr( {
  11887. // Only set static values; aria-valuenow and aria-valuemax are
  11888. // set inside _refreshValue()
  11889. role: "progressbar",
  11890. "aria-valuemin": this.min
  11891. } );
  11892. this._addClass( "ui-progressbar", "ui-widget ui-widget-content" );
  11893. this.valueDiv = $( "<div>" ).appendTo( this.element );
  11894. this._addClass( this.valueDiv, "ui-progressbar-value", "ui-widget-header" );
  11895. this._refreshValue();
  11896. },
  11897. _destroy: function() {
  11898. this.element.removeAttr( "role aria-valuemin aria-valuemax aria-valuenow" );
  11899. this.valueDiv.remove();
  11900. },
  11901. value: function( newValue ) {
  11902. if ( newValue === undefined ) {
  11903. return this.options.value;
  11904. }
  11905. this.options.value = this._constrainedValue( newValue );
  11906. this._refreshValue();
  11907. },
  11908. _constrainedValue: function( newValue ) {
  11909. if ( newValue === undefined ) {
  11910. newValue = this.options.value;
  11911. }
  11912. this.indeterminate = newValue === false;
  11913. // Sanitize value
  11914. if ( typeof newValue !== "number" ) {
  11915. newValue = 0;
  11916. }
  11917. return this.indeterminate ? false :
  11918. Math.min( this.options.max, Math.max( this.min, newValue ) );
  11919. },
  11920. _setOptions: function( options ) {
  11921. // Ensure "value" option is set after other values (like max)
  11922. var value = options.value;
  11923. delete options.value;
  11924. this._super( options );
  11925. this.options.value = this._constrainedValue( value );
  11926. this._refreshValue();
  11927. },
  11928. _setOption: function( key, value ) {
  11929. if ( key === "max" ) {
  11930. // Don't allow a max less than min
  11931. value = Math.max( this.min, value );
  11932. }
  11933. this._super( key, value );
  11934. },
  11935. _setOptionDisabled: function( value ) {
  11936. this._super( value );
  11937. this.element.attr( "aria-disabled", value );
  11938. this._toggleClass( null, "ui-state-disabled", !!value );
  11939. },
  11940. _percentage: function() {
  11941. return this.indeterminate ?
  11942. 100 :
  11943. 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
  11944. },
  11945. _refreshValue: function() {
  11946. var value = this.options.value,
  11947. percentage = this._percentage();
  11948. this.valueDiv
  11949. .toggle( this.indeterminate || value > this.min )
  11950. .width( percentage.toFixed( 0 ) + "%" );
  11951. this
  11952. ._toggleClass( this.valueDiv, "ui-progressbar-complete", null,
  11953. value === this.options.max )
  11954. ._toggleClass( "ui-progressbar-indeterminate", null, this.indeterminate );
  11955. if ( this.indeterminate ) {
  11956. this.element.removeAttr( "aria-valuenow" );
  11957. if ( !this.overlayDiv ) {
  11958. this.overlayDiv = $( "<div>" ).appendTo( this.valueDiv );
  11959. this._addClass( this.overlayDiv, "ui-progressbar-overlay" );
  11960. }
  11961. } else {
  11962. this.element.attr( {
  11963. "aria-valuemax": this.options.max,
  11964. "aria-valuenow": value
  11965. } );
  11966. if ( this.overlayDiv ) {
  11967. this.overlayDiv.remove();
  11968. this.overlayDiv = null;
  11969. }
  11970. }
  11971. if ( this.oldValue !== value ) {
  11972. this.oldValue = value;
  11973. this._trigger( "change" );
  11974. }
  11975. if ( value === this.options.max ) {
  11976. this._trigger( "complete" );
  11977. }
  11978. }
  11979. } );
  11980. /*!
  11981. * jQuery UI Selectable 1.12.1
  11982. * http://jqueryui.com
  11983. *
  11984. * Copyright jQuery Foundation and other contributors
  11985. * Released under the MIT license.
  11986. * http://jquery.org/license
  11987. */
  11988. //>>label: Selectable
  11989. //>>group: Interactions
  11990. //>>description: Allows groups of elements to be selected with the mouse.
  11991. //>>docs: http://api.jqueryui.com/selectable/
  11992. //>>demos: http://jqueryui.com/selectable/
  11993. //>>css.structure: ../../themes/base/selectable.css
  11994. var widgetsSelectable = $.widget( "ui.selectable", $.ui.mouse, {
  11995. version: "1.12.1",
  11996. options: {
  11997. appendTo: "body",
  11998. autoRefresh: true,
  11999. distance: 0,
  12000. filter: "*",
  12001. tolerance: "touch",
  12002. // Callbacks
  12003. selected: null,
  12004. selecting: null,
  12005. start: null,
  12006. stop: null,
  12007. unselected: null,
  12008. unselecting: null
  12009. },
  12010. _create: function() {
  12011. var that = this;
  12012. this._addClass( "ui-selectable" );
  12013. this.dragged = false;
  12014. // Cache selectee children based on filter
  12015. this.refresh = function() {
  12016. that.elementPos = $( that.element[ 0 ] ).offset();
  12017. that.selectees = $( that.options.filter, that.element[ 0 ] );
  12018. that._addClass( that.selectees, "ui-selectee" );
  12019. that.selectees.each( function() {
  12020. var $this = $( this ),
  12021. selecteeOffset = $this.offset(),
  12022. pos = {
  12023. left: selecteeOffset.left - that.elementPos.left,
  12024. top: selecteeOffset.top - that.elementPos.top
  12025. };
  12026. $.data( this, "selectable-item", {
  12027. element: this,
  12028. $element: $this,
  12029. left: pos.left,
  12030. top: pos.top,
  12031. right: pos.left + $this.outerWidth(),
  12032. bottom: pos.top + $this.outerHeight(),
  12033. startselected: false,
  12034. selected: $this.hasClass( "ui-selected" ),
  12035. selecting: $this.hasClass( "ui-selecting" ),
  12036. unselecting: $this.hasClass( "ui-unselecting" )
  12037. } );
  12038. } );
  12039. };
  12040. this.refresh();
  12041. this._mouseInit();
  12042. this.helper = $( "<div>" );
  12043. this._addClass( this.helper, "ui-selectable-helper" );
  12044. },
  12045. _destroy: function() {
  12046. this.selectees.removeData( "selectable-item" );
  12047. this._mouseDestroy();
  12048. },
  12049. _mouseStart: function( event ) {
  12050. var that = this,
  12051. options = this.options;
  12052. this.opos = [ event.pageX, event.pageY ];
  12053. this.elementPos = $( this.element[ 0 ] ).offset();
  12054. if ( this.options.disabled ) {
  12055. return;
  12056. }
  12057. this.selectees = $( options.filter, this.element[ 0 ] );
  12058. this._trigger( "start", event );
  12059. $( options.appendTo ).append( this.helper );
  12060. // position helper (lasso)
  12061. this.helper.css( {
  12062. "left": event.pageX,
  12063. "top": event.pageY,
  12064. "width": 0,
  12065. "height": 0
  12066. } );
  12067. if ( options.autoRefresh ) {
  12068. this.refresh();
  12069. }
  12070. this.selectees.filter( ".ui-selected" ).each( function() {
  12071. var selectee = $.data( this, "selectable-item" );
  12072. selectee.startselected = true;
  12073. if ( !event.metaKey && !event.ctrlKey ) {
  12074. that._removeClass( selectee.$element, "ui-selected" );
  12075. selectee.selected = false;
  12076. that._addClass( selectee.$element, "ui-unselecting" );
  12077. selectee.unselecting = true;
  12078. // selectable UNSELECTING callback
  12079. that._trigger( "unselecting", event, {
  12080. unselecting: selectee.element
  12081. } );
  12082. }
  12083. } );
  12084. $( event.target ).parents().addBack().each( function() {
  12085. var doSelect,
  12086. selectee = $.data( this, "selectable-item" );
  12087. if ( selectee ) {
  12088. doSelect = ( !event.metaKey && !event.ctrlKey ) ||
  12089. !selectee.$element.hasClass( "ui-selected" );
  12090. that._removeClass( selectee.$element, doSelect ? "ui-unselecting" : "ui-selected" )
  12091. ._addClass( selectee.$element, doSelect ? "ui-selecting" : "ui-unselecting" );
  12092. selectee.unselecting = !doSelect;
  12093. selectee.selecting = doSelect;
  12094. selectee.selected = doSelect;
  12095. // selectable (UN)SELECTING callback
  12096. if ( doSelect ) {
  12097. that._trigger( "selecting", event, {
  12098. selecting: selectee.element
  12099. } );
  12100. } else {
  12101. that._trigger( "unselecting", event, {
  12102. unselecting: selectee.element
  12103. } );
  12104. }
  12105. return false;
  12106. }
  12107. } );
  12108. },
  12109. _mouseDrag: function( event ) {
  12110. this.dragged = true;
  12111. if ( this.options.disabled ) {
  12112. return;
  12113. }
  12114. var tmp,
  12115. that = this,
  12116. options = this.options,
  12117. x1 = this.opos[ 0 ],
  12118. y1 = this.opos[ 1 ],
  12119. x2 = event.pageX,
  12120. y2 = event.pageY;
  12121. if ( x1 > x2 ) { tmp = x2; x2 = x1; x1 = tmp; }
  12122. if ( y1 > y2 ) { tmp = y2; y2 = y1; y1 = tmp; }
  12123. this.helper.css( { left: x1, top: y1, width: x2 - x1, height: y2 - y1 } );
  12124. this.selectees.each( function() {
  12125. var selectee = $.data( this, "selectable-item" ),
  12126. hit = false,
  12127. offset = {};
  12128. //prevent helper from being selected if appendTo: selectable
  12129. if ( !selectee || selectee.element === that.element[ 0 ] ) {
  12130. return;
  12131. }
  12132. offset.left = selectee.left + that.elementPos.left;
  12133. offset.right = selectee.right + that.elementPos.left;
  12134. offset.top = selectee.top + that.elementPos.top;
  12135. offset.bottom = selectee.bottom + that.elementPos.top;
  12136. if ( options.tolerance === "touch" ) {
  12137. hit = ( !( offset.left > x2 || offset.right < x1 || offset.top > y2 ||
  12138. offset.bottom < y1 ) );
  12139. } else if ( options.tolerance === "fit" ) {
  12140. hit = ( offset.left > x1 && offset.right < x2 && offset.top > y1 &&
  12141. offset.bottom < y2 );
  12142. }
  12143. if ( hit ) {
  12144. // SELECT
  12145. if ( selectee.selected ) {
  12146. that._removeClass( selectee.$element, "ui-selected" );
  12147. selectee.selected = false;
  12148. }
  12149. if ( selectee.unselecting ) {
  12150. that._removeClass( selectee.$element, "ui-unselecting" );
  12151. selectee.unselecting = false;
  12152. }
  12153. if ( !selectee.selecting ) {
  12154. that._addClass( selectee.$element, "ui-selecting" );
  12155. selectee.selecting = true;
  12156. // selectable SELECTING callback
  12157. that._trigger( "selecting", event, {
  12158. selecting: selectee.element
  12159. } );
  12160. }
  12161. } else {
  12162. // UNSELECT
  12163. if ( selectee.selecting ) {
  12164. if ( ( event.metaKey || event.ctrlKey ) && selectee.startselected ) {
  12165. that._removeClass( selectee.$element, "ui-selecting" );
  12166. selectee.selecting = false;
  12167. that._addClass( selectee.$element, "ui-selected" );
  12168. selectee.selected = true;
  12169. } else {
  12170. that._removeClass( selectee.$element, "ui-selecting" );
  12171. selectee.selecting = false;
  12172. if ( selectee.startselected ) {
  12173. that._addClass( selectee.$element, "ui-unselecting" );
  12174. selectee.unselecting = true;
  12175. }
  12176. // selectable UNSELECTING callback
  12177. that._trigger( "unselecting", event, {
  12178. unselecting: selectee.element
  12179. } );
  12180. }
  12181. }
  12182. if ( selectee.selected ) {
  12183. if ( !event.metaKey && !event.ctrlKey && !selectee.startselected ) {
  12184. that._removeClass( selectee.$element, "ui-selected" );
  12185. selectee.selected = false;
  12186. that._addClass( selectee.$element, "ui-unselecting" );
  12187. selectee.unselecting = true;
  12188. // selectable UNSELECTING callback
  12189. that._trigger( "unselecting", event, {
  12190. unselecting: selectee.element
  12191. } );
  12192. }
  12193. }
  12194. }
  12195. } );
  12196. return false;
  12197. },
  12198. _mouseStop: function( event ) {
  12199. var that = this;
  12200. this.dragged = false;
  12201. $( ".ui-unselecting", this.element[ 0 ] ).each( function() {
  12202. var selectee = $.data( this, "selectable-item" );
  12203. that._removeClass( selectee.$element, "ui-unselecting" );
  12204. selectee.unselecting = false;
  12205. selectee.startselected = false;
  12206. that._trigger( "unselected", event, {
  12207. unselected: selectee.element
  12208. } );
  12209. } );
  12210. $( ".ui-selecting", this.element[ 0 ] ).each( function() {
  12211. var selectee = $.data( this, "selectable-item" );
  12212. that._removeClass( selectee.$element, "ui-selecting" )
  12213. ._addClass( selectee.$element, "ui-selected" );
  12214. selectee.selecting = false;
  12215. selectee.selected = true;
  12216. selectee.startselected = true;
  12217. that._trigger( "selected", event, {
  12218. selected: selectee.element
  12219. } );
  12220. } );
  12221. this._trigger( "stop", event );
  12222. this.helper.remove();
  12223. return false;
  12224. }
  12225. } );
  12226. /*!
  12227. * jQuery UI Selectmenu 1.12.1
  12228. * http://jqueryui.com
  12229. *
  12230. * Copyright jQuery Foundation and other contributors
  12231. * Released under the MIT license.
  12232. * http://jquery.org/license
  12233. */
  12234. //>>label: Selectmenu
  12235. //>>group: Widgets
  12236. // jscs:disable maximumLineLength
  12237. //>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select.
  12238. // jscs:enable maximumLineLength
  12239. //>>docs: http://api.jqueryui.com/selectmenu/
  12240. //>>demos: http://jqueryui.com/selectmenu/
  12241. //>>css.structure: ../../themes/base/core.css
  12242. //>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css
  12243. //>>css.theme: ../../themes/base/theme.css
  12244. var widgetsSelectmenu = $.widget( "ui.selectmenu", [ $.ui.formResetMixin, {
  12245. version: "1.12.1",
  12246. defaultElement: "<select>",
  12247. options: {
  12248. appendTo: null,
  12249. classes: {
  12250. "ui-selectmenu-button-open": "ui-corner-top",
  12251. "ui-selectmenu-button-closed": "ui-corner-all"
  12252. },
  12253. disabled: null,
  12254. icons: {
  12255. button: "ui-icon-triangle-1-s"
  12256. },
  12257. position: {
  12258. my: "left top",
  12259. at: "left bottom",
  12260. collision: "none"
  12261. },
  12262. width: false,
  12263. // Callbacks
  12264. change: null,
  12265. close: null,
  12266. focus: null,
  12267. open: null,
  12268. select: null
  12269. },
  12270. _create: function() {
  12271. var selectmenuId = this.element.uniqueId().attr( "id" );
  12272. this.ids = {
  12273. element: selectmenuId,
  12274. button: selectmenuId + "-button",
  12275. menu: selectmenuId + "-menu"
  12276. };
  12277. this._drawButton();
  12278. this._drawMenu();
  12279. this._bindFormResetHandler();
  12280. this._rendered = false;
  12281. this.menuItems = $();
  12282. },
  12283. _drawButton: function() {
  12284. var icon,
  12285. that = this,
  12286. item = this._parseOption(
  12287. this.element.find( "option:selected" ),
  12288. this.element[ 0 ].selectedIndex
  12289. );
  12290. // Associate existing label with the new button
  12291. this.labels = this.element.labels().attr( "for", this.ids.button );
  12292. this._on( this.labels, {
  12293. click: function( event ) {
  12294. this.button.focus();
  12295. event.preventDefault();
  12296. }
  12297. } );
  12298. // Hide original select element
  12299. this.element.hide();
  12300. // Create button
  12301. this.button = $( "<span>", {
  12302. tabindex: this.options.disabled ? -1 : 0,
  12303. id: this.ids.button,
  12304. role: "combobox",
  12305. "aria-expanded": "false",
  12306. "aria-autocomplete": "list",
  12307. "aria-owns": this.ids.menu,
  12308. "aria-haspopup": "true",
  12309. title: this.element.attr( "title" )
  12310. } )
  12311. .insertAfter( this.element );
  12312. this._addClass( this.button, "ui-selectmenu-button ui-selectmenu-button-closed",
  12313. "ui-button ui-widget" );
  12314. icon = $( "<span>" ).appendTo( this.button );
  12315. this._addClass( icon, "ui-selectmenu-icon", "ui-icon " + this.options.icons.button );
  12316. this.buttonItem = this._renderButtonItem( item )
  12317. .appendTo( this.button );
  12318. if ( this.options.width !== false ) {
  12319. this._resizeButton();
  12320. }
  12321. this._on( this.button, this._buttonEvents );
  12322. this.button.one( "focusin", function() {
  12323. // Delay rendering the menu items until the button receives focus.
  12324. // The menu may have already been rendered via a programmatic open.
  12325. if ( !that._rendered ) {
  12326. that._refreshMenu();
  12327. }
  12328. } );
  12329. },
  12330. _drawMenu: function() {
  12331. var that = this;
  12332. // Create menu
  12333. this.menu = $( "<ul>", {
  12334. "aria-hidden": "true",
  12335. "aria-labelledby": this.ids.button,
  12336. id: this.ids.menu
  12337. } );
  12338. // Wrap menu
  12339. this.menuWrap = $( "<div>" ).append( this.menu );
  12340. this._addClass( this.menuWrap, "ui-selectmenu-menu", "ui-front" );
  12341. this.menuWrap.appendTo( this._appendTo() );
  12342. // Initialize menu widget
  12343. this.menuInstance = this.menu
  12344. .menu( {
  12345. classes: {
  12346. "ui-menu": "ui-corner-bottom"
  12347. },
  12348. role: "listbox",
  12349. select: function( event, ui ) {
  12350. event.preventDefault();
  12351. // Support: IE8
  12352. // If the item was selected via a click, the text selection
  12353. // will be destroyed in IE
  12354. that._setSelection();
  12355. that._select( ui.item.data( "ui-selectmenu-item" ), event );
  12356. },
  12357. focus: function( event, ui ) {
  12358. var item = ui.item.data( "ui-selectmenu-item" );
  12359. // Prevent inital focus from firing and check if its a newly focused item
  12360. if ( that.focusIndex != null && item.index !== that.focusIndex ) {
  12361. that._trigger( "focus", event, { item: item } );
  12362. if ( !that.isOpen ) {
  12363. that._select( item, event );
  12364. }
  12365. }
  12366. that.focusIndex = item.index;
  12367. that.button.attr( "aria-activedescendant",
  12368. that.menuItems.eq( item.index ).attr( "id" ) );
  12369. }
  12370. } )
  12371. .menu( "instance" );
  12372. // Don't close the menu on mouseleave
  12373. this.menuInstance._off( this.menu, "mouseleave" );
  12374. // Cancel the menu's collapseAll on document click
  12375. this.menuInstance._closeOnDocumentClick = function() {
  12376. return false;
  12377. };
  12378. // Selects often contain empty items, but never contain dividers
  12379. this.menuInstance._isDivider = function() {
  12380. return false;
  12381. };
  12382. },
  12383. refresh: function() {
  12384. this._refreshMenu();
  12385. this.buttonItem.replaceWith(
  12386. this.buttonItem = this._renderButtonItem(
  12387. // Fall back to an empty object in case there are no options
  12388. this._getSelectedItem().data( "ui-selectmenu-item" ) || {}
  12389. )
  12390. );
  12391. if ( this.options.width === null ) {
  12392. this._resizeButton();
  12393. }
  12394. },
  12395. _refreshMenu: function() {
  12396. var item,
  12397. options = this.element.find( "option" );
  12398. this.menu.empty();
  12399. this._parseOptions( options );
  12400. this._renderMenu( this.menu, this.items );
  12401. this.menuInstance.refresh();
  12402. this.menuItems = this.menu.find( "li" )
  12403. .not( ".ui-selectmenu-optgroup" )
  12404. .find( ".ui-menu-item-wrapper" );
  12405. this._rendered = true;
  12406. if ( !options.length ) {
  12407. return;
  12408. }
  12409. item = this._getSelectedItem();
  12410. // Update the menu to have the correct item focused
  12411. this.menuInstance.focus( null, item );
  12412. this._setAria( item.data( "ui-selectmenu-item" ) );
  12413. // Set disabled state
  12414. this._setOption( "disabled", this.element.prop( "disabled" ) );
  12415. },
  12416. open: function( event ) {
  12417. if ( this.options.disabled ) {
  12418. return;
  12419. }
  12420. // If this is the first time the menu is being opened, render the items
  12421. if ( !this._rendered ) {
  12422. this._refreshMenu();
  12423. } else {
  12424. // Menu clears focus on close, reset focus to selected item
  12425. this._removeClass( this.menu.find( ".ui-state-active" ), null, "ui-state-active" );
  12426. this.menuInstance.focus( null, this._getSelectedItem() );
  12427. }
  12428. // If there are no options, don't open the menu
  12429. if ( !this.menuItems.length ) {
  12430. return;
  12431. }
  12432. this.isOpen = true;
  12433. this._toggleAttr();
  12434. this._resizeMenu();
  12435. this._position();
  12436. this._on( this.document, this._documentClick );
  12437. this._trigger( "open", event );
  12438. },
  12439. _position: function() {
  12440. this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
  12441. },
  12442. close: function( event ) {
  12443. if ( !this.isOpen ) {
  12444. return;
  12445. }
  12446. this.isOpen = false;
  12447. this._toggleAttr();
  12448. this.range = null;
  12449. this._off( this.document );
  12450. this._trigger( "close", event );
  12451. },
  12452. widget: function() {
  12453. return this.button;
  12454. },
  12455. menuWidget: function() {
  12456. return this.menu;
  12457. },
  12458. _renderButtonItem: function( item ) {
  12459. var buttonItem = $( "<span>" );
  12460. this._setText( buttonItem, item.label );
  12461. this._addClass( buttonItem, "ui-selectmenu-text" );
  12462. return buttonItem;
  12463. },
  12464. _renderMenu: function( ul, items ) {
  12465. var that = this,
  12466. currentOptgroup = "";
  12467. $.each( items, function( index, item ) {
  12468. var li;
  12469. if ( item.optgroup !== currentOptgroup ) {
  12470. li = $( "<li>", {
  12471. text: item.optgroup
  12472. } );
  12473. that._addClass( li, "ui-selectmenu-optgroup", "ui-menu-divider" +
  12474. ( item.element.parent( "optgroup" ).prop( "disabled" ) ?
  12475. " ui-state-disabled" :
  12476. "" ) );
  12477. li.appendTo( ul );
  12478. currentOptgroup = item.optgroup;
  12479. }
  12480. that._renderItemData( ul, item );
  12481. } );
  12482. },
  12483. _renderItemData: function( ul, item ) {
  12484. return this._renderItem( ul, item ).data( "ui-selectmenu-item", item );
  12485. },
  12486. _renderItem: function( ul, item ) {
  12487. var li = $( "<li>" ),
  12488. wrapper = $( "<div>", {
  12489. title: item.element.attr( "title" )
  12490. } );
  12491. if ( item.disabled ) {
  12492. this._addClass( li, null, "ui-state-disabled" );
  12493. }
  12494. this._setText( wrapper, item.label );
  12495. return li.append( wrapper ).appendTo( ul );
  12496. },
  12497. _setText: function( element, value ) {
  12498. if ( value ) {
  12499. element.text( value );
  12500. } else {
  12501. element.html( "&#160;" );
  12502. }
  12503. },
  12504. _move: function( direction, event ) {
  12505. var item, next,
  12506. filter = ".ui-menu-item";
  12507. if ( this.isOpen ) {
  12508. item = this.menuItems.eq( this.focusIndex ).parent( "li" );
  12509. } else {
  12510. item = this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" );
  12511. filter += ":not(.ui-state-disabled)";
  12512. }
  12513. if ( direction === "first" || direction === "last" ) {
  12514. next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 );
  12515. } else {
  12516. next = item[ direction + "All" ]( filter ).eq( 0 );
  12517. }
  12518. if ( next.length ) {
  12519. this.menuInstance.focus( event, next );
  12520. }
  12521. },
  12522. _getSelectedItem: function() {
  12523. return this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" );
  12524. },
  12525. _toggle: function( event ) {
  12526. this[ this.isOpen ? "close" : "open" ]( event );
  12527. },
  12528. _setSelection: function() {
  12529. var selection;
  12530. if ( !this.range ) {
  12531. return;
  12532. }
  12533. if ( window.getSelection ) {
  12534. selection = window.getSelection();
  12535. selection.removeAllRanges();
  12536. selection.addRange( this.range );
  12537. // Support: IE8
  12538. } else {
  12539. this.range.select();
  12540. }
  12541. // Support: IE
  12542. // Setting the text selection kills the button focus in IE, but
  12543. // restoring the focus doesn't kill the selection.
  12544. this.button.focus();
  12545. },
  12546. _documentClick: {
  12547. mousedown: function( event ) {
  12548. if ( !this.isOpen ) {
  12549. return;
  12550. }
  12551. if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" +
  12552. $.ui.escapeSelector( this.ids.button ) ).length ) {
  12553. this.close( event );
  12554. }
  12555. }
  12556. },
  12557. _buttonEvents: {
  12558. // Prevent text selection from being reset when interacting with the selectmenu (#10144)
  12559. mousedown: function() {
  12560. var selection;
  12561. if ( window.getSelection ) {
  12562. selection = window.getSelection();
  12563. if ( selection.rangeCount ) {
  12564. this.range = selection.getRangeAt( 0 );
  12565. }
  12566. // Support: IE8
  12567. } else {
  12568. this.range = document.selection.createRange();
  12569. }
  12570. },
  12571. click: function( event ) {
  12572. this._setSelection();
  12573. this._toggle( event );
  12574. },
  12575. keydown: function( event ) {
  12576. var preventDefault = true;
  12577. switch ( event.keyCode ) {
  12578. case $.ui.keyCode.TAB:
  12579. case $.ui.keyCode.ESCAPE:
  12580. this.close( event );
  12581. preventDefault = false;
  12582. break;
  12583. case $.ui.keyCode.ENTER:
  12584. if ( this.isOpen ) {
  12585. this._selectFocusedItem( event );
  12586. }
  12587. break;
  12588. case $.ui.keyCode.UP:
  12589. if ( event.altKey ) {
  12590. this._toggle( event );
  12591. } else {
  12592. this._move( "prev", event );
  12593. }
  12594. break;
  12595. case $.ui.keyCode.DOWN:
  12596. if ( event.altKey ) {
  12597. this._toggle( event );
  12598. } else {
  12599. this._move( "next", event );
  12600. }
  12601. break;
  12602. case $.ui.keyCode.SPACE:
  12603. if ( this.isOpen ) {
  12604. this._selectFocusedItem( event );
  12605. } else {
  12606. this._toggle( event );
  12607. }
  12608. break;
  12609. case $.ui.keyCode.LEFT:
  12610. this._move( "prev", event );
  12611. break;
  12612. case $.ui.keyCode.RIGHT:
  12613. this._move( "next", event );
  12614. break;
  12615. case $.ui.keyCode.HOME:
  12616. case $.ui.keyCode.PAGE_UP:
  12617. this._move( "first", event );
  12618. break;
  12619. case $.ui.keyCode.END:
  12620. case $.ui.keyCode.PAGE_DOWN:
  12621. this._move( "last", event );
  12622. break;
  12623. default:
  12624. this.menu.trigger( event );
  12625. preventDefault = false;
  12626. }
  12627. if ( preventDefault ) {
  12628. event.preventDefault();
  12629. }
  12630. }
  12631. },
  12632. _selectFocusedItem: function( event ) {
  12633. var item = this.menuItems.eq( this.focusIndex ).parent( "li" );
  12634. if ( !item.hasClass( "ui-state-disabled" ) ) {
  12635. this._select( item.data( "ui-selectmenu-item" ), event );
  12636. }
  12637. },
  12638. _select: function( item, event ) {
  12639. var oldIndex = this.element[ 0 ].selectedIndex;
  12640. // Change native select element
  12641. this.element[ 0 ].selectedIndex = item.index;
  12642. this.buttonItem.replaceWith( this.buttonItem = this._renderButtonItem( item ) );
  12643. this._setAria( item );
  12644. this._trigger( "select", event, { item: item } );
  12645. if ( item.index !== oldIndex ) {
  12646. this._trigger( "change", event, { item: item } );
  12647. }
  12648. this.close( event );
  12649. },
  12650. _setAria: function( item ) {
  12651. var id = this.menuItems.eq( item.index ).attr( "id" );
  12652. this.button.attr( {
  12653. "aria-labelledby": id,
  12654. "aria-activedescendant": id
  12655. } );
  12656. this.menu.attr( "aria-activedescendant", id );
  12657. },
  12658. _setOption: function( key, value ) {
  12659. if ( key === "icons" ) {
  12660. var icon = this.button.find( "span.ui-icon" );
  12661. this._removeClass( icon, null, this.options.icons.button )
  12662. ._addClass( icon, null, value.button );
  12663. }
  12664. this._super( key, value );
  12665. if ( key === "appendTo" ) {
  12666. this.menuWrap.appendTo( this._appendTo() );
  12667. }
  12668. if ( key === "width" ) {
  12669. this._resizeButton();
  12670. }
  12671. },
  12672. _setOptionDisabled: function( value ) {
  12673. this._super( value );
  12674. this.menuInstance.option( "disabled", value );
  12675. this.button.attr( "aria-disabled", value );
  12676. this._toggleClass( this.button, null, "ui-state-disabled", value );
  12677. this.element.prop( "disabled", value );
  12678. if ( value ) {
  12679. this.button.attr( "tabindex", -1 );
  12680. this.close();
  12681. } else {
  12682. this.button.attr( "tabindex", 0 );
  12683. }
  12684. },
  12685. _appendTo: function() {
  12686. var element = this.options.appendTo;
  12687. if ( element ) {
  12688. element = element.jquery || element.nodeType ?
  12689. $( element ) :
  12690. this.document.find( element ).eq( 0 );
  12691. }
  12692. if ( !element || !element[ 0 ] ) {
  12693. element = this.element.closest( ".ui-front, dialog" );
  12694. }
  12695. if ( !element.length ) {
  12696. element = this.document[ 0 ].body;
  12697. }
  12698. return element;
  12699. },
  12700. _toggleAttr: function() {
  12701. this.button.attr( "aria-expanded", this.isOpen );
  12702. // We can't use two _toggleClass() calls here, because we need to make sure
  12703. // we always remove classes first and add them second, otherwise if both classes have the
  12704. // same theme class, it will be removed after we add it.
  12705. this._removeClass( this.button, "ui-selectmenu-button-" +
  12706. ( this.isOpen ? "closed" : "open" ) )
  12707. ._addClass( this.button, "ui-selectmenu-button-" +
  12708. ( this.isOpen ? "open" : "closed" ) )
  12709. ._toggleClass( this.menuWrap, "ui-selectmenu-open", null, this.isOpen );
  12710. this.menu.attr( "aria-hidden", !this.isOpen );
  12711. },
  12712. _resizeButton: function() {
  12713. var width = this.options.width;
  12714. // For `width: false`, just remove inline style and stop
  12715. if ( width === false ) {
  12716. this.button.css( "width", "" );
  12717. return;
  12718. }
  12719. // For `width: null`, match the width of the original element
  12720. if ( width === null ) {
  12721. width = this.element.show().outerWidth();
  12722. this.element.hide();
  12723. }
  12724. this.button.outerWidth( width );
  12725. },
  12726. _resizeMenu: function() {
  12727. this.menu.outerWidth( Math.max(
  12728. this.button.outerWidth(),
  12729. // Support: IE10
  12730. // IE10 wraps long text (possibly a rounding bug)
  12731. // so we add 1px to avoid the wrapping
  12732. this.menu.width( "" ).outerWidth() + 1
  12733. ) );
  12734. },
  12735. _getCreateOptions: function() {
  12736. var options = this._super();
  12737. options.disabled = this.element.prop( "disabled" );
  12738. return options;
  12739. },
  12740. _parseOptions: function( options ) {
  12741. var that = this,
  12742. data = [];
  12743. options.each( function( index, item ) {
  12744. data.push( that._parseOption( $( item ), index ) );
  12745. } );
  12746. this.items = data;
  12747. },
  12748. _parseOption: function( option, index ) {
  12749. var optgroup = option.parent( "optgroup" );
  12750. return {
  12751. element: option,
  12752. index: index,
  12753. value: option.val(),
  12754. label: option.text(),
  12755. optgroup: optgroup.attr( "label" ) || "",
  12756. disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
  12757. };
  12758. },
  12759. _destroy: function() {
  12760. this._unbindFormResetHandler();
  12761. this.menuWrap.remove();
  12762. this.button.remove();
  12763. this.element.show();
  12764. this.element.removeUniqueId();
  12765. this.labels.attr( "for", this.ids.element );
  12766. }
  12767. } ] );
  12768. /*!
  12769. * jQuery UI Slider 1.12.1
  12770. * http://jqueryui.com
  12771. *
  12772. * Copyright jQuery Foundation and other contributors
  12773. * Released under the MIT license.
  12774. * http://jquery.org/license
  12775. */
  12776. //>>label: Slider
  12777. //>>group: Widgets
  12778. //>>description: Displays a flexible slider with ranges and accessibility via keyboard.
  12779. //>>docs: http://api.jqueryui.com/slider/
  12780. //>>demos: http://jqueryui.com/slider/
  12781. //>>css.structure: ../../themes/base/core.css
  12782. //>>css.structure: ../../themes/base/slider.css
  12783. //>>css.theme: ../../themes/base/theme.css
  12784. var widgetsSlider = $.widget( "ui.slider", $.ui.mouse, {
  12785. version: "1.12.1",
  12786. widgetEventPrefix: "slide",
  12787. options: {
  12788. animate: false,
  12789. classes: {
  12790. "ui-slider": "ui-corner-all",
  12791. "ui-slider-handle": "ui-corner-all",
  12792. // Note: ui-widget-header isn't the most fittingly semantic framework class for this
  12793. // element, but worked best visually with a variety of themes
  12794. "ui-slider-range": "ui-corner-all ui-widget-header"
  12795. },
  12796. distance: 0,
  12797. max: 100,
  12798. min: 0,
  12799. orientation: "horizontal",
  12800. range: false,
  12801. step: 1,
  12802. value: 0,
  12803. values: null,
  12804. // Callbacks
  12805. change: null,
  12806. slide: null,
  12807. start: null,
  12808. stop: null
  12809. },
  12810. // Number of pages in a slider
  12811. // (how many times can you page up/down to go through the whole range)
  12812. numPages: 5,
  12813. _create: function() {
  12814. this._keySliding = false;
  12815. this._mouseSliding = false;
  12816. this._animateOff = true;
  12817. this._handleIndex = null;
  12818. this._detectOrientation();
  12819. this._mouseInit();
  12820. this._calculateNewMax();
  12821. this._addClass( "ui-slider ui-slider-" + this.orientation,
  12822. "ui-widget ui-widget-content" );
  12823. this._refresh();
  12824. this._animateOff = false;
  12825. },
  12826. _refresh: function() {
  12827. this._createRange();
  12828. this._createHandles();
  12829. this._setupEvents();
  12830. this._refreshValue();
  12831. },
  12832. _createHandles: function() {
  12833. var i, handleCount,
  12834. options = this.options,
  12835. existingHandles = this.element.find( ".ui-slider-handle" ),
  12836. handle = "<span tabindex='0'></span>",
  12837. handles = [];
  12838. handleCount = ( options.values && options.values.length ) || 1;
  12839. if ( existingHandles.length > handleCount ) {
  12840. existingHandles.slice( handleCount ).remove();
  12841. existingHandles = existingHandles.slice( 0, handleCount );
  12842. }
  12843. for ( i = existingHandles.length; i < handleCount; i++ ) {
  12844. handles.push( handle );
  12845. }
  12846. this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
  12847. this._addClass( this.handles, "ui-slider-handle", "ui-state-default" );
  12848. this.handle = this.handles.eq( 0 );
  12849. this.handles.each( function( i ) {
  12850. $( this )
  12851. .data( "ui-slider-handle-index", i )
  12852. .attr( "tabIndex", 0 );
  12853. } );
  12854. },
  12855. _createRange: function() {
  12856. var options = this.options;
  12857. if ( options.range ) {
  12858. if ( options.range === true ) {
  12859. if ( !options.values ) {
  12860. options.values = [ this._valueMin(), this._valueMin() ];
  12861. } else if ( options.values.length && options.values.length !== 2 ) {
  12862. options.values = [ options.values[ 0 ], options.values[ 0 ] ];
  12863. } else if ( $.isArray( options.values ) ) {
  12864. options.values = options.values.slice( 0 );
  12865. }
  12866. }
  12867. if ( !this.range || !this.range.length ) {
  12868. this.range = $( "<div>" )
  12869. .appendTo( this.element );
  12870. this._addClass( this.range, "ui-slider-range" );
  12871. } else {
  12872. this._removeClass( this.range, "ui-slider-range-min ui-slider-range-max" );
  12873. // Handle range switching from true to min/max
  12874. this.range.css( {
  12875. "left": "",
  12876. "bottom": ""
  12877. } );
  12878. }
  12879. if ( options.range === "min" || options.range === "max" ) {
  12880. this._addClass( this.range, "ui-slider-range-" + options.range );
  12881. }
  12882. } else {
  12883. if ( this.range ) {
  12884. this.range.remove();
  12885. }
  12886. this.range = null;
  12887. }
  12888. },
  12889. _setupEvents: function() {
  12890. this._off( this.handles );
  12891. this._on( this.handles, this._handleEvents );
  12892. this._hoverable( this.handles );
  12893. this._focusable( this.handles );
  12894. },
  12895. _destroy: function() {
  12896. this.handles.remove();
  12897. if ( this.range ) {
  12898. this.range.remove();
  12899. }
  12900. this._mouseDestroy();
  12901. },
  12902. _mouseCapture: function( event ) {
  12903. var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
  12904. that = this,
  12905. o = this.options;
  12906. if ( o.disabled ) {
  12907. return false;
  12908. }
  12909. this.elementSize = {
  12910. width: this.element.outerWidth(),
  12911. height: this.element.outerHeight()
  12912. };
  12913. this.elementOffset = this.element.offset();
  12914. position = { x: event.pageX, y: event.pageY };
  12915. normValue = this._normValueFromMouse( position );
  12916. distance = this._valueMax() - this._valueMin() + 1;
  12917. this.handles.each( function( i ) {
  12918. var thisDistance = Math.abs( normValue - that.values( i ) );
  12919. if ( ( distance > thisDistance ) ||
  12920. ( distance === thisDistance &&
  12921. ( i === that._lastChangedValue || that.values( i ) === o.min ) ) ) {
  12922. distance = thisDistance;
  12923. closestHandle = $( this );
  12924. index = i;
  12925. }
  12926. } );
  12927. allowed = this._start( event, index );
  12928. if ( allowed === false ) {
  12929. return false;
  12930. }
  12931. this._mouseSliding = true;
  12932. this._handleIndex = index;
  12933. this._addClass( closestHandle, null, "ui-state-active" );
  12934. closestHandle.trigger( "focus" );
  12935. offset = closestHandle.offset();
  12936. mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
  12937. this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
  12938. left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
  12939. top: event.pageY - offset.top -
  12940. ( closestHandle.height() / 2 ) -
  12941. ( parseInt( closestHandle.css( "borderTopWidth" ), 10 ) || 0 ) -
  12942. ( parseInt( closestHandle.css( "borderBottomWidth" ), 10 ) || 0 ) +
  12943. ( parseInt( closestHandle.css( "marginTop" ), 10 ) || 0 )
  12944. };
  12945. if ( !this.handles.hasClass( "ui-state-hover" ) ) {
  12946. this._slide( event, index, normValue );
  12947. }
  12948. this._animateOff = true;
  12949. return true;
  12950. },
  12951. _mouseStart: function() {
  12952. return true;
  12953. },
  12954. _mouseDrag: function( event ) {
  12955. var position = { x: event.pageX, y: event.pageY },
  12956. normValue = this._normValueFromMouse( position );
  12957. this._slide( event, this._handleIndex, normValue );
  12958. return false;
  12959. },
  12960. _mouseStop: function( event ) {
  12961. this._removeClass( this.handles, null, "ui-state-active" );
  12962. this._mouseSliding = false;
  12963. this._stop( event, this._handleIndex );
  12964. this._change( event, this._handleIndex );
  12965. this._handleIndex = null;
  12966. this._clickOffset = null;
  12967. this._animateOff = false;
  12968. return false;
  12969. },
  12970. _detectOrientation: function() {
  12971. this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
  12972. },
  12973. _normValueFromMouse: function( position ) {
  12974. var pixelTotal,
  12975. pixelMouse,
  12976. percentMouse,
  12977. valueTotal,
  12978. valueMouse;
  12979. if ( this.orientation === "horizontal" ) {
  12980. pixelTotal = this.elementSize.width;
  12981. pixelMouse = position.x - this.elementOffset.left -
  12982. ( this._clickOffset ? this._clickOffset.left : 0 );
  12983. } else {
  12984. pixelTotal = this.elementSize.height;
  12985. pixelMouse = position.y - this.elementOffset.top -
  12986. ( this._clickOffset ? this._clickOffset.top : 0 );
  12987. }
  12988. percentMouse = ( pixelMouse / pixelTotal );
  12989. if ( percentMouse > 1 ) {
  12990. percentMouse = 1;
  12991. }
  12992. if ( percentMouse < 0 ) {
  12993. percentMouse = 0;
  12994. }
  12995. if ( this.orientation === "vertical" ) {
  12996. percentMouse = 1 - percentMouse;
  12997. }
  12998. valueTotal = this._valueMax() - this._valueMin();
  12999. valueMouse = this._valueMin() + percentMouse * valueTotal;
  13000. return this._trimAlignValue( valueMouse );
  13001. },
  13002. _uiHash: function( index, value, values ) {
  13003. var uiHash = {
  13004. handle: this.handles[ index ],
  13005. handleIndex: index,
  13006. value: value !== undefined ? value : this.value()
  13007. };
  13008. if ( this._hasMultipleValues() ) {
  13009. uiHash.value = value !== undefined ? value : this.values( index );
  13010. uiHash.values = values || this.values();
  13011. }
  13012. return uiHash;
  13013. },
  13014. _hasMultipleValues: function() {
  13015. return this.options.values && this.options.values.length;
  13016. },
  13017. _start: function( event, index ) {
  13018. return this._trigger( "start", event, this._uiHash( index ) );
  13019. },
  13020. _slide: function( event, index, newVal ) {
  13021. var allowed, otherVal,
  13022. currentValue = this.value(),
  13023. newValues = this.values();
  13024. if ( this._hasMultipleValues() ) {
  13025. otherVal = this.values( index ? 0 : 1 );
  13026. currentValue = this.values( index );
  13027. if ( this.options.values.length === 2 && this.options.range === true ) {
  13028. newVal = index === 0 ? Math.min( otherVal, newVal ) : Math.max( otherVal, newVal );
  13029. }
  13030. newValues[ index ] = newVal;
  13031. }
  13032. if ( newVal === currentValue ) {
  13033. return;
  13034. }
  13035. allowed = this._trigger( "slide", event, this._uiHash( index, newVal, newValues ) );
  13036. // A slide can be canceled by returning false from the slide callback
  13037. if ( allowed === false ) {
  13038. return;
  13039. }
  13040. if ( this._hasMultipleValues() ) {
  13041. this.values( index, newVal );
  13042. } else {
  13043. this.value( newVal );
  13044. }
  13045. },
  13046. _stop: function( event, index ) {
  13047. this._trigger( "stop", event, this._uiHash( index ) );
  13048. },
  13049. _change: function( event, index ) {
  13050. if ( !this._keySliding && !this._mouseSliding ) {
  13051. //store the last changed value index for reference when handles overlap
  13052. this._lastChangedValue = index;
  13053. this._trigger( "change", event, this._uiHash( index ) );
  13054. }
  13055. },
  13056. value: function( newValue ) {
  13057. if ( arguments.length ) {
  13058. this.options.value = this._trimAlignValue( newValue );
  13059. this._refreshValue();
  13060. this._change( null, 0 );
  13061. return;
  13062. }
  13063. return this._value();
  13064. },
  13065. values: function( index, newValue ) {
  13066. var vals,
  13067. newValues,
  13068. i;
  13069. if ( arguments.length > 1 ) {
  13070. this.options.values[ index ] = this._trimAlignValue( newValue );
  13071. this._refreshValue();
  13072. this._change( null, index );
  13073. return;
  13074. }
  13075. if ( arguments.length ) {
  13076. if ( $.isArray( arguments[ 0 ] ) ) {
  13077. vals = this.options.values;
  13078. newValues = arguments[ 0 ];
  13079. for ( i = 0; i < vals.length; i += 1 ) {
  13080. vals[ i ] = this._trimAlignValue( newValues[ i ] );
  13081. this._change( null, i );
  13082. }
  13083. this._refreshValue();
  13084. } else {
  13085. if ( this._hasMultipleValues() ) {
  13086. return this._values( index );
  13087. } else {
  13088. return this.value();
  13089. }
  13090. }
  13091. } else {
  13092. return this._values();
  13093. }
  13094. },
  13095. _setOption: function( key, value ) {
  13096. var i,
  13097. valsLength = 0;
  13098. if ( key === "range" && this.options.range === true ) {
  13099. if ( value === "min" ) {
  13100. this.options.value = this._values( 0 );
  13101. this.options.values = null;
  13102. } else if ( value === "max" ) {
  13103. this.options.value = this._values( this.options.values.length - 1 );
  13104. this.options.values = null;
  13105. }
  13106. }
  13107. if ( $.isArray( this.options.values ) ) {
  13108. valsLength = this.options.values.length;
  13109. }
  13110. this._super( key, value );
  13111. switch ( key ) {
  13112. case "orientation":
  13113. this._detectOrientation();
  13114. this._removeClass( "ui-slider-horizontal ui-slider-vertical" )
  13115. ._addClass( "ui-slider-" + this.orientation );
  13116. this._refreshValue();
  13117. if ( this.options.range ) {
  13118. this._refreshRange( value );
  13119. }
  13120. // Reset positioning from previous orientation
  13121. this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
  13122. break;
  13123. case "value":
  13124. this._animateOff = true;
  13125. this._refreshValue();
  13126. this._change( null, 0 );
  13127. this._animateOff = false;
  13128. break;
  13129. case "values":
  13130. this._animateOff = true;
  13131. this._refreshValue();
  13132. // Start from the last handle to prevent unreachable handles (#9046)
  13133. for ( i = valsLength - 1; i >= 0; i-- ) {
  13134. this._change( null, i );
  13135. }
  13136. this._animateOff = false;
  13137. break;
  13138. case "step":
  13139. case "min":
  13140. case "max":
  13141. this._animateOff = true;
  13142. this._calculateNewMax();
  13143. this._refreshValue();
  13144. this._animateOff = false;
  13145. break;
  13146. case "range":
  13147. this._animateOff = true;
  13148. this._refresh();
  13149. this._animateOff = false;
  13150. break;
  13151. }
  13152. },
  13153. _setOptionDisabled: function( value ) {
  13154. this._super( value );
  13155. this._toggleClass( null, "ui-state-disabled", !!value );
  13156. },
  13157. //internal value getter
  13158. // _value() returns value trimmed by min and max, aligned by step
  13159. _value: function() {
  13160. var val = this.options.value;
  13161. val = this._trimAlignValue( val );
  13162. return val;
  13163. },
  13164. //internal values getter
  13165. // _values() returns array of values trimmed by min and max, aligned by step
  13166. // _values( index ) returns single value trimmed by min and max, aligned by step
  13167. _values: function( index ) {
  13168. var val,
  13169. vals,
  13170. i;
  13171. if ( arguments.length ) {
  13172. val = this.options.values[ index ];
  13173. val = this._trimAlignValue( val );
  13174. return val;
  13175. } else if ( this._hasMultipleValues() ) {
  13176. // .slice() creates a copy of the array
  13177. // this copy gets trimmed by min and max and then returned
  13178. vals = this.options.values.slice();
  13179. for ( i = 0; i < vals.length; i += 1 ) {
  13180. vals[ i ] = this._trimAlignValue( vals[ i ] );
  13181. }
  13182. return vals;
  13183. } else {
  13184. return [];
  13185. }
  13186. },
  13187. // Returns the step-aligned value that val is closest to, between (inclusive) min and max
  13188. _trimAlignValue: function( val ) {
  13189. if ( val <= this._valueMin() ) {
  13190. return this._valueMin();
  13191. }
  13192. if ( val >= this._valueMax() ) {
  13193. return this._valueMax();
  13194. }
  13195. var step = ( this.options.step > 0 ) ? this.options.step : 1,
  13196. valModStep = ( val - this._valueMin() ) % step,
  13197. alignValue = val - valModStep;
  13198. if ( Math.abs( valModStep ) * 2 >= step ) {
  13199. alignValue += ( valModStep > 0 ) ? step : ( -step );
  13200. }
  13201. // Since JavaScript has problems with large floats, round
  13202. // the final value to 5 digits after the decimal point (see #4124)
  13203. return parseFloat( alignValue.toFixed( 5 ) );
  13204. },
  13205. _calculateNewMax: function() {
  13206. var max = this.options.max,
  13207. min = this._valueMin(),
  13208. step = this.options.step,
  13209. aboveMin = Math.round( ( max - min ) / step ) * step;
  13210. max = aboveMin + min;
  13211. if ( max > this.options.max ) {
  13212. //If max is not divisible by step, rounding off may increase its value
  13213. max -= step;
  13214. }
  13215. this.max = parseFloat( max.toFixed( this._precision() ) );
  13216. },
  13217. _precision: function() {
  13218. var precision = this._precisionOf( this.options.step );
  13219. if ( this.options.min !== null ) {
  13220. precision = Math.max( precision, this._precisionOf( this.options.min ) );
  13221. }
  13222. return precision;
  13223. },
  13224. _precisionOf: function( num ) {
  13225. var str = num.toString(),
  13226. decimal = str.indexOf( "." );
  13227. return decimal === -1 ? 0 : str.length - decimal - 1;
  13228. },
  13229. _valueMin: function() {
  13230. return this.options.min;
  13231. },
  13232. _valueMax: function() {
  13233. return this.max;
  13234. },
  13235. _refreshRange: function( orientation ) {
  13236. if ( orientation === "vertical" ) {
  13237. this.range.css( { "width": "", "left": "" } );
  13238. }
  13239. if ( orientation === "horizontal" ) {
  13240. this.range.css( { "height": "", "bottom": "" } );
  13241. }
  13242. },
  13243. _refreshValue: function() {
  13244. var lastValPercent, valPercent, value, valueMin, valueMax,
  13245. oRange = this.options.range,
  13246. o = this.options,
  13247. that = this,
  13248. animate = ( !this._animateOff ) ? o.animate : false,
  13249. _set = {};
  13250. if ( this._hasMultipleValues() ) {
  13251. this.handles.each( function( i ) {
  13252. valPercent = ( that.values( i ) - that._valueMin() ) / ( that._valueMax() -
  13253. that._valueMin() ) * 100;
  13254. _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
  13255. $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
  13256. if ( that.options.range === true ) {
  13257. if ( that.orientation === "horizontal" ) {
  13258. if ( i === 0 ) {
  13259. that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
  13260. left: valPercent + "%"
  13261. }, o.animate );
  13262. }
  13263. if ( i === 1 ) {
  13264. that.range[ animate ? "animate" : "css" ]( {
  13265. width: ( valPercent - lastValPercent ) + "%"
  13266. }, {
  13267. queue: false,
  13268. duration: o.animate
  13269. } );
  13270. }
  13271. } else {
  13272. if ( i === 0 ) {
  13273. that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
  13274. bottom: ( valPercent ) + "%"
  13275. }, o.animate );
  13276. }
  13277. if ( i === 1 ) {
  13278. that.range[ animate ? "animate" : "css" ]( {
  13279. height: ( valPercent - lastValPercent ) + "%"
  13280. }, {
  13281. queue: false,
  13282. duration: o.animate
  13283. } );
  13284. }
  13285. }
  13286. }
  13287. lastValPercent = valPercent;
  13288. } );
  13289. } else {
  13290. value = this.value();
  13291. valueMin = this._valueMin();
  13292. valueMax = this._valueMax();
  13293. valPercent = ( valueMax !== valueMin ) ?
  13294. ( value - valueMin ) / ( valueMax - valueMin ) * 100 :
  13295. 0;
  13296. _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
  13297. this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
  13298. if ( oRange === "min" && this.orientation === "horizontal" ) {
  13299. this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
  13300. width: valPercent + "%"
  13301. }, o.animate );
  13302. }
  13303. if ( oRange === "max" && this.orientation === "horizontal" ) {
  13304. this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
  13305. width: ( 100 - valPercent ) + "%"
  13306. }, o.animate );
  13307. }
  13308. if ( oRange === "min" && this.orientation === "vertical" ) {
  13309. this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
  13310. height: valPercent + "%"
  13311. }, o.animate );
  13312. }
  13313. if ( oRange === "max" && this.orientation === "vertical" ) {
  13314. this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
  13315. height: ( 100 - valPercent ) + "%"
  13316. }, o.animate );
  13317. }
  13318. }
  13319. },
  13320. _handleEvents: {
  13321. keydown: function( event ) {
  13322. var allowed, curVal, newVal, step,
  13323. index = $( event.target ).data( "ui-slider-handle-index" );
  13324. switch ( event.keyCode ) {
  13325. case $.ui.keyCode.HOME:
  13326. case $.ui.keyCode.END:
  13327. case $.ui.keyCode.PAGE_UP:
  13328. case $.ui.keyCode.PAGE_DOWN:
  13329. case $.ui.keyCode.UP:
  13330. case $.ui.keyCode.RIGHT:
  13331. case $.ui.keyCode.DOWN:
  13332. case $.ui.keyCode.LEFT:
  13333. event.preventDefault();
  13334. if ( !this._keySliding ) {
  13335. this._keySliding = true;
  13336. this._addClass( $( event.target ), null, "ui-state-active" );
  13337. allowed = this._start( event, index );
  13338. if ( allowed === false ) {
  13339. return;
  13340. }
  13341. }
  13342. break;
  13343. }
  13344. step = this.options.step;
  13345. if ( this._hasMultipleValues() ) {
  13346. curVal = newVal = this.values( index );
  13347. } else {
  13348. curVal = newVal = this.value();
  13349. }
  13350. switch ( event.keyCode ) {
  13351. case $.ui.keyCode.HOME:
  13352. newVal = this._valueMin();
  13353. break;
  13354. case $.ui.keyCode.END:
  13355. newVal = this._valueMax();
  13356. break;
  13357. case $.ui.keyCode.PAGE_UP:
  13358. newVal = this._trimAlignValue(
  13359. curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
  13360. );
  13361. break;
  13362. case $.ui.keyCode.PAGE_DOWN:
  13363. newVal = this._trimAlignValue(
  13364. curVal - ( ( this._valueMax() - this._valueMin() ) / this.numPages ) );
  13365. break;
  13366. case $.ui.keyCode.UP:
  13367. case $.ui.keyCode.RIGHT:
  13368. if ( curVal === this._valueMax() ) {
  13369. return;
  13370. }
  13371. newVal = this._trimAlignValue( curVal + step );
  13372. break;
  13373. case $.ui.keyCode.DOWN:
  13374. case $.ui.keyCode.LEFT:
  13375. if ( curVal === this._valueMin() ) {
  13376. return;
  13377. }
  13378. newVal = this._trimAlignValue( curVal - step );
  13379. break;
  13380. }
  13381. this._slide( event, index, newVal );
  13382. },
  13383. keyup: function( event ) {
  13384. var index = $( event.target ).data( "ui-slider-handle-index" );
  13385. if ( this._keySliding ) {
  13386. this._keySliding = false;
  13387. this._stop( event, index );
  13388. this._change( event, index );
  13389. this._removeClass( $( event.target ), null, "ui-state-active" );
  13390. }
  13391. }
  13392. }
  13393. } );
  13394. /*!
  13395. * jQuery UI Sortable 1.12.1
  13396. * http://jqueryui.com
  13397. *
  13398. * Copyright jQuery Foundation and other contributors
  13399. * Released under the MIT license.
  13400. * http://jquery.org/license
  13401. */
  13402. //>>label: Sortable
  13403. //>>group: Interactions
  13404. //>>description: Enables items in a list to be sorted using the mouse.
  13405. //>>docs: http://api.jqueryui.com/sortable/
  13406. //>>demos: http://jqueryui.com/sortable/
  13407. //>>css.structure: ../../themes/base/sortable.css
  13408. var widgetsSortable = $.widget( "ui.sortable", $.ui.mouse, {
  13409. version: "1.12.1",
  13410. widgetEventPrefix: "sort",
  13411. ready: false,
  13412. options: {
  13413. appendTo: "parent",
  13414. axis: false,
  13415. connectWith: false,
  13416. containment: false,
  13417. cursor: "auto",
  13418. cursorAt: false,
  13419. dropOnEmpty: true,
  13420. forcePlaceholderSize: false,
  13421. forceHelperSize: false,
  13422. grid: false,
  13423. handle: false,
  13424. helper: "original",
  13425. items: "> *",
  13426. opacity: false,
  13427. placeholder: false,
  13428. revert: false,
  13429. scroll: true,
  13430. scrollSensitivity: 20,
  13431. scrollSpeed: 20,
  13432. scope: "default",
  13433. tolerance: "intersect",
  13434. zIndex: 1000,
  13435. // Callbacks
  13436. activate: null,
  13437. beforeStop: null,
  13438. change: null,
  13439. deactivate: null,
  13440. out: null,
  13441. over: null,
  13442. receive: null,
  13443. remove: null,
  13444. sort: null,
  13445. start: null,
  13446. stop: null,
  13447. update: null
  13448. },
  13449. _isOverAxis: function( x, reference, size ) {
  13450. return ( x >= reference ) && ( x < ( reference + size ) );
  13451. },
  13452. _isFloating: function( item ) {
  13453. return ( /left|right/ ).test( item.css( "float" ) ) ||
  13454. ( /inline|table-cell/ ).test( item.css( "display" ) );
  13455. },
  13456. _create: function() {
  13457. this.containerCache = {};
  13458. this._addClass( "ui-sortable" );
  13459. //Get the items
  13460. this.refresh();
  13461. //Let's determine the parent's offset
  13462. this.offset = this.element.offset();
  13463. //Initialize mouse events for interaction
  13464. this._mouseInit();
  13465. this._setHandleClassName();
  13466. //We're ready to go
  13467. this.ready = true;
  13468. },
  13469. _setOption: function( key, value ) {
  13470. this._super( key, value );
  13471. if ( key === "handle" ) {
  13472. this._setHandleClassName();
  13473. }
  13474. },
  13475. _setHandleClassName: function() {
  13476. var that = this;
  13477. this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" );
  13478. $.each( this.items, function() {
  13479. that._addClass(
  13480. this.instance.options.handle ?
  13481. this.item.find( this.instance.options.handle ) :
  13482. this.item,
  13483. "ui-sortable-handle"
  13484. );
  13485. } );
  13486. },
  13487. _destroy: function() {
  13488. this._mouseDestroy();
  13489. for ( var i = this.items.length - 1; i >= 0; i-- ) {
  13490. this.items[ i ].item.removeData( this.widgetName + "-item" );
  13491. }
  13492. return this;
  13493. },
  13494. _mouseCapture: function( event, overrideHandle ) {
  13495. var currentItem = null,
  13496. validHandle = false,
  13497. that = this;
  13498. if ( this.reverting ) {
  13499. return false;
  13500. }
  13501. if ( this.options.disabled || this.options.type === "static" ) {
  13502. return false;
  13503. }
  13504. //We have to refresh the items data once first
  13505. this._refreshItems( event );
  13506. //Find out if the clicked node (or one of its parents) is a actual item in this.items
  13507. $( event.target ).parents().each( function() {
  13508. if ( $.data( this, that.widgetName + "-item" ) === that ) {
  13509. currentItem = $( this );
  13510. return false;
  13511. }
  13512. } );
  13513. if ( $.data( event.target, that.widgetName + "-item" ) === that ) {
  13514. currentItem = $( event.target );
  13515. }
  13516. if ( !currentItem ) {
  13517. return false;
  13518. }
  13519. if ( this.options.handle && !overrideHandle ) {
  13520. $( this.options.handle, currentItem ).find( "*" ).addBack().each( function() {
  13521. if ( this === event.target ) {
  13522. validHandle = true;
  13523. }
  13524. } );
  13525. if ( !validHandle ) {
  13526. return false;
  13527. }
  13528. }
  13529. this.currentItem = currentItem;
  13530. this._removeCurrentsFromItems();
  13531. return true;
  13532. },
  13533. _mouseStart: function( event, overrideHandle, noActivation ) {
  13534. var i, body,
  13535. o = this.options;
  13536. this.currentContainer = this;
  13537. //We only need to call refreshPositions, because the refreshItems call has been moved to
  13538. // mouseCapture
  13539. this.refreshPositions();
  13540. //Create and append the visible helper
  13541. this.helper = this._createHelper( event );
  13542. //Cache the helper size
  13543. this._cacheHelperProportions();
  13544. /*
  13545. * - Position generation -
  13546. * This block generates everything position related - it's the core of draggables.
  13547. */
  13548. //Cache the margins of the original element
  13549. this._cacheMargins();
  13550. //Get the next scrolling parent
  13551. this.scrollParent = this.helper.scrollParent();
  13552. //The element's absolute position on the page minus margins
  13553. this.offset = this.currentItem.offset();
  13554. this.offset = {
  13555. top: this.offset.top - this.margins.top,
  13556. left: this.offset.left - this.margins.left
  13557. };
  13558. $.extend( this.offset, {
  13559. click: { //Where the click happened, relative to the element
  13560. left: event.pageX - this.offset.left,
  13561. top: event.pageY - this.offset.top
  13562. },
  13563. parent: this._getParentOffset(),
  13564. // This is a relative to absolute position minus the actual position calculation -
  13565. // only used for relative positioned helper
  13566. relative: this._getRelativeOffset()
  13567. } );
  13568. // Only after we got the offset, we can change the helper's position to absolute
  13569. // TODO: Still need to figure out a way to make relative sorting possible
  13570. this.helper.css( "position", "absolute" );
  13571. this.cssPosition = this.helper.css( "position" );
  13572. //Generate the original position
  13573. this.originalPosition = this._generatePosition( event );
  13574. this.originalPageX = event.pageX;
  13575. this.originalPageY = event.pageY;
  13576. //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
  13577. ( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) );
  13578. //Cache the former DOM position
  13579. this.domPosition = {
  13580. prev: this.currentItem.prev()[ 0 ],
  13581. parent: this.currentItem.parent()[ 0 ]
  13582. };
  13583. // If the helper is not the original, hide the original so it's not playing any role during
  13584. // the drag, won't cause anything bad this way
  13585. if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
  13586. this.currentItem.hide();
  13587. }
  13588. //Create the placeholder
  13589. this._createPlaceholder();
  13590. //Set a containment if given in the options
  13591. if ( o.containment ) {
  13592. this._setContainment();
  13593. }
  13594. if ( o.cursor && o.cursor !== "auto" ) { // cursor option
  13595. body = this.document.find( "body" );
  13596. // Support: IE
  13597. this.storedCursor = body.css( "cursor" );
  13598. body.css( "cursor", o.cursor );
  13599. this.storedStylesheet =
  13600. $( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body );
  13601. }
  13602. if ( o.opacity ) { // opacity option
  13603. if ( this.helper.css( "opacity" ) ) {
  13604. this._storedOpacity = this.helper.css( "opacity" );
  13605. }
  13606. this.helper.css( "opacity", o.opacity );
  13607. }
  13608. if ( o.zIndex ) { // zIndex option
  13609. if ( this.helper.css( "zIndex" ) ) {
  13610. this._storedZIndex = this.helper.css( "zIndex" );
  13611. }
  13612. this.helper.css( "zIndex", o.zIndex );
  13613. }
  13614. //Prepare scrolling
  13615. if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
  13616. this.scrollParent[ 0 ].tagName !== "HTML" ) {
  13617. this.overflowOffset = this.scrollParent.offset();
  13618. }
  13619. //Call callbacks
  13620. this._trigger( "start", event, this._uiHash() );
  13621. //Recache the helper size
  13622. if ( !this._preserveHelperProportions ) {
  13623. this._cacheHelperProportions();
  13624. }
  13625. //Post "activate" events to possible containers
  13626. if ( !noActivation ) {
  13627. for ( i = this.containers.length - 1; i >= 0; i-- ) {
  13628. this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
  13629. }
  13630. }
  13631. //Prepare possible droppables
  13632. if ( $.ui.ddmanager ) {
  13633. $.ui.ddmanager.current = this;
  13634. }
  13635. if ( $.ui.ddmanager && !o.dropBehaviour ) {
  13636. $.ui.ddmanager.prepareOffsets( this, event );
  13637. }
  13638. this.dragging = true;
  13639. this._addClass( this.helper, "ui-sortable-helper" );
  13640. // Execute the drag once - this causes the helper not to be visiblebefore getting its
  13641. // correct position
  13642. this._mouseDrag( event );
  13643. return true;
  13644. },
  13645. _mouseDrag: function( event ) {
  13646. var i, item, itemElement, intersection,
  13647. o = this.options,
  13648. scrolled = false;
  13649. //Compute the helpers position
  13650. this.position = this._generatePosition( event );
  13651. this.positionAbs = this._convertPositionTo( "absolute" );
  13652. if ( !this.lastPositionAbs ) {
  13653. this.lastPositionAbs = this.positionAbs;
  13654. }
  13655. //Do scrolling
  13656. if ( this.options.scroll ) {
  13657. if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
  13658. this.scrollParent[ 0 ].tagName !== "HTML" ) {
  13659. if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) -
  13660. event.pageY < o.scrollSensitivity ) {
  13661. this.scrollParent[ 0 ].scrollTop =
  13662. scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed;
  13663. } else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) {
  13664. this.scrollParent[ 0 ].scrollTop =
  13665. scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed;
  13666. }
  13667. if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) -
  13668. event.pageX < o.scrollSensitivity ) {
  13669. this.scrollParent[ 0 ].scrollLeft = scrolled =
  13670. this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed;
  13671. } else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) {
  13672. this.scrollParent[ 0 ].scrollLeft = scrolled =
  13673. this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed;
  13674. }
  13675. } else {
  13676. if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) {
  13677. scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed );
  13678. } else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) <
  13679. o.scrollSensitivity ) {
  13680. scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed );
  13681. }
  13682. if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) {
  13683. scrolled = this.document.scrollLeft(
  13684. this.document.scrollLeft() - o.scrollSpeed
  13685. );
  13686. } else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) <
  13687. o.scrollSensitivity ) {
  13688. scrolled = this.document.scrollLeft(
  13689. this.document.scrollLeft() + o.scrollSpeed
  13690. );
  13691. }
  13692. }
  13693. if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) {
  13694. $.ui.ddmanager.prepareOffsets( this, event );
  13695. }
  13696. }
  13697. //Regenerate the absolute position used for position checks
  13698. this.positionAbs = this._convertPositionTo( "absolute" );
  13699. //Set the helper position
  13700. if ( !this.options.axis || this.options.axis !== "y" ) {
  13701. this.helper[ 0 ].style.left = this.position.left + "px";
  13702. }
  13703. if ( !this.options.axis || this.options.axis !== "x" ) {
  13704. this.helper[ 0 ].style.top = this.position.top + "px";
  13705. }
  13706. //Rearrange
  13707. for ( i = this.items.length - 1; i >= 0; i-- ) {
  13708. //Cache variables and intersection, continue if no intersection
  13709. item = this.items[ i ];
  13710. itemElement = item.item[ 0 ];
  13711. intersection = this._intersectsWithPointer( item );
  13712. if ( !intersection ) {
  13713. continue;
  13714. }
  13715. // Only put the placeholder inside the current Container, skip all
  13716. // items from other containers. This works because when moving
  13717. // an item from one container to another the
  13718. // currentContainer is switched before the placeholder is moved.
  13719. //
  13720. // Without this, moving items in "sub-sortables" can cause
  13721. // the placeholder to jitter between the outer and inner container.
  13722. if ( item.instance !== this.currentContainer ) {
  13723. continue;
  13724. }
  13725. // Cannot intersect with itself
  13726. // no useless actions that have been done before
  13727. // no action if the item moved is the parent of the item checked
  13728. if ( itemElement !== this.currentItem[ 0 ] &&
  13729. this.placeholder[ intersection === 1 ? "next" : "prev" ]()[ 0 ] !== itemElement &&
  13730. !$.contains( this.placeholder[ 0 ], itemElement ) &&
  13731. ( this.options.type === "semi-dynamic" ?
  13732. !$.contains( this.element[ 0 ], itemElement ) :
  13733. true
  13734. )
  13735. ) {
  13736. this.direction = intersection === 1 ? "down" : "up";
  13737. if ( this.options.tolerance === "pointer" || this._intersectsWithSides( item ) ) {
  13738. this._rearrange( event, item );
  13739. } else {
  13740. break;
  13741. }
  13742. this._trigger( "change", event, this._uiHash() );
  13743. break;
  13744. }
  13745. }
  13746. //Post events to containers
  13747. this._contactContainers( event );
  13748. //Interconnect with droppables
  13749. if ( $.ui.ddmanager ) {
  13750. $.ui.ddmanager.drag( this, event );
  13751. }
  13752. //Call callbacks
  13753. this._trigger( "sort", event, this._uiHash() );
  13754. this.lastPositionAbs = this.positionAbs;
  13755. return false;
  13756. },
  13757. _mouseStop: function( event, noPropagation ) {
  13758. if ( !event ) {
  13759. return;
  13760. }
  13761. //If we are using droppables, inform the manager about the drop
  13762. if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
  13763. $.ui.ddmanager.drop( this, event );
  13764. }
  13765. if ( this.options.revert ) {
  13766. var that = this,
  13767. cur = this.placeholder.offset(),
  13768. axis = this.options.axis,
  13769. animation = {};
  13770. if ( !axis || axis === "x" ) {
  13771. animation.left = cur.left - this.offset.parent.left - this.margins.left +
  13772. ( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
  13773. 0 :
  13774. this.offsetParent[ 0 ].scrollLeft
  13775. );
  13776. }
  13777. if ( !axis || axis === "y" ) {
  13778. animation.top = cur.top - this.offset.parent.top - this.margins.top +
  13779. ( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
  13780. 0 :
  13781. this.offsetParent[ 0 ].scrollTop
  13782. );
  13783. }
  13784. this.reverting = true;
  13785. $( this.helper ).animate(
  13786. animation,
  13787. parseInt( this.options.revert, 10 ) || 500,
  13788. function() {
  13789. that._clear( event );
  13790. }
  13791. );
  13792. } else {
  13793. this._clear( event, noPropagation );
  13794. }
  13795. return false;
  13796. },
  13797. cancel: function() {
  13798. if ( this.dragging ) {
  13799. this._mouseUp( new $.Event( "mouseup", { target: null } ) );
  13800. if ( this.options.helper === "original" ) {
  13801. this.currentItem.css( this._storedCSS );
  13802. this._removeClass( this.currentItem, "ui-sortable-helper" );
  13803. } else {
  13804. this.currentItem.show();
  13805. }
  13806. //Post deactivating events to containers
  13807. for ( var i = this.containers.length - 1; i >= 0; i-- ) {
  13808. this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) );
  13809. if ( this.containers[ i ].containerCache.over ) {
  13810. this.containers[ i ]._trigger( "out", null, this._uiHash( this ) );
  13811. this.containers[ i ].containerCache.over = 0;
  13812. }
  13813. }
  13814. }
  13815. if ( this.placeholder ) {
  13816. //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
  13817. // it unbinds ALL events from the original node!
  13818. if ( this.placeholder[ 0 ].parentNode ) {
  13819. this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
  13820. }
  13821. if ( this.options.helper !== "original" && this.helper &&
  13822. this.helper[ 0 ].parentNode ) {
  13823. this.helper.remove();
  13824. }
  13825. $.extend( this, {
  13826. helper: null,
  13827. dragging: false,
  13828. reverting: false,
  13829. _noFinalSort: null
  13830. } );
  13831. if ( this.domPosition.prev ) {
  13832. $( this.domPosition.prev ).after( this.currentItem );
  13833. } else {
  13834. $( this.domPosition.parent ).prepend( this.currentItem );
  13835. }
  13836. }
  13837. return this;
  13838. },
  13839. serialize: function( o ) {
  13840. var items = this._getItemsAsjQuery( o && o.connected ),
  13841. str = [];
  13842. o = o || {};
  13843. $( items ).each( function() {
  13844. var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" )
  13845. .match( o.expression || ( /(.+)[\-=_](.+)/ ) );
  13846. if ( res ) {
  13847. str.push(
  13848. ( o.key || res[ 1 ] + "[]" ) +
  13849. "=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) );
  13850. }
  13851. } );
  13852. if ( !str.length && o.key ) {
  13853. str.push( o.key + "=" );
  13854. }
  13855. return str.join( "&" );
  13856. },
  13857. toArray: function( o ) {
  13858. var items = this._getItemsAsjQuery( o && o.connected ),
  13859. ret = [];
  13860. o = o || {};
  13861. items.each( function() {
  13862. ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" );
  13863. } );
  13864. return ret;
  13865. },
  13866. /* Be careful with the following core functions */
  13867. _intersectsWith: function( item ) {
  13868. var x1 = this.positionAbs.left,
  13869. x2 = x1 + this.helperProportions.width,
  13870. y1 = this.positionAbs.top,
  13871. y2 = y1 + this.helperProportions.height,
  13872. l = item.left,
  13873. r = l + item.width,
  13874. t = item.top,
  13875. b = t + item.height,
  13876. dyClick = this.offset.click.top,
  13877. dxClick = this.offset.click.left,
  13878. isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t &&
  13879. ( y1 + dyClick ) < b ),
  13880. isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l &&
  13881. ( x1 + dxClick ) < r ),
  13882. isOverElement = isOverElementHeight && isOverElementWidth;
  13883. if ( this.options.tolerance === "pointer" ||
  13884. this.options.forcePointerForContainers ||
  13885. ( this.options.tolerance !== "pointer" &&
  13886. this.helperProportions[ this.floating ? "width" : "height" ] >
  13887. item[ this.floating ? "width" : "height" ] )
  13888. ) {
  13889. return isOverElement;
  13890. } else {
  13891. return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half
  13892. x2 - ( this.helperProportions.width / 2 ) < r && // Left Half
  13893. t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half
  13894. y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half
  13895. }
  13896. },
  13897. _intersectsWithPointer: function( item ) {
  13898. var verticalDirection, horizontalDirection,
  13899. isOverElementHeight = ( this.options.axis === "x" ) ||
  13900. this._isOverAxis(
  13901. this.positionAbs.top + this.offset.click.top, item.top, item.height ),
  13902. isOverElementWidth = ( this.options.axis === "y" ) ||
  13903. this._isOverAxis(
  13904. this.positionAbs.left + this.offset.click.left, item.left, item.width ),
  13905. isOverElement = isOverElementHeight && isOverElementWidth;
  13906. if ( !isOverElement ) {
  13907. return false;
  13908. }
  13909. verticalDirection = this._getDragVerticalDirection();
  13910. horizontalDirection = this._getDragHorizontalDirection();
  13911. return this.floating ?
  13912. ( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 )
  13913. : ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) );
  13914. },
  13915. _intersectsWithSides: function( item ) {
  13916. var isOverBottomHalf = this._isOverAxis( this.positionAbs.top +
  13917. this.offset.click.top, item.top + ( item.height / 2 ), item.height ),
  13918. isOverRightHalf = this._isOverAxis( this.positionAbs.left +
  13919. this.offset.click.left, item.left + ( item.width / 2 ), item.width ),
  13920. verticalDirection = this._getDragVerticalDirection(),
  13921. horizontalDirection = this._getDragHorizontalDirection();
  13922. if ( this.floating && horizontalDirection ) {
  13923. return ( ( horizontalDirection === "right" && isOverRightHalf ) ||
  13924. ( horizontalDirection === "left" && !isOverRightHalf ) );
  13925. } else {
  13926. return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) ||
  13927. ( verticalDirection === "up" && !isOverBottomHalf ) );
  13928. }
  13929. },
  13930. _getDragVerticalDirection: function() {
  13931. var delta = this.positionAbs.top - this.lastPositionAbs.top;
  13932. return delta !== 0 && ( delta > 0 ? "down" : "up" );
  13933. },
  13934. _getDragHorizontalDirection: function() {
  13935. var delta = this.positionAbs.left - this.lastPositionAbs.left;
  13936. return delta !== 0 && ( delta > 0 ? "right" : "left" );
  13937. },
  13938. refresh: function( event ) {
  13939. this._refreshItems( event );
  13940. this._setHandleClassName();
  13941. this.refreshPositions();
  13942. return this;
  13943. },
  13944. _connectWith: function() {
  13945. var options = this.options;
  13946. return options.connectWith.constructor === String ?
  13947. [ options.connectWith ] :
  13948. options.connectWith;
  13949. },
  13950. _getItemsAsjQuery: function( connected ) {
  13951. var i, j, cur, inst,
  13952. items = [],
  13953. queries = [],
  13954. connectWith = this._connectWith();
  13955. if ( connectWith && connected ) {
  13956. for ( i = connectWith.length - 1; i >= 0; i-- ) {
  13957. cur = $( connectWith[ i ], this.document[ 0 ] );
  13958. for ( j = cur.length - 1; j >= 0; j-- ) {
  13959. inst = $.data( cur[ j ], this.widgetFullName );
  13960. if ( inst && inst !== this && !inst.options.disabled ) {
  13961. queries.push( [ $.isFunction( inst.options.items ) ?
  13962. inst.options.items.call( inst.element ) :
  13963. $( inst.options.items, inst.element )
  13964. .not( ".ui-sortable-helper" )
  13965. .not( ".ui-sortable-placeholder" ), inst ] );
  13966. }
  13967. }
  13968. }
  13969. }
  13970. queries.push( [ $.isFunction( this.options.items ) ?
  13971. this.options.items
  13972. .call( this.element, null, { options: this.options, item: this.currentItem } ) :
  13973. $( this.options.items, this.element )
  13974. .not( ".ui-sortable-helper" )
  13975. .not( ".ui-sortable-placeholder" ), this ] );
  13976. function addItems() {
  13977. items.push( this );
  13978. }
  13979. for ( i = queries.length - 1; i >= 0; i-- ) {
  13980. queries[ i ][ 0 ].each( addItems );
  13981. }
  13982. return $( items );
  13983. },
  13984. _removeCurrentsFromItems: function() {
  13985. var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" );
  13986. this.items = $.grep( this.items, function( item ) {
  13987. for ( var j = 0; j < list.length; j++ ) {
  13988. if ( list[ j ] === item.item[ 0 ] ) {
  13989. return false;
  13990. }
  13991. }
  13992. return true;
  13993. } );
  13994. },
  13995. _refreshItems: function( event ) {
  13996. this.items = [];
  13997. this.containers = [ this ];
  13998. var i, j, cur, inst, targetData, _queries, item, queriesLength,
  13999. items = this.items,
  14000. queries = [ [ $.isFunction( this.options.items ) ?
  14001. this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) :
  14002. $( this.options.items, this.element ), this ] ],
  14003. connectWith = this._connectWith();
  14004. //Shouldn't be run the first time through due to massive slow-down
  14005. if ( connectWith && this.ready ) {
  14006. for ( i = connectWith.length - 1; i >= 0; i-- ) {
  14007. cur = $( connectWith[ i ], this.document[ 0 ] );
  14008. for ( j = cur.length - 1; j >= 0; j-- ) {
  14009. inst = $.data( cur[ j ], this.widgetFullName );
  14010. if ( inst && inst !== this && !inst.options.disabled ) {
  14011. queries.push( [ $.isFunction( inst.options.items ) ?
  14012. inst.options.items
  14013. .call( inst.element[ 0 ], event, { item: this.currentItem } ) :
  14014. $( inst.options.items, inst.element ), inst ] );
  14015. this.containers.push( inst );
  14016. }
  14017. }
  14018. }
  14019. }
  14020. for ( i = queries.length - 1; i >= 0; i-- ) {
  14021. targetData = queries[ i ][ 1 ];
  14022. _queries = queries[ i ][ 0 ];
  14023. for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) {
  14024. item = $( _queries[ j ] );
  14025. // Data for target checking (mouse manager)
  14026. item.data( this.widgetName + "-item", targetData );
  14027. items.push( {
  14028. item: item,
  14029. instance: targetData,
  14030. width: 0, height: 0,
  14031. left: 0, top: 0
  14032. } );
  14033. }
  14034. }
  14035. },
  14036. refreshPositions: function( fast ) {
  14037. // Determine whether items are being displayed horizontally
  14038. this.floating = this.items.length ?
  14039. this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
  14040. false;
  14041. //This has to be redone because due to the item being moved out/into the offsetParent,
  14042. // the offsetParent's position will change
  14043. if ( this.offsetParent && this.helper ) {
  14044. this.offset.parent = this._getParentOffset();
  14045. }
  14046. var i, item, t, p;
  14047. for ( i = this.items.length - 1; i >= 0; i-- ) {
  14048. item = this.items[ i ];
  14049. //We ignore calculating positions of all connected containers when we're not over them
  14050. if ( item.instance !== this.currentContainer && this.currentContainer &&
  14051. item.item[ 0 ] !== this.currentItem[ 0 ] ) {
  14052. continue;
  14053. }
  14054. t = this.options.toleranceElement ?
  14055. $( this.options.toleranceElement, item.item ) :
  14056. item.item;
  14057. if ( !fast ) {
  14058. item.width = t.outerWidth();
  14059. item.height = t.outerHeight();
  14060. }
  14061. p = t.offset();
  14062. item.left = p.left;
  14063. item.top = p.top;
  14064. }
  14065. if ( this.options.custom && this.options.custom.refreshContainers ) {
  14066. this.options.custom.refreshContainers.call( this );
  14067. } else {
  14068. for ( i = this.containers.length - 1; i >= 0; i-- ) {
  14069. p = this.containers[ i ].element.offset();
  14070. this.containers[ i ].containerCache.left = p.left;
  14071. this.containers[ i ].containerCache.top = p.top;
  14072. this.containers[ i ].containerCache.width =
  14073. this.containers[ i ].element.outerWidth();
  14074. this.containers[ i ].containerCache.height =
  14075. this.containers[ i ].element.outerHeight();
  14076. }
  14077. }
  14078. return this;
  14079. },
  14080. _createPlaceholder: function( that ) {
  14081. that = that || this;
  14082. var className,
  14083. o = that.options;
  14084. if ( !o.placeholder || o.placeholder.constructor === String ) {
  14085. className = o.placeholder;
  14086. o.placeholder = {
  14087. element: function() {
  14088. var nodeName = that.currentItem[ 0 ].nodeName.toLowerCase(),
  14089. element = $( "<" + nodeName + ">", that.document[ 0 ] );
  14090. that._addClass( element, "ui-sortable-placeholder",
  14091. className || that.currentItem[ 0 ].className )
  14092. ._removeClass( element, "ui-sortable-helper" );
  14093. if ( nodeName === "tbody" ) {
  14094. that._createTrPlaceholder(
  14095. that.currentItem.find( "tr" ).eq( 0 ),
  14096. $( "<tr>", that.document[ 0 ] ).appendTo( element )
  14097. );
  14098. } else if ( nodeName === "tr" ) {
  14099. that._createTrPlaceholder( that.currentItem, element );
  14100. } else if ( nodeName === "img" ) {
  14101. element.attr( "src", that.currentItem.attr( "src" ) );
  14102. }
  14103. if ( !className ) {
  14104. element.css( "visibility", "hidden" );
  14105. }
  14106. return element;
  14107. },
  14108. update: function( container, p ) {
  14109. // 1. If a className is set as 'placeholder option, we don't force sizes -
  14110. // the class is responsible for that
  14111. // 2. The option 'forcePlaceholderSize can be enabled to force it even if a
  14112. // class name is specified
  14113. if ( className && !o.forcePlaceholderSize ) {
  14114. return;
  14115. }
  14116. //If the element doesn't have a actual height by itself (without styles coming
  14117. // from a stylesheet), it receives the inline height from the dragged item
  14118. if ( !p.height() ) {
  14119. p.height(
  14120. that.currentItem.innerHeight() -
  14121. parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) -
  14122. parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) );
  14123. }
  14124. if ( !p.width() ) {
  14125. p.width(
  14126. that.currentItem.innerWidth() -
  14127. parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) -
  14128. parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) );
  14129. }
  14130. }
  14131. };
  14132. }
  14133. //Create the placeholder
  14134. that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) );
  14135. //Append it after the actual current item
  14136. that.currentItem.after( that.placeholder );
  14137. //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
  14138. o.placeholder.update( that, that.placeholder );
  14139. },
  14140. _createTrPlaceholder: function( sourceTr, targetTr ) {
  14141. var that = this;
  14142. sourceTr.children().each( function() {
  14143. $( "<td>&#160;</td>", that.document[ 0 ] )
  14144. .attr( "colspan", $( this ).attr( "colspan" ) || 1 )
  14145. .appendTo( targetTr );
  14146. } );
  14147. },
  14148. _contactContainers: function( event ) {
  14149. var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom,
  14150. floating, axis,
  14151. innermostContainer = null,
  14152. innermostIndex = null;
  14153. // Get innermost container that intersects with item
  14154. for ( i = this.containers.length - 1; i >= 0; i-- ) {
  14155. // Never consider a container that's located within the item itself
  14156. if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) {
  14157. continue;
  14158. }
  14159. if ( this._intersectsWith( this.containers[ i ].containerCache ) ) {
  14160. // If we've already found a container and it's more "inner" than this, then continue
  14161. if ( innermostContainer &&
  14162. $.contains(
  14163. this.containers[ i ].element[ 0 ],
  14164. innermostContainer.element[ 0 ] ) ) {
  14165. continue;
  14166. }
  14167. innermostContainer = this.containers[ i ];
  14168. innermostIndex = i;
  14169. } else {
  14170. // container doesn't intersect. trigger "out" event if necessary
  14171. if ( this.containers[ i ].containerCache.over ) {
  14172. this.containers[ i ]._trigger( "out", event, this._uiHash( this ) );
  14173. this.containers[ i ].containerCache.over = 0;
  14174. }
  14175. }
  14176. }
  14177. // If no intersecting containers found, return
  14178. if ( !innermostContainer ) {
  14179. return;
  14180. }
  14181. // Move the item into the container if it's not there already
  14182. if ( this.containers.length === 1 ) {
  14183. if ( !this.containers[ innermostIndex ].containerCache.over ) {
  14184. this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
  14185. this.containers[ innermostIndex ].containerCache.over = 1;
  14186. }
  14187. } else {
  14188. // When entering a new container, we will find the item with the least distance and
  14189. // append our item near it
  14190. dist = 10000;
  14191. itemWithLeastDistance = null;
  14192. floating = innermostContainer.floating || this._isFloating( this.currentItem );
  14193. posProperty = floating ? "left" : "top";
  14194. sizeProperty = floating ? "width" : "height";
  14195. axis = floating ? "pageX" : "pageY";
  14196. for ( j = this.items.length - 1; j >= 0; j-- ) {
  14197. if ( !$.contains(
  14198. this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] )
  14199. ) {
  14200. continue;
  14201. }
  14202. if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) {
  14203. continue;
  14204. }
  14205. cur = this.items[ j ].item.offset()[ posProperty ];
  14206. nearBottom = false;
  14207. if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
  14208. nearBottom = true;
  14209. }
  14210. if ( Math.abs( event[ axis ] - cur ) < dist ) {
  14211. dist = Math.abs( event[ axis ] - cur );
  14212. itemWithLeastDistance = this.items[ j ];
  14213. this.direction = nearBottom ? "up" : "down";
  14214. }
  14215. }
  14216. //Check if dropOnEmpty is enabled
  14217. if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) {
  14218. return;
  14219. }
  14220. if ( this.currentContainer === this.containers[ innermostIndex ] ) {
  14221. if ( !this.currentContainer.containerCache.over ) {
  14222. this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
  14223. this.currentContainer.containerCache.over = 1;
  14224. }
  14225. return;
  14226. }
  14227. itemWithLeastDistance ?
  14228. this._rearrange( event, itemWithLeastDistance, null, true ) :
  14229. this._rearrange( event, null, this.containers[ innermostIndex ].element, true );
  14230. this._trigger( "change", event, this._uiHash() );
  14231. this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) );
  14232. this.currentContainer = this.containers[ innermostIndex ];
  14233. //Update the placeholder
  14234. this.options.placeholder.update( this.currentContainer, this.placeholder );
  14235. this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
  14236. this.containers[ innermostIndex ].containerCache.over = 1;
  14237. }
  14238. },
  14239. _createHelper: function( event ) {
  14240. var o = this.options,
  14241. helper = $.isFunction( o.helper ) ?
  14242. $( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) :
  14243. ( o.helper === "clone" ? this.currentItem.clone() : this.currentItem );
  14244. //Add the helper to the DOM if that didn't happen already
  14245. if ( !helper.parents( "body" ).length ) {
  14246. $( o.appendTo !== "parent" ?
  14247. o.appendTo :
  14248. this.currentItem[ 0 ].parentNode )[ 0 ].appendChild( helper[ 0 ] );
  14249. }
  14250. if ( helper[ 0 ] === this.currentItem[ 0 ] ) {
  14251. this._storedCSS = {
  14252. width: this.currentItem[ 0 ].style.width,
  14253. height: this.currentItem[ 0 ].style.height,
  14254. position: this.currentItem.css( "position" ),
  14255. top: this.currentItem.css( "top" ),
  14256. left: this.currentItem.css( "left" )
  14257. };
  14258. }
  14259. if ( !helper[ 0 ].style.width || o.forceHelperSize ) {
  14260. helper.width( this.currentItem.width() );
  14261. }
  14262. if ( !helper[ 0 ].style.height || o.forceHelperSize ) {
  14263. helper.height( this.currentItem.height() );
  14264. }
  14265. return helper;
  14266. },
  14267. _adjustOffsetFromHelper: function( obj ) {
  14268. if ( typeof obj === "string" ) {
  14269. obj = obj.split( " " );
  14270. }
  14271. if ( $.isArray( obj ) ) {
  14272. obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
  14273. }
  14274. if ( "left" in obj ) {
  14275. this.offset.click.left = obj.left + this.margins.left;
  14276. }
  14277. if ( "right" in obj ) {
  14278. this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
  14279. }
  14280. if ( "top" in obj ) {
  14281. this.offset.click.top = obj.top + this.margins.top;
  14282. }
  14283. if ( "bottom" in obj ) {
  14284. this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
  14285. }
  14286. },
  14287. _getParentOffset: function() {
  14288. //Get the offsetParent and cache its position
  14289. this.offsetParent = this.helper.offsetParent();
  14290. var po = this.offsetParent.offset();
  14291. // This is a special case where we need to modify a offset calculated on start, since the
  14292. // following happened:
  14293. // 1. The position of the helper is absolute, so it's position is calculated based on the
  14294. // next positioned parent
  14295. // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
  14296. // the document, which means that the scroll is included in the initial calculation of the
  14297. // offset of the parent, and never recalculated upon drag
  14298. if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] &&
  14299. $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
  14300. po.left += this.scrollParent.scrollLeft();
  14301. po.top += this.scrollParent.scrollTop();
  14302. }
  14303. // This needs to be actually done for all browsers, since pageX/pageY includes this
  14304. // information with an ugly IE fix
  14305. if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ||
  14306. ( this.offsetParent[ 0 ].tagName &&
  14307. this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) {
  14308. po = { top: 0, left: 0 };
  14309. }
  14310. return {
  14311. top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
  14312. left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
  14313. };
  14314. },
  14315. _getRelativeOffset: function() {
  14316. if ( this.cssPosition === "relative" ) {
  14317. var p = this.currentItem.position();
  14318. return {
  14319. top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
  14320. this.scrollParent.scrollTop(),
  14321. left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
  14322. this.scrollParent.scrollLeft()
  14323. };
  14324. } else {
  14325. return { top: 0, left: 0 };
  14326. }
  14327. },
  14328. _cacheMargins: function() {
  14329. this.margins = {
  14330. left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ),
  14331. top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 )
  14332. };
  14333. },
  14334. _cacheHelperProportions: function() {
  14335. this.helperProportions = {
  14336. width: this.helper.outerWidth(),
  14337. height: this.helper.outerHeight()
  14338. };
  14339. },
  14340. _setContainment: function() {
  14341. var ce, co, over,
  14342. o = this.options;
  14343. if ( o.containment === "parent" ) {
  14344. o.containment = this.helper[ 0 ].parentNode;
  14345. }
  14346. if ( o.containment === "document" || o.containment === "window" ) {
  14347. this.containment = [
  14348. 0 - this.offset.relative.left - this.offset.parent.left,
  14349. 0 - this.offset.relative.top - this.offset.parent.top,
  14350. o.containment === "document" ?
  14351. this.document.width() :
  14352. this.window.width() - this.helperProportions.width - this.margins.left,
  14353. ( o.containment === "document" ?
  14354. ( this.document.height() || document.body.parentNode.scrollHeight ) :
  14355. this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight
  14356. ) - this.helperProportions.height - this.margins.top
  14357. ];
  14358. }
  14359. if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) {
  14360. ce = $( o.containment )[ 0 ];
  14361. co = $( o.containment ).offset();
  14362. over = ( $( ce ).css( "overflow" ) !== "hidden" );
  14363. this.containment = [
  14364. co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) +
  14365. ( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left,
  14366. co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) +
  14367. ( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top,
  14368. co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
  14369. ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) -
  14370. ( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) -
  14371. this.helperProportions.width - this.margins.left,
  14372. co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
  14373. ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) -
  14374. ( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) -
  14375. this.helperProportions.height - this.margins.top
  14376. ];
  14377. }
  14378. },
  14379. _convertPositionTo: function( d, pos ) {
  14380. if ( !pos ) {
  14381. pos = this.position;
  14382. }
  14383. var mod = d === "absolute" ? 1 : -1,
  14384. scroll = this.cssPosition === "absolute" &&
  14385. !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
  14386. $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
  14387. this.offsetParent :
  14388. this.scrollParent,
  14389. scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
  14390. return {
  14391. top: (
  14392. // The absolute mouse position
  14393. pos.top +
  14394. // Only for relative positioned nodes: Relative offset from element to offset parent
  14395. this.offset.relative.top * mod +
  14396. // The offsetParent's offset without borders (offset + border)
  14397. this.offset.parent.top * mod -
  14398. ( ( this.cssPosition === "fixed" ?
  14399. -this.scrollParent.scrollTop() :
  14400. ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod )
  14401. ),
  14402. left: (
  14403. // The absolute mouse position
  14404. pos.left +
  14405. // Only for relative positioned nodes: Relative offset from element to offset parent
  14406. this.offset.relative.left * mod +
  14407. // The offsetParent's offset without borders (offset + border)
  14408. this.offset.parent.left * mod -
  14409. ( ( this.cssPosition === "fixed" ?
  14410. -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 :
  14411. scroll.scrollLeft() ) * mod )
  14412. )
  14413. };
  14414. },
  14415. _generatePosition: function( event ) {
  14416. var top, left,
  14417. o = this.options,
  14418. pageX = event.pageX,
  14419. pageY = event.pageY,
  14420. scroll = this.cssPosition === "absolute" &&
  14421. !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
  14422. $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
  14423. this.offsetParent :
  14424. this.scrollParent,
  14425. scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
  14426. // This is another very weird special case that only happens for relative elements:
  14427. // 1. If the css position is relative
  14428. // 2. and the scroll parent is the document or similar to the offset parent
  14429. // we have to refresh the relative offset during the scroll so there are no jumps
  14430. if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
  14431. this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) {
  14432. this.offset.relative = this._getRelativeOffset();
  14433. }
  14434. /*
  14435. * - Position constraining -
  14436. * Constrain the position to a mix of grid, containment.
  14437. */
  14438. if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options
  14439. if ( this.containment ) {
  14440. if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) {
  14441. pageX = this.containment[ 0 ] + this.offset.click.left;
  14442. }
  14443. if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) {
  14444. pageY = this.containment[ 1 ] + this.offset.click.top;
  14445. }
  14446. if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) {
  14447. pageX = this.containment[ 2 ] + this.offset.click.left;
  14448. }
  14449. if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) {
  14450. pageY = this.containment[ 3 ] + this.offset.click.top;
  14451. }
  14452. }
  14453. if ( o.grid ) {
  14454. top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) /
  14455. o.grid[ 1 ] ) * o.grid[ 1 ];
  14456. pageY = this.containment ?
  14457. ( ( top - this.offset.click.top >= this.containment[ 1 ] &&
  14458. top - this.offset.click.top <= this.containment[ 3 ] ) ?
  14459. top :
  14460. ( ( top - this.offset.click.top >= this.containment[ 1 ] ) ?
  14461. top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) :
  14462. top;
  14463. left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) /
  14464. o.grid[ 0 ] ) * o.grid[ 0 ];
  14465. pageX = this.containment ?
  14466. ( ( left - this.offset.click.left >= this.containment[ 0 ] &&
  14467. left - this.offset.click.left <= this.containment[ 2 ] ) ?
  14468. left :
  14469. ( ( left - this.offset.click.left >= this.containment[ 0 ] ) ?
  14470. left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) :
  14471. left;
  14472. }
  14473. }
  14474. return {
  14475. top: (
  14476. // The absolute mouse position
  14477. pageY -
  14478. // Click offset (relative to the element)
  14479. this.offset.click.top -
  14480. // Only for relative positioned nodes: Relative offset from element to offset parent
  14481. this.offset.relative.top -
  14482. // The offsetParent's offset without borders (offset + border)
  14483. this.offset.parent.top +
  14484. ( ( this.cssPosition === "fixed" ?
  14485. -this.scrollParent.scrollTop() :
  14486. ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) )
  14487. ),
  14488. left: (
  14489. // The absolute mouse position
  14490. pageX -
  14491. // Click offset (relative to the element)
  14492. this.offset.click.left -
  14493. // Only for relative positioned nodes: Relative offset from element to offset parent
  14494. this.offset.relative.left -
  14495. // The offsetParent's offset without borders (offset + border)
  14496. this.offset.parent.left +
  14497. ( ( this.cssPosition === "fixed" ?
  14498. -this.scrollParent.scrollLeft() :
  14499. scrollIsRootNode ? 0 : scroll.scrollLeft() ) )
  14500. )
  14501. };
  14502. },
  14503. _rearrange: function( event, i, a, hardRefresh ) {
  14504. a ? a[ 0 ].appendChild( this.placeholder[ 0 ] ) :
  14505. i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ],
  14506. ( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) );
  14507. //Various things done here to improve the performance:
  14508. // 1. we create a setTimeout, that calls refreshPositions
  14509. // 2. on the instance, we have a counter variable, that get's higher after every append
  14510. // 3. on the local scope, we copy the counter variable, and check in the timeout,
  14511. // if it's still the same
  14512. // 4. this lets only the last addition to the timeout stack through
  14513. this.counter = this.counter ? ++this.counter : 1;
  14514. var counter = this.counter;
  14515. this._delay( function() {
  14516. if ( counter === this.counter ) {
  14517. //Precompute after each DOM insertion, NOT on mousemove
  14518. this.refreshPositions( !hardRefresh );
  14519. }
  14520. } );
  14521. },
  14522. _clear: function( event, noPropagation ) {
  14523. this.reverting = false;
  14524. // We delay all events that have to be triggered to after the point where the placeholder
  14525. // has been removed and everything else normalized again
  14526. var i,
  14527. delayedTriggers = [];
  14528. // We first have to update the dom position of the actual currentItem
  14529. // Note: don't do it if the current item is already removed (by a user), or it gets
  14530. // reappended (see #4088)
  14531. if ( !this._noFinalSort && this.currentItem.parent().length ) {
  14532. this.placeholder.before( this.currentItem );
  14533. }
  14534. this._noFinalSort = null;
  14535. if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) {
  14536. for ( i in this._storedCSS ) {
  14537. if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) {
  14538. this._storedCSS[ i ] = "";
  14539. }
  14540. }
  14541. this.currentItem.css( this._storedCSS );
  14542. this._removeClass( this.currentItem, "ui-sortable-helper" );
  14543. } else {
  14544. this.currentItem.show();
  14545. }
  14546. if ( this.fromOutside && !noPropagation ) {
  14547. delayedTriggers.push( function( event ) {
  14548. this._trigger( "receive", event, this._uiHash( this.fromOutside ) );
  14549. } );
  14550. }
  14551. if ( ( this.fromOutside ||
  14552. this.domPosition.prev !==
  14553. this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] ||
  14554. this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) {
  14555. // Trigger update callback if the DOM position has changed
  14556. delayedTriggers.push( function( event ) {
  14557. this._trigger( "update", event, this._uiHash() );
  14558. } );
  14559. }
  14560. // Check if the items Container has Changed and trigger appropriate
  14561. // events.
  14562. if ( this !== this.currentContainer ) {
  14563. if ( !noPropagation ) {
  14564. delayedTriggers.push( function( event ) {
  14565. this._trigger( "remove", event, this._uiHash() );
  14566. } );
  14567. delayedTriggers.push( ( function( c ) {
  14568. return function( event ) {
  14569. c._trigger( "receive", event, this._uiHash( this ) );
  14570. };
  14571. } ).call( this, this.currentContainer ) );
  14572. delayedTriggers.push( ( function( c ) {
  14573. return function( event ) {
  14574. c._trigger( "update", event, this._uiHash( this ) );
  14575. };
  14576. } ).call( this, this.currentContainer ) );
  14577. }
  14578. }
  14579. //Post events to containers
  14580. function delayEvent( type, instance, container ) {
  14581. return function( event ) {
  14582. container._trigger( type, event, instance._uiHash( instance ) );
  14583. };
  14584. }
  14585. for ( i = this.containers.length - 1; i >= 0; i-- ) {
  14586. if ( !noPropagation ) {
  14587. delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
  14588. }
  14589. if ( this.containers[ i ].containerCache.over ) {
  14590. delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
  14591. this.containers[ i ].containerCache.over = 0;
  14592. }
  14593. }
  14594. //Do what was originally in plugins
  14595. if ( this.storedCursor ) {
  14596. this.document.find( "body" ).css( "cursor", this.storedCursor );
  14597. this.storedStylesheet.remove();
  14598. }
  14599. if ( this._storedOpacity ) {
  14600. this.helper.css( "opacity", this._storedOpacity );
  14601. }
  14602. if ( this._storedZIndex ) {
  14603. this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex );
  14604. }
  14605. this.dragging = false;
  14606. if ( !noPropagation ) {
  14607. this._trigger( "beforeStop", event, this._uiHash() );
  14608. }
  14609. //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
  14610. // it unbinds ALL events from the original node!
  14611. this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
  14612. if ( !this.cancelHelperRemoval ) {
  14613. if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
  14614. this.helper.remove();
  14615. }
  14616. this.helper = null;
  14617. }
  14618. if ( !noPropagation ) {
  14619. for ( i = 0; i < delayedTriggers.length; i++ ) {
  14620. // Trigger all delayed events
  14621. delayedTriggers[ i ].call( this, event );
  14622. }
  14623. this._trigger( "stop", event, this._uiHash() );
  14624. }
  14625. this.fromOutside = false;
  14626. return !this.cancelHelperRemoval;
  14627. },
  14628. _trigger: function() {
  14629. if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) {
  14630. this.cancel();
  14631. }
  14632. },
  14633. _uiHash: function( _inst ) {
  14634. var inst = _inst || this;
  14635. return {
  14636. helper: inst.helper,
  14637. placeholder: inst.placeholder || $( [] ),
  14638. position: inst.position,
  14639. originalPosition: inst.originalPosition,
  14640. offset: inst.positionAbs,
  14641. item: inst.currentItem,
  14642. sender: _inst ? _inst.element : null
  14643. };
  14644. }
  14645. } );
  14646. /*!
  14647. * jQuery UI Spinner 1.12.1
  14648. * http://jqueryui.com
  14649. *
  14650. * Copyright jQuery Foundation and other contributors
  14651. * Released under the MIT license.
  14652. * http://jquery.org/license
  14653. */
  14654. //>>label: Spinner
  14655. //>>group: Widgets
  14656. //>>description: Displays buttons to easily input numbers via the keyboard or mouse.
  14657. //>>docs: http://api.jqueryui.com/spinner/
  14658. //>>demos: http://jqueryui.com/spinner/
  14659. //>>css.structure: ../../themes/base/core.css
  14660. //>>css.structure: ../../themes/base/spinner.css
  14661. //>>css.theme: ../../themes/base/theme.css
  14662. function spinnerModifer( fn ) {
  14663. return function() {
  14664. var previous = this.element.val();
  14665. fn.apply( this, arguments );
  14666. this._refresh();
  14667. if ( previous !== this.element.val() ) {
  14668. this._trigger( "change" );
  14669. }
  14670. };
  14671. }
  14672. $.widget( "ui.spinner", {
  14673. version: "1.12.1",
  14674. defaultElement: "<input>",
  14675. widgetEventPrefix: "spin",
  14676. options: {
  14677. classes: {
  14678. "ui-spinner": "ui-corner-all",
  14679. "ui-spinner-down": "ui-corner-br",
  14680. "ui-spinner-up": "ui-corner-tr"
  14681. },
  14682. culture: null,
  14683. icons: {
  14684. down: "ui-icon-triangle-1-s",
  14685. up: "ui-icon-triangle-1-n"
  14686. },
  14687. incremental: true,
  14688. max: null,
  14689. min: null,
  14690. numberFormat: null,
  14691. page: 10,
  14692. step: 1,
  14693. change: null,
  14694. spin: null,
  14695. start: null,
  14696. stop: null
  14697. },
  14698. _create: function() {
  14699. // handle string values that need to be parsed
  14700. this._setOption( "max", this.options.max );
  14701. this._setOption( "min", this.options.min );
  14702. this._setOption( "step", this.options.step );
  14703. // Only format if there is a value, prevents the field from being marked
  14704. // as invalid in Firefox, see #9573.
  14705. if ( this.value() !== "" ) {
  14706. // Format the value, but don't constrain.
  14707. this._value( this.element.val(), true );
  14708. }
  14709. this._draw();
  14710. this._on( this._events );
  14711. this._refresh();
  14712. // Turning off autocomplete prevents the browser from remembering the
  14713. // value when navigating through history, so we re-enable autocomplete
  14714. // if the page is unloaded before the widget is destroyed. #7790
  14715. this._on( this.window, {
  14716. beforeunload: function() {
  14717. this.element.removeAttr( "autocomplete" );
  14718. }
  14719. } );
  14720. },
  14721. _getCreateOptions: function() {
  14722. var options = this._super();
  14723. var element = this.element;
  14724. $.each( [ "min", "max", "step" ], function( i, option ) {
  14725. var value = element.attr( option );
  14726. if ( value != null && value.length ) {
  14727. options[ option ] = value;
  14728. }
  14729. } );
  14730. return options;
  14731. },
  14732. _events: {
  14733. keydown: function( event ) {
  14734. if ( this._start( event ) && this._keydown( event ) ) {
  14735. event.preventDefault();
  14736. }
  14737. },
  14738. keyup: "_stop",
  14739. focus: function() {
  14740. this.previous = this.element.val();
  14741. },
  14742. blur: function( event ) {
  14743. if ( this.cancelBlur ) {
  14744. delete this.cancelBlur;
  14745. return;
  14746. }
  14747. this._stop();
  14748. this._refresh();
  14749. if ( this.previous !== this.element.val() ) {
  14750. this._trigger( "change", event );
  14751. }
  14752. },
  14753. mousewheel: function( event, delta ) {
  14754. if ( !delta ) {
  14755. return;
  14756. }
  14757. if ( !this.spinning && !this._start( event ) ) {
  14758. return false;
  14759. }
  14760. this._spin( ( delta > 0 ? 1 : -1 ) * this.options.step, event );
  14761. clearTimeout( this.mousewheelTimer );
  14762. this.mousewheelTimer = this._delay( function() {
  14763. if ( this.spinning ) {
  14764. this._stop( event );
  14765. }
  14766. }, 100 );
  14767. event.preventDefault();
  14768. },
  14769. "mousedown .ui-spinner-button": function( event ) {
  14770. var previous;
  14771. // We never want the buttons to have focus; whenever the user is
  14772. // interacting with the spinner, the focus should be on the input.
  14773. // If the input is focused then this.previous is properly set from
  14774. // when the input first received focus. If the input is not focused
  14775. // then we need to set this.previous based on the value before spinning.
  14776. previous = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ) ?
  14777. this.previous : this.element.val();
  14778. function checkFocus() {
  14779. var isActive = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] );
  14780. if ( !isActive ) {
  14781. this.element.trigger( "focus" );
  14782. this.previous = previous;
  14783. // support: IE
  14784. // IE sets focus asynchronously, so we need to check if focus
  14785. // moved off of the input because the user clicked on the button.
  14786. this._delay( function() {
  14787. this.previous = previous;
  14788. } );
  14789. }
  14790. }
  14791. // Ensure focus is on (or stays on) the text field
  14792. event.preventDefault();
  14793. checkFocus.call( this );
  14794. // Support: IE
  14795. // IE doesn't prevent moving focus even with event.preventDefault()
  14796. // so we set a flag to know when we should ignore the blur event
  14797. // and check (again) if focus moved off of the input.
  14798. this.cancelBlur = true;
  14799. this._delay( function() {
  14800. delete this.cancelBlur;
  14801. checkFocus.call( this );
  14802. } );
  14803. if ( this._start( event ) === false ) {
  14804. return;
  14805. }
  14806. this._repeat( null, $( event.currentTarget )
  14807. .hasClass( "ui-spinner-up" ) ? 1 : -1, event );
  14808. },
  14809. "mouseup .ui-spinner-button": "_stop",
  14810. "mouseenter .ui-spinner-button": function( event ) {
  14811. // button will add ui-state-active if mouse was down while mouseleave and kept down
  14812. if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) {
  14813. return;
  14814. }
  14815. if ( this._start( event ) === false ) {
  14816. return false;
  14817. }
  14818. this._repeat( null, $( event.currentTarget )
  14819. .hasClass( "ui-spinner-up" ) ? 1 : -1, event );
  14820. },
  14821. // TODO: do we really want to consider this a stop?
  14822. // shouldn't we just stop the repeater and wait until mouseup before
  14823. // we trigger the stop event?
  14824. "mouseleave .ui-spinner-button": "_stop"
  14825. },
  14826. // Support mobile enhanced option and make backcompat more sane
  14827. _enhance: function() {
  14828. this.uiSpinner = this.element
  14829. .attr( "autocomplete", "off" )
  14830. .wrap( "<span>" )
  14831. .parent()
  14832. // Add buttons
  14833. .append(
  14834. "<a></a><a></a>"
  14835. );
  14836. },
  14837. _draw: function() {
  14838. this._enhance();
  14839. this._addClass( this.uiSpinner, "ui-spinner", "ui-widget ui-widget-content" );
  14840. this._addClass( "ui-spinner-input" );
  14841. this.element.attr( "role", "spinbutton" );
  14842. // Button bindings
  14843. this.buttons = this.uiSpinner.children( "a" )
  14844. .attr( "tabIndex", -1 )
  14845. .attr( "aria-hidden", true )
  14846. .button( {
  14847. classes: {
  14848. "ui-button": ""
  14849. }
  14850. } );
  14851. // TODO: Right now button does not support classes this is already updated in button PR
  14852. this._removeClass( this.buttons, "ui-corner-all" );
  14853. this._addClass( this.buttons.first(), "ui-spinner-button ui-spinner-up" );
  14854. this._addClass( this.buttons.last(), "ui-spinner-button ui-spinner-down" );
  14855. this.buttons.first().button( {
  14856. "icon": this.options.icons.up,
  14857. "showLabel": false
  14858. } );
  14859. this.buttons.last().button( {
  14860. "icon": this.options.icons.down,
  14861. "showLabel": false
  14862. } );
  14863. // IE 6 doesn't understand height: 50% for the buttons
  14864. // unless the wrapper has an explicit height
  14865. if ( this.buttons.height() > Math.ceil( this.uiSpinner.height() * 0.5 ) &&
  14866. this.uiSpinner.height() > 0 ) {
  14867. this.uiSpinner.height( this.uiSpinner.height() );
  14868. }
  14869. },
  14870. _keydown: function( event ) {
  14871. var options = this.options,
  14872. keyCode = $.ui.keyCode;
  14873. switch ( event.keyCode ) {
  14874. case keyCode.UP:
  14875. this._repeat( null, 1, event );
  14876. return true;
  14877. case keyCode.DOWN:
  14878. this._repeat( null, -1, event );
  14879. return true;
  14880. case keyCode.PAGE_UP:
  14881. this._repeat( null, options.page, event );
  14882. return true;
  14883. case keyCode.PAGE_DOWN:
  14884. this._repeat( null, -options.page, event );
  14885. return true;
  14886. }
  14887. return false;
  14888. },
  14889. _start: function( event ) {
  14890. if ( !this.spinning && this._trigger( "start", event ) === false ) {
  14891. return false;
  14892. }
  14893. if ( !this.counter ) {
  14894. this.counter = 1;
  14895. }
  14896. this.spinning = true;
  14897. return true;
  14898. },
  14899. _repeat: function( i, steps, event ) {
  14900. i = i || 500;
  14901. clearTimeout( this.timer );
  14902. this.timer = this._delay( function() {
  14903. this._repeat( 40, steps, event );
  14904. }, i );
  14905. this._spin( steps * this.options.step, event );
  14906. },
  14907. _spin: function( step, event ) {
  14908. var value = this.value() || 0;
  14909. if ( !this.counter ) {
  14910. this.counter = 1;
  14911. }
  14912. value = this._adjustValue( value + step * this._increment( this.counter ) );
  14913. if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false ) {
  14914. this._value( value );
  14915. this.counter++;
  14916. }
  14917. },
  14918. _increment: function( i ) {
  14919. var incremental = this.options.incremental;
  14920. if ( incremental ) {
  14921. return $.isFunction( incremental ) ?
  14922. incremental( i ) :
  14923. Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 );
  14924. }
  14925. return 1;
  14926. },
  14927. _precision: function() {
  14928. var precision = this._precisionOf( this.options.step );
  14929. if ( this.options.min !== null ) {
  14930. precision = Math.max( precision, this._precisionOf( this.options.min ) );
  14931. }
  14932. return precision;
  14933. },
  14934. _precisionOf: function( num ) {
  14935. var str = num.toString(),
  14936. decimal = str.indexOf( "." );
  14937. return decimal === -1 ? 0 : str.length - decimal - 1;
  14938. },
  14939. _adjustValue: function( value ) {
  14940. var base, aboveMin,
  14941. options = this.options;
  14942. // Make sure we're at a valid step
  14943. // - find out where we are relative to the base (min or 0)
  14944. base = options.min !== null ? options.min : 0;
  14945. aboveMin = value - base;
  14946. // - round to the nearest step
  14947. aboveMin = Math.round( aboveMin / options.step ) * options.step;
  14948. // - rounding is based on 0, so adjust back to our base
  14949. value = base + aboveMin;
  14950. // Fix precision from bad JS floating point math
  14951. value = parseFloat( value.toFixed( this._precision() ) );
  14952. // Clamp the value
  14953. if ( options.max !== null && value > options.max ) {
  14954. return options.max;
  14955. }
  14956. if ( options.min !== null && value < options.min ) {
  14957. return options.min;
  14958. }
  14959. return value;
  14960. },
  14961. _stop: function( event ) {
  14962. if ( !this.spinning ) {
  14963. return;
  14964. }
  14965. clearTimeout( this.timer );
  14966. clearTimeout( this.mousewheelTimer );
  14967. this.counter = 0;
  14968. this.spinning = false;
  14969. this._trigger( "stop", event );
  14970. },
  14971. _setOption: function( key, value ) {
  14972. var prevValue, first, last;
  14973. if ( key === "culture" || key === "numberFormat" ) {
  14974. prevValue = this._parse( this.element.val() );
  14975. this.options[ key ] = value;
  14976. this.element.val( this._format( prevValue ) );
  14977. return;
  14978. }
  14979. if ( key === "max" || key === "min" || key === "step" ) {
  14980. if ( typeof value === "string" ) {
  14981. value = this._parse( value );
  14982. }
  14983. }
  14984. if ( key === "icons" ) {
  14985. first = this.buttons.first().find( ".ui-icon" );
  14986. this._removeClass( first, null, this.options.icons.up );
  14987. this._addClass( first, null, value.up );
  14988. last = this.buttons.last().find( ".ui-icon" );
  14989. this._removeClass( last, null, this.options.icons.down );
  14990. this._addClass( last, null, value.down );
  14991. }
  14992. this._super( key, value );
  14993. },
  14994. _setOptionDisabled: function( value ) {
  14995. this._super( value );
  14996. this._toggleClass( this.uiSpinner, null, "ui-state-disabled", !!value );
  14997. this.element.prop( "disabled", !!value );
  14998. this.buttons.button( value ? "disable" : "enable" );
  14999. },
  15000. _setOptions: spinnerModifer( function( options ) {
  15001. this._super( options );
  15002. } ),
  15003. _parse: function( val ) {
  15004. if ( typeof val === "string" && val !== "" ) {
  15005. val = window.Globalize && this.options.numberFormat ?
  15006. Globalize.parseFloat( val, 10, this.options.culture ) : +val;
  15007. }
  15008. return val === "" || isNaN( val ) ? null : val;
  15009. },
  15010. _format: function( value ) {
  15011. if ( value === "" ) {
  15012. return "";
  15013. }
  15014. return window.Globalize && this.options.numberFormat ?
  15015. Globalize.format( value, this.options.numberFormat, this.options.culture ) :
  15016. value;
  15017. },
  15018. _refresh: function() {
  15019. this.element.attr( {
  15020. "aria-valuemin": this.options.min,
  15021. "aria-valuemax": this.options.max,
  15022. // TODO: what should we do with values that can't be parsed?
  15023. "aria-valuenow": this._parse( this.element.val() )
  15024. } );
  15025. },
  15026. isValid: function() {
  15027. var value = this.value();
  15028. // Null is invalid
  15029. if ( value === null ) {
  15030. return false;
  15031. }
  15032. // If value gets adjusted, it's invalid
  15033. return value === this._adjustValue( value );
  15034. },
  15035. // Update the value without triggering change
  15036. _value: function( value, allowAny ) {
  15037. var parsed;
  15038. if ( value !== "" ) {
  15039. parsed = this._parse( value );
  15040. if ( parsed !== null ) {
  15041. if ( !allowAny ) {
  15042. parsed = this._adjustValue( parsed );
  15043. }
  15044. value = this._format( parsed );
  15045. }
  15046. }
  15047. this.element.val( value );
  15048. this._refresh();
  15049. },
  15050. _destroy: function() {
  15051. this.element
  15052. .prop( "disabled", false )
  15053. .removeAttr( "autocomplete role aria-valuemin aria-valuemax aria-valuenow" );
  15054. this.uiSpinner.replaceWith( this.element );
  15055. },
  15056. stepUp: spinnerModifer( function( steps ) {
  15057. this._stepUp( steps );
  15058. } ),
  15059. _stepUp: function( steps ) {
  15060. if ( this._start() ) {
  15061. this._spin( ( steps || 1 ) * this.options.step );
  15062. this._stop();
  15063. }
  15064. },
  15065. stepDown: spinnerModifer( function( steps ) {
  15066. this._stepDown( steps );
  15067. } ),
  15068. _stepDown: function( steps ) {
  15069. if ( this._start() ) {
  15070. this._spin( ( steps || 1 ) * -this.options.step );
  15071. this._stop();
  15072. }
  15073. },
  15074. pageUp: spinnerModifer( function( pages ) {
  15075. this._stepUp( ( pages || 1 ) * this.options.page );
  15076. } ),
  15077. pageDown: spinnerModifer( function( pages ) {
  15078. this._stepDown( ( pages || 1 ) * this.options.page );
  15079. } ),
  15080. value: function( newVal ) {
  15081. if ( !arguments.length ) {
  15082. return this._parse( this.element.val() );
  15083. }
  15084. spinnerModifer( this._value ).call( this, newVal );
  15085. },
  15086. widget: function() {
  15087. return this.uiSpinner;
  15088. }
  15089. } );
  15090. // DEPRECATED
  15091. // TODO: switch return back to widget declaration at top of file when this is removed
  15092. if ( $.uiBackCompat !== false ) {
  15093. // Backcompat for spinner html extension points
  15094. $.widget( "ui.spinner", $.ui.spinner, {
  15095. _enhance: function() {
  15096. this.uiSpinner = this.element
  15097. .attr( "autocomplete", "off" )
  15098. .wrap( this._uiSpinnerHtml() )
  15099. .parent()
  15100. // Add buttons
  15101. .append( this._buttonHtml() );
  15102. },
  15103. _uiSpinnerHtml: function() {
  15104. return "<span>";
  15105. },
  15106. _buttonHtml: function() {
  15107. return "<a></a><a></a>";
  15108. }
  15109. } );
  15110. }
  15111. var widgetsSpinner = $.ui.spinner;
  15112. /*!
  15113. * jQuery UI Tabs 1.12.1
  15114. * http://jqueryui.com
  15115. *
  15116. * Copyright jQuery Foundation and other contributors
  15117. * Released under the MIT license.
  15118. * http://jquery.org/license
  15119. */
  15120. //>>label: Tabs
  15121. //>>group: Widgets
  15122. //>>description: Transforms a set of container elements into a tab structure.
  15123. //>>docs: http://api.jqueryui.com/tabs/
  15124. //>>demos: http://jqueryui.com/tabs/
  15125. //>>css.structure: ../../themes/base/core.css
  15126. //>>css.structure: ../../themes/base/tabs.css
  15127. //>>css.theme: ../../themes/base/theme.css
  15128. $.widget( "ui.tabs", {
  15129. version: "1.12.1",
  15130. delay: 300,
  15131. options: {
  15132. active: null,
  15133. classes: {
  15134. "ui-tabs": "ui-corner-all",
  15135. "ui-tabs-nav": "ui-corner-all",
  15136. "ui-tabs-panel": "ui-corner-bottom",
  15137. "ui-tabs-tab": "ui-corner-top"
  15138. },
  15139. collapsible: false,
  15140. event: "click",
  15141. heightStyle: "content",
  15142. hide: null,
  15143. show: null,
  15144. // Callbacks
  15145. activate: null,
  15146. beforeActivate: null,
  15147. beforeLoad: null,
  15148. load: null
  15149. },
  15150. _isLocal: ( function() {
  15151. var rhash = /#.*$/;
  15152. return function( anchor ) {
  15153. var anchorUrl, locationUrl;
  15154. anchorUrl = anchor.href.replace( rhash, "" );
  15155. locationUrl = location.href.replace( rhash, "" );
  15156. // Decoding may throw an error if the URL isn't UTF-8 (#9518)
  15157. try {
  15158. anchorUrl = decodeURIComponent( anchorUrl );
  15159. } catch ( error ) {}
  15160. try {
  15161. locationUrl = decodeURIComponent( locationUrl );
  15162. } catch ( error ) {}
  15163. return anchor.hash.length > 1 && anchorUrl === locationUrl;
  15164. };
  15165. } )(),
  15166. _create: function() {
  15167. var that = this,
  15168. options = this.options;
  15169. this.running = false;
  15170. this._addClass( "ui-tabs", "ui-widget ui-widget-content" );
  15171. this._toggleClass( "ui-tabs-collapsible", null, options.collapsible );
  15172. this._processTabs();
  15173. options.active = this._initialActive();
  15174. // Take disabling tabs via class attribute from HTML
  15175. // into account and update option properly.
  15176. if ( $.isArray( options.disabled ) ) {
  15177. options.disabled = $.unique( options.disabled.concat(
  15178. $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
  15179. return that.tabs.index( li );
  15180. } )
  15181. ) ).sort();
  15182. }
  15183. // Check for length avoids error when initializing empty list
  15184. if ( this.options.active !== false && this.anchors.length ) {
  15185. this.active = this._findActive( options.active );
  15186. } else {
  15187. this.active = $();
  15188. }
  15189. this._refresh();
  15190. if ( this.active.length ) {
  15191. this.load( options.active );
  15192. }
  15193. },
  15194. _initialActive: function() {
  15195. var active = this.options.active,
  15196. collapsible = this.options.collapsible,
  15197. locationHash = location.hash.substring( 1 );
  15198. if ( active === null ) {
  15199. // check the fragment identifier in the URL
  15200. if ( locationHash ) {
  15201. this.tabs.each( function( i, tab ) {
  15202. if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
  15203. active = i;
  15204. return false;
  15205. }
  15206. } );
  15207. }
  15208. // Check for a tab marked active via a class
  15209. if ( active === null ) {
  15210. active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
  15211. }
  15212. // No active tab, set to false
  15213. if ( active === null || active === -1 ) {
  15214. active = this.tabs.length ? 0 : false;
  15215. }
  15216. }
  15217. // Handle numbers: negative, out of range
  15218. if ( active !== false ) {
  15219. active = this.tabs.index( this.tabs.eq( active ) );
  15220. if ( active === -1 ) {
  15221. active = collapsible ? false : 0;
  15222. }
  15223. }
  15224. // Don't allow collapsible: false and active: false
  15225. if ( !collapsible && active === false && this.anchors.length ) {
  15226. active = 0;
  15227. }
  15228. return active;
  15229. },
  15230. _getCreateEventData: function() {
  15231. return {
  15232. tab: this.active,
  15233. panel: !this.active.length ? $() : this._getPanelForTab( this.active )
  15234. };
  15235. },
  15236. _tabKeydown: function( event ) {
  15237. var focusedTab = $( $.ui.safeActiveElement( this.document[ 0 ] ) ).closest( "li" ),
  15238. selectedIndex = this.tabs.index( focusedTab ),
  15239. goingForward = true;
  15240. if ( this._handlePageNav( event ) ) {
  15241. return;
  15242. }
  15243. switch ( event.keyCode ) {
  15244. case $.ui.keyCode.RIGHT:
  15245. case $.ui.keyCode.DOWN:
  15246. selectedIndex++;
  15247. break;
  15248. case $.ui.keyCode.UP:
  15249. case $.ui.keyCode.LEFT:
  15250. goingForward = false;
  15251. selectedIndex--;
  15252. break;
  15253. case $.ui.keyCode.END:
  15254. selectedIndex = this.anchors.length - 1;
  15255. break;
  15256. case $.ui.keyCode.HOME:
  15257. selectedIndex = 0;
  15258. break;
  15259. case $.ui.keyCode.SPACE:
  15260. // Activate only, no collapsing
  15261. event.preventDefault();
  15262. clearTimeout( this.activating );
  15263. this._activate( selectedIndex );
  15264. return;
  15265. case $.ui.keyCode.ENTER:
  15266. // Toggle (cancel delayed activation, allow collapsing)
  15267. event.preventDefault();
  15268. clearTimeout( this.activating );
  15269. // Determine if we should collapse or activate
  15270. this._activate( selectedIndex === this.options.active ? false : selectedIndex );
  15271. return;
  15272. default:
  15273. return;
  15274. }
  15275. // Focus the appropriate tab, based on which key was pressed
  15276. event.preventDefault();
  15277. clearTimeout( this.activating );
  15278. selectedIndex = this._focusNextTab( selectedIndex, goingForward );
  15279. // Navigating with control/command key will prevent automatic activation
  15280. if ( !event.ctrlKey && !event.metaKey ) {
  15281. // Update aria-selected immediately so that AT think the tab is already selected.
  15282. // Otherwise AT may confuse the user by stating that they need to activate the tab,
  15283. // but the tab will already be activated by the time the announcement finishes.
  15284. focusedTab.attr( "aria-selected", "false" );
  15285. this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
  15286. this.activating = this._delay( function() {
  15287. this.option( "active", selectedIndex );
  15288. }, this.delay );
  15289. }
  15290. },
  15291. _panelKeydown: function( event ) {
  15292. if ( this._handlePageNav( event ) ) {
  15293. return;
  15294. }
  15295. // Ctrl+up moves focus to the current tab
  15296. if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
  15297. event.preventDefault();
  15298. this.active.trigger( "focus" );
  15299. }
  15300. },
  15301. // Alt+page up/down moves focus to the previous/next tab (and activates)
  15302. _handlePageNav: function( event ) {
  15303. if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
  15304. this._activate( this._focusNextTab( this.options.active - 1, false ) );
  15305. return true;
  15306. }
  15307. if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
  15308. this._activate( this._focusNextTab( this.options.active + 1, true ) );
  15309. return true;
  15310. }
  15311. },
  15312. _findNextTab: function( index, goingForward ) {
  15313. var lastTabIndex = this.tabs.length - 1;
  15314. function constrain() {
  15315. if ( index > lastTabIndex ) {
  15316. index = 0;
  15317. }
  15318. if ( index < 0 ) {
  15319. index = lastTabIndex;
  15320. }
  15321. return index;
  15322. }
  15323. while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
  15324. index = goingForward ? index + 1 : index - 1;
  15325. }
  15326. return index;
  15327. },
  15328. _focusNextTab: function( index, goingForward ) {
  15329. index = this._findNextTab( index, goingForward );
  15330. this.tabs.eq( index ).trigger( "focus" );
  15331. return index;
  15332. },
  15333. _setOption: function( key, value ) {
  15334. if ( key === "active" ) {
  15335. // _activate() will handle invalid values and update this.options
  15336. this._activate( value );
  15337. return;
  15338. }
  15339. this._super( key, value );
  15340. if ( key === "collapsible" ) {
  15341. this._toggleClass( "ui-tabs-collapsible", null, value );
  15342. // Setting collapsible: false while collapsed; open first panel
  15343. if ( !value && this.options.active === false ) {
  15344. this._activate( 0 );
  15345. }
  15346. }
  15347. if ( key === "event" ) {
  15348. this._setupEvents( value );
  15349. }
  15350. if ( key === "heightStyle" ) {
  15351. this._setupHeightStyle( value );
  15352. }
  15353. },
  15354. _sanitizeSelector: function( hash ) {
  15355. return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
  15356. },
  15357. refresh: function() {
  15358. var options = this.options,
  15359. lis = this.tablist.children( ":has(a[href])" );
  15360. // Get disabled tabs from class attribute from HTML
  15361. // this will get converted to a boolean if needed in _refresh()
  15362. options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
  15363. return lis.index( tab );
  15364. } );
  15365. this._processTabs();
  15366. // Was collapsed or no tabs
  15367. if ( options.active === false || !this.anchors.length ) {
  15368. options.active = false;
  15369. this.active = $();
  15370. // was active, but active tab is gone
  15371. } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
  15372. // all remaining tabs are disabled
  15373. if ( this.tabs.length === options.disabled.length ) {
  15374. options.active = false;
  15375. this.active = $();
  15376. // activate previous tab
  15377. } else {
  15378. this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
  15379. }
  15380. // was active, active tab still exists
  15381. } else {
  15382. // make sure active index is correct
  15383. options.active = this.tabs.index( this.active );
  15384. }
  15385. this._refresh();
  15386. },
  15387. _refresh: function() {
  15388. this._setOptionDisabled( this.options.disabled );
  15389. this._setupEvents( this.options.event );
  15390. this._setupHeightStyle( this.options.heightStyle );
  15391. this.tabs.not( this.active ).attr( {
  15392. "aria-selected": "false",
  15393. "aria-expanded": "false",
  15394. tabIndex: -1
  15395. } );
  15396. this.panels.not( this._getPanelForTab( this.active ) )
  15397. .hide()
  15398. .attr( {
  15399. "aria-hidden": "true"
  15400. } );
  15401. // Make sure one tab is in the tab order
  15402. if ( !this.active.length ) {
  15403. this.tabs.eq( 0 ).attr( "tabIndex", 0 );
  15404. } else {
  15405. this.active
  15406. .attr( {
  15407. "aria-selected": "true",
  15408. "aria-expanded": "true",
  15409. tabIndex: 0
  15410. } );
  15411. this._addClass( this.active, "ui-tabs-active", "ui-state-active" );
  15412. this._getPanelForTab( this.active )
  15413. .show()
  15414. .attr( {
  15415. "aria-hidden": "false"
  15416. } );
  15417. }
  15418. },
  15419. _processTabs: function() {
  15420. var that = this,
  15421. prevTabs = this.tabs,
  15422. prevAnchors = this.anchors,
  15423. prevPanels = this.panels;
  15424. this.tablist = this._getList().attr( "role", "tablist" );
  15425. this._addClass( this.tablist, "ui-tabs-nav",
  15426. "ui-helper-reset ui-helper-clearfix ui-widget-header" );
  15427. // Prevent users from focusing disabled tabs via click
  15428. this.tablist
  15429. .on( "mousedown" + this.eventNamespace, "> li", function( event ) {
  15430. if ( $( this ).is( ".ui-state-disabled" ) ) {
  15431. event.preventDefault();
  15432. }
  15433. } )
  15434. // Support: IE <9
  15435. // Preventing the default action in mousedown doesn't prevent IE
  15436. // from focusing the element, so if the anchor gets focused, blur.
  15437. // We don't have to worry about focusing the previously focused
  15438. // element since clicking on a non-focusable element should focus
  15439. // the body anyway.
  15440. .on( "focus" + this.eventNamespace, ".ui-tabs-anchor", function() {
  15441. if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
  15442. this.blur();
  15443. }
  15444. } );
  15445. this.tabs = this.tablist.find( "> li:has(a[href])" )
  15446. .attr( {
  15447. role: "tab",
  15448. tabIndex: -1
  15449. } );
  15450. this._addClass( this.tabs, "ui-tabs-tab", "ui-state-default" );
  15451. this.anchors = this.tabs.map( function() {
  15452. return $( "a", this )[ 0 ];
  15453. } )
  15454. .attr( {
  15455. role: "presentation",
  15456. tabIndex: -1
  15457. } );
  15458. this._addClass( this.anchors, "ui-tabs-anchor" );
  15459. this.panels = $();
  15460. this.anchors.each( function( i, anchor ) {
  15461. var selector, panel, panelId,
  15462. anchorId = $( anchor ).uniqueId().attr( "id" ),
  15463. tab = $( anchor ).closest( "li" ),
  15464. originalAriaControls = tab.attr( "aria-controls" );
  15465. // Inline tab
  15466. if ( that._isLocal( anchor ) ) {
  15467. selector = anchor.hash;
  15468. panelId = selector.substring( 1 );
  15469. panel = that.element.find( that._sanitizeSelector( selector ) );
  15470. // remote tab
  15471. } else {
  15472. // If the tab doesn't already have aria-controls,
  15473. // generate an id by using a throw-away element
  15474. panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id;
  15475. selector = "#" + panelId;
  15476. panel = that.element.find( selector );
  15477. if ( !panel.length ) {
  15478. panel = that._createPanel( panelId );
  15479. panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
  15480. }
  15481. panel.attr( "aria-live", "polite" );
  15482. }
  15483. if ( panel.length ) {
  15484. that.panels = that.panels.add( panel );
  15485. }
  15486. if ( originalAriaControls ) {
  15487. tab.data( "ui-tabs-aria-controls", originalAriaControls );
  15488. }
  15489. tab.attr( {
  15490. "aria-controls": panelId,
  15491. "aria-labelledby": anchorId
  15492. } );
  15493. panel.attr( "aria-labelledby", anchorId );
  15494. } );
  15495. this.panels.attr( "role", "tabpanel" );
  15496. this._addClass( this.panels, "ui-tabs-panel", "ui-widget-content" );
  15497. // Avoid memory leaks (#10056)
  15498. if ( prevTabs ) {
  15499. this._off( prevTabs.not( this.tabs ) );
  15500. this._off( prevAnchors.not( this.anchors ) );
  15501. this._off( prevPanels.not( this.panels ) );
  15502. }
  15503. },
  15504. // Allow overriding how to find the list for rare usage scenarios (#7715)
  15505. _getList: function() {
  15506. return this.tablist || this.element.find( "ol, ul" ).eq( 0 );
  15507. },
  15508. _createPanel: function( id ) {
  15509. return $( "<div>" )
  15510. .attr( "id", id )
  15511. .data( "ui-tabs-destroy", true );
  15512. },
  15513. _setOptionDisabled: function( disabled ) {
  15514. var currentItem, li, i;
  15515. if ( $.isArray( disabled ) ) {
  15516. if ( !disabled.length ) {
  15517. disabled = false;
  15518. } else if ( disabled.length === this.anchors.length ) {
  15519. disabled = true;
  15520. }
  15521. }
  15522. // Disable tabs
  15523. for ( i = 0; ( li = this.tabs[ i ] ); i++ ) {
  15524. currentItem = $( li );
  15525. if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
  15526. currentItem.attr( "aria-disabled", "true" );
  15527. this._addClass( currentItem, null, "ui-state-disabled" );
  15528. } else {
  15529. currentItem.removeAttr( "aria-disabled" );
  15530. this._removeClass( currentItem, null, "ui-state-disabled" );
  15531. }
  15532. }
  15533. this.options.disabled = disabled;
  15534. this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null,
  15535. disabled === true );
  15536. },
  15537. _setupEvents: function( event ) {
  15538. var events = {};
  15539. if ( event ) {
  15540. $.each( event.split( " " ), function( index, eventName ) {
  15541. events[ eventName ] = "_eventHandler";
  15542. } );
  15543. }
  15544. this._off( this.anchors.add( this.tabs ).add( this.panels ) );
  15545. // Always prevent the default action, even when disabled
  15546. this._on( true, this.anchors, {
  15547. click: function( event ) {
  15548. event.preventDefault();
  15549. }
  15550. } );
  15551. this._on( this.anchors, events );
  15552. this._on( this.tabs, { keydown: "_tabKeydown" } );
  15553. this._on( this.panels, { keydown: "_panelKeydown" } );
  15554. this._focusable( this.tabs );
  15555. this._hoverable( this.tabs );
  15556. },
  15557. _setupHeightStyle: function( heightStyle ) {
  15558. var maxHeight,
  15559. parent = this.element.parent();
  15560. if ( heightStyle === "fill" ) {
  15561. maxHeight = parent.height();
  15562. maxHeight -= this.element.outerHeight() - this.element.height();
  15563. this.element.siblings( ":visible" ).each( function() {
  15564. var elem = $( this ),
  15565. position = elem.css( "position" );
  15566. if ( position === "absolute" || position === "fixed" ) {
  15567. return;
  15568. }
  15569. maxHeight -= elem.outerHeight( true );
  15570. } );
  15571. this.element.children().not( this.panels ).each( function() {
  15572. maxHeight -= $( this ).outerHeight( true );
  15573. } );
  15574. this.panels.each( function() {
  15575. $( this ).height( Math.max( 0, maxHeight -
  15576. $( this ).innerHeight() + $( this ).height() ) );
  15577. } )
  15578. .css( "overflow", "auto" );
  15579. } else if ( heightStyle === "auto" ) {
  15580. maxHeight = 0;
  15581. this.panels.each( function() {
  15582. maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
  15583. } ).height( maxHeight );
  15584. }
  15585. },
  15586. _eventHandler: function( event ) {
  15587. var options = this.options,
  15588. active = this.active,
  15589. anchor = $( event.currentTarget ),
  15590. tab = anchor.closest( "li" ),
  15591. clickedIsActive = tab[ 0 ] === active[ 0 ],
  15592. collapsing = clickedIsActive && options.collapsible,
  15593. toShow = collapsing ? $() : this._getPanelForTab( tab ),
  15594. toHide = !active.length ? $() : this._getPanelForTab( active ),
  15595. eventData = {
  15596. oldTab: active,
  15597. oldPanel: toHide,
  15598. newTab: collapsing ? $() : tab,
  15599. newPanel: toShow
  15600. };
  15601. event.preventDefault();
  15602. if ( tab.hasClass( "ui-state-disabled" ) ||
  15603. // tab is already loading
  15604. tab.hasClass( "ui-tabs-loading" ) ||
  15605. // can't switch durning an animation
  15606. this.running ||
  15607. // click on active header, but not collapsible
  15608. ( clickedIsActive && !options.collapsible ) ||
  15609. // allow canceling activation
  15610. ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
  15611. return;
  15612. }
  15613. options.active = collapsing ? false : this.tabs.index( tab );
  15614. this.active = clickedIsActive ? $() : tab;
  15615. if ( this.xhr ) {
  15616. this.xhr.abort();
  15617. }
  15618. if ( !toHide.length && !toShow.length ) {
  15619. $.error( "jQuery UI Tabs: Mismatching fragment identifier." );
  15620. }
  15621. if ( toShow.length ) {
  15622. this.load( this.tabs.index( tab ), event );
  15623. }
  15624. this._toggle( event, eventData );
  15625. },
  15626. // Handles show/hide for selecting tabs
  15627. _toggle: function( event, eventData ) {
  15628. var that = this,
  15629. toShow = eventData.newPanel,
  15630. toHide = eventData.oldPanel;
  15631. this.running = true;
  15632. function complete() {
  15633. that.running = false;
  15634. that._trigger( "activate", event, eventData );
  15635. }
  15636. function show() {
  15637. that._addClass( eventData.newTab.closest( "li" ), "ui-tabs-active", "ui-state-active" );
  15638. if ( toShow.length && that.options.show ) {
  15639. that._show( toShow, that.options.show, complete );
  15640. } else {
  15641. toShow.show();
  15642. complete();
  15643. }
  15644. }
  15645. // Start out by hiding, then showing, then completing
  15646. if ( toHide.length && this.options.hide ) {
  15647. this._hide( toHide, this.options.hide, function() {
  15648. that._removeClass( eventData.oldTab.closest( "li" ),
  15649. "ui-tabs-active", "ui-state-active" );
  15650. show();
  15651. } );
  15652. } else {
  15653. this._removeClass( eventData.oldTab.closest( "li" ),
  15654. "ui-tabs-active", "ui-state-active" );
  15655. toHide.hide();
  15656. show();
  15657. }
  15658. toHide.attr( "aria-hidden", "true" );
  15659. eventData.oldTab.attr( {
  15660. "aria-selected": "false",
  15661. "aria-expanded": "false"
  15662. } );
  15663. // If we're switching tabs, remove the old tab from the tab order.
  15664. // If we're opening from collapsed state, remove the previous tab from the tab order.
  15665. // If we're collapsing, then keep the collapsing tab in the tab order.
  15666. if ( toShow.length && toHide.length ) {
  15667. eventData.oldTab.attr( "tabIndex", -1 );
  15668. } else if ( toShow.length ) {
  15669. this.tabs.filter( function() {
  15670. return $( this ).attr( "tabIndex" ) === 0;
  15671. } )
  15672. .attr( "tabIndex", -1 );
  15673. }
  15674. toShow.attr( "aria-hidden", "false" );
  15675. eventData.newTab.attr( {
  15676. "aria-selected": "true",
  15677. "aria-expanded": "true",
  15678. tabIndex: 0
  15679. } );
  15680. },
  15681. _activate: function( index ) {
  15682. var anchor,
  15683. active = this._findActive( index );
  15684. // Trying to activate the already active panel
  15685. if ( active[ 0 ] === this.active[ 0 ] ) {
  15686. return;
  15687. }
  15688. // Trying to collapse, simulate a click on the current active header
  15689. if ( !active.length ) {
  15690. active = this.active;
  15691. }
  15692. anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
  15693. this._eventHandler( {
  15694. target: anchor,
  15695. currentTarget: anchor,
  15696. preventDefault: $.noop
  15697. } );
  15698. },
  15699. _findActive: function( index ) {
  15700. return index === false ? $() : this.tabs.eq( index );
  15701. },
  15702. _getIndex: function( index ) {
  15703. // meta-function to give users option to provide a href string instead of a numerical index.
  15704. if ( typeof index === "string" ) {
  15705. index = this.anchors.index( this.anchors.filter( "[href$='" +
  15706. $.ui.escapeSelector( index ) + "']" ) );
  15707. }
  15708. return index;
  15709. },
  15710. _destroy: function() {
  15711. if ( this.xhr ) {
  15712. this.xhr.abort();
  15713. }
  15714. this.tablist
  15715. .removeAttr( "role" )
  15716. .off( this.eventNamespace );
  15717. this.anchors
  15718. .removeAttr( "role tabIndex" )
  15719. .removeUniqueId();
  15720. this.tabs.add( this.panels ).each( function() {
  15721. if ( $.data( this, "ui-tabs-destroy" ) ) {
  15722. $( this ).remove();
  15723. } else {
  15724. $( this ).removeAttr( "role tabIndex " +
  15725. "aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded" );
  15726. }
  15727. } );
  15728. this.tabs.each( function() {
  15729. var li = $( this ),
  15730. prev = li.data( "ui-tabs-aria-controls" );
  15731. if ( prev ) {
  15732. li
  15733. .attr( "aria-controls", prev )
  15734. .removeData( "ui-tabs-aria-controls" );
  15735. } else {
  15736. li.removeAttr( "aria-controls" );
  15737. }
  15738. } );
  15739. this.panels.show();
  15740. if ( this.options.heightStyle !== "content" ) {
  15741. this.panels.css( "height", "" );
  15742. }
  15743. },
  15744. enable: function( index ) {
  15745. var disabled = this.options.disabled;
  15746. if ( disabled === false ) {
  15747. return;
  15748. }
  15749. if ( index === undefined ) {
  15750. disabled = false;
  15751. } else {
  15752. index = this._getIndex( index );
  15753. if ( $.isArray( disabled ) ) {
  15754. disabled = $.map( disabled, function( num ) {
  15755. return num !== index ? num : null;
  15756. } );
  15757. } else {
  15758. disabled = $.map( this.tabs, function( li, num ) {
  15759. return num !== index ? num : null;
  15760. } );
  15761. }
  15762. }
  15763. this._setOptionDisabled( disabled );
  15764. },
  15765. disable: function( index ) {
  15766. var disabled = this.options.disabled;
  15767. if ( disabled === true ) {
  15768. return;
  15769. }
  15770. if ( index === undefined ) {
  15771. disabled = true;
  15772. } else {
  15773. index = this._getIndex( index );
  15774. if ( $.inArray( index, disabled ) !== -1 ) {
  15775. return;
  15776. }
  15777. if ( $.isArray( disabled ) ) {
  15778. disabled = $.merge( [ index ], disabled ).sort();
  15779. } else {
  15780. disabled = [ index ];
  15781. }
  15782. }
  15783. this._setOptionDisabled( disabled );
  15784. },
  15785. load: function( index, event ) {
  15786. index = this._getIndex( index );
  15787. var that = this,
  15788. tab = this.tabs.eq( index ),
  15789. anchor = tab.find( ".ui-tabs-anchor" ),
  15790. panel = this._getPanelForTab( tab ),
  15791. eventData = {
  15792. tab: tab,
  15793. panel: panel
  15794. },
  15795. complete = function( jqXHR, status ) {
  15796. if ( status === "abort" ) {
  15797. that.panels.stop( false, true );
  15798. }
  15799. that._removeClass( tab, "ui-tabs-loading" );
  15800. panel.removeAttr( "aria-busy" );
  15801. if ( jqXHR === that.xhr ) {
  15802. delete that.xhr;
  15803. }
  15804. };
  15805. // Not remote
  15806. if ( this._isLocal( anchor[ 0 ] ) ) {
  15807. return;
  15808. }
  15809. this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
  15810. // Support: jQuery <1.8
  15811. // jQuery <1.8 returns false if the request is canceled in beforeSend,
  15812. // but as of 1.8, $.ajax() always returns a jqXHR object.
  15813. if ( this.xhr && this.xhr.statusText !== "canceled" ) {
  15814. this._addClass( tab, "ui-tabs-loading" );
  15815. panel.attr( "aria-busy", "true" );
  15816. this.xhr
  15817. .done( function( response, status, jqXHR ) {
  15818. // support: jQuery <1.8
  15819. // http://bugs.jquery.com/ticket/11778
  15820. setTimeout( function() {
  15821. panel.html( response );
  15822. that._trigger( "load", event, eventData );
  15823. complete( jqXHR, status );
  15824. }, 1 );
  15825. } )
  15826. .fail( function( jqXHR, status ) {
  15827. // support: jQuery <1.8
  15828. // http://bugs.jquery.com/ticket/11778
  15829. setTimeout( function() {
  15830. complete( jqXHR, status );
  15831. }, 1 );
  15832. } );
  15833. }
  15834. },
  15835. _ajaxSettings: function( anchor, event, eventData ) {
  15836. var that = this;
  15837. return {
  15838. // Support: IE <11 only
  15839. // Strip any hash that exists to prevent errors with the Ajax request
  15840. url: anchor.attr( "href" ).replace( /#.*$/, "" ),
  15841. beforeSend: function( jqXHR, settings ) {
  15842. return that._trigger( "beforeLoad", event,
  15843. $.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
  15844. }
  15845. };
  15846. },
  15847. _getPanelForTab: function( tab ) {
  15848. var id = $( tab ).attr( "aria-controls" );
  15849. return this.element.find( this._sanitizeSelector( "#" + id ) );
  15850. }
  15851. } );
  15852. // DEPRECATED
  15853. // TODO: Switch return back to widget declaration at top of file when this is removed
  15854. if ( $.uiBackCompat !== false ) {
  15855. // Backcompat for ui-tab class (now ui-tabs-tab)
  15856. $.widget( "ui.tabs", $.ui.tabs, {
  15857. _processTabs: function() {
  15858. this._superApply( arguments );
  15859. this._addClass( this.tabs, "ui-tab" );
  15860. }
  15861. } );
  15862. }
  15863. var widgetsTabs = $.ui.tabs;
  15864. // DEPRECATED
  15865. // TODO: Switch return back to widget declaration at top of file when this is removed
  15866. }));
  15867. /* jQuery Validation Plugin
  15868. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
  15869. /*! jQuery Validation Plugin - v1.11.0 - 2/4/2013
  15870. * https://github.com/jzaefferer/jquery-validation
  15871. * Copyright (c) 2013 Jörn Zaefferer; Licensed MIT */
  15872. (function(e){e.extend(e.fn,{validate:function(t){if(!this.length){t&&t.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing.");return}var n=e.data(this[0],"validator");return n?n:(this.attr("novalidate","novalidate"),n=new e.validator(t,this[0]),e.data(this[0],"validator",n),n.settings.onsubmit&&(this.validateDelegate(":submit","click",function(t){n.settings.submitHandler&&(n.submitButton=t.target),e(t.target).hasClass("cancel")&&(n.cancelSubmit=!0)}),this.submit(function(t){function r(){var r;return n.settings.submitHandler?(n.submitButton&&(r=e("<input type='hidden'/>").attr("name",n.submitButton.name).val(n.submitButton.value).appendTo(n.currentForm)),n.settings.submitHandler.call(n,n.currentForm,t),n.submitButton&&r.remove(),!1):!0}return n.settings.debug&&t.preventDefault(),n.cancelSubmit?(n.cancelSubmit=!1,r()):n.form()?n.pendingRequest?(n.formSubmitted=!0,!1):r():(n.focusInvalid(),!1)})),n)},valid:function(){if(e(this[0]).is("form"))return this.validate().form();var t=!0,n=e(this[0].form).validate();return this.each(function(){t&=n.element(this)}),t},removeAttrs:function(t){var n={},r=this;return e.each(t.split(/\s/),function(e,t){n[t]=r.attr(t),r.removeAttr(t)}),n},rules:function(t,n){var r=this[0];if(t){var i=e.data(r.form,"validator").settings,s=i.rules,o=e.validator.staticRules(r);switch(t){case"add":e.extend(o,e.validator.normalizeRule(n)),s[r.name]=o,n.messages&&(i.messages[r.name]=e.extend(i.messages[r.name],n.messages));break;case"remove":if(!n)return delete s[r.name],o;var u={};return e.each(n.split(/\s/),function(e,t){u[t]=o[t],delete o[t]}),u}}var a=e.validator.normalizeRules(e.extend({},e.validator.classRules(r),e.validator.attributeRules(r),e.validator.dataRules(r),e.validator.staticRules(r)),r);if(a.required){var f=a.required;delete a.required,a=e.extend({required:f},a)}return a}}),e.extend(e.expr[":"],{blank:function(t){return!e.trim(""+t.value)},filled:function(t){return!!e.trim(""+t.value)},unchecked:function(e){return!e.checked}}),e.validator=function(t,n){this.settings=e.extend(!0,{},e.validator.defaults,t),this.currentForm=n,this.init()},e.validator.format=function(t,n){return arguments.length===1?function(){var n=e.makeArray(arguments);return n.unshift(t),e.validator.format.apply(this,n)}:(arguments.length>2&&n.constructor!==Array&&(n=e.makeArray(arguments).slice(1)),n.constructor!==Array&&(n=[n]),e.each(n,function(e,n){t=t.replace(new RegExp("\\{"+e+"\\}","g"),function(){return n})}),t)},e.extend(e.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:e([]),errorLabelContainer:e([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(e,t){this.lastActive=e,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,e,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(e)).hide())},onfocusout:function(e,t){!this.checkable(e)&&(e.name in this.submitted||!this.optional(e))&&this.element(e)},onkeyup:function(e,t){if(t.which===9&&this.elementValue(e)==="")return;(e.name in this.submitted||e===this.lastElement)&&this.element(e)},onclick:function(e,t){e.name in this.submitted?this.element(e):e.parentNode.name in this.submitted&&this.element(e.parentNode)},highlight:function(t,n,r){t.type==="radio"?this.findByName(t.name).addClass(n).removeClass(r):e(t).addClass(n).removeClass(r)},unhighlight:function(t,n,r){t.type==="radio"?this.findByName(t.name).removeClass(n).addClass(r):e(t).removeClass(n).addClass(r)}},setDefaults:function(t){e.extend(e.validator.defaults,t)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:e.validator.format("Please enter no more than {0} characters."),minlength:e.validator.format("Please enter at least {0} characters."),rangelength:e.validator.format("Please enter a value between {0} and {1} characters long."),range:e.validator.format("Please enter a value between {0} and {1}."),max:e.validator.format("Please enter a value less than or equal to {0}."),min:e.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function r(t){var n=e.data(this[0].form,"validator"),r="on"+t.type.replace(/^validate/,"");n.settings[r]&&n.settings[r].call(n,this[0],t)}this.labelContainer=e(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||e(this.currentForm),this.containers=e(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var t=this.groups={};e.each(this.settings.groups,function(n,r){typeof r=="string"&&(r=r.split(/\s/)),e.each(r,function(e,r){t[r]=n})});var n=this.settings.rules;e.each(n,function(t,r){n[t]=e.validator.normalizeRule(r)}),e(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",r).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",r),this.settings.invalidHandler&&e(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),e.extend(this.submitted,this.errorMap),this.invalid=e.extend({},this.errorMap),this.valid()||e(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var e=0,t=this.currentElements=this.elements();t[e];e++)this.check(t[e]);return this.valid()},element:function(t){t=this.validationTargetFor(this.clean(t)),this.lastElement=t,this.prepareElement(t),this.currentElements=e(t);var n=this.check(t)!==!1;return n?delete this.invalid[t.name]:this.invalid[t.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),n},showErrors:function(t){if(t){e.extend(this.errorMap,t),this.errorList=[];for(var n in t)this.errorList.push({message:t[n],element:this.findByName(n)[0]});this.successList=e.grep(this.successList,function(e){return!(e.name in t)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){e.fn.resetForm&&e(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(e){var t=0;for(var n in e)t++;return t},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()===0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{e(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(t){}},findLastActive:function(){var t=this.lastActive;return t&&e.grep(this.errorList,function(e){return e.element.name===t.name}).length===1&&t},elements:function(){var t=this,n={};return e(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&t.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in n||!t.objectLength(e(this).rules())?!1:(n[this.name]=!0,!0)})},clean:function(t){return e(t)[0]},errors:function(){var t=this.settings.errorClass.replace(" ",".");return e(this.settings.errorElement+"."+t,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=e([]),this.toHide=e([]),this.currentElements=e([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(e){this.reset(),this.toHide=this.errorsFor(e)},elementValue:function(t){var n=e(t).attr("type"),r=e(t).val();return n==="radio"||n==="checkbox"?e("input[name='"+e(t).attr("name")+"']:checked").val():typeof r=="string"?r.replace(/\r/g,""):r},check:function(t){t=this.validationTargetFor(this.clean(t));var n=e(t).rules(),r=!1,i=this.elementValue(t),s;for(var o in n){var u={method:o,parameters:n[o]};try{s=e.validator.methods[o].call(this,i,t,u.parameters);if(s==="dependency-mismatch"){r=!0;continue}r=!1;if(s==="pending"){this.toHide=this.toHide.not(this.errorsFor(t));return}if(!s)return this.formatAndAdd(t,u),!1}catch(a){throw this.settings.debug&&window.console&&console.log("Exception occured when checking element "+t.id+", check the '"+u.method+"' method.",a),a}}if(r)return;return this.objectLength(n)&&this.successList.push(t),!0},customDataMessage:function(t,n){return e(t).data("msg-"+n.toLowerCase())||t.attributes&&e(t).attr("data-msg-"+n.toLowerCase())},customMessage:function(e,t){var n=this.settings.messages[e];return n&&(n.constructor===String?n:n[t])},findDefined:function(){for(var e=0;e<arguments.length;e++)if(arguments[e]!==undefined)return arguments[e];return undefined},defaultMessage:function(t,n){return this.findDefined(this.customMessage(t.name,n),this.customDataMessage(t,n),!this.settings.ignoreTitle&&t.title||undefined,e.validator.messages[n],"<strong>Warning: No message defined for "+t.name+"</strong>")},formatAndAdd:function(t,n){var r=this.defaultMessage(t,n.method),i=/\$?\{(\d+)\}/g;typeof r=="function"?r=r.call(this,n.parameters,t):i.test(r)&&(r=e.validator.format(r.replace(i,"{$1}"),n.parameters)),this.errorList.push({message:r,element:t}),this.errorMap[t.name]=r,this.submitted[t.name]=r},addWrapper:function(e){return this.settings.wrapper&&(e=e.add(e.parent(this.settings.wrapper))),e},defaultShowErrors:function(){var e,t;for(e=0;this.errorList[e];e++){var n=this.errorList[e];this.settings.highlight&&this.settings.highlight.call(this,n.element,this.settings.errorClass,this.settings.validClass),this.showLabel(n.element,n.message)}this.errorList.length&&(this.toShow=this.toShow.add(this.containers));if(this.settings.success)for(e=0;this.successList[e];e++)this.showLabel(this.successList[e]);if(this.settings.unhighlight)for(e=0,t=this.validElements();t[e];e++)this.settings.unhighlight.call(this,t[e],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return e(this.errorList).map(function(){return this.element})},showLabel:function(t,n){var r=this.errorsFor(t);r.length?(r.removeClass(this.settings.validClass).addClass(this.settings.errorClass),r.html(n)):(r=e("<"+this.settings.errorElement+">").attr("for",this.idOrName(t)).addClass(this.settings.errorClass).html(n||""),this.settings.wrapper&&(r=r.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(r).length||(this.settings.errorPlacement?this.settings.errorPlacement(r,e(t)):r.insertAfter(t))),!n&&this.settings.success&&(r.text(""),typeof this.settings.success=="string"?r.addClass(this.settings.success):this.settings.success(r,t)),this.toShow=this.toShow.add(r)},errorsFor:function(t){var n=this.idOrName(t);return this.errors().filter(function(){return e(this).attr("for")===n})},idOrName:function(e){return this.groups[e.name]||(this.checkable(e)?e.name:e.id||e.name)},validationTargetFor:function(e){return this.checkable(e)&&(e=this.findByName(e.name).not(this.settings.ignore)[0]),e},checkable:function(e){return/radio|checkbox/i.test(e.type)},findByName:function(t){return e(this.currentForm).find("[name='"+t+"']")},getLength:function(t,n){switch(n.nodeName.toLowerCase()){case"select":return e("option:selected",n).length;case"input":if(this.checkable(n))return this.findByName(n.name).filter(":checked").length}return t.length},depend:function(e,t){return this.dependTypes[typeof e]?this.dependTypes[typeof e](e,t):!0},dependTypes:{"boolean":function(e,t){return e},string:function(t,n){return!!e(t,n.form).length},"function":function(e,t){return e(t)}},optional:function(t){var n=this.elementValue(t);return!e.validator.methods.required.call(this,n,t)&&"dependency-mismatch"},startRequest:function(e){this.pending[e.name]||(this.pendingRequest++,this.pending[e.name]=!0)},stopRequest:function(t,n){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[t.name],n&&this.pendingRequest===0&&this.formSubmitted&&this.form()?(e(this.currentForm).submit(),this.formSubmitted=!1):!n&&this.pendingRequest===0&&this.formSubmitted&&(e(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(t){return e.data(t,"previousValue")||e.data(t,"previousValue",{old:null,valid:!0,message:this.defaultMessage(t,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(t,n){t.constructor===String?this.classRuleSettings[t]=n:e.extend(this.classRuleSettings,t)},classRules:function(t){var n={},r=e(t).attr("class");return r&&e.each(r.split(" "),function(){this in e.validator.classRuleSettings&&e.extend(n,e.validator.classRuleSettings[this])}),n},attributeRules:function(t){var n={},r=e(t);for(var i in e.validator.methods){var s;i==="required"?(s=r.get(0).getAttribute(i),s===""&&(s=!0),s=!!s):s=r.attr(i),s?n[i]=s:r[0].getAttribute("type")===i&&(n[i]=!0)}return n.maxlength&&/-1|2147483647|524288/.test(n.maxlength)&&delete n.maxlength,n},dataRules:function(t){var n,r,i={},s=e(t);for(n in e.validator.methods)r=s.data("rule-"+n.toLowerCase()),r!==undefined&&(i[n]=r);return i},staticRules:function(t){var n={},r=e.data(t.form,"validator");return r.settings.rules&&(n=e.validator.normalizeRule(r.settings.rules[t.name])||{}),n},normalizeRules:function(t,n){return e.each(t,function(r,i){if(i===!1){delete t[r];return}if(i.param||i.depends){var s=!0;switch(typeof i.depends){case"string":s=!!e(i.depends,n.form).length;break;case"function":s=i.depends.call(n,n)}s?t[r]=i.param!==undefined?i.param:!0:delete t[r]}}),e.each(t,function(r,i){t[r]=e.isFunction(i)?i(n):i}),e.each(["minlength","maxlength"],function(){t[this]&&(t[this]=Number(t[this]))}),e.each(["rangelength"],function(){var n;t[this]&&(e.isArray(t[this])?t[this]=[Number(t[this][0]),Number(t[this][1])]:typeof t[this]=="string"&&(n=t[this].split(/[\s,]+/),t[this]=[Number(n[0]),Number(n[1])]))}),e.validator.autoCreateRanges&&(t.min&&t.max&&(t.range=[t.min,t.max],delete t.min,delete t.max),t.minlength&&t.maxlength&&(t.rangelength=[t.minlength,t.maxlength],delete t.minlength,delete t.maxlength)),t},normalizeRule:function(t){if(typeof t=="string"){var n={};e.each(t.split(/\s/),function(){n[this]=!0}),t=n}return t},addMethod:function(t,n,r){e.validator.methods[t]=n,e.validator.messages[t]=r!==undefined?r:e.validator.messages[t],n.length<3&&e.validator.addClassRules(t,e.validator.normalizeRule(t))},methods:{required:function(t,n,r){if(!this.depend(r,n))return"dependency-mismatch";if(n.nodeName.toLowerCase()==="select"){var i=e(n).val();return i&&i.length>0}return this.checkable(n)?this.getLength(t,n)>0:e.trim(t).length>0},remote:function(t,n,r){if(this.optional(n))return"dependency-mismatch";var i=this.previousValue(n);this.settings.messages[n.name]||(this.settings.messages[n.name]={}),i.originalMessage=this.settings.messages[n.name].remote,this.settings.messages[n.name].remote=i.message,r=typeof r=="string"&&{url:r}||r;if(i.old===t)return i.valid;i.old=t;var s=this;this.startRequest(n);var o={};return o[n.name]=t,e.ajax(e.extend(!0,{url:r,mode:"abort",port:"validate"+n.name,dataType:"json",data:o,success:function(r){s.settings.messages[n.name].remote=i.originalMessage;var o=r===!0||r==="true";if(o){var u=s.formSubmitted;s.prepareElement(n),s.formSubmitted=u,s.successList.push(n),delete s.invalid[n.name],s.showErrors()}else{var a={},f=r||s.defaultMessage(n,"remote");a[n.name]=i.message=e.isFunction(f)?f(t):f,s.invalid[n.name]=!0,s.showErrors(a)}i.valid=o,s.stopRequest(n,o)}},r)),"pending"},minlength:function(t,n,r){var i=e.isArray(t)?t.length:this.getLength(e.trim(t),n);return this.optional(n)||i>=r},maxlength:function(t,n,r){var i=e.isArray(t)?t.length:this.getLength(e.trim(t),n);return this.optional(n)||i<=r},rangelength:function(t,n,r){var i=e.isArray(t)?t.length:this.getLength(e.trim(t),n);return this.optional(n)||i>=r[0]&&i<=r[1]},min:function(e,t,n){return this.optional(t)||e>=n},max:function(e,t,n){return this.optional(t)||e<=n},range:function(e,t,n){return this.optional(t)||e>=n[0]&&e<=n[1]},email:function(e,t){return this.optional(t)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(e)},url:function(e,t){return this.optional(t)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e)},date:function(e,t){return this.optional(t)||!/Invalid|NaN/.test((new Date(e)).toString())},dateISO:function(e,t){return this.optional(t)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(e)},number:function(e,t){return this.optional(t)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(e)},digits:function(e,t){return this.optional(t)||/^\d+$/.test(e)},creditcard:function(e,t){if(this.optional(t))return"dependency-mismatch";if(/[^0-9 \-]+/.test(e))return!1;var n=0,r=0,i=!1;e=e.replace(/\D/g,"");for(var s=e.length-1;s>=0;s--){var o=e.charAt(s);r=parseInt(o,10),i&&(r*=2)>9&&(r-=9),n+=r,i=!i}return n%10===0},equalTo:function(t,n,r){var i=e(r);return this.settings.onfocusout&&i.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){e(n).valid()}),t===i.val()}}}),e.format=e.validator.format})(jQuery),function(e){var t={};if(e.ajaxPrefilter)e.ajaxPrefilter(function(e,n,r){var i=e.port;e.mode==="abort"&&(t[i]&&t[i].abort(),t[i]=r)});else{var n=e.ajax;e.ajax=function(r){var i=("mode"in r?r:e.ajaxSettings).mode,s=("port"in r?r:e.ajaxSettings).port;return i==="abort"?(t[s]&&t[s].abort(),t[s]=n.apply(this,arguments)):n.apply(this,arguments)}}}(jQuery),function(e){e.extend(e.fn,{validateDelegate:function(t,n,r){return this.bind(n,function(n){var i=e(n.target);if(i.is(t))return r.apply(i,arguments)})}})}(jQuery);