application-6e4d4050e5485a01bc952959b02e6c9022fc967b7dc11eba82d15f53ce8991f4.js 867 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812
  1. /*
  2. Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
  3. For licensing, see LICENSE.html or http://ckeditor.com/license
  4. */
  5. CKEDITOR.editorConfig = function( config )
  6. {
  7. // Define changes to default configuration here. For example:
  8. // config.language = 'fr';
  9. // config.uiColor = '#AADC6E';
  10. /* Filebrowser routes */
  11. // The location of an external file browser, that should be launched when "Browse Server" button is pressed.
  12. config.filebrowserBrowseUrl = "/ckeditor/attachment_files";
  13. // The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Flash dialog.
  14. config.filebrowserFlashBrowseUrl = "/ckeditor/attachment_files";
  15. // The location of a script that handles file uploads in the Flash dialog.
  16. config.filebrowserFlashUploadUrl = "/ckeditor/attachment_files";
  17. // The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Link tab of Image dialog.
  18. config.filebrowserImageBrowseLinkUrl = "/ckeditor/pictures";
  19. // The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Image dialog.
  20. config.filebrowserImageBrowseUrl = "/ckeditor/pictures";
  21. // The location of a script that handles file uploads in the Image dialog.
  22. config.filebrowserImageUploadUrl = "/ckeditor/pictures";
  23. // The location of a script that handles file uploads.
  24. config.filebrowserUploadUrl = "/ckeditor/attachment_files";
  25. config.allowedContent = true;
  26. // Rails CSRF token
  27. config.filebrowserParams = function(){
  28. var csrf_token, csrf_param, meta,
  29. metas = document.getElementsByTagName('meta'),
  30. params = new Object();
  31. for ( var i = 0 ; i < metas.length ; i++ ){
  32. meta = metas[i];
  33. switch(meta.name) {
  34. case "csrf-token":
  35. csrf_token = meta.content;
  36. break;
  37. case "csrf-param":
  38. csrf_param = meta.content;
  39. break;
  40. default:
  41. continue;
  42. }
  43. }
  44. if (csrf_param !== undefined && csrf_token !== undefined) {
  45. params[csrf_param] = csrf_token;
  46. }
  47. return params;
  48. };
  49. config.addQueryString = function( url, params ){
  50. var queryString = [];
  51. if ( !params ) {
  52. return url;
  53. } else {
  54. for ( var i in params )
  55. queryString.push( i + "=" + encodeURIComponent( params[ i ] ) );
  56. }
  57. return url + ( ( url.indexOf( "?" ) != -1 ) ? "&" : "?" ) + queryString.join( "&" );
  58. };
  59. // Integrate Rails CSRF token into file upload dialogs (link, image, attachment and flash)
  60. CKEDITOR.on( 'dialogDefinition', function( ev ){
  61. // Take the dialog name and its definition from the event data.
  62. var dialogName = ev.data.name;
  63. var dialogDefinition = ev.data.definition;
  64. var content, upload;
  65. if (CKEDITOR.tools.indexOf(['link', 'image', 'attachment', 'flash'], dialogName) > -1) {
  66. content = (dialogDefinition.getContents('Upload') || dialogDefinition.getContents('upload'));
  67. upload = (content == null ? null : content.get('upload'));
  68. if (upload && upload.filebrowser && upload.filebrowser['params'] === undefined) {
  69. upload.filebrowser['params'] = config.filebrowserParams();
  70. upload.action = config.addQueryString(upload.action, upload.filebrowser['params']);
  71. }
  72. }
  73. });
  74. // Toolbar groups configuration.
  75. config.toolbar = [
  76. { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source'] },
  77. { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
  78. // { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },
  79. // { name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },
  80. { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
  81. { name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar' ] },
  82. { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ] },
  83. '/',
  84. { name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
  85. { name: 'colors', items: [ 'TextColor', 'BGColor' ] },
  86. { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] }
  87. ];
  88. config.toolbar_mini = [
  89. { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ] },
  90. { name: 'styles', items: [ 'Font', 'FontSize' ] },
  91. { name: 'colors', items: [ 'TextColor', 'BGColor' ] },
  92. { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
  93. { name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar' ] },
  94. { name: 'maximize'}
  95. ];
  96. };
  97. (function() {
  98. $(document).ready(function() {
  99. return $(document).on('mousedown', '.save-action', function(e) {
  100. var editor, instance;
  101. for (instance in CKEDITOR.instances) {
  102. editor = CKEDITOR.instances[instance];
  103. if (editor.checkDirty()) {
  104. editor.updateElement();
  105. }
  106. }
  107. return true;
  108. });
  109. });
  110. }).call(this);
  111. (function() {
  112. if (typeof window['CKEDITOR_BASEPATH'] === "undefined" || window['CKEDITOR_BASEPATH'] === null) {
  113. window['CKEDITOR_BASEPATH'] = "/assets/ckeditor/";
  114. }
  115. }).call(this);
  116. /*
  117. Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  118. For licensing, see LICENSE.md or http://ckeditor.com/license
  119. */
  120. (function(){if(window.CKEDITOR&&window.CKEDITOR.dom)return;window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,d={timestamp:"G6DE",version:"4.5.10",revision:"b47abaf",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var b=window.CKEDITOR_BASEPATH||"";if(!b)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var l=c[d].src.match(a);if(l){b=l[1];break}}-1==b.indexOf(":/")&&"//"!=b.slice(0,2)&&(b=0===b.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+
  121. b:location.href.match(/^[^\?]*\/(?:)/)[0]+b);if(!b)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return b}(),getUrl:function(a){-1==a.indexOf(":/")&&0!==a.indexOf("/")&&(a=this.basePath+a);this.timestamp&&"/"!=a.charAt(a.length-1)&&!/[&?]t=/.test(a)&&(a+=(0<=a.indexOf("?")?"\x26":"?")+"t\x3d"+this.timestamp);return a},domReady:function(){function a(){try{document.addEventListener?(document.removeEventListener("DOMContentLoaded",
  122. a,!1),b()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",a),b())}catch(c){}}function b(){for(var a;a=c.shift();)a()}var c=[];return function(b){function d(){try{document.documentElement.doScroll("left")}catch(f){setTimeout(d,1);return}a()}c.push(b);"complete"===document.readyState&&setTimeout(a,1);if(1==c.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",a,!1),window.addEventListener("load",a,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",
  123. a);window.attachEvent("onload",a);b=!1;try{b=!window.frameElement}catch(v){}document.documentElement.doScroll&&b&&d()}}}()},b=window.CKEDITOR_GETURL;if(b){var c=d.getUrl;d.getUrl=function(a){return b.call(d,a)||c.call(d,a)}}return d}());
  124. CKEDITOR.event||(CKEDITOR.event=function(){},CKEDITOR.event.implementOn=function(a){var d=CKEDITOR.event.prototype,b;for(b in d)null==a[b]&&(a[b]=d[b])},CKEDITOR.event.prototype=function(){function a(a){var e=d(this);return e[a]||(e[a]=new b(a))}var d=function(a){a=a.getPrivate&&a.getPrivate()||a._||(a._={});return a.events||(a.events={})},b=function(a){this.name=a;this.listeners=[]};b.prototype={getListenerIndex:function(a){for(var b=0,d=this.listeners;b<d.length;b++)if(d[b].fn==a)return b;return-1}};
  125. return{define:function(b,d){var g=a.call(this,b);CKEDITOR.tools.extend(g,d,!0)},on:function(b,d,g,k,l){function q(a,f,y,l){a={name:b,sender:this,editor:a,data:f,listenerData:k,stop:y,cancel:l,removeListener:v};return!1===d.call(g,a)?!1:a.data}function v(){y.removeListener(b,d)}var f=a.call(this,b);if(0>f.getListenerIndex(d)){f=f.listeners;g||(g=this);isNaN(l)&&(l=10);var y=this;q.fn=d;q.priority=l;for(var A=f.length-1;0<=A;A--)if(f[A].priority<=l)return f.splice(A+1,0,q),{removeListener:v};f.unshift(q)}return{removeListener:v}},
  126. once:function(){var a=Array.prototype.slice.call(arguments),b=a[1];a[1]=function(a){a.removeListener();return b.apply(this,arguments)};return this.on.apply(this,a)},capture:function(){CKEDITOR.event.useCapture=1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var a=0,b=function(){a=1},g=0,k=function(){g=1};return function(l,q,v){var f=d(this)[l];l=a;var y=g;a=g=0;if(f){var A=f.listeners;if(A.length)for(var A=A.slice(0),r,D=0;D<A.length;D++){if(f.errorProof)try{r=
  127. A[D].call(this,v,q,b,k)}catch(n){}else r=A[D].call(this,v,q,b,k);!1===r?g=1:"undefined"!=typeof r&&(q=r);if(a||g)break}}q=g?!1:"undefined"==typeof q?!0:q;a=l;g=y;return q}}(),fireOnce:function(a,b,g){b=this.fire(a,b,g);delete d(this)[a];return b},removeListener:function(a,b){var g=d(this)[a];if(g){var k=g.getListenerIndex(b);0<=k&&g.listeners.splice(k,1)}},removeAllListeners:function(){var a=d(this),b;for(b in a)delete a[b]},hasListeners:function(a){return(a=d(this)[a])&&0<a.listeners.length}}}());
  128. CKEDITOR.editor||(CKEDITOR.editor=function(){CKEDITOR._.pending.push([this,arguments]);CKEDITOR.event.call(this)},CKEDITOR.editor.prototype.fire=function(a,d){a in{instanceReady:1,loaded:1}&&(this[a]=!0);return CKEDITOR.event.prototype.fire.call(this,a,d,this)},CKEDITOR.editor.prototype.fireOnce=function(a,d){a in{instanceReady:1,loaded:1}&&(this[a]=!0);return CKEDITOR.event.prototype.fireOnce.call(this,a,d,this)},CKEDITOR.event.implementOn(CKEDITOR.editor.prototype));
  129. CKEDITOR.env||(CKEDITOR.env=function(){var a=navigator.userAgent.toLowerCase(),d=a.match(/edge[ \/](\d+.?\d*)/),b=-1<a.indexOf("trident/"),b=!(!d&&!b),b={ie:b,edge:!!d,webkit:!b&&-1<a.indexOf(" applewebkit/"),air:-1<a.indexOf(" adobeair/"),mac:-1<a.indexOf("macintosh"),quirks:"BackCompat"==document.compatMode&&(!document.documentMode||10>document.documentMode),mobile:-1<a.indexOf("mobile"),iOS:/(ipad|iphone|ipod)/.test(a),isCustomDomain:function(){if(!this.ie)return!1;var a=document.domain,b=window.location.hostname;
  130. return a!=b&&a!="["+b+"]"},secure:"https:"==location.protocol};b.gecko="Gecko"==navigator.product&&!b.webkit&&!b.ie;b.webkit&&(-1<a.indexOf("chrome")?b.chrome=!0:b.safari=!0);var c=0;b.ie&&(c=d?parseFloat(d[1]):b.quirks||!document.documentMode?parseFloat(a.match(/msie (\d+)/)[1]):document.documentMode,b.ie9Compat=9==c,b.ie8Compat=8==c,b.ie7Compat=7==c,b.ie6Compat=7>c||b.quirks);b.gecko&&(d=a.match(/rv:([\d\.]+)/))&&(d=d[1].split("."),c=1E4*d[0]+100*(d[1]||0)+1*(d[2]||0));b.air&&(c=parseFloat(a.match(/ adobeair\/(\d+)/)[1]));
  131. b.webkit&&(c=parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));b.version=c;b.isCompatible=!(b.ie&&7>c)&&!(b.gecko&&4E4>c)&&!(b.webkit&&534>c);b.hidpi=2<=window.devicePixelRatio;b.needsBrFiller=b.gecko||b.webkit||b.ie&&10<c;b.needsNbspFiller=b.ie&&11>c;b.cssClass="cke_browser_"+(b.ie?"ie":b.gecko?"gecko":b.webkit?"webkit":"unknown");b.quirks&&(b.cssClass+=" cke_browser_quirks");b.ie&&(b.cssClass+=" cke_browser_ie"+(b.quirks?"6 cke_browser_iequirks":b.version));b.air&&(b.cssClass+=" cke_browser_air");
  132. b.iOS&&(b.cssClass+=" cke_browser_ios");b.hidpi&&(b.cssClass+=" cke_hidpi");return b}());
  133. "unloaded"==CKEDITOR.status&&function(){CKEDITOR.event.implementOn(CKEDITOR);CKEDITOR.loadFullCore=function(){if("basic_ready"!=CKEDITOR.status)CKEDITOR.loadFullCore._load=1;else{delete CKEDITOR.loadFullCore;var a=document.createElement("script");a.type="text/javascript";a.src=CKEDITOR.basePath+"ckeditor.js";document.getElementsByTagName("head")[0].appendChild(a)}};CKEDITOR.loadFullCoreTimeout=0;CKEDITOR.add=function(a){(this._.pending||(this._.pending=[])).push(a)};(function(){CKEDITOR.domReady(function(){var a=
  134. CKEDITOR.loadFullCore,d=CKEDITOR.loadFullCoreTimeout;a&&(CKEDITOR.status="basic_ready",a&&a._load?a():d&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},1E3*d))})})();CKEDITOR.status="basic_loaded"}();"use strict";CKEDITOR.VERBOSITY_WARN=1;CKEDITOR.VERBOSITY_ERROR=2;CKEDITOR.verbosity=CKEDITOR.VERBOSITY_WARN|CKEDITOR.VERBOSITY_ERROR;CKEDITOR.warn=function(a,d){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_WARN&&CKEDITOR.fire("log",{type:"warn",errorCode:a,additionalData:d})};
  135. CKEDITOR.error=function(a,d){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_ERROR&&CKEDITOR.fire("log",{type:"error",errorCode:a,additionalData:d})};
  136. CKEDITOR.on("log",function(a){if(window.console&&window.console.log){var d=console[a.data.type]?a.data.type:"log",b=a.data.errorCode;if(a=a.data.additionalData)console[d]("[CKEDITOR] Error code: "+b+".",a);else console[d]("[CKEDITOR] Error code: "+b+".");console[d]("[CKEDITOR] For more information about this error go to http://docs.ckeditor.com/#!/guide/dev_errors-section-"+b)}},null,null,999);CKEDITOR.dom={};
  137. (function(){var a=[],d=CKEDITOR.env.gecko?"-moz-":CKEDITOR.env.webkit?"-webkit-":CKEDITOR.env.ie?"-ms-":"",b=/&/g,c=/>/g,e=/</g,g=/"/g,k=/&(lt|gt|amp|quot|nbsp|shy|#\d{1,5});/g,l={lt:"\x3c",gt:"\x3e",amp:"\x26",quot:'"',nbsp:" ",shy:"­"},q=function(a,f){return"#"==f[0]?String.fromCharCode(parseInt(f.slice(1),10)):l[f]};CKEDITOR.on("reset",function(){a=[]});CKEDITOR.tools={arrayCompare:function(a,f){if(!a&&!f)return!0;if(!a||!f||a.length!=f.length)return!1;for(var b=0;b<a.length;b++)if(a[b]!=f[b])return!1;
  138. return!0},getIndex:function(a,f){for(var b=0;b<a.length;++b)if(f(a[b]))return b;return-1},clone:function(a){var f;if(a&&a instanceof Array){f=[];for(var b=0;b<a.length;b++)f[b]=CKEDITOR.tools.clone(a[b]);return f}if(null===a||"object"!=typeof a||a instanceof String||a instanceof Number||a instanceof Boolean||a instanceof Date||a instanceof RegExp||a.nodeType||a.window===a)return a;f=new a.constructor;for(b in a)f[b]=CKEDITOR.tools.clone(a[b]);return f},capitalize:function(a,f){return a.charAt(0).toUpperCase()+
  139. (f?a.slice(1):a.slice(1).toLowerCase())},extend:function(a){var f=arguments.length,b,c;"boolean"==typeof(b=arguments[f-1])?f--:"boolean"==typeof(b=arguments[f-2])&&(c=arguments[f-1],f-=2);for(var l=1;l<f;l++){var d=arguments[l],n;for(n in d)if(!0===b||null==a[n])if(!c||n in c)a[n]=d[n]}return a},prototypedCopy:function(a){var f=function(){};f.prototype=a;return new f},copy:function(a){var f={},b;for(b in a)f[b]=a[b];return f},isArray:function(a){return"[object Array]"==Object.prototype.toString.call(a)},
  140. isEmpty:function(a){for(var f in a)if(a.hasOwnProperty(f))return!1;return!0},cssVendorPrefix:function(a,f,b){if(b)return d+a+":"+f+";"+a+":"+f;b={};b[a]=f;b[d+a]=f;return b},cssStyleToDomStyle:function(){var a=document.createElement("div").style,f="undefined"!=typeof a.cssFloat?"cssFloat":"undefined"!=typeof a.styleFloat?"styleFloat":"float";return function(a){return"float"==a?f:a.replace(/-./g,function(a){return a.substr(1).toUpperCase()})}}(),buildStyleHtml:function(a){a=[].concat(a);for(var f,
  141. b=[],c=0;c<a.length;c++)if(f=a[c])/@import|[{}]/.test(f)?b.push("\x3cstyle\x3e"+f+"\x3c/style\x3e"):b.push('\x3clink type\x3d"text/css" rel\x3dstylesheet href\x3d"'+f+'"\x3e');return b.join("")},htmlEncode:function(a){return void 0===a||null===a?"":String(a).replace(b,"\x26amp;").replace(c,"\x26gt;").replace(e,"\x26lt;")},htmlDecode:function(a){return a.replace(k,q)},htmlEncodeAttr:function(a){return CKEDITOR.tools.htmlEncode(a).replace(g,"\x26quot;")},htmlDecodeAttr:function(a){return CKEDITOR.tools.htmlDecode(a)},
  142. transformPlainTextToHtml:function(a,f){var b=f==CKEDITOR.ENTER_BR,c=this.htmlEncode(a.replace(/\r\n/g,"\n")),c=c.replace(/\t/g,"\x26nbsp;\x26nbsp; \x26nbsp;"),l=f==CKEDITOR.ENTER_P?"p":"div";if(!b){var d=/\n{2}/g;if(d.test(c))var n="\x3c"+l+"\x3e",q="\x3c/"+l+"\x3e",c=n+c.replace(d,function(){return q+n})+q}c=c.replace(/\n/g,"\x3cbr\x3e");b||(c=c.replace(new RegExp("\x3cbr\x3e(?\x3d\x3c/"+l+"\x3e)"),function(a){return CKEDITOR.tools.repeat(a,2)}));c=c.replace(/^ | $/g,"\x26nbsp;");return c=c.replace(/(>|\s) /g,
  143. function(a,f){return f+"\x26nbsp;"}).replace(/ (?=<)/g,"\x26nbsp;")},getNextNumber:function(){var a=0;return function(){return++a}}(),getNextId:function(){return"cke_"+this.getNextNumber()},getUniqueId:function(){for(var a="e",f=0;8>f;f++)a+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return a},override:function(a,f){var b=f(a);b.prototype=a.prototype;return b},setTimeout:function(a,f,b,c,l){l||(l=window);b||(b=l);return l.setTimeout(function(){c?a.apply(b,[].concat(c)):a.apply(b)},
  144. f||0)},trim:function(){var a=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(f){return f.replace(a,"")}}(),ltrim:function(){var a=/^[ \t\n\r]+/g;return function(f){return f.replace(a,"")}}(),rtrim:function(){var a=/[ \t\n\r]+$/g;return function(f){return f.replace(a,"")}}(),indexOf:function(a,f){if("function"==typeof f)for(var b=0,c=a.length;b<c;b++){if(f(a[b]))return b}else{if(a.indexOf)return a.indexOf(f);b=0;for(c=a.length;b<c;b++)if(a[b]===f)return b}return-1},search:function(a,f){var b=CKEDITOR.tools.indexOf(a,
  145. f);return 0<=b?a[b]:null},bind:function(a,f){return function(){return a.apply(f,arguments)}},createClass:function(a){var f=a.$,b=a.base,c=a.privates||a._,l=a.proto;a=a.statics;!f&&(f=function(){b&&this.base.apply(this,arguments)});if(c)var d=f,f=function(){var a=this._||(this._={}),f;for(f in c){var b=c[f];a[f]="function"==typeof b?CKEDITOR.tools.bind(b,this):b}d.apply(this,arguments)};b&&(f.prototype=this.prototypedCopy(b.prototype),f.prototype.constructor=f,f.base=b,f.baseProto=b.prototype,f.prototype.base=
  146. function(){this.base=b.prototype.base;b.apply(this,arguments);this.base=arguments.callee});l&&this.extend(f.prototype,l,!0);a&&this.extend(f,a,!0);return f},addFunction:function(b,f){return a.push(function(){return b.apply(f||this,arguments)})-1},removeFunction:function(b){a[b]=null},callFunction:function(b){var f=a[b];return f&&f.apply(window,Array.prototype.slice.call(arguments,1))},cssLength:function(){var a=/^-?\d+\.?\d*px$/,f;return function(b){f=CKEDITOR.tools.trim(b+"")+"px";return a.test(f)?
  147. f:b||""}}(),convertToPx:function(){var a;return function(f){a||(a=CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"\x3e\x3c/div\x3e',CKEDITOR.document),CKEDITOR.document.getBody().append(a));return/%$/.test(f)?f:(a.setStyle("width",f),a.$.clientWidth)}}(),repeat:function(a,f){return Array(f+1).join(a)},tryThese:function(){for(var a,f=0,b=arguments.length;f<b;f++){var c=arguments[f];try{a=c();break}catch(l){}}return a},
  148. genKey:function(){return Array.prototype.slice.call(arguments).join("-")},defer:function(a){return function(){var b=arguments,c=this;window.setTimeout(function(){a.apply(c,b)},0)}},normalizeCssText:function(a,b){var c=[],l,d=CKEDITOR.tools.parseCssText(a,!0,b);for(l in d)c.push(l+":"+d[l]);c.sort();return c.length?c.join(";")+";":""},convertRgbToHex:function(a){return a.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi,function(a,b,c,l){a=[b,c,l];for(b=0;3>b;b++)a[b]=("0"+parseInt(a[b],10).toString(16)).slice(-2);
  149. return"#"+a.join("")})},normalizeHex:function(a){return a.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi,function(a,b,c,l){a=b.toLowerCase();3==a.length&&(a=a.split(""),a=[a[0],a[0],a[1],a[1],a[2],a[2]].join(""));return"#"+a+l})},parseCssText:function(a,b,c){var l={};c&&(a=(new CKEDITOR.dom.element("span")).setAttribute("style",a).getAttribute("style")||"");a&&(a=CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(a)));if(!a||";"==a)return l;a.replace(/&quot;/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
  150. function(a,c,d){b&&(c=c.toLowerCase(),"font-family"==c&&(d=d.replace(/\s*,\s*/g,",")),d=CKEDITOR.tools.trim(d));l[c]=d});return l},writeCssText:function(a,b){var c,l=[];for(c in a)l.push(c+":"+a[c]);b&&l.sort();return l.join("; ")},objectCompare:function(a,b,c){var l;if(!a&&!b)return!0;if(!a||!b)return!1;for(l in a)if(a[l]!=b[l])return!1;if(!c)for(l in b)if(a[l]!=b[l])return!1;return!0},objectKeys:function(a){var b=[],c;for(c in a)b.push(c);return b},convertArrayToObject:function(a,b){var c={};1==
  151. arguments.length&&(b=!0);for(var l=0,d=a.length;l<d;++l)c[a[l]]=b;return c},fixDomain:function(){for(var a;;)try{a=window.parent.document.domain;break}catch(b){a=a?a.replace(/.+?(?:\.|$)/,""):document.domain;if(!a)break;document.domain=a}return!!a},eventsBuffer:function(a,b,c){function l(){q=(new Date).getTime();d=!1;c?b.call(c):b()}var d,q=0;return{input:function(){if(!d){var b=(new Date).getTime()-q;b<a?d=setTimeout(l,a-b):l()}},reset:function(){d&&clearTimeout(d);d=q=0}}},enableHtml5Elements:function(a,
  152. b){for(var c="abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video".split(" "),l=c.length,d;l--;)d=a.createElement(c[l]),b&&a.appendChild(d)},checkIfAnyArrayItemMatches:function(a,b){for(var c=0,l=a.length;c<l;++c)if(a[c].match(b))return!0;return!1},checkIfAnyObjectPropertyMatches:function(a,b){for(var c in a)if(c.match(b))return!0;return!1},transparentImageData:"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw\x3d\x3d",
  153. getCookie:function(a){a=a.toLowerCase();for(var b=document.cookie.split(";"),c,l,d=0;d<b.length;d++)if(c=b[d].split("\x3d"),l=decodeURIComponent(CKEDITOR.tools.trim(c[0]).toLowerCase()),l===a)return decodeURIComponent(1<c.length?c[1]:"");return null},setCookie:function(a,b){document.cookie=encodeURIComponent(a)+"\x3d"+encodeURIComponent(b)+";path\x3d/"},getCsrfToken:function(){var a=CKEDITOR.tools.getCookie("ckCsrfToken");if(!a||40!=a.length){var a=[],b="";if(window.crypto&&window.crypto.getRandomValues)a=
  154. new Uint8Array(40),window.crypto.getRandomValues(a);else for(var c=0;40>c;c++)a.push(Math.floor(256*Math.random()));for(c=0;c<a.length;c++)var l="abcdefghijklmnopqrstuvwxyz0123456789".charAt(a[c]%36),b=b+(.5<Math.random()?l.toUpperCase():l);a=b;CKEDITOR.tools.setCookie("ckCsrfToken",a)}return a},escapeCss:function(a){return a?window.CSS&&CSS.escape?CSS.escape(a):isNaN(parseInt(a.charAt(0),10))?a:"\\3"+a.charAt(0)+" "+a.substring(1,a.length):""}}})();
  155. CKEDITOR.dtd=function(){var a=CKEDITOR.tools.extend,d=function(a,b){for(var c=CKEDITOR.tools.clone(a),l=1;l<arguments.length;l++){b=arguments[l];for(var d in b)delete c[d]}return c},b={},c={},e={address:1,article:1,aside:1,blockquote:1,details:1,div:1,dl:1,fieldset:1,figure:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,hr:1,main:1,menu:1,nav:1,ol:1,p:1,pre:1,section:1,table:1,ul:1},g={command:1,link:1,meta:1,noscript:1,script:1,style:1},k={},l={"#":1},q={center:1,dir:1,noframes:1};
  156. a(b,{a:1,abbr:1,area:1,audio:1,b:1,bdi:1,bdo:1,br:1,button:1,canvas:1,cite:1,code:1,command:1,datalist:1,del:1,dfn:1,em:1,embed:1,i:1,iframe:1,img:1,input:1,ins:1,kbd:1,keygen:1,label:1,map:1,mark:1,meter:1,noscript:1,object:1,output:1,progress:1,q:1,ruby:1,s:1,samp:1,script:1,select:1,small:1,span:1,strong:1,sub:1,sup:1,textarea:1,time:1,u:1,"var":1,video:1,wbr:1},l,{acronym:1,applet:1,basefont:1,big:1,font:1,isindex:1,strike:1,style:1,tt:1});a(c,e,b,q);d={a:d(b,{a:1,button:1}),abbr:b,address:c,
  157. area:k,article:c,aside:c,audio:a({source:1,track:1},c),b:b,base:k,bdi:b,bdo:b,blockquote:c,body:c,br:k,button:d(b,{a:1,button:1}),canvas:b,caption:c,cite:b,code:b,col:k,colgroup:{col:1},command:k,datalist:a({option:1},b),dd:c,del:b,details:a({summary:1},c),dfn:b,div:c,dl:{dt:1,dd:1},dt:c,em:b,embed:k,fieldset:a({legend:1},c),figcaption:c,figure:a({figcaption:1},c),footer:c,form:c,h1:b,h2:b,h3:b,h4:b,h5:b,h6:b,head:a({title:1,base:1},g),header:c,hgroup:{h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},hr:k,html:a({head:1,
  158. body:1},c,g),i:b,iframe:l,img:k,input:k,ins:b,kbd:b,keygen:k,label:b,legend:b,li:c,link:k,main:c,map:c,mark:b,menu:a({li:1},c),meta:k,meter:d(b,{meter:1}),nav:c,noscript:a({link:1,meta:1,style:1},b),object:a({param:1},b),ol:{li:1},optgroup:{option:1},option:l,output:b,p:b,param:k,pre:b,progress:d(b,{progress:1}),q:b,rp:b,rt:b,ruby:a({rp:1,rt:1},b),s:b,samp:b,script:l,section:c,select:{optgroup:1,option:1},small:b,source:k,span:b,strong:b,style:l,sub:b,summary:a({h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},b),
  159. sup:b,table:{caption:1,colgroup:1,thead:1,tfoot:1,tbody:1,tr:1},tbody:{tr:1},td:c,textarea:l,tfoot:{tr:1},th:c,thead:{tr:1},time:d(b,{time:1}),title:l,tr:{th:1,td:1},track:k,u:b,ul:{li:1},"var":b,video:a({source:1,track:1},c),wbr:k,acronym:b,applet:a({param:1},c),basefont:k,big:b,center:c,dialog:k,dir:{li:1},font:b,isindex:k,noframes:c,strike:b,tt:b};a(d,{$block:a({audio:1,dd:1,dt:1,figcaption:1,li:1,video:1},e,q),$blockLimit:{article:1,aside:1,audio:1,body:1,caption:1,details:1,dir:1,div:1,dl:1,
  160. fieldset:1,figcaption:1,figure:1,footer:1,form:1,header:1,hgroup:1,main:1,menu:1,nav:1,ol:1,section:1,table:1,td:1,th:1,tr:1,ul:1,video:1},$cdata:{script:1,style:1},$editable:{address:1,article:1,aside:1,blockquote:1,body:1,details:1,div:1,fieldset:1,figcaption:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,main:1,nav:1,p:1,pre:1,section:1},$empty:{area:1,base:1,basefont:1,br:1,col:1,command:1,dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,
  161. track:1,wbr:1},$inline:b,$list:{dl:1,ol:1,ul:1},$listItem:{dd:1,dt:1,li:1},$nonBodyContent:a({body:1,head:1,html:1},d.head),$nonEditable:{applet:1,audio:1,button:1,embed:1,iframe:1,map:1,object:1,option:1,param:1,script:1,textarea:1,video:1},$object:{applet:1,audio:1,button:1,hr:1,iframe:1,img:1,input:1,object:1,select:1,table:1,textarea:1,video:1},$removeEmpty:{abbr:1,acronym:1,b:1,bdi:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,mark:1,meter:1,output:1,q:1,ruby:1,
  162. s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,time:1,tt:1,u:1,"var":1},$tabIndex:{a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},$tableContent:{caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},$transparent:{a:1,audio:1,canvas:1,del:1,ins:1,map:1,noscript:1,object:1,video:1},$intermediate:{caption:1,colgroup:1,dd:1,dt:1,figcaption:1,legend:1,li:1,optgroup:1,option:1,rp:1,rt:1,summary:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1}});return d}();
  163. CKEDITOR.dom.event=function(a){this.$=a};
  164. CKEDITOR.dom.event.prototype={getKey:function(){return this.$.keyCode||this.$.which},getKeystroke:function(){var a=this.getKey();if(this.$.ctrlKey||this.$.metaKey)a+=CKEDITOR.CTRL;this.$.shiftKey&&(a+=CKEDITOR.SHIFT);this.$.altKey&&(a+=CKEDITOR.ALT);return a},preventDefault:function(a){var d=this.$;d.preventDefault?d.preventDefault():d.returnValue=!1;a&&this.stopPropagation()},stopPropagation:function(){var a=this.$;a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},getTarget:function(){var a=
  165. this.$.target||this.$.srcElement;return a?new CKEDITOR.dom.node(a):null},getPhase:function(){return this.$.eventPhase||2},getPageOffset:function(){var a=this.getTarget().getDocument().$;return{x:this.$.pageX||this.$.clientX+(a.documentElement.scrollLeft||a.body.scrollLeft),y:this.$.pageY||this.$.clientY+(a.documentElement.scrollTop||a.body.scrollTop)}}};CKEDITOR.CTRL=1114112;CKEDITOR.SHIFT=2228224;CKEDITOR.ALT=4456448;CKEDITOR.EVENT_PHASE_CAPTURING=1;CKEDITOR.EVENT_PHASE_AT_TARGET=2;
  166. CKEDITOR.EVENT_PHASE_BUBBLING=3;CKEDITOR.dom.domObject=function(a){a&&(this.$=a)};
  167. CKEDITOR.dom.domObject.prototype=function(){var a=function(a,b){return function(c){"undefined"!=typeof CKEDITOR&&a.fire(b,new CKEDITOR.dom.event(c))}};return{getPrivate:function(){var a;(a=this.getCustomData("_"))||this.setCustomData("_",a={});return a},on:function(d){var b=this.getCustomData("_cke_nativeListeners");b||(b={},this.setCustomData("_cke_nativeListeners",b));b[d]||(b=b[d]=a(this,d),this.$.addEventListener?this.$.addEventListener(d,b,!!CKEDITOR.event.useCapture):this.$.attachEvent&&this.$.attachEvent("on"+
  168. d,b));return CKEDITOR.event.prototype.on.apply(this,arguments)},removeListener:function(a){CKEDITOR.event.prototype.removeListener.apply(this,arguments);if(!this.hasListeners(a)){var b=this.getCustomData("_cke_nativeListeners"),c=b&&b[a];c&&(this.$.removeEventListener?this.$.removeEventListener(a,c,!1):this.$.detachEvent&&this.$.detachEvent("on"+a,c),delete b[a])}},removeAllListeners:function(){var a=this.getCustomData("_cke_nativeListeners"),b;for(b in a){var c=a[b];this.$.detachEvent?this.$.detachEvent("on"+
  169. b,c):this.$.removeEventListener&&this.$.removeEventListener(b,c,!1);delete a[b]}CKEDITOR.event.prototype.removeAllListeners.call(this)}}}();
  170. (function(a){var d={};CKEDITOR.on("reset",function(){d={}});a.equals=function(a){try{return a&&a.$===this.$}catch(c){return!1}};a.setCustomData=function(a,c){var e=this.getUniqueId();(d[e]||(d[e]={}))[a]=c;return this};a.getCustomData=function(a){var c=this.$["data-cke-expando"];return(c=c&&d[c])&&a in c?c[a]:null};a.removeCustomData=function(a){var c=this.$["data-cke-expando"],c=c&&d[c],e,g;c&&(e=c[a],g=a in c,delete c[a]);return g?e:null};a.clearCustomData=function(){this.removeAllListeners();var a=
  171. this.$["data-cke-expando"];a&&delete d[a]};a.getUniqueId=function(){return this.$["data-cke-expando"]||(this.$["data-cke-expando"]=CKEDITOR.tools.getNextNumber())};CKEDITOR.event.implementOn(a)})(CKEDITOR.dom.domObject.prototype);
  172. CKEDITOR.dom.node=function(a){return a?new CKEDITOR.dom[a.nodeType==CKEDITOR.NODE_DOCUMENT?"document":a.nodeType==CKEDITOR.NODE_ELEMENT?"element":a.nodeType==CKEDITOR.NODE_TEXT?"text":a.nodeType==CKEDITOR.NODE_COMMENT?"comment":a.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT?"documentFragment":"domObject"](a):this};CKEDITOR.dom.node.prototype=new CKEDITOR.dom.domObject;CKEDITOR.NODE_ELEMENT=1;CKEDITOR.NODE_DOCUMENT=9;CKEDITOR.NODE_TEXT=3;CKEDITOR.NODE_COMMENT=8;CKEDITOR.NODE_DOCUMENT_FRAGMENT=11;
  173. CKEDITOR.POSITION_IDENTICAL=0;CKEDITOR.POSITION_DISCONNECTED=1;CKEDITOR.POSITION_FOLLOWING=2;CKEDITOR.POSITION_PRECEDING=4;CKEDITOR.POSITION_IS_CONTAINED=8;CKEDITOR.POSITION_CONTAINS=16;
  174. CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype,{appendTo:function(a,d){a.append(this,d);return a},clone:function(a,d){function b(c){c["data-cke-expando"]&&(c["data-cke-expando"]=!1);if(c.nodeType==CKEDITOR.NODE_ELEMENT||c.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)if(d||c.nodeType!=CKEDITOR.NODE_ELEMENT||c.removeAttribute("id",!1),a){c=c.childNodes;for(var e=0;e<c.length;e++)b(c[e])}}function c(b){if(b.type==CKEDITOR.NODE_ELEMENT||b.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT){if(b.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var d=
  175. b.getName();":"==d[0]&&b.renameNode(d.substring(1))}if(a)for(d=0;d<b.getChildCount();d++)c(b.getChild(d))}}var e=this.$.cloneNode(a);b(e);e=new CKEDITOR.dom.node(e);CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(this.type==CKEDITOR.NODE_ELEMENT||this.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)&&c(e);return e},hasPrevious:function(){return!!this.$.previousSibling},hasNext:function(){return!!this.$.nextSibling},insertAfter:function(a){a.$.parentNode.insertBefore(this.$,a.$.nextSibling);return a},insertBefore:function(a){a.$.parentNode.insertBefore(this.$,
  176. a.$);return a},insertBeforeMe:function(a){this.$.parentNode.insertBefore(a.$,this.$);return a},getAddress:function(a){for(var d=[],b=this.getDocument().$.documentElement,c=this.$;c&&c!=b;){var e=c.parentNode;e&&d.unshift(this.getIndex.call({$:c},a));c=e}return d},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)},getIndex:function(a){function d(a,c){var q=c?a.nextSibling:a.previousSibling;return q&&q.nodeType==CKEDITOR.NODE_TEXT?b(q)?d(q,
  177. c):q:null}function b(a){return!a.nodeValue||a.nodeValue==CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE}var c=this.$,e=-1,g;if(!this.$.parentNode||a&&c.nodeType==CKEDITOR.NODE_TEXT&&b(c)&&!d(c)&&!d(c,!0))return-1;do a&&c!=this.$&&c.nodeType==CKEDITOR.NODE_TEXT&&(g||b(c))||(e++,g=c.nodeType==CKEDITOR.NODE_TEXT);while(c=c.previousSibling);return e},getNextSourceNode:function(a,d,b){if(b&&!b.call){var c=b;b=function(a){return!a.equals(c)}}a=!a&&this.getFirst&&this.getFirst();var e;if(!a){if(this.type==
  178. CKEDITOR.NODE_ELEMENT&&b&&!1===b(this,!0))return null;a=this.getNext()}for(;!a&&(e=(e||this).getParent());){if(b&&!1===b(e,!0))return null;a=e.getNext()}return!a||b&&!1===b(a)?null:d&&d!=a.type?a.getNextSourceNode(!1,d,b):a},getPreviousSourceNode:function(a,d,b){if(b&&!b.call){var c=b;b=function(a){return!a.equals(c)}}a=!a&&this.getLast&&this.getLast();var e;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&b&&!1===b(this,!0))return null;a=this.getPrevious()}for(;!a&&(e=(e||this).getParent());){if(b&&!1===
  179. b(e,!0))return null;a=e.getPrevious()}return!a||b&&!1===b(a)?null:d&&a.type!=d?a.getPreviousSourceNode(!1,d,b):a},getPrevious:function(a){var d=this.$,b;do b=(d=d.previousSibling)&&10!=d.nodeType&&new CKEDITOR.dom.node(d);while(b&&a&&!a(b));return b},getNext:function(a){var d=this.$,b;do b=(d=d.nextSibling)&&new CKEDITOR.dom.node(d);while(b&&a&&!a(b));return b},getParent:function(a){var d=this.$.parentNode;return d&&(d.nodeType==CKEDITOR.NODE_ELEMENT||a&&d.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)?
  180. new CKEDITOR.dom.node(d):null},getParents:function(a){var d=this,b=[];do b[a?"push":"unshift"](d);while(d=d.getParent());return b},getCommonAncestor:function(a){if(a.equals(this))return this;if(a.contains&&a.contains(this))return a;var d=this.contains?this:this.getParent();do if(d.contains(a))return d;while(d=d.getParent());return null},getPosition:function(a){var d=this.$,b=a.$;if(d.compareDocumentPosition)return d.compareDocumentPosition(b);if(d==b)return CKEDITOR.POSITION_IDENTICAL;if(this.type==
  181. CKEDITOR.NODE_ELEMENT&&a.type==CKEDITOR.NODE_ELEMENT){if(d.contains){if(d.contains(b))return CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING;if(b.contains(d))return CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in d)return 0>d.sourceIndex||0>b.sourceIndex?CKEDITOR.POSITION_DISCONNECTED:d.sourceIndex<b.sourceIndex?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING}d=this.getAddress();a=a.getAddress();for(var b=Math.min(d.length,a.length),c=0;c<b;c++)if(d[c]!=
  182. a[c])return d[c]<a[c]?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING;return d.length<a.length?CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING},getAscendant:function(a,d){var b=this.$,c,e;d||(b=b.parentNode);"function"==typeof a?(e=!0,c=a):(e=!1,c=function(b){b="string"==typeof b.nodeName?b.nodeName.toLowerCase():"";return"string"==typeof a?b==a:b in a});for(;b;){if(c(e?new CKEDITOR.dom.node(b):b))return new CKEDITOR.dom.node(b);
  183. try{b=b.parentNode}catch(g){b=null}}return null},hasAscendant:function(a,d){var b=this.$;d||(b=b.parentNode);for(;b;){if(b.nodeName&&b.nodeName.toLowerCase()==a)return!0;b=b.parentNode}return!1},move:function(a,d){a.append(this.remove(),d)},remove:function(a){var d=this.$,b=d.parentNode;if(b){if(a)for(;a=d.firstChild;)b.insertBefore(d.removeChild(a),d);b.removeChild(d)}return this},replace:function(a){this.insertBefore(a);a.remove()},trim:function(){this.ltrim();this.rtrim()},ltrim:function(){for(var a;this.getFirst&&
  184. (a=this.getFirst());){if(a.type==CKEDITOR.NODE_TEXT){var d=CKEDITOR.tools.ltrim(a.getText()),b=a.getLength();if(d)d.length<b&&(a.split(b-d.length),this.$.removeChild(this.$.firstChild));else{a.remove();continue}}break}},rtrim:function(){for(var a;this.getLast&&(a=this.getLast());){if(a.type==CKEDITOR.NODE_TEXT){var d=CKEDITOR.tools.rtrim(a.getText()),b=a.getLength();if(d)d.length<b&&(a.split(d.length),this.$.lastChild.parentNode.removeChild(this.$.lastChild));else{a.remove();continue}}break}CKEDITOR.env.needsBrFiller&&
  185. (a=this.$.lastChild)&&1==a.type&&"br"==a.nodeName.toLowerCase()&&a.parentNode.removeChild(a)},isReadOnly:function(a){var d=this;this.type!=CKEDITOR.NODE_ELEMENT&&(d=this.getParent());CKEDITOR.env.edge&&d&&d.is("textarea","input")&&(a=!0);if(!a&&d&&"undefined"!=typeof d.$.isContentEditable)return!(d.$.isContentEditable||d.data("cke-editable"));for(;d;){if(d.data("cke-editable"))return!1;if(d.hasAttribute("contenteditable"))return"false"==d.getAttribute("contenteditable");d=d.getParent()}return!0}});
  186. CKEDITOR.dom.window=function(a){CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.window.prototype=new CKEDITOR.dom.domObject;
  187. CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype,{focus:function(){this.$.focus()},getViewPaneSize:function(){var a=this.$.document,d="CSS1Compat"==a.compatMode;return{width:(d?a.documentElement.clientWidth:a.body.clientWidth)||0,height:(d?a.documentElement.clientHeight:a.body.clientHeight)||0}},getScrollPosition:function(){var a=this.$;if("pageXOffset"in a)return{x:a.pageXOffset||0,y:a.pageYOffset||0};a=a.document;return{x:a.documentElement.scrollLeft||a.body.scrollLeft||0,y:a.documentElement.scrollTop||
  188. a.body.scrollTop||0}},getFrame:function(){var a=this.$.frameElement;return a?new CKEDITOR.dom.element.get(a):null}});CKEDITOR.dom.document=function(a){CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.document.prototype=new CKEDITOR.dom.domObject;
  189. CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype,{type:CKEDITOR.NODE_DOCUMENT,appendStyleSheet:function(a){if(this.$.createStyleSheet)this.$.createStyleSheet(a);else{var d=new CKEDITOR.dom.element("link");d.setAttributes({rel:"stylesheet",type:"text/css",href:a});this.getHead().append(d)}},appendStyleText:function(a){if(this.$.createStyleSheet){var d=this.$.createStyleSheet("");d.cssText=a}else{var b=new CKEDITOR.dom.element("style",this);b.append(new CKEDITOR.dom.text(a,this));this.getHead().append(b)}return d||
  190. b.$.sheet},createElement:function(a,d){var b=new CKEDITOR.dom.element(a,this);d&&(d.attributes&&b.setAttributes(d.attributes),d.styles&&b.setStyles(d.styles));return b},createText:function(a){return new CKEDITOR.dom.text(a,this)},focus:function(){this.getWindow().focus()},getActive:function(){var a;try{a=this.$.activeElement}catch(d){return null}return new CKEDITOR.dom.element(a)},getById:function(a){return(a=this.$.getElementById(a))?new CKEDITOR.dom.element(a):null},getByAddress:function(a,d){for(var b=
  191. this.$.documentElement,c=0;b&&c<a.length;c++){var e=a[c];if(d)for(var g=-1,k=0;k<b.childNodes.length;k++){var l=b.childNodes[k];if(!0!==d||3!=l.nodeType||!l.previousSibling||3!=l.previousSibling.nodeType)if(g++,g==e){b=l;break}}else b=b.childNodes[e]}return b?new CKEDITOR.dom.node(b):null},getElementsByTag:function(a,d){CKEDITOR.env.ie&&8>=document.documentMode||!d||(a=d+":"+a);return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))},getHead:function(){var a=this.$.getElementsByTagName("head")[0];
  192. return a=a?new CKEDITOR.dom.element(a):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),!0)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)},getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||this.$.defaultView)},write:function(a){this.$.open("text/html","replace");CKEDITOR.env.ie&&(a=a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i,'$\x26\n\x3cscript data-cke-temp\x3d"1"\x3e('+
  193. CKEDITOR.tools.fixDomain+")();\x3c/script\x3e"));this.$.write(a);this.$.close()},find:function(a){return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a))},findOne:function(a){return(a=this.$.querySelector(a))?new CKEDITOR.dom.element(a):null},_getHtml5ShivFrag:function(){var a=this.getCustomData("html5ShivFrag");a||(a=this.$.createDocumentFragment(),CKEDITOR.tools.enableHtml5Elements(a,!0),this.setCustomData("html5ShivFrag",a));return a}});CKEDITOR.dom.nodeList=function(a){this.$=a};
  194. CKEDITOR.dom.nodeList.prototype={count:function(){return this.$.length},getItem:function(a){return 0>a||a>=this.$.length?null:(a=this.$[a])?new CKEDITOR.dom.node(a):null}};CKEDITOR.dom.element=function(a,d){"string"==typeof a&&(a=(d?d.$:document).createElement(a));CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.element.get=function(a){return(a="string"==typeof a?document.getElementById(a)||document.getElementsByName(a)[0]:a)&&(a.$?a:new CKEDITOR.dom.element(a))};CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node;
  195. CKEDITOR.dom.element.createFromHtml=function(a,d){var b=new CKEDITOR.dom.element("div",d);b.setHtml(a);return b.getFirst().remove()};CKEDITOR.dom.element.setMarker=function(a,d,b,c){var e=d.getCustomData("list_marker_id")||d.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),g=d.getCustomData("list_marker_names")||d.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");a[e]=d;g[b]=1;return d.setCustomData(b,c)};
  196. CKEDITOR.dom.element.clearAllMarkers=function(a){for(var d in a)CKEDITOR.dom.element.clearMarkers(a,a[d],1)};CKEDITOR.dom.element.clearMarkers=function(a,d,b){var c=d.getCustomData("list_marker_names"),e=d.getCustomData("list_marker_id"),g;for(g in c)d.removeCustomData(g);d.removeCustomData("list_marker_names");b&&(d.removeCustomData("list_marker_id"),delete a[e])};
  197. (function(){function a(a,b){return-1<(" "+a+" ").replace(g," ").indexOf(" "+b+" ")}function d(a){var b=!0;a.$.id||(a.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber(),b=!1);return function(){b||a.removeAttribute("id")}}function b(a,b){var c=CKEDITOR.tools.escapeCss(a.$.id);return"#"+c+" "+b.split(/,\s*/).join(", #"+c+" ")}function c(a){for(var b=0,c=0,f=k[a].length;c<f;c++)b+=parseInt(this.getComputedStyle(k[a][c])||0,10)||0;return b}var e=document.createElement("_").classList,e="undefined"!==typeof e&&
  198. null!==String(e.add).match(/\[Native code\]/gi),g=/[\n\t\r]/g;CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_ELEMENT,addClass:e?function(a){this.$.classList.add(a);return this}:function(b){var c=this.$.className;c&&(a(c,b)||(c+=" "+b));this.$.className=c||b;return this},removeClass:e?function(a){var b=this.$;b.classList.remove(a);b.className||b.removeAttribute("class");return this}:function(b){var c=this.getAttribute("class");c&&a(c,b)&&((c=c.replace(new RegExp("(?:^|\\s+)"+
  199. b+"(?\x3d\\s|$)"),"").replace(/^\s+/,""))?this.setAttribute("class",c):this.removeAttribute("class"));return this},hasClass:function(b){return a(this.$.className,b)},append:function(a,b){"string"==typeof a&&(a=this.getDocument().createElement(a));b?this.$.insertBefore(a.$,this.$.firstChild):this.$.appendChild(a.$);return a},appendHtml:function(a){if(this.$.childNodes.length){var b=new CKEDITOR.dom.element("div",this.getDocument());b.setHtml(a);b.moveChildren(this)}else this.setHtml(a)},appendText:function(a){null!=
  200. this.$.text&&CKEDITOR.env.ie&&9>CKEDITOR.env.version?this.$.text+=a:this.append(new CKEDITOR.dom.text(a))},appendBogus:function(a){if(a||CKEDITOR.env.needsBrFiller){for(a=this.getLast();a&&a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(a.getText());)a=a.getPrevious();a&&a.is&&a.is("br")||(a=this.getDocument().createElement("br"),CKEDITOR.env.gecko&&a.setAttribute("type","_moz"),this.append(a))}},breakParent:function(a,b){var c=new CKEDITOR.dom.range(this.getDocument());c.setStartAfter(this);c.setEndAfter(a);
  201. var f=c.extractContents(!1,b||!1),d;c.insertNode(this.remove());if(CKEDITOR.env.ie&&!CKEDITOR.env.edge){for(c=new CKEDITOR.dom.element("div");d=f.getFirst();)d.$.style.backgroundColor&&(d.$.style.backgroundColor=d.$.style.backgroundColor),c.append(d);c.insertAfter(this);c.remove(!0)}else f.insertAfterNode(this)},contains:document.compareDocumentPosition?function(a){return!!(this.$.compareDocumentPosition(a.$)&16)}:function(a){var b=this.$;return a.type!=CKEDITOR.NODE_ELEMENT?b.contains(a.getParent().$):
  202. b!=a.$&&b.contains(a.$)},focus:function(){function a(){try{this.$.focus()}catch(b){}}return function(b){b?CKEDITOR.tools.setTimeout(a,100,this):a.call(this)}}(),getHtml:function(){var a=this.$.innerHTML;return CKEDITOR.env.ie?a.replace(/<\?[^>]*>/g,""):a},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/,"");var a=this.$.ownerDocument.createElement("div");a.appendChild(this.$.cloneNode(!0));return a.innerHTML},getClientRect:function(){var a=CKEDITOR.tools.extend({},
  203. this.$.getBoundingClientRect());!a.width&&(a.width=a.right-a.left);!a.height&&(a.height=a.bottom-a.top);return a},setHtml:CKEDITOR.env.ie&&9>CKEDITOR.env.version?function(a){try{var b=this.$;if(this.getParent())return b.innerHTML=a;var c=this.getDocument()._getHtml5ShivFrag();c.appendChild(b);b.innerHTML=a;c.removeChild(b);return a}catch(f){this.$.innerHTML="";b=new CKEDITOR.dom.element("body",this.getDocument());b.$.innerHTML=a;for(b=b.getChildren();b.count();)this.append(b.getItem(0));return a}}:
  204. function(a){return this.$.innerHTML=a},setText:function(){var a=document.createElement("p");a.innerHTML="x";a=a.textContent;return function(b){this.$[a?"textContent":"innerText"]=b}}(),getAttribute:function(){var a=function(a){return this.$.getAttribute(a,2)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){switch(a){case "class":a="className";break;case "http-equiv":a="httpEquiv";break;case "name":return this.$.name;case "tabindex":return a=this.$.getAttribute(a,
  205. 2),0!==a&&0===this.$.tabIndex&&(a=null),a;case "checked":return a=this.$.attributes.getNamedItem(a),(a.specified?a.nodeValue:this.$.checked)?"checked":null;case "hspace":case "value":return this.$[a];case "style":return this.$.style.cssText;case "contenteditable":case "contentEditable":return this.$.attributes.getNamedItem("contentEditable").specified?this.$.getAttribute("contentEditable"):null}return this.$.getAttribute(a,2)}:a}(),getAttributes:function(a){var b={},c=this.$.attributes,f;a=CKEDITOR.tools.isArray(a)?
  206. a:[];for(f=0;f<c.length;f++)-1===CKEDITOR.tools.indexOf(a,c[f].name)&&(b[c[f].name]=c[f].value);return b},getChildren:function(){return new CKEDITOR.dom.nodeList(this.$.childNodes)},getComputedStyle:document.defaultView&&document.defaultView.getComputedStyle?function(a){var b=this.getWindow().$.getComputedStyle(this.$,null);return b?b.getPropertyValue(a):""}:function(a){return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(a)]},getDtd:function(){var a=CKEDITOR.dtd[this.getName()];this.getDtd=
  207. function(){return a};return a},getElementsByTag:CKEDITOR.dom.document.prototype.getElementsByTag,getTabIndex:function(){var a=this.$.tabIndex;return 0!==a||CKEDITOR.dtd.$tabIndex[this.getName()]||0===parseInt(this.getAttribute("tabindex"),10)?a:-1},getText:function(){return this.$.textContent||this.$.innerText||""},getWindow:function(){return this.getDocument().getWindow()},getId:function(){return this.$.id||null},getNameAtt:function(){return this.$.name||null},getName:function(){var a=this.$.nodeName.toLowerCase();
  208. if(CKEDITOR.env.ie&&8>=document.documentMode){var b=this.$.scopeName;"HTML"!=b&&(a=b.toLowerCase()+":"+a)}this.getName=function(){return a};return this.getName()},getValue:function(){return this.$.value},getFirst:function(a){var b=this.$.firstChild;(b=b&&new CKEDITOR.dom.node(b))&&a&&!a(b)&&(b=b.getNext(a));return b},getLast:function(a){var b=this.$.lastChild;(b=b&&new CKEDITOR.dom.node(b))&&a&&!a(b)&&(b=b.getPrevious(a));return b},getStyle:function(a){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]},
  209. is:function(){var a=this.getName();if("object"==typeof arguments[0])return!!arguments[0][a];for(var b=0;b<arguments.length;b++)if(arguments[b]==a)return!0;return!1},isEditable:function(a){var b=this.getName();return this.isReadOnly()||"none"==this.getComputedStyle("display")||"hidden"==this.getComputedStyle("visibility")||CKEDITOR.dtd.$nonEditable[b]||CKEDITOR.dtd.$empty[b]||this.is("a")&&(this.data("cke-saved-name")||this.hasAttribute("name"))&&!this.getChildCount()?!1:!1!==a?(a=CKEDITOR.dtd[b]||
  210. CKEDITOR.dtd.span,!(!a||!a["#"])):!0},isIdentical:function(a){var b=this.clone(0,1);a=a.clone(0,1);b.removeAttributes(["_moz_dirty","data-cke-expando","data-cke-saved-href","data-cke-saved-name"]);a.removeAttributes(["_moz_dirty","data-cke-expando","data-cke-saved-href","data-cke-saved-name"]);if(b.$.isEqualNode)return b.$.style.cssText=CKEDITOR.tools.normalizeCssText(b.$.style.cssText),a.$.style.cssText=CKEDITOR.tools.normalizeCssText(a.$.style.cssText),b.$.isEqualNode(a.$);b=b.getOuterHtml();a=
  211. a.getOuterHtml();if(CKEDITOR.env.ie&&9>CKEDITOR.env.version&&this.is("a")){var c=this.getParent();c.type==CKEDITOR.NODE_ELEMENT&&(c=c.clone(),c.setHtml(b),b=c.getHtml(),c.setHtml(a),a=c.getHtml())}return b==a},isVisible:function(){var a=(this.$.offsetHeight||this.$.offsetWidth)&&"hidden"!=this.getComputedStyle("visibility"),b,c;a&&CKEDITOR.env.webkit&&(b=this.getWindow(),!b.equals(CKEDITOR.document.getWindow())&&(c=b.$.frameElement)&&(a=(new CKEDITOR.dom.element(c)).isVisible()));return!!a},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return!1;
  212. for(var a=this.getChildren(),b=0,c=a.count();b<c;b++){var f=a.getItem(b);if(f.type!=CKEDITOR.NODE_ELEMENT||!f.data("cke-bookmark"))if(f.type==CKEDITOR.NODE_ELEMENT&&!f.isEmptyInlineRemoveable()||f.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(f.getText()))return!1}return!0},hasAttributes:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(){for(var a=this.$.attributes,b=0;b<a.length;b++){var c=a[b];switch(c.nodeName){case "class":if(this.getAttribute("class"))return!0;case "data-cke-expando":continue;
  213. default:if(c.specified)return!0}}return!1}:function(){var a=this.$.attributes,b=a.length,c={"data-cke-expando":1,_moz_dirty:1};return 0<b&&(2<b||!c[a[0].nodeName]||2==b&&!c[a[1].nodeName])},hasAttribute:function(){function a(b){var c=this.$.attributes.getNamedItem(b);if("input"==this.getName())switch(b){case "class":return 0<this.$.className.length;case "checked":return!!this.$.checked;case "value":return b=this.getAttribute("type"),"checkbox"==b||"radio"==b?"on"!=this.$.value:!!this.$.value}return c?
  214. c.specified:!1}return CKEDITOR.env.ie?8>CKEDITOR.env.version?function(b){return"name"==b?!!this.$.name:a.call(this,b)}:a:function(a){return!!this.$.attributes.getNamedItem(a)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(a,b){var c=this.$;a=a.$;if(c!=a){var f;if(b)for(;f=c.lastChild;)a.insertBefore(c.removeChild(f),a.firstChild);else for(;f=c.firstChild;)a.appendChild(c.removeChild(f))}},mergeSiblings:function(){function a(b,c,f){if(c&&c.type==CKEDITOR.NODE_ELEMENT){for(var d=
  215. [];c.data("cke-bookmark")||c.isEmptyInlineRemoveable();)if(d.push(c),c=f?c.getNext():c.getPrevious(),!c||c.type!=CKEDITOR.NODE_ELEMENT)return;if(b.isIdentical(c)){for(var l=f?b.getLast():b.getFirst();d.length;)d.shift().move(b,!f);c.moveChildren(b,!f);c.remove();l&&l.type==CKEDITOR.NODE_ELEMENT&&l.mergeSiblings()}}}return function(b){if(!1===b||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a"))a(this,this.getNext(),!0),a(this,this.getPrevious())}}(),show:function(){this.setStyles({display:"",
  216. visibility:""})},setAttribute:function(){var a=function(a,b){this.$.setAttribute(a,b);return this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(b,c){"class"==b?this.$.className=c:"style"==b?this.$.style.cssText=c:"tabindex"==b?this.$.tabIndex=c:"checked"==b?this.$.checked=c:"contenteditable"==b?a.call(this,"contentEditable",c):a.apply(this,arguments);return this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(b,c){if("src"==b&&c.match(/^http:\/\//))try{a.apply(this,
  217. arguments)}catch(f){}else a.apply(this,arguments);return this}:a}(),setAttributes:function(a){for(var b in a)this.setAttribute(b,a[b]);return this},setValue:function(a){this.$.value=a;return this},removeAttribute:function(){var a=function(a){this.$.removeAttribute(a)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){"class"==a?a="className":"tabindex"==a?a="tabIndex":"contenteditable"==a&&(a="contentEditable");this.$.removeAttribute(a)}:a}(),removeAttributes:function(a){if(CKEDITOR.tools.isArray(a))for(var b=
  218. 0;b<a.length;b++)this.removeAttribute(a[b]);else for(b in a=a||this.getAttributes(),a)a.hasOwnProperty(b)&&this.removeAttribute(b)},removeStyle:function(a){var b=this.$.style;if(b.removeProperty||"border"!=a&&"margin"!=a&&"padding"!=a)b.removeProperty?b.removeProperty(a):b.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a)),this.$.style.cssText||this.removeAttribute("style");else{var c=["top","left","right","bottom"],f;"border"==a&&(f=["color","style","width"]);for(var b=[],d=0;d<c.length;d++)if(f)for(var e=
  219. 0;e<f.length;e++)b.push([a,c[d],f[e]].join("-"));else b.push([a,c[d]].join("-"));for(a=0;a<b.length;a++)this.removeStyle(b[a])}},setStyle:function(a,b){this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]=b;return this},setStyles:function(a){for(var b in a)this.setStyle(b,a[b]);return this},setOpacity:function(a){CKEDITOR.env.ie&&9>CKEDITOR.env.version?(a=Math.round(100*a),this.setStyle("filter",100<=a?"":"progid:DXImageTransform.Microsoft.Alpha(opacity\x3d"+a+")")):this.setStyle("opacity",a)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select",
  220. "none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var a,b=this.getElementsByTag("*"),c=0,f=b.count();c<f;c++)a=b.getItem(c),a.setAttribute("unselectable","on")}},getPositionedAncestor:function(){for(var a=this;"html"!=a.getName();){if("static"!=a.getComputedStyle("position"))return a;a=a.getParent()}return null},getDocumentPosition:function(a){var b=0,c=0,f=this.getDocument(),d=f.getBody(),e="BackCompat"==f.$.compatMode;if(document.documentElement.getBoundingClientRect&&(CKEDITOR.env.ie?
  221. 8!==CKEDITOR.env.version:1)){var r=this.$.getBoundingClientRect(),g=f.$.documentElement,n=g.clientTop||d.$.clientTop||0,w=g.clientLeft||d.$.clientLeft||0,k=!0;CKEDITOR.env.ie&&(k=f.getDocumentElement().contains(this),f=f.getBody().contains(this),k=e&&f||!e&&k);k&&(CKEDITOR.env.webkit||CKEDITOR.env.ie&&12<=CKEDITOR.env.version?(b=d.$.scrollLeft||g.scrollLeft,c=d.$.scrollTop||g.scrollTop):(c=e?d.$:g,b=c.scrollLeft,c=c.scrollTop),b=r.left+b-w,c=r.top+c-n)}else for(n=this,w=null;n&&"body"!=n.getName()&&
  222. "html"!=n.getName();){b+=n.$.offsetLeft-n.$.scrollLeft;c+=n.$.offsetTop-n.$.scrollTop;n.equals(this)||(b+=n.$.clientLeft||0,c+=n.$.clientTop||0);for(;w&&!w.equals(n);)b-=w.$.scrollLeft,c-=w.$.scrollTop,w=w.getParent();w=n;n=(r=n.$.offsetParent)?new CKEDITOR.dom.element(r):null}a&&(r=this.getWindow(),n=a.getWindow(),!r.equals(n)&&r.$.frameElement&&(a=(new CKEDITOR.dom.element(r.$.frameElement)).getDocumentPosition(a),b+=a.x,c+=a.y));document.documentElement.getBoundingClientRect||!CKEDITOR.env.gecko||
  223. e||(b+=this.$.clientLeft?1:0,c+=this.$.clientTop?1:0);return{x:b,y:c}},scrollIntoView:function(a){var b=this.getParent();if(b){do if((b.$.clientWidth&&b.$.clientWidth<b.$.scrollWidth||b.$.clientHeight&&b.$.clientHeight<b.$.scrollHeight)&&!b.is("body")&&this.scrollIntoParent(b,a,1),b.is("html")){var c=b.getWindow();try{var f=c.$.frameElement;f&&(b=new CKEDITOR.dom.element(f))}catch(d){}}while(b=b.getParent())}},scrollIntoParent:function(a,b,c){var f,d,e,r;function g(b,c){/body|html/.test(a.getName())?
  224. a.getWindow().$.scrollBy(b,c):(a.$.scrollLeft+=b,a.$.scrollTop+=c)}function n(a,b){var c={x:0,y:0};if(!a.is(k?"body":"html")){var f=a.$.getBoundingClientRect();c.x=f.left;c.y=f.top}f=a.getWindow();f.equals(b)||(f=n(CKEDITOR.dom.element.get(f.$.frameElement),b),c.x+=f.x,c.y+=f.y);return c}function w(a,b){return parseInt(a.getComputedStyle("margin-"+b)||0,10)||0}!a&&(a=this.getWindow());e=a.getDocument();var k="BackCompat"==e.$.compatMode;a instanceof CKEDITOR.dom.window&&(a=k?e.getBody():e.getDocumentElement());
  225. e=a.getWindow();d=n(this,e);var u=n(a,e),t=this.$.offsetHeight;f=this.$.offsetWidth;var h=a.$.clientHeight,p=a.$.clientWidth;e=d.x-w(this,"left")-u.x||0;r=d.y-w(this,"top")-u.y||0;f=d.x+f+w(this,"right")-(u.x+p)||0;d=d.y+t+w(this,"bottom")-(u.y+h)||0;(0>r||0<d)&&g(0,!0===b?r:!1===b?d:0>r?r:d);c&&(0>e||0<f)&&g(0>e?e:f,0)},setState:function(a,b,c){b=b||"cke";switch(a){case CKEDITOR.TRISTATE_ON:this.addClass(b+"_on");this.removeClass(b+"_off");this.removeClass(b+"_disabled");c&&this.setAttribute("aria-pressed",
  226. !0);c&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(b+"_disabled");this.removeClass(b+"_off");this.removeClass(b+"_on");c&&this.setAttribute("aria-disabled",!0);c&&this.removeAttribute("aria-pressed");break;default:this.addClass(b+"_off"),this.removeClass(b+"_on"),this.removeClass(b+"_disabled"),c&&this.removeAttribute("aria-pressed"),c&&this.removeAttribute("aria-disabled")}},getFrameDocument:function(){var a=this.$;try{a.contentWindow.document}catch(b){a.src=
  227. a.src}return a&&new CKEDITOR.dom.document(a.contentWindow.document)},copyAttributes:function(a,b){var c=this.$.attributes;b=b||{};for(var f=0;f<c.length;f++){var d=c[f],e=d.nodeName.toLowerCase(),r;if(!(e in b))if("checked"==e&&(r=this.getAttribute(e)))a.setAttribute(e,r);else if(!CKEDITOR.env.ie||this.hasAttribute(e))r=this.getAttribute(e),null===r&&(r=d.nodeValue),a.setAttribute(e,r)}""!==this.$.style.cssText&&(a.$.style.cssText=this.$.style.cssText)},renameNode:function(a){if(this.getName()!=a){var b=
  228. this.getDocument();a=new CKEDITOR.dom.element(a,b);this.copyAttributes(a);this.moveChildren(a);this.getParent(!0)&&this.$.parentNode.replaceChild(a.$,this.$);a.$["data-cke-expando"]=this.$["data-cke-expando"];this.$=a.$;delete this.getName}},getChild:function(){function a(b,c){var f=b.childNodes;if(0<=c&&c<f.length)return f[c]}return function(b){var c=this.$;if(b.slice)for(b=b.slice();0<b.length&&c;)c=a(c,b.shift());else c=a(c,b);return c?new CKEDITOR.dom.node(c):null}}(),getChildCount:function(){return this.$.childNodes.length},
  229. disableContextMenu:function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT&&b.hasClass("cke_enable_context_menu")}this.on("contextmenu",function(b){b.data.getTarget().getAscendant(a,!0)||b.data.preventDefault()})},getDirection:function(a){return a?this.getComputedStyle("direction")||this.getDirection()||this.getParent()&&this.getParent().getDirection(1)||this.getDocument().$.dir||"ltr":this.getStyle("direction")||this.getAttribute("dir")},data:function(a,b){a="data-"+a;if(void 0===b)return this.getAttribute(a);
  230. !1===b?this.removeAttribute(a):this.setAttribute(a,b);return null},getEditor:function(){var a=CKEDITOR.instances,b,c;for(b in a)if(c=a[b],c.element.equals(this)&&c.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO)return c;return null},find:function(a){var c=d(this);a=new CKEDITOR.dom.nodeList(this.$.querySelectorAll(b(this,a)));c();return a},findOne:function(a){var c=d(this);a=this.$.querySelector(b(this,a));c();return a?new CKEDITOR.dom.element(a):null},forEach:function(a,b,c){if(!(c||b&&this.type!=b))var f=
  231. a(this);if(!1!==f){c=this.getChildren();for(var d=0;d<c.count();d++)f=c.getItem(d),f.type==CKEDITOR.NODE_ELEMENT?f.forEach(a,b):b&&f.type!=b||a(f)}}});var k={width:["border-left-width","border-right-width","padding-left","padding-right"],height:["border-top-width","border-bottom-width","padding-top","padding-bottom"]};CKEDITOR.dom.element.prototype.setSize=function(a,b,d){"number"==typeof b&&(!d||CKEDITOR.env.ie&&CKEDITOR.env.quirks||(b-=c.call(this,a)),this.setStyle(a,b+"px"))};CKEDITOR.dom.element.prototype.getSize=
  232. function(a,b){var d=Math.max(this.$["offset"+CKEDITOR.tools.capitalize(a)],this.$["client"+CKEDITOR.tools.capitalize(a)])||0;b&&(d-=c.call(this,a));return d}})();CKEDITOR.dom.documentFragment=function(a){a=a||CKEDITOR.document;this.$=a.type==CKEDITOR.NODE_DOCUMENT?a.$.createDocumentFragment():a};
  233. CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,insertAfterNode:function(a){a=a.$;a.parentNode.insertBefore(this.$,a.nextSibling)},getHtml:function(){var a=new CKEDITOR.dom.element("div");this.clone(1,1).appendTo(a);return a.getHtml().replace(/\s*data-cke-expando=".*?"/g,"")}},!0,{append:1,appendBogus:1,clone:1,getFirst:1,getHtml:1,getLast:1,getParent:1,getNext:1,getPrevious:1,appendTo:1,moveChildren:1,insertBefore:1,
  234. insertAfterNode:1,replace:1,trim:1,type:1,ltrim:1,rtrim:1,getDocument:1,getChildCount:1,getChild:1,getChildren:1});
  235. (function(){function a(a,b){var c=this.range;if(this._.end)return null;if(!this._.start){this._.start=1;if(c.collapsed)return this.end(),null;c.optimize()}var f,d=c.startContainer;f=c.endContainer;var e=c.startOffset,y=c.endOffset,t,h=this.guard,p=this.type,m=a?"getPreviousSourceNode":"getNextSourceNode";if(!a&&!this._.guardLTR){var x=f.type==CKEDITOR.NODE_ELEMENT?f:f.getParent(),z=f.type==CKEDITOR.NODE_ELEMENT?f.getChild(y):f.getNext();this._.guardLTR=function(a,b){return(!b||!x.equals(a))&&(!z||
  236. !a.equals(z))&&(a.type!=CKEDITOR.NODE_ELEMENT||!b||!a.equals(c.root))}}if(a&&!this._.guardRTL){var F=d.type==CKEDITOR.NODE_ELEMENT?d:d.getParent(),g=d.type==CKEDITOR.NODE_ELEMENT?e?d.getChild(e-1):null:d.getPrevious();this._.guardRTL=function(a,b){return(!b||!F.equals(a))&&(!g||!a.equals(g))&&(a.type!=CKEDITOR.NODE_ELEMENT||!b||!a.equals(c.root))}}var k=a?this._.guardRTL:this._.guardLTR;t=h?function(a,b){return!1===k(a,b)?!1:h(a,b)}:k;this.current?f=this.current[m](!1,p,t):(a?f.type==CKEDITOR.NODE_ELEMENT&&
  237. (f=0<y?f.getChild(y-1):!1===t(f,!0)?null:f.getPreviousSourceNode(!0,p,t)):(f=d,f.type==CKEDITOR.NODE_ELEMENT&&((f=f.getChild(e))||(f=!1===t(d,!0)?null:d.getNextSourceNode(!0,p,t)))),f&&!1===t(f)&&(f=null));for(;f&&!this._.end;){this.current=f;if(!this.evaluator||!1!==this.evaluator(f)){if(!b)return f}else if(b&&this.evaluator)return!1;f=f[m](!1,p,t)}this.end();return this.current=null}function d(b){for(var c,f=null;c=a.call(this,b);)f=c;return f}CKEDITOR.dom.walker=CKEDITOR.tools.createClass({$:function(a){this.range=
  238. a;this._={}},proto:{end:function(){this._.end=1},next:function(){return a.call(this)},previous:function(){return a.call(this,1)},checkForward:function(){return!1!==a.call(this,0,1)},checkBackward:function(){return!1!==a.call(this,1,1)},lastForward:function(){return d.call(this)},lastBackward:function(){return d.call(this,1)},reset:function(){delete this.current;this._={}}}});var b={block:1,"list-item":1,table:1,"table-row-group":1,"table-header-group":1,"table-footer-group":1,"table-row":1,"table-column-group":1,
  239. "table-column":1,"table-cell":1,"table-caption":1},c={absolute:1,fixed:1};CKEDITOR.dom.element.prototype.isBlockBoundary=function(a){return"none"!=this.getComputedStyle("float")||this.getComputedStyle("position")in c||!b[this.getComputedStyle("display")]?!!(this.is(CKEDITOR.dtd.$block)||a&&this.is(a)):!0};CKEDITOR.dom.walker.blockBoundary=function(a){return function(b){return!(b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary(a))}};CKEDITOR.dom.walker.listItemBoundary=function(){return this.blockBoundary({br:1})};
  240. CKEDITOR.dom.walker.bookmark=function(a,b){function c(a){return a&&a.getName&&"span"==a.getName()&&a.data("cke-bookmark")}return function(f){var d,e;d=f&&f.type!=CKEDITOR.NODE_ELEMENT&&(e=f.getParent())&&c(e);d=a?d:d||c(f);return!!(b^d)}};CKEDITOR.dom.walker.whitespaces=function(a){return function(b){var c;b&&b.type==CKEDITOR.NODE_TEXT&&(c=!CKEDITOR.tools.trim(b.getText())||CKEDITOR.env.webkit&&b.getText()==CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE);return!!(a^c)}};CKEDITOR.dom.walker.invisible=
  241. function(a){var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.env.webkit?1:0;return function(f){b(f)?f=1:(f.type==CKEDITOR.NODE_TEXT&&(f=f.getParent()),f=f.$.offsetWidth<=c);return!!(a^f)}};CKEDITOR.dom.walker.nodeType=function(a,b){return function(c){return!!(b^c.type==a)}};CKEDITOR.dom.walker.bogus=function(a){function b(a){return!g(a)&&!k(a)}return function(c){var f=CKEDITOR.env.needsBrFiller?c.is&&c.is("br"):c.getText&&e.test(c.getText());f&&(f=c.getParent(),c=c.getNext(b),f=f.isBlockBoundary()&&
  242. (!c||c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary()));return!!(a^f)}};CKEDITOR.dom.walker.temp=function(a){return function(b){b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent());b=b&&b.hasAttribute("data-cke-temp");return!!(a^b)}};var e=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,g=CKEDITOR.dom.walker.whitespaces(),k=CKEDITOR.dom.walker.bookmark(),l=CKEDITOR.dom.walker.temp(),q=function(a){return k(a)||g(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$inline)&&!a.is(CKEDITOR.dtd.$empty)};CKEDITOR.dom.walker.ignored=
  243. function(a){return function(b){b=g(b)||k(b)||l(b);return!!(a^b)}};var v=CKEDITOR.dom.walker.ignored();CKEDITOR.dom.walker.empty=function(a){return function(b){for(var c=0,f=b.getChildCount();c<f;++c)if(!v(b.getChild(c)))return!!a;return!a}};var f=CKEDITOR.dom.walker.empty(),y=CKEDITOR.dom.walker.validEmptyBlockContainers=CKEDITOR.tools.extend(function(a){var b={},c;for(c in a)CKEDITOR.dtd[c]["#"]&&(b[c]=1);return b}(CKEDITOR.dtd.$block),{caption:1,td:1,th:1});CKEDITOR.dom.walker.editable=function(a){return function(b){b=
  244. v(b)?!1:b.type==CKEDITOR.NODE_TEXT||b.type==CKEDITOR.NODE_ELEMENT&&(b.is(CKEDITOR.dtd.$inline)||b.is("hr")||"false"==b.getAttribute("contenteditable")||!CKEDITOR.env.needsBrFiller&&b.is(y)&&f(b))?!0:!1;return!!(a^b)}};CKEDITOR.dom.element.prototype.getBogus=function(){var a=this;do a=a.getPreviousSourceNode();while(q(a));return a&&(CKEDITOR.env.needsBrFiller?a.is&&a.is("br"):a.getText&&e.test(a.getText()))?a:!1}})();
  245. CKEDITOR.dom.range=function(a){this.endOffset=this.endContainer=this.startOffset=this.startContainer=null;this.collapsed=!0;var d=a instanceof CKEDITOR.dom.document;this.document=d?a:a.getDocument();this.root=d?a.getBody():a};
  246. (function(){function a(a){a.collapsed=a.startContainer&&a.endContainer&&a.startContainer.equals(a.endContainer)&&a.startOffset==a.endOffset}function d(a,b,c,d,e){function n(a,b,c,f){var d=c?a.getPrevious():a.getNext();if(f&&l)return d;h||f?b.append(a.clone(!0,e),c):(a.remove(),t&&b.append(a));return d}function g(){var a,b,c,f=Math.min(N.length,C.length);for(a=0;a<f;a++)if(b=N[a],c=C[a],!b.equals(c))return a;return a-1}function k(){var b=I-1,c=E&&v&&!p.equals(m);b<G-1||b<K-1||c?(c?a.moveToPosition(m,
  247. CKEDITOR.POSITION_BEFORE_START):K==b+1&&B?a.moveToPosition(C[b],CKEDITOR.POSITION_BEFORE_END):a.moveToPosition(C[b+1],CKEDITOR.POSITION_BEFORE_START),d&&(b=N[b+1])&&b.type==CKEDITOR.NODE_ELEMENT&&(c=CKEDITOR.dom.element.createFromHtml('\x3cspan data-cke-bookmark\x3d"1" style\x3d"display:none"\x3e\x26nbsp;\x3c/span\x3e',a.document),c.insertAfter(b),b.mergeSiblings(!1),a.moveToBookmark({startNode:c}))):a.collapse(!0)}a.optimizeBookmark();var l=0===b,t=1==b,h=2==b;b=h||t;var p=a.startContainer,m=a.endContainer,
  248. x=a.startOffset,z=a.endOffset,F,B,E,v,q,O;if(h&&m.type==CKEDITOR.NODE_TEXT&&p.equals(m))p=a.document.createText(p.substring(x,z)),c.append(p);else{m.type==CKEDITOR.NODE_TEXT?h?O=!0:m=m.split(z):0<m.getChildCount()?z>=m.getChildCount()?(m=m.getChild(z-1),B=!0):m=m.getChild(z):v=B=!0;p.type==CKEDITOR.NODE_TEXT?h?q=!0:p.split(x):0<p.getChildCount()?0===x?(p=p.getChild(x),F=!0):p=p.getChild(x-1):E=F=!0;for(var N=p.getParents(),C=m.getParents(),I=g(),G=N.length-1,K=C.length-1,J=c,L,Z,U,fa=-1,Q=I;Q<=G;Q++){Z=
  249. N[Q];U=Z.getNext();for(Q!=G||Z.equals(C[Q])&&G<K?b&&(L=J.append(Z.clone(0,e))):F?n(Z,J,!1,E):q&&J.append(a.document.createText(Z.substring(x)));U;){if(U.equals(C[Q])){fa=Q;break}U=n(U,J)}J=L}J=c;for(Q=I;Q<=K;Q++)if(c=C[Q],U=c.getPrevious(),c.equals(N[Q]))b&&(J=J.getChild(0));else{Q!=K||c.equals(N[Q])&&K<G?b&&(L=J.append(c.clone(0,e))):B?n(c,J,!1,v):O&&J.append(a.document.createText(c.substring(0,z)));if(Q>fa)for(;U;)U=n(U,J,!0);J=L}h||k()}}function b(){var a=!1,b=CKEDITOR.dom.walker.whitespaces(),
  250. c=CKEDITOR.dom.walker.bookmark(!0),d=CKEDITOR.dom.walker.bogus();return function(e){return c(e)||b(e)?!0:d(e)&&!a?a=!0:e.type==CKEDITOR.NODE_TEXT&&(e.hasAscendant("pre")||CKEDITOR.tools.trim(e.getText()).length)||e.type==CKEDITOR.NODE_ELEMENT&&!e.is(g)?!1:!0}}function c(a){var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(1);return function(d){return c(d)||b(d)?!0:!a&&k(d)||d.type==CKEDITOR.NODE_ELEMENT&&d.is(CKEDITOR.dtd.$removeEmpty)}}function e(a){return function(){var b;return this[a?
  251. "getPreviousNode":"getNextNode"](function(a){!b&&v(a)&&(b=a);return q(a)&&!(k(a)&&a.equals(b))})}}var g={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},k=CKEDITOR.dom.walker.bogus(),l=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,q=CKEDITOR.dom.walker.editable(),v=CKEDITOR.dom.walker.ignored(!0);CKEDITOR.dom.range.prototype={clone:function(){var a=new CKEDITOR.dom.range(this.root);a._setStartContainer(this.startContainer);
  252. a.startOffset=this.startOffset;a._setEndContainer(this.endContainer);a.endOffset=this.endOffset;a.collapsed=this.collapsed;return a},collapse:function(a){a?(this._setEndContainer(this.startContainer),this.endOffset=this.startOffset):(this._setStartContainer(this.endContainer),this.startOffset=this.endOffset);this.collapsed=!0},cloneContents:function(a){var b=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||d(this,2,b,!1,"undefined"==typeof a?!0:a);return b},deleteContents:function(a){this.collapsed||
  253. d(this,0,null,a)},extractContents:function(a,b){var c=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||d(this,1,c,a,"undefined"==typeof b?!0:b);return c},createBookmark:function(a){var b,c,d,e,n=this.collapsed;b=this.document.createElement("span");b.data("cke-bookmark",1);b.setStyle("display","none");b.setHtml("\x26nbsp;");a&&(d="cke_bm_"+CKEDITOR.tools.getNextNumber(),b.setAttribute("id",d+(n?"C":"S")));n||(c=b.clone(),c.setHtml("\x26nbsp;"),a&&c.setAttribute("id",d+"E"),e=this.clone(),
  254. e.collapse(),e.insertNode(c));e=this.clone();e.collapse(!0);e.insertNode(b);c?(this.setStartAfter(b),this.setEndBefore(c)):this.moveToPosition(b,CKEDITOR.POSITION_AFTER_END);return{startNode:a?d+(n?"C":"S"):b,endNode:a?d+"E":c,serializable:a,collapsed:n}},createBookmark2:function(){function a(b){var f=b.container,d=b.offset,e;e=f;var g=d;e=e.type!=CKEDITOR.NODE_ELEMENT||0===g||g==e.getChildCount()?0:e.getChild(g-1).type==CKEDITOR.NODE_TEXT&&e.getChild(g).type==CKEDITOR.NODE_TEXT;e&&(f=f.getChild(d-
  255. 1),d=f.getLength());if(f.type==CKEDITOR.NODE_ELEMENT&&0<d){a:{for(e=f;d--;)if(g=e.getChild(d).getIndex(!0),0<=g){d=g;break a}d=-1}d+=1}if(f.type==CKEDITOR.NODE_TEXT){e=f;for(g=0;(e=e.getPrevious())&&e.type==CKEDITOR.NODE_TEXT;)g+=e.getText().replace(CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE,"").length;e=g;f.getText()?d+=e:(g=f.getPrevious(c),e?(d=e,f=g?g.getNext():f.getParent().getFirst()):(f=f.getParent(),d=g?g.getIndex(!0)+1:0))}b.container=f;b.offset=d}function b(a,c){var f=c.getCustomData("cke-fillingChar");
  256. if(f){var d=a.container;f.equals(d)&&(a.offset-=CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE.length,0>=a.offset&&(a.offset=d.getIndex(),a.container=d.getParent()))}}var c=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT,!0);return function(c){var d=this.collapsed,e={container:this.startContainer,offset:this.startOffset},g={container:this.endContainer,offset:this.endOffset};c&&(a(e),b(e,this.root),d||(a(g),b(g,this.root)));return{start:e.container.getAddress(c),end:d?null:g.container.getAddress(c),
  257. startOffset:e.offset,endOffset:g.offset,normalized:c,collapsed:d,is2:!0}}}(),moveToBookmark:function(a){if(a.is2){var b=this.document.getByAddress(a.start,a.normalized),c=a.startOffset,d=a.end&&this.document.getByAddress(a.end,a.normalized);a=a.endOffset;this.setStart(b,c);d?this.setEnd(d,a):this.collapse(!0)}else b=(c=a.serializable)?this.document.getById(a.startNode):a.startNode,a=c?this.document.getById(a.endNode):a.endNode,this.setStartBefore(b),b.remove(),a?(this.setEndBefore(a),a.remove()):
  258. this.collapse(!0)},getBoundaryNodes:function(){var a=this.startContainer,b=this.endContainer,c=this.startOffset,d=this.endOffset,e;if(a.type==CKEDITOR.NODE_ELEMENT)if(e=a.getChildCount(),e>c)a=a.getChild(c);else if(1>e)a=a.getPreviousSourceNode();else{for(a=a.$;a.lastChild;)a=a.lastChild;a=new CKEDITOR.dom.node(a);a=a.getNextSourceNode()||a}if(b.type==CKEDITOR.NODE_ELEMENT)if(e=b.getChildCount(),e>d)b=b.getChild(d).getPreviousSourceNode(!0);else if(1>e)b=b.getPreviousSourceNode();else{for(b=b.$;b.lastChild;)b=
  259. b.lastChild;b=new CKEDITOR.dom.node(b)}a.getPosition(b)&CKEDITOR.POSITION_FOLLOWING&&(a=b);return{startNode:a,endNode:b}},getCommonAncestor:function(a,b){var c=this.startContainer,d=this.endContainer,c=c.equals(d)?a&&c.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-1?c.getChild(this.startOffset):c:c.getCommonAncestor(d);return b&&!c.is?c.getParent():c},optimize:function(){var a=this.startContainer,b=this.startOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setStartAfter(a):
  260. this.setStartBefore(a));a=this.endContainer;b=this.endOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setEndAfter(a):this.setEndBefore(a))},optimizeBookmark:function(){var a=this.startContainer,b=this.endContainer;a.is&&a.is("span")&&a.data("cke-bookmark")&&this.setStartAt(a,CKEDITOR.POSITION_BEFORE_START);b&&b.is&&b.is("span")&&b.data("cke-bookmark")&&this.setEndAt(b,CKEDITOR.POSITION_AFTER_END)},trim:function(a,b){var c=this.startContainer,d=this.startOffset,e=this.collapsed;if((!a||
  261. e)&&c&&c.type==CKEDITOR.NODE_TEXT){if(d)if(d>=c.getLength())d=c.getIndex()+1,c=c.getParent();else{var n=c.split(d),d=c.getIndex()+1,c=c.getParent();this.startContainer.equals(this.endContainer)?this.setEnd(n,this.endOffset-this.startOffset):c.equals(this.endContainer)&&(this.endOffset+=1)}else d=c.getIndex(),c=c.getParent();this.setStart(c,d);if(e){this.collapse(!0);return}}c=this.endContainer;d=this.endOffset;b||e||!c||c.type!=CKEDITOR.NODE_TEXT||(d?(d>=c.getLength()||c.split(d),d=c.getIndex()+1):
  262. d=c.getIndex(),c=c.getParent(),this.setEnd(c,d))},enlarge:function(a,b){function c(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")?null:a}var d=new RegExp(/[^\s\ufeff]/);switch(a){case CKEDITOR.ENLARGE_INLINE:var e=1;case CKEDITOR.ENLARGE_ELEMENT:var n=function(a,b){var c=new CKEDITOR.dom.range(k);c.setStart(a,b);c.setEndAt(k,CKEDITOR.POSITION_BEFORE_END);var c=new CKEDITOR.dom.walker(c),f;for(c.guard=function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())};f=
  263. c.next();){if(f.type!=CKEDITOR.NODE_TEXT)return!1;F=f!=a?f.getText():f.substring(b);if(d.test(F))return!1}return!0};if(this.collapsed)break;var g=this.getCommonAncestor(),k=this.root,l,t,h,p,m,x=!1,z,F;z=this.startContainer;var B=this.startOffset;z.type==CKEDITOR.NODE_TEXT?(B&&(z=!CKEDITOR.tools.trim(z.substring(0,B)).length&&z,x=!!z),z&&((p=z.getPrevious())||(h=z.getParent()))):(B&&(p=z.getChild(B-1)||z.getLast()),p||(h=z));for(h=c(h);h||p;){if(h&&!p){!m&&h.equals(g)&&(m=!0);if(e?h.isBlockBoundary():
  264. !k.contains(h))break;x&&"inline"==h.getComputedStyle("display")||(x=!1,m?l=h:this.setStartBefore(h));p=h.getPrevious()}for(;p;)if(z=!1,p.type==CKEDITOR.NODE_COMMENT)p=p.getPrevious();else{if(p.type==CKEDITOR.NODE_TEXT)F=p.getText(),d.test(F)&&(p=null),z=/[\s\ufeff]$/.test(F);else if((p.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||b&&p.is("br"))&&!p.data("cke-bookmark"))if(x&&CKEDITOR.dtd.$removeEmpty[p.getName()]){F=p.getText();if(d.test(F))p=null;else for(var B=p.$.getElementsByTagName("*"),E=0,v;v=
  265. B[E++];)if(!CKEDITOR.dtd.$removeEmpty[v.nodeName.toLowerCase()]){p=null;break}p&&(z=!!F.length)}else p=null;z&&(x?m?l=h:h&&this.setStartBefore(h):x=!0);if(p){z=p.getPrevious();if(!h&&!z){h=p;p=null;break}p=z}else h=null}h&&(h=c(h.getParent()))}z=this.endContainer;B=this.endOffset;h=p=null;m=x=!1;z.type==CKEDITOR.NODE_TEXT?CKEDITOR.tools.trim(z.substring(B)).length?x=!0:(x=!z.getLength(),B==z.getLength()?(p=z.getNext())||(h=z.getParent()):n(z,B)&&(h=z.getParent())):(p=z.getChild(B))||(h=z);for(;h||
  266. p;){if(h&&!p){!m&&h.equals(g)&&(m=!0);if(e?h.isBlockBoundary():!k.contains(h))break;x&&"inline"==h.getComputedStyle("display")||(x=!1,m?t=h:h&&this.setEndAfter(h));p=h.getNext()}for(;p;){z=!1;if(p.type==CKEDITOR.NODE_TEXT)F=p.getText(),n(p,0)||(p=null),z=/^[\s\ufeff]/.test(F);else if(p.type==CKEDITOR.NODE_ELEMENT){if((0<p.$.offsetWidth||b&&p.is("br"))&&!p.data("cke-bookmark"))if(x&&CKEDITOR.dtd.$removeEmpty[p.getName()]){F=p.getText();if(d.test(F))p=null;else for(B=p.$.getElementsByTagName("*"),E=
  267. 0;v=B[E++];)if(!CKEDITOR.dtd.$removeEmpty[v.nodeName.toLowerCase()]){p=null;break}p&&(z=!!F.length)}else p=null}else z=1;z&&x&&(m?t=h:this.setEndAfter(h));if(p){z=p.getNext();if(!h&&!z){h=p;p=null;break}p=z}else h=null}h&&(h=c(h.getParent()))}l&&t&&(g=l.contains(t)?t:l,this.setStartBefore(g),this.setEndAfter(g));break;case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:h=new CKEDITOR.dom.range(this.root);k=this.root;h.setStartAt(k,CKEDITOR.POSITION_AFTER_START);h.setEnd(this.startContainer,
  268. this.startOffset);h=new CKEDITOR.dom.walker(h);var q,O,N=CKEDITOR.dom.walker.blockBoundary(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?{br:1}:null),C=null,I=function(a){if(a.type==CKEDITOR.NODE_ELEMENT&&"false"==a.getAttribute("contenteditable"))if(C){if(C.equals(a)){C=null;return}}else C=a;else if(C)return;var b=N(a);b||(q=a);return b},e=function(a){var b=I(a);!b&&a.is&&a.is("br")&&(O=a);return b};h.guard=I;h=h.lastBackward();q=q||k;this.setStartAt(q,!q.is("br")&&(!h&&this.checkStartOfBlock()||h&&q.contains(h))?
  269. CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_AFTER_END);if(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS){h=this.clone();h=new CKEDITOR.dom.walker(h);var G=CKEDITOR.dom.walker.whitespaces(),K=CKEDITOR.dom.walker.bookmark();h.evaluator=function(a){return!G(a)&&!K(a)};if((h=h.previous())&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("br"))break}h=this.clone();h.collapse();h.setEndAt(k,CKEDITOR.POSITION_BEFORE_END);h=new CKEDITOR.dom.walker(h);h.guard=a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?e:I;q=C=O=null;h=h.lastForward();
  270. q=q||k;this.setEndAt(q,!h&&this.checkEndOfBlock()||h&&q.contains(h)?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_BEFORE_START);O&&this.setEndAfter(O)}},shrink:function(a,b,c){if(!this.collapsed){a=a||CKEDITOR.SHRINK_TEXT;var d=this.clone(),e=this.startContainer,n=this.endContainer,g=this.startOffset,k=this.endOffset,l=1,t=1;e&&e.type==CKEDITOR.NODE_TEXT&&(g?g>=e.getLength()?d.setStartAfter(e):(d.setStartBefore(e),l=0):d.setStartBefore(e));n&&n.type==CKEDITOR.NODE_TEXT&&(k?k>=n.getLength()?d.setEndAfter(n):
  271. (d.setEndAfter(n),t=0):d.setEndBefore(n));var d=new CKEDITOR.dom.walker(d),h=CKEDITOR.dom.walker.bookmark();d.evaluator=function(b){return b.type==(a==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var p;d.guard=function(b,d){if(h(b))return!0;if(a==CKEDITOR.SHRINK_ELEMENT&&b.type==CKEDITOR.NODE_TEXT||d&&b.equals(p)||!1===c&&b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()||b.type==CKEDITOR.NODE_ELEMENT&&b.hasAttribute("contenteditable"))return!1;d||b.type!=CKEDITOR.NODE_ELEMENT||
  272. (p=b);return!0};l&&(e=d[a==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(e,b?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START);t&&(d.reset(),(d=d[a==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(d,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END));return!(!l&&!t)}},insertNode:function(a){this.optimizeBookmark();this.trim(!1,!0);var b=this.startContainer,c=b.getChild(this.startOffset);c?a.insertBefore(c):b.append(a);a.getParent()&&a.getParent().equals(this.endContainer)&&
  273. this.endOffset++;this.setStartBefore(a)},moveToPosition:function(a,b){this.setStartAt(a,b);this.collapse(!0)},moveToRange:function(a){this.setStart(a.startContainer,a.startOffset);this.setEnd(a.endContainer,a.endOffset)},selectNodeContents:function(a){this.setStart(a,0);this.setEnd(a,a.type==CKEDITOR.NODE_TEXT?a.getLength():a.getChildCount())},setStart:function(b,c){b.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[b.getName()]&&(c=b.getIndex(),b=b.getParent());this._setStartContainer(b);this.startOffset=
  274. c;this.endContainer||(this._setEndContainer(b),this.endOffset=c);a(this)},setEnd:function(b,c){b.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[b.getName()]&&(c=b.getIndex()+1,b=b.getParent());this._setEndContainer(b);this.endOffset=c;this.startContainer||(this._setStartContainer(b),this.startOffset=c);a(this)},setStartAfter:function(a){this.setStart(a.getParent(),a.getIndex()+1)},setStartBefore:function(a){this.setStart(a.getParent(),a.getIndex())},setEndAfter:function(a){this.setEnd(a.getParent(),
  275. a.getIndex()+1)},setEndBefore:function(a){this.setEnd(a.getParent(),a.getIndex())},setStartAt:function(b,c){switch(c){case CKEDITOR.POSITION_AFTER_START:this.setStart(b,0);break;case CKEDITOR.POSITION_BEFORE_END:b.type==CKEDITOR.NODE_TEXT?this.setStart(b,b.getLength()):this.setStart(b,b.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(b);break;case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(b)}a(this)},setEndAt:function(b,c){switch(c){case CKEDITOR.POSITION_AFTER_START:this.setEnd(b,
  276. 0);break;case CKEDITOR.POSITION_BEFORE_END:b.type==CKEDITOR.NODE_TEXT?this.setEnd(b,b.getLength()):this.setEnd(b,b.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(b);break;case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(b)}a(this)},fixBlock:function(a,b){var c=this.createBookmark(),d=this.document.createElement(b);this.collapse(a);this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);this.extractContents().appendTo(d);d.trim();this.insertNode(d);var e=d.getBogus();e&&e.remove();
  277. d.appendBogus();this.moveToBookmark(c);return d},splitBlock:function(a,b){var c=new CKEDITOR.dom.elementPath(this.startContainer,this.root),d=new CKEDITOR.dom.elementPath(this.endContainer,this.root),e=c.block,n=d.block,g=null;if(!c.blockLimit.equals(d.blockLimit))return null;"br"!=a&&(e||(e=this.fixBlock(!0,a),n=(new CKEDITOR.dom.elementPath(this.endContainer,this.root)).block),n||(n=this.fixBlock(!1,a)));c=e&&this.checkStartOfBlock();d=n&&this.checkEndOfBlock();this.deleteContents();e&&e.equals(n)&&
  278. (d?(g=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(n,CKEDITOR.POSITION_AFTER_END),n=null):c?(g=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START),e=null):(n=this.splitElement(e,b||!1),e.is("ul","ol")||e.appendBogus()));return{previousBlock:e,nextBlock:n,wasStartOfBlock:c,wasEndOfBlock:d,elementPath:g}},splitElement:function(a,b){if(!this.collapsed)return null;this.setEndAt(a,CKEDITOR.POSITION_BEFORE_END);
  279. var c=this.extractContents(!1,b||!1),d=a.clone(!1,b||!1);c.appendTo(d);d.insertAfter(a);this.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);return d},removeEmptyBlocksAtEnd:function(){function a(d){return function(a){return b(a)||c(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.isEmptyInlineRemoveable()||d.is("table")&&a.is("caption")?!1:!0}}var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(!1);return function(b){for(var c=this.createBookmark(),d=this[b?"endPath":"startPath"](),e=d.block||
  280. d.blockLimit,g;e&&!e.equals(d.root)&&!e.getFirst(a(e));)g=e.getParent(),this[b?"setEndAt":"setStartAt"](e,CKEDITOR.POSITION_AFTER_END),e.remove(1),e=g;this.moveToBookmark(c)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer,this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer,this.root)},checkBoundaryOfElement:function(a,b){var d=b==CKEDITOR.START,e=this.clone();e.collapse(d);e[d?"setStartAt":"setEndAt"](a,d?CKEDITOR.POSITION_AFTER_START:
  281. CKEDITOR.POSITION_BEFORE_END);e=new CKEDITOR.dom.walker(e);e.evaluator=c(d);return e[d?"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var a=this.startContainer,c=this.startOffset;CKEDITOR.env.ie&&c&&a.type==CKEDITOR.NODE_TEXT&&(a=CKEDITOR.tools.ltrim(a.substring(0,c)),l.test(a)&&this.trim(0,1));this.trim();a=new CKEDITOR.dom.elementPath(this.startContainer,this.root);c=this.clone();c.collapse(!0);c.setStartAt(a.block||a.blockLimit,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(c);
  282. a.evaluator=b();return a.checkBackward()},checkEndOfBlock:function(){var a=this.endContainer,c=this.endOffset;CKEDITOR.env.ie&&a.type==CKEDITOR.NODE_TEXT&&(a=CKEDITOR.tools.rtrim(a.substring(c)),l.test(a)&&this.trim(1,0));this.trim();a=new CKEDITOR.dom.elementPath(this.endContainer,this.root);c=this.clone();c.collapse(!1);c.setEndAt(a.block||a.blockLimit,CKEDITOR.POSITION_BEFORE_END);a=new CKEDITOR.dom.walker(c);a.evaluator=b();return a.checkForward()},getPreviousNode:function(a,b,c){var d=this.clone();
  283. d.collapse(1);d.setStartAt(c||this.root,CKEDITOR.POSITION_AFTER_START);c=new CKEDITOR.dom.walker(d);c.evaluator=a;c.guard=b;return c.previous()},getNextNode:function(a,b,c){var d=this.clone();d.collapse();d.setEndAt(c||this.root,CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(d);c.evaluator=a;c.guard=b;return c.next()},checkReadOnly:function(){function a(b,c){for(;b;){if(b.type==CKEDITOR.NODE_ELEMENT){if("false"==b.getAttribute("contentEditable")&&!b.data("cke-editable"))return 0;if(b.is("html")||
  284. "true"==b.getAttribute("contentEditable")&&(b.contains(c)||b.equals(c)))break}b=b.getParent()}return 1}return function(){var b=this.startContainer,c=this.endContainer;return!(a(b,c)&&a(c,b))}}(),moveToElementEditablePosition:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&!a.isEditable(!1))return this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),!0;for(var c=0;a;){if(a.type==CKEDITOR.NODE_TEXT){b&&this.endContainer&&this.checkEndOfBlock()&&l.test(a.getText())?this.moveToPosition(a,
  285. CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START);c=1;break}if(a.type==CKEDITOR.NODE_ELEMENT)if(a.isEditable())this.moveToPosition(a,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),c=1;else if(b&&a.is("br")&&this.endContainer&&this.checkEndOfBlock())this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START);else if("false"==a.getAttribute("contenteditable")&&a.is(CKEDITOR.dtd.$block))return this.setStartBefore(a),this.setEndAfter(a),
  286. !0;var d=a,e=c,n=void 0;d.type==CKEDITOR.NODE_ELEMENT&&d.isEditable(!1)&&(n=d[b?"getLast":"getFirst"](v));e||n||(n=d[b?"getPrevious":"getNext"](v));a=n}return!!c},moveToClosestEditablePosition:function(a,b){var c,d=0,e,n,g=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];a?(c=new CKEDITOR.dom.range(this.root),c.moveToPosition(a,g[b?0:1])):c=this.clone();if(a&&!a.is(CKEDITOR.dtd.$block))d=1;else if(e=c[b?"getNextEditableNode":"getPreviousEditableNode"]())d=1,(n=e.type==CKEDITOR.NODE_ELEMENT)&&
  287. e.is(CKEDITOR.dtd.$block)&&"false"==e.getAttribute("contenteditable")?(c.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),c.setEndAt(e,CKEDITOR.POSITION_AFTER_END)):!CKEDITOR.env.needsBrFiller&&n&&e.is(CKEDITOR.dom.walker.validEmptyBlockContainers)?(c.setEnd(e,0),c.collapse()):c.moveToPosition(e,g[b?1:0]);d&&this.moveToRange(c);return!!d},moveToElementEditStart:function(a){return this.moveToElementEditablePosition(a)},moveToElementEditEnd:function(a){return this.moveToElementEditablePosition(a,!0)},getEnclosedNode:function(){var a=
  288. this.clone();a.optimize();if(a.startContainer.type!=CKEDITOR.NODE_ELEMENT||a.endContainer.type!=CKEDITOR.NODE_ELEMENT)return null;var a=new CKEDITOR.dom.walker(a),b=CKEDITOR.dom.walker.bookmark(!1,!0),c=CKEDITOR.dom.walker.whitespaces(!0);a.evaluator=function(a){return c(a)&&b(a)};var d=a.next();a.reset();return d&&d.equals(a.previous())?d:null},getTouchedStartNode:function(){var a=this.startContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.startOffset)||a},getTouchedEndNode:function(){var a=
  289. this.endContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.endOffset-1)||a},getNextEditableNode:e(),getPreviousEditableNode:e(1),scrollIntoView:function(){var a=new CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",this.document),b,c,d,e=this.clone();e.optimize();(d=e.startContainer.type==CKEDITOR.NODE_TEXT)?(c=e.startContainer.getText(),b=e.startContainer.split(e.startOffset),a.insertAfter(e.startContainer)):e.insertNode(a);a.scrollIntoView();
  290. d&&(e.startContainer.setText(c),b.remove());a.remove()},_setStartContainer:function(a){this.startContainer=a},_setEndContainer:function(a){this.endContainer=a}}})();CKEDITOR.POSITION_AFTER_START=1;CKEDITOR.POSITION_BEFORE_END=2;CKEDITOR.POSITION_BEFORE_START=3;CKEDITOR.POSITION_AFTER_END=4;CKEDITOR.ENLARGE_ELEMENT=1;CKEDITOR.ENLARGE_BLOCK_CONTENTS=2;CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS=3;CKEDITOR.ENLARGE_INLINE=4;CKEDITOR.START=1;CKEDITOR.END=2;CKEDITOR.SHRINK_ELEMENT=1;CKEDITOR.SHRINK_TEXT=2;"use strict";
  291. (function(){function a(a){1>arguments.length||(this.range=a,this.forceBrBreak=0,this.enlargeBr=1,this.enforceRealBlocks=0,this._||(this._={}))}function d(a){var b=[];a.forEach(function(a){if("true"==a.getAttribute("contenteditable"))return b.push(a),!1},CKEDITOR.NODE_ELEMENT,!0);return b}function b(a,c,e,g){a:{null==g&&(g=d(e));for(var k;k=g.shift();)if(k.getDtd().p){g={element:k,remaining:g};break a}g=null}if(!g)return 0;if((k=CKEDITOR.filter.instances[g.element.data("cke-filter")])&&!k.check(c))return b(a,
  292. c,e,g.remaining);c=new CKEDITOR.dom.range(g.element);c.selectNodeContents(g.element);c=c.createIterator();c.enlargeBr=a.enlargeBr;c.enforceRealBlocks=a.enforceRealBlocks;c.activeFilter=c.filter=k;a._.nestedEditable={element:g.element,container:e,remaining:g.remaining,iterator:c};return 1}function c(a,b,c){if(!b)return!1;a=a.clone();a.collapse(!c);return a.checkBoundaryOfElement(b,c?CKEDITOR.START:CKEDITOR.END)}var e=/^[\r\n\t ]+$/,g=CKEDITOR.dom.walker.bookmark(!1,!0),k=CKEDITOR.dom.walker.whitespaces(!0),
  293. l=function(a){return g(a)&&k(a)},q={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var d,k,A,r,D;a=a||"p";if(this._.nestedEditable){if(d=this._.nestedEditable.iterator.getNextParagraph(a))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,d;this.activeFilter=this.filter;if(b(this,a,this._.nestedEditable.container,this._.nestedEditable.remaining))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,this._.nestedEditable.iterator.getNextParagraph(a);this._.nestedEditable=
  294. null}if(!this.range.root.getDtd()[a])return null;if(!this._.started){var n=this.range.clone();k=n.startPath();var w=n.endPath(),H=!n.collapsed&&c(n,k.block),u=!n.collapsed&&c(n,w.block,1);n.shrink(CKEDITOR.SHRINK_ELEMENT,!0);H&&n.setStartAt(k.block,CKEDITOR.POSITION_BEFORE_END);u&&n.setEndAt(w.block,CKEDITOR.POSITION_AFTER_START);k=n.endContainer.hasAscendant("pre",!0)||n.startContainer.hasAscendant("pre",!0);n.enlarge(this.forceBrBreak&&!k||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  295. n.collapsed||(k=new CKEDITOR.dom.walker(n.clone()),w=CKEDITOR.dom.walker.bookmark(!0,!0),k.evaluator=w,this._.nextNode=k.next(),k=new CKEDITOR.dom.walker(n.clone()),k.evaluator=w,k=k.previous(),this._.lastNode=k.getNextSourceNode(!0,null,n.root),this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(w=this.range.clone(),w.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),w.checkEndOfBlock()&&
  296. (w=new CKEDITOR.dom.elementPath(w.endContainer,w.root),this._.lastNode=(w.block||w.blockLimit).getNextSourceNode(!0))),this._.lastNode&&n.root.contains(this._.lastNode)||(this._.lastNode=this._.docEndMarker=n.document.createText(""),this._.lastNode.insertAfter(k)),n=null);this._.started=1;k=n}w=this._.nextNode;n=this._.lastNode;for(this._.nextNode=null;w;){var H=0,u=w.hasAscendant("pre"),t=w.type!=CKEDITOR.NODE_ELEMENT,h=0;if(t)w.type==CKEDITOR.NODE_TEXT&&e.test(w.getText())&&(t=0);else{var p=w.getName();
  297. if(CKEDITOR.dtd.$block[p]&&"false"==w.getAttribute("contenteditable")){d=w;b(this,a,d);break}else if(w.isBlockBoundary(this.forceBrBreak&&!u&&{br:1})){if("br"==p)t=1;else if(!k&&!w.getChildCount()&&"hr"!=p){d=w;A=w.equals(n);break}k&&(k.setEndAt(w,CKEDITOR.POSITION_BEFORE_START),"br"!=p&&(this._.nextNode=w));H=1}else{if(w.getFirst()){k||(k=this.range.clone(),k.setStartAt(w,CKEDITOR.POSITION_BEFORE_START));w=w.getFirst();continue}t=1}}t&&!k&&(k=this.range.clone(),k.setStartAt(w,CKEDITOR.POSITION_BEFORE_START));
  298. A=(!H||t)&&w.equals(n);if(k&&!H)for(;!w.getNext(l)&&!A;){p=w.getParent();if(p.isBlockBoundary(this.forceBrBreak&&!u&&{br:1})){H=1;t=0;A||p.equals(n);k.setEndAt(p,CKEDITOR.POSITION_BEFORE_END);break}w=p;t=1;A=w.equals(n);h=1}t&&k.setEndAt(w,CKEDITOR.POSITION_AFTER_END);w=this._getNextSourceNode(w,h,n);if((A=!w)||H&&k)break}if(!d){if(!k)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;d=new CKEDITOR.dom.elementPath(k.startContainer,k.root);w=d.blockLimit;H={div:1,th:1,td:1};
  299. d=d.block;!d&&w&&!this.enforceRealBlocks&&H[w.getName()]&&k.checkStartOfBlock()&&k.checkEndOfBlock()&&!w.equals(k.root)?d=w:!d||this.enforceRealBlocks&&d.is(q)?(d=this.range.document.createElement(a),k.extractContents().appendTo(d),d.trim(),k.insertNode(d),r=D=!0):"li"!=d.getName()?k.checkStartOfBlock()&&k.checkEndOfBlock()||(d=d.clone(!1),k.extractContents().appendTo(d),d.trim(),D=k.splitBlock(),r=!D.wasStartOfBlock,D=!D.wasEndOfBlock,k.insertNode(d)):A||(this._.nextNode=d.equals(n)?null:this._getNextSourceNode(k.getBoundaryNodes().endNode,
  300. 1,n))}r&&(r=d.getPrevious())&&r.type==CKEDITOR.NODE_ELEMENT&&("br"==r.getName()?r.remove():r.getLast()&&"br"==r.getLast().$.nodeName.toLowerCase()&&r.getLast().remove());D&&(r=d.getLast())&&r.type==CKEDITOR.NODE_ELEMENT&&"br"==r.getName()&&(!CKEDITOR.env.needsBrFiller||r.getPrevious(g)||r.getNext(g))&&r.remove();this._.nextNode||(this._.nextNode=A||d.equals(n)||!n?null:this._getNextSourceNode(d,1,n));return d},_getNextSourceNode:function(a,b,c){function d(a){return!(a.equals(c)||a.equals(e))}var e=
  301. this.range.root;for(a=a.getNextSourceNode(b,null,d);!g(a);)a=a.getNextSourceNode(b,null,d);return a}};CKEDITOR.dom.range.prototype.createIterator=function(){return new a(this)}})();
  302. CKEDITOR.command=function(a,d){this.uiItems=[];this.exec=function(b){if(this.state==CKEDITOR.TRISTATE_DISABLED||!this.checkAllowed())return!1;this.editorFocus&&a.focus();return!1===this.fire("exec")?!0:!1!==d.exec.call(this,a,b)};this.refresh=function(a,b){if(!this.readOnly&&a.readOnly)return!0;if(this.context&&!b.isContextFor(this.context)||!this.checkAllowed(!0))return this.disable(),!0;this.startDisabled||this.enable();this.modes&&!this.modes[a.mode]&&this.disable();return!1===this.fire("refresh",
  303. {editor:a,path:b})?!0:d.refresh&&!1!==d.refresh.apply(this,arguments)};var b;this.checkAllowed=function(c){return c||"boolean"!=typeof b?b=a.activeFilter.checkFeature(this):b};CKEDITOR.tools.extend(this,d,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!d.context,state:CKEDITOR.TRISTATE_DISABLED});CKEDITOR.event.call(this)};
  304. CKEDITOR.command.prototype={enable:function(){this.state==CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()&&this.setState(this.preserveState&&"undefined"!=typeof this.previousState?this.previousState:CKEDITOR.TRISTATE_OFF)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},setState:function(a){if(this.state==a||a!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed())return!1;this.previousState=this.state;this.state=a;this.fire("state");return!0},toggleState:function(){this.state==CKEDITOR.TRISTATE_OFF?
  305. this.setState(CKEDITOR.TRISTATE_ON):this.state==CKEDITOR.TRISTATE_ON&&this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.event.implementOn(CKEDITOR.command.prototype);CKEDITOR.ENTER_P=1;CKEDITOR.ENTER_BR=2;CKEDITOR.ENTER_DIV=3;
  306. CKEDITOR.config={customConfig:"config.js",autoUpdateElement:!0,language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"\x3c!DOCTYPE html\x3e",bodyId:"",bodyClass:"",fullPage:!1,height:200,contentsCss:CKEDITOR.getUrl("contents.css"),extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:1E4,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]};
  307. (function(){function a(a,b,c,d,e){var h,p;a=[];for(h in b){p=b[h];p="boolean"==typeof p?{}:"function"==typeof p?{match:p}:E(p);"$"!=h.charAt(0)&&(p.elements=h);c&&(p.featureName=c.toLowerCase());var m=p;m.elements=k(m.elements,/\s+/)||null;m.propertiesOnly=m.propertiesOnly||!0===m.elements;var f=/\s*,\s*/,n=void 0;for(n in O){m[n]=k(m[n],f)||null;var G=m,t=N[n],g=k(m[N[n]],f),x=m[n],F=[],C=!0,K=void 0;g?C=!1:g={};for(K in x)"!"==K.charAt(0)&&(K=K.slice(1),F.push(K),g[K]=!0,C=!1);for(;K=F.pop();)x[K]=
  308. x["!"+K],delete x["!"+K];G[t]=(C?!1:g)||null}m.match=m.match||null;d.push(p);a.push(p)}b=e.elements;e=e.generic;var z;c=0;for(d=a.length;c<d;++c){h=E(a[c]);p=!0===h.classes||!0===h.styles||!0===h.attributes;m=h;n=t=f=void 0;for(f in O)m[f]=H(m[f]);G=!0;for(n in N){f=N[n];t=m[f];g=[];x=void 0;for(x in t)-1<x.indexOf("*")?g.push(new RegExp("^"+x.replace(/\*/g,".*")+"$")):g.push(x);t=g;t.length&&(m[f]=t,G=!1)}m.nothingRequired=G;m.noProperties=!(m.attributes||m.classes||m.styles);if(!0===h.elements||
  309. null===h.elements)e[p?"unshift":"push"](h);else for(z in m=h.elements,delete h.elements,m)if(b[z])b[z][p?"unshift":"push"](h);else b[z]=[h]}}function d(a,c,d,h){if(!a.match||a.match(c))if(h||l(a,c))if(a.propertiesOnly||(d.valid=!0),d.allAttributes||(d.allAttributes=b(a.attributes,c.attributes,d.validAttributes)),d.allStyles||(d.allStyles=b(a.styles,c.styles,d.validStyles)),!d.allClasses){a=a.classes;c=c.classes;h=d.validClasses;if(a)if(!0===a)a=!0;else{for(var p=0,e=c.length,m;p<e;++p)m=c[p],h[m]||
  310. (h[m]=a(m));a=!1}else a=!1;d.allClasses=a}}function b(a,b,c){if(!a)return!1;if(!0===a)return!0;for(var d in b)c[d]||(c[d]=a(d));return!1}function c(a,b,c){if(!a.match||a.match(b)){if(a.noProperties)return!1;c.hadInvalidAttribute=e(a.attributes,b.attributes)||c.hadInvalidAttribute;c.hadInvalidStyle=e(a.styles,b.styles)||c.hadInvalidStyle;a=a.classes;b=b.classes;if(a){for(var d=!1,h=!0===a,p=b.length;p--;)if(h||a(b[p]))b.splice(p,1),d=!0;a=d}else a=!1;c.hadInvalidClass=a||c.hadInvalidClass}}function e(a,
  311. b){if(!a)return!1;var c=!1,d=!0===a,h;for(h in b)if(d||a(h))delete b[h],c=!0;return c}function g(a,b,c){if(a.disabled||a.customConfig&&!c||!b)return!1;a._.cachedChecks={};return!0}function k(a,b){if(!a)return!1;if(!0===a)return a;if("string"==typeof a)return a=Y(a),"*"==a?!0:CKEDITOR.tools.convertArrayToObject(a.split(b));if(CKEDITOR.tools.isArray(a))return a.length?CKEDITOR.tools.convertArrayToObject(a):!1;var c={},d=0,h;for(h in a)c[h]=a[h],d++;return d?c:!1}function l(a,b){if(a.nothingRequired)return!0;
  312. var c,d,h,p;if(h=a.requiredClasses)for(p=b.classes,c=0;c<h.length;++c)if(d=h[c],"string"==typeof d){if(-1==CKEDITOR.tools.indexOf(p,d))return!1}else if(!CKEDITOR.tools.checkIfAnyArrayItemMatches(p,d))return!1;return q(b.styles,a.requiredStyles)&&q(b.attributes,a.requiredAttributes)}function q(a,b){if(!b)return!0;for(var c=0,d;c<b.length;++c)if(d=b[c],"string"==typeof d){if(!(d in a))return!1}else if(!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a,d))return!1;return!0}function v(a){if(!a)return{};
  313. a=a.split(/\s*,\s*/).sort();for(var b={};a.length;)b[a.shift()]="cke-test";return b}function f(a){var b,c,d,h,p={},e=1;for(a=Y(a);b=a.match(C);)(c=b[2])?(d=y(c,"styles"),h=y(c,"attrs"),c=y(c,"classes")):d=h=c=null,p["$"+e++]={elements:b[1],classes:c,styles:d,attributes:h},a=a.slice(b[0].length);return p}function y(a,b){var c=a.match(I[b]);return c?Y(c[1]):null}function A(a){var b=a.styleBackup=a.attributes.style,c=a.classBackup=a.attributes["class"];a.styles||(a.styles=CKEDITOR.tools.parseCssText(b||
  314. "",1));a.classes||(a.classes=c?c.split(/\s+/):[])}function r(a,b,h,e){var m=0,f;e.toHtml&&(b.name=b.name.replace(G,"$1"));if(e.doCallbacks&&a.elementCallbacks){a:{f=a.elementCallbacks;for(var g=0,t=f.length,x;g<t;++g)if(x=f[g](b)){f=x;break a}f=void 0}if(f)return f}if(e.doTransform&&(f=a._.transformations[b.name])){A(b);for(g=0;g<f.length;++g)p(a,b,f[g]);n(b)}if(e.doFilter){a:{g=b.name;t=a._;a=t.allowedRules.elements[g];f=t.allowedRules.generic;g=t.disallowedRules.elements[g];t=t.disallowedRules.generic;
  315. x=e.skipRequired;var F={valid:!1,validAttributes:{},validClasses:{},validStyles:{},allAttributes:!1,allClasses:!1,allStyles:!1,hadInvalidAttribute:!1,hadInvalidClass:!1,hadInvalidStyle:!1},k,C;if(a||f){A(b);if(g)for(k=0,C=g.length;k<C;++k)if(!1===c(g[k],b,F)){a=null;break a}if(t)for(k=0,C=t.length;k<C;++k)c(t[k],b,F);if(a)for(k=0,C=a.length;k<C;++k)d(a[k],b,F,x);if(f)for(k=0,C=f.length;k<C;++k)d(f[k],b,F,x);a=F}else a=null}if(!a||!a.valid)return h.push(b),1;C=a.validAttributes;var z=a.validStyles;
  316. f=a.validClasses;var g=b.attributes,l=b.styles,t=b.classes;x=b.classBackup;var J=b.styleBackup,B,I,E=[],F=[],q=/^data-cke-/;k=!1;delete g.style;delete g["class"];delete b.classBackup;delete b.styleBackup;if(!a.allAttributes)for(B in g)C[B]||(q.test(B)?B==(I=B.replace(/^data-cke-saved-/,""))||C[I]||(delete g[B],k=!0):(delete g[B],k=!0));if(!a.allStyles||a.hadInvalidStyle){for(B in l)a.allStyles||z[B]?E.push(B+":"+l[B]):k=!0;E.length&&(g.style=E.sort().join("; "))}else J&&(g.style=J);if(!a.allClasses||
  317. a.hadInvalidClass){for(B=0;B<t.length;++B)(a.allClasses||f[t[B]])&&F.push(t[B]);F.length&&(g["class"]=F.sort().join(" "));x&&F.length<x.split(/\s+/).length&&(k=!0)}else x&&(g["class"]=x);k&&(m=1);if(!e.skipFinalValidation&&!w(b))return h.push(b),1}e.toHtml&&(b.name=b.name.replace(K,"cke:$1"));return m}function D(a){var b=[],c;for(c in a)-1<c.indexOf("*")&&b.push(c.replace(/\*/g,".*"));return b.length?new RegExp("^(?:"+b.join("|")+")$"):null}function n(a){var b=a.attributes,c;delete b.style;delete b["class"];
  318. if(c=CKEDITOR.tools.writeCssText(a.styles,!0))b.style=c;a.classes.length&&(b["class"]=a.classes.sort().join(" "))}function w(a){switch(a.name){case "a":if(!(a.children.length||a.attributes.name||a.attributes.id))return!1;break;case "img":if(!a.attributes.src)return!1}return!0}function H(a){if(!a)return!1;if(!0===a)return!0;var b=D(a);return function(c){return c in a||b&&c.match(b)}}function u(){return new CKEDITOR.htmlParser.element("br")}function t(a){return a.type==CKEDITOR.NODE_ELEMENT&&("br"==
  319. a.name||B.$block[a.name])}function h(a,b,c){var d=a.name;if(B.$empty[d]||!a.children.length)"hr"==d&&"br"==b?a.replaceWith(u()):(a.parent&&c.push({check:"it",el:a.parent}),a.remove());else if(B.$block[d]||"tr"==d)if("br"==b)a.previous&&!t(a.previous)&&(b=u(),b.insertBefore(a)),a.next&&!t(a.next)&&(b=u(),b.insertAfter(a)),a.replaceWithChildren();else{var d=a.children,h;b:{h=B[b];for(var p=0,e=d.length,m;p<e;++p)if(m=d[p],m.type==CKEDITOR.NODE_ELEMENT&&!h[m.name]){h=!1;break b}h=!0}if(h)a.name=b,a.attributes=
  320. {},c.push({check:"parent-down",el:a});else{h=a.parent;for(var p=h.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||"body"==h.name,f,g,e=d.length;0<e;)m=d[--e],p&&(m.type==CKEDITOR.NODE_TEXT||m.type==CKEDITOR.NODE_ELEMENT&&B.$inline[m.name])?(f||(f=new CKEDITOR.htmlParser.element(b),f.insertAfter(a),c.push({check:"parent-down",el:f})),f.add(m,0)):(f=null,g=B[h.name]||B.span,m.insertAfter(a),h.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||m.type!=CKEDITOR.NODE_ELEMENT||g[m.name]||c.push({check:"el-up",el:m}));a.remove()}}else d in
  321. {style:1,script:1}?a.remove():(a.parent&&c.push({check:"it",el:a.parent}),a.replaceWithChildren())}function p(a,b,c){var d,h;for(d=0;d<c.length;++d)if(h=c[d],!(h.check&&!a.check(h.check,!1)||h.left&&!h.left(b))){h.right(b,J);break}}function m(a,b){var c=b.getDefinition(),d=c.attributes,h=c.styles,p,e,m,f;if(a.name!=c.element)return!1;for(p in d)if("class"==p)for(c=d[p].split(/\s+/),m=a.classes.join("|");f=c.pop();){if(-1==m.indexOf(f))return!1}else if(a.attributes[p]!=d[p])return!1;for(e in h)if(a.styles[e]!=
  322. h[e])return!1;return!0}function x(a,b){var c,d;"string"==typeof a?c=a:a instanceof CKEDITOR.style?d=a:(c=a[0],d=a[1]);return[{element:c,left:d,right:function(a,c){c.transform(a,b)}}]}function z(a){return function(b){return m(b,a)}}function F(a){return function(b,c){c[a](b)}}var B=CKEDITOR.dtd,E=CKEDITOR.tools.copy,Y=CKEDITOR.tools.trim,P=["","p","br","div"];CKEDITOR.FILTER_SKIP_TREE=2;CKEDITOR.filter=function(a){this.allowedContent=[];this.disallowedContent=[];this.elementCallbacks=null;this.disabled=
  323. !1;this.editor=null;this.id=CKEDITOR.tools.getNextNumber();this._={allowedRules:{elements:{},generic:[]},disallowedRules:{elements:{},generic:[]},transformations:{},cachedTests:{}};CKEDITOR.filter.instances[this.id]=this;if(a instanceof CKEDITOR.editor){a=this.editor=a;this.customConfig=!0;var b=a.config.allowedContent;!0===b?this.disabled=!0:(b||(this.customConfig=!1),this.allow(b,"config",1),this.allow(a.config.extraAllowedContent,"extra",1),this.allow(P[a.enterMode]+" "+P[a.shiftEnterMode],"default",
  324. 1),this.disallow(a.config.disallowedContent))}else this.customConfig=!1,this.allow(a,"default",1)};CKEDITOR.filter.instances={};CKEDITOR.filter.prototype={allow:function(b,c,d){if(!g(this,b,d))return!1;var h,p;if("string"==typeof b)b=f(b);else if(b instanceof CKEDITOR.style){if(b.toAllowedContentRules)return this.allow(b.toAllowedContentRules(this.editor),c,d);h=b.getDefinition();b={};d=h.attributes;b[h.element]=h={styles:h.styles,requiredStyles:h.styles&&CKEDITOR.tools.objectKeys(h.styles)};d&&(d=
  325. E(d),h.classes=d["class"]?d["class"].split(/\s+/):null,h.requiredClasses=h.classes,delete d["class"],h.attributes=d,h.requiredAttributes=d&&CKEDITOR.tools.objectKeys(d))}else if(CKEDITOR.tools.isArray(b)){for(h=0;h<b.length;++h)p=this.allow(b[h],c,d);return p}a(this,b,c,this.allowedContent,this._.allowedRules);return!0},applyTo:function(a,b,c,d){if(this.disabled)return!1;var p=this,e=[],m=this.editor&&this.editor.config.protectedSource,f,g=!1,n={doFilter:!c,doTransform:!0,doCallbacks:!0,toHtml:b};
  326. a.forEach(function(a){if(a.type==CKEDITOR.NODE_ELEMENT){if("off"==a.attributes["data-cke-filter"])return!1;if(!b||"span"!=a.name||!~CKEDITOR.tools.objectKeys(a.attributes).join("|").indexOf("data-cke-"))if(f=r(p,a,e,n),f&1)g=!0;else if(f&2)return!1}else if(a.type==CKEDITOR.NODE_COMMENT&&a.value.match(/^\{cke_protected\}(?!\{C\})/)){var c;a:{var d=decodeURIComponent(a.value.replace(/^\{cke_protected\}/,""));c=[];var h,t,x;if(m)for(t=0;t<m.length;++t)if((x=d.match(m[t]))&&x[0].length==d.length){c=!0;
  327. break a}d=CKEDITOR.htmlParser.fragment.fromHtml(d);1==d.children.length&&(h=d.children[0]).type==CKEDITOR.NODE_ELEMENT&&r(p,h,c,n);c=!c.length}c||e.push(a)}},null,!0);e.length&&(g=!0);var t;a=[];d=P[d||(this.editor?this.editor.enterMode:CKEDITOR.ENTER_P)];for(var x;c=e.pop();)c.type==CKEDITOR.NODE_ELEMENT?h(c,d,a):c.remove();for(;t=a.pop();)if(c=t.el,c.parent)switch(x=B[c.parent.name]||B.span,t.check){case "it":B.$removeEmpty[c.name]&&!c.children.length?h(c,d,a):w(c)||h(c,d,a);break;case "el-up":c.parent.type==
  328. CKEDITOR.NODE_DOCUMENT_FRAGMENT||x[c.name]||h(c,d,a);break;case "parent-down":c.parent.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||x[c.name]||h(c.parent,d,a)}return g},checkFeature:function(a){if(this.disabled||!a)return!0;a.toFeature&&(a=a.toFeature(this.editor));return!a.requiredContent||this.check(a.requiredContent)},disable:function(){this.disabled=!0},disallow:function(b){if(!g(this,b,!0))return!1;"string"==typeof b&&(b=f(b));a(this,b,null,this.disallowedContent,this._.disallowedRules);return!0},
  329. addContentForms:function(a){if(!this.disabled&&a){var b,c,d=[],h;for(b=0;b<a.length&&!h;++b)c=a[b],("string"==typeof c||c instanceof CKEDITOR.style)&&this.check(c)&&(h=c);if(h){for(b=0;b<a.length;++b)d.push(x(a[b],h));this.addTransformations(d)}}},addElementCallback:function(a){this.elementCallbacks||(this.elementCallbacks=[]);this.elementCallbacks.push(a)},addFeature:function(a){if(this.disabled||!a)return!0;a.toFeature&&(a=a.toFeature(this.editor));this.allow(a.allowedContent,a.name);this.addTransformations(a.contentTransformations);
  330. this.addContentForms(a.contentForms);return a.requiredContent&&(this.customConfig||this.disallowedContent.length)?this.check(a.requiredContent):!0},addTransformations:function(a){var b,c;if(!this.disabled&&a){var d=this._.transformations,h;for(h=0;h<a.length;++h){b=a[h];var p=void 0,e=void 0,m=void 0,f=void 0,g=void 0,t=void 0;c=[];for(e=0;e<b.length;++e)m=b[e],"string"==typeof m?(m=m.split(/\s*:\s*/),f=m[0],g=null,t=m[1]):(f=m.check,g=m.left,t=m.right),p||(p=m,p=p.element?p.element:f?f.match(/^([a-z0-9]+)/i)[0]:
  331. p.left.getDefinition().element),g instanceof CKEDITOR.style&&(g=z(g)),c.push({check:f==p?null:f,left:g,right:"string"==typeof t?F(t):t});b=p;d[b]||(d[b]=[]);d[b].push(c)}}},check:function(a,b,c){if(this.disabled)return!0;if(CKEDITOR.tools.isArray(a)){for(var d=a.length;d--;)if(this.check(a[d],b,c))return!0;return!1}var h,e;if("string"==typeof a){e=a+"\x3c"+(!1===b?"0":"1")+(c?"1":"0")+"\x3e";if(e in this._.cachedChecks)return this._.cachedChecks[e];d=f(a).$1;h=d.styles;var m=d.classes;d.name=d.elements;
  332. d.classes=m=m?m.split(/\s*,\s*/):[];d.styles=v(h);d.attributes=v(d.attributes);d.children=[];m.length&&(d.attributes["class"]=m.join(" "));h&&(d.attributes.style=CKEDITOR.tools.writeCssText(d.styles));h=d}else d=a.getDefinition(),h=d.styles,m=d.attributes||{},h&&!CKEDITOR.tools.isEmpty(h)?(h=E(h),m.style=CKEDITOR.tools.writeCssText(h,!0)):h={},h={name:d.element,attributes:m,classes:m["class"]?m["class"].split(/\s+/):[],styles:h,children:[]};var m=CKEDITOR.tools.clone(h),g=[],t;if(!1!==b&&(t=this._.transformations[h.name])){for(d=
  333. 0;d<t.length;++d)p(this,h,t[d]);n(h)}r(this,m,g,{doFilter:!0,doTransform:!1!==b,skipRequired:!c,skipFinalValidation:!c});b=0<g.length?!1:CKEDITOR.tools.objectCompare(h.attributes,m.attributes,!0)?!0:!1;"string"==typeof a&&(this._.cachedChecks[e]=b);return b},getAllowedEnterMode:function(){var a=["p","div","br"],b={p:CKEDITOR.ENTER_P,div:CKEDITOR.ENTER_DIV,br:CKEDITOR.ENTER_BR};return function(c,d){var h=a.slice(),p;if(this.check(P[c]))return c;for(d||(h=h.reverse());p=h.pop();)if(this.check(p))return b[p];
  334. return CKEDITOR.ENTER_BR}}(),destroy:function(){delete CKEDITOR.filter.instances[this.id];delete this._;delete this.allowedContent;delete this.disallowedContent}};var O={styles:1,attributes:1,classes:1},N={styles:"requiredStyles",attributes:"requiredAttributes",classes:"requiredClasses"},C=/^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,I={styles:/{([^}]+)}/,attrs:/\[([^\]]+)\]/,classes:/\(([^\)]+)\)/},G=/^cke:(object|embed|param)$/,
  335. K=/^(object|embed|param)$/,J;J=CKEDITOR.filter.transformationsTools={sizeToStyle:function(a){this.lengthToStyle(a,"width");this.lengthToStyle(a,"height")},sizeToAttribute:function(a){this.lengthToAttribute(a,"width");this.lengthToAttribute(a,"height")},lengthToStyle:function(a,b,c){c=c||b;if(!(c in a.styles)){var d=a.attributes[b];d&&(/^\d+$/.test(d)&&(d+="px"),a.styles[c]=d)}delete a.attributes[b]},lengthToAttribute:function(a,b,c){c=c||b;if(!(c in a.attributes)){var d=a.styles[b],h=d&&d.match(/^(\d+)(?:\.\d*)?px$/);
  336. h?a.attributes[c]=h[1]:"cke-test"==d&&(a.attributes[c]="cke-test")}delete a.styles[b]},alignmentToStyle:function(a){if(!("float"in a.styles)){var b=a.attributes.align;if("left"==b||"right"==b)a.styles["float"]=b}delete a.attributes.align},alignmentToAttribute:function(a){if(!("align"in a.attributes)){var b=a.styles["float"];if("left"==b||"right"==b)a.attributes.align=b}delete a.styles["float"]},matchesStyle:m,transform:function(a,b){if("string"==typeof b)a.name=b;else{var c=b.getDefinition(),d=c.styles,
  337. h=c.attributes,p,e,m,f;a.name=c.element;for(p in h)if("class"==p)for(c=a.classes.join("|"),m=h[p].split(/\s+/);f=m.pop();)-1==c.indexOf(f)&&a.classes.push(f);else a.attributes[p]=h[p];for(e in d)a.styles[e]=d[e]}}}})();
  338. (function(){CKEDITOR.focusManager=function(a){if(a.focusManager)return a.focusManager;this.hasFocus=!1;this.currentActive=null;this._={editor:a};return this};CKEDITOR.focusManager._={blurDelay:200};CKEDITOR.focusManager.prototype={focus:function(a){this._.timer&&clearTimeout(this._.timer);a&&(this.currentActive=a);this.hasFocus||this._.locked||((a=CKEDITOR.currentInstance)&&a.focusManager.blur(1),this.hasFocus=!0,(a=this._.editor.container)&&a.addClass("cke_focus"),this._.editor.fire("focus"))},lock:function(){this._.locked=
  339. 1},unlock:function(){delete this._.locked},blur:function(a){function d(){if(this.hasFocus){this.hasFocus=!1;var a=this._.editor.container;a&&a.removeClass("cke_focus");this._.editor.fire("blur")}}if(!this._.locked){this._.timer&&clearTimeout(this._.timer);var b=CKEDITOR.focusManager._.blurDelay;a||!b?d.call(this):this._.timer=CKEDITOR.tools.setTimeout(function(){delete this._.timer;d.call(this)},b,this)}},add:function(a,d){var b=a.getCustomData("focusmanager");if(!b||b!=this){b&&b.remove(a);var b=
  340. "focus",c="blur";d&&(CKEDITOR.env.ie?(b="focusin",c="focusout"):CKEDITOR.event.useCapture=1);var e={blur:function(){a.equals(this.currentActive)&&this.blur()},focus:function(){this.focus(a)}};a.on(b,e.focus,this);a.on(c,e.blur,this);d&&(CKEDITOR.event.useCapture=0);a.setCustomData("focusmanager",this);a.setCustomData("focusmanager_handlers",e)}},remove:function(a){a.removeCustomData("focusmanager");var d=a.removeCustomData("focusmanager_handlers");a.removeListener("blur",d.blur);a.removeListener("focus",
  341. d.focus)}}})();CKEDITOR.keystrokeHandler=function(a){if(a.keystrokeHandler)return a.keystrokeHandler;this.keystrokes={};this.blockedKeystrokes={};this._={editor:a};return this};
  342. (function(){var a,d=function(b){b=b.data;var d=b.getKeystroke(),g=this.keystrokes[d],k=this._.editor;a=!1===k.fire("key",{keyCode:d,domEvent:b});a||(g&&(a=!1!==k.execCommand(g,{from:"keystrokeHandler"})),a||(a=!!this.blockedKeystrokes[d]));a&&b.preventDefault(!0);return!a},b=function(b){a&&(a=!1,b.data.preventDefault(!0))};CKEDITOR.keystrokeHandler.prototype={attach:function(a){a.on("keydown",d,this);if(CKEDITOR.env.gecko&&CKEDITOR.env.mac)a.on("keypress",b,this)}}})();
  343. (function(){CKEDITOR.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,"de-ch":1,el:1,"en-au":1,"en-ca":1,"en-gb":1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,"fr-ca":1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,is:1,it:1,ja:1,ka:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,"pt-br":1,pt:1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,"sr-latn":1,sr:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,"zh-cn":1,zh:1},rtl:{ar:1,fa:1,he:1,ku:1,ug:1},load:function(a,d,b){a&&CKEDITOR.lang.languages[a]||(a=
  344. this.detect(d,a));var c=this;d=function(){c[a].dir=c.rtl[a]?"rtl":"ltr";b(a,c[a])};this[a]?d():CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/"+a+".js"),d,this)},detect:function(a,d){var b=this.languages;d=d||navigator.userLanguage||navigator.language||a;var c=d.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),e=c[1],c=c[2];b[e+"-"+c]?e=e+"-"+c:b[e]||(e=null);CKEDITOR.lang.detect=e?function(){return e}:function(a){return a};return e||a}}})();
  345. CKEDITOR.scriptLoader=function(){var a={},d={};return{load:function(b,c,e,g){var k="string"==typeof b;k&&(b=[b]);e||(e=CKEDITOR);var l=b.length,q=[],v=[],f=function(a){c&&(k?c.call(e,a):c.call(e,q,v))};if(0===l)f(!0);else{var y=function(a,b){(b?q:v).push(a);0>=--l&&(g&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),f(b))},A=function(b,c){a[b]=1;var e=d[b];delete d[b];for(var f=0;f<e.length;f++)e[f](b,c)},r=function(b){if(a[b])y(b,!0);else{var e=d[b]||(d[b]=[]);e.push(y);if(!(1<e.length)){var f=
  346. new CKEDITOR.dom.element("script");f.setAttributes({type:"text/javascript",src:b});c&&(CKEDITOR.env.ie&&8>=CKEDITOR.env.version?f.$.onreadystatechange=function(){if("loaded"==f.$.readyState||"complete"==f.$.readyState)f.$.onreadystatechange=null,A(b,!0)}:(f.$.onload=function(){setTimeout(function(){A(b,!0)},0)},f.$.onerror=function(){A(b,!1)}));f.appendTo(CKEDITOR.document.getHead())}}};g&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var D=0;D<l;D++)r(b[D])}},queue:function(){function a(){var b;
  347. (b=c[0])&&this.load(b.scriptUrl,b.callback,CKEDITOR,0)}var c=[];return function(d,g){var k=this;c.push({scriptUrl:d,callback:function(){g&&g.apply(this,arguments);c.shift();a.call(k)}});1==c.length&&a.call(this)}}()}}();CKEDITOR.resourceManager=function(a,d){this.basePath=a;this.fileName=d;this.registered={};this.loaded={};this.externals={};this._={waitingList:{}}};
  348. CKEDITOR.resourceManager.prototype={add:function(a,d){if(this.registered[a])throw Error('[CKEDITOR.resourceManager.add] The resource name "'+a+'" is already registered.');var b=this.registered[a]=d||{};b.name=a;b.path=this.getPath(a);CKEDITOR.fire(a+CKEDITOR.tools.capitalize(this.fileName)+"Ready",b);return this.get(a)},get:function(a){return this.registered[a]||null},getPath:function(a){var d=this.externals[a];return CKEDITOR.getUrl(d&&d.dir||this.basePath+a+"/")},getFilePath:function(a){var d=this.externals[a];
  349. return CKEDITOR.getUrl(this.getPath(a)+(d?d.file:this.fileName+".js"))},addExternal:function(a,d,b){a=a.split(",");for(var c=0;c<a.length;c++){var e=a[c];b||(d=d.replace(/[^\/]+$/,function(a){b=a;return""}));this.externals[e]={dir:d,file:b||this.fileName+".js"}}},load:function(a,d,b){CKEDITOR.tools.isArray(a)||(a=a?[a]:[]);for(var c=this.loaded,e=this.registered,g=[],k={},l={},q=0;q<a.length;q++){var v=a[q];if(v)if(c[v]||e[v])l[v]=this.get(v);else{var f=this.getFilePath(v);g.push(f);f in k||(k[f]=
  350. []);k[f].push(v)}}CKEDITOR.scriptLoader.load(g,function(a,e){if(e.length)throw Error('[CKEDITOR.resourceManager.load] Resource name "'+k[e[0]].join(",")+'" was not found at "'+e[0]+'".');for(var f=0;f<a.length;f++)for(var g=k[a[f]],n=0;n<g.length;n++){var w=g[n];l[w]=this.get(w);c[w]=1}d.call(b,l)},this)}};CKEDITOR.plugins=new CKEDITOR.resourceManager("plugins/","plugin");
  351. CKEDITOR.plugins.load=CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){var d={};return function(b,c,e){var g={},k=function(b){a.call(this,b,function(a){CKEDITOR.tools.extend(g,a);var b=[],f;for(f in a){var l=a[f],A=l&&l.requires;if(!d[f]){if(l.icons)for(var r=l.icons.split(","),D=r.length;D--;)CKEDITOR.skin.addIcon(r[D],l.path+"icons/"+(CKEDITOR.env.hidpi&&l.hidpi?"hidpi/":"")+r[D]+".png");d[f]=1}if(A)for(A.split&&(A=A.split(",")),l=0;l<A.length;l++)g[A[l]]||b.push(A[l])}if(b.length)k.call(this,
  352. b);else{for(f in g)l=g[f],l.onLoad&&!l.onLoad._called&&(!1===l.onLoad()&&delete g[f],l.onLoad._called=1);c&&c.call(e||window,g)}},this)};k.call(this,b)}});CKEDITOR.plugins.setLang=function(a,d,b){var c=this.get(a);a=c.langEntries||(c.langEntries={});c=c.lang||(c.lang=[]);c.split&&(c=c.split(","));-1==CKEDITOR.tools.indexOf(c,d)&&c.push(d);a[d]=b};CKEDITOR.ui=function(a){if(a.ui)return a.ui;this.items={};this.instances={};this.editor=a;this._={handlers:{}};return this};
  353. CKEDITOR.ui.prototype={add:function(a,d,b){b.name=a.toLowerCase();var c=this.items[a]={type:d,command:b.command||null,args:Array.prototype.slice.call(arguments,2)};CKEDITOR.tools.extend(c,b)},get:function(a){return this.instances[a]},create:function(a){var d=this.items[a],b=d&&this._.handlers[d.type],c=d&&d.command&&this.editor.getCommand(d.command),b=b&&b.create.apply(this,d.args);this.instances[a]=b;c&&c.uiItems.push(b);b&&!b.type&&(b.type=d.type);return b},addHandler:function(a,d){this._.handlers[a]=
  354. d},space:function(a){return CKEDITOR.document.getById(this.spaceId(a))},spaceId:function(a){return this.editor.id+"_"+a}};CKEDITOR.event.implementOn(CKEDITOR.ui);
  355. (function(){function a(a,e,f){CKEDITOR.event.call(this);a=a&&CKEDITOR.tools.clone(a);if(void 0!==e){if(!(e instanceof CKEDITOR.dom.element))throw Error("Expect element of type CKEDITOR.dom.element.");if(!f)throw Error("One of the element modes must be specified.");if(CKEDITOR.env.ie&&CKEDITOR.env.quirks&&f==CKEDITOR.ELEMENT_MODE_INLINE)throw Error("Inline element mode is not supported on IE quirks.");if(!b(e,f))throw Error('The specified element mode is not supported on element: "'+e.getName()+'".');
  356. this.element=e;this.elementMode=f;this.name=this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO&&(e.getId()||e.getNameAtt())}else this.elementMode=CKEDITOR.ELEMENT_MODE_NONE;this._={};this.commands={};this.templates={};this.name=this.name||d();this.id=CKEDITOR.tools.getNextId();this.status="unloaded";this.config=CKEDITOR.tools.prototypedCopy(CKEDITOR.config);this.ui=new CKEDITOR.ui(this);this.focusManager=new CKEDITOR.focusManager(this);this.keystrokeHandler=new CKEDITOR.keystrokeHandler(this);this.on("readOnly",
  357. c);this.on("selectionChange",function(a){g(this,a.data.path)});this.on("activeFilterChange",function(){g(this,this.elementPath(),!0)});this.on("mode",c);this.on("instanceReady",function(){this.config.startupFocus&&this.focus()});CKEDITOR.fire("instanceCreated",null,this);CKEDITOR.add(this);CKEDITOR.tools.setTimeout(function(){"destroyed"!==this.status?l(this,a):CKEDITOR.warn("editor-incorrect-destroy")},0,this)}function d(){do var a="editor"+ ++r;while(CKEDITOR.instances[a]);return a}function b(a,
  358. b){return b==CKEDITOR.ELEMENT_MODE_INLINE?a.is(CKEDITOR.dtd.$editable)||a.is("textarea"):b==CKEDITOR.ELEMENT_MODE_REPLACE?!a.is(CKEDITOR.dtd.$nonBodyContent):1}function c(){var a=this.commands,b;for(b in a)e(this,a[b])}function e(a,b){b[b.startDisabled?"disable":a.readOnly&&!b.readOnly?"disable":b.modes[a.mode]?"enable":"disable"]()}function g(a,b,c){if(b){var d,e,h=a.commands;for(e in h)d=h[e],(c||d.contextSensitive)&&d.refresh(a,b)}}function k(a){var b=a.config.customConfig;if(!b)return!1;var b=
  359. CKEDITOR.getUrl(b),c=D[b]||(D[b]={});c.fn?(c.fn.call(a,a.config),CKEDITOR.getUrl(a.config.customConfig)!=b&&k(a)||a.fireOnce("customConfigLoaded")):CKEDITOR.scriptLoader.queue(b,function(){c.fn=CKEDITOR.editorConfig?CKEDITOR.editorConfig:function(){};k(a)});return!0}function l(a,b){a.on("customConfigLoaded",function(){if(b){if(b.on)for(var c in b.on)a.on(c,b.on[c]);CKEDITOR.tools.extend(a.config,b,!0);delete a.config.on}c=a.config;a.readOnly=c.readOnly?!0:a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?
  360. a.element.is("textarea")?a.element.hasAttribute("disabled")||a.element.hasAttribute("readonly"):a.element.isReadOnly():a.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?a.element.hasAttribute("disabled")||a.element.hasAttribute("readonly"):!1;a.blockless=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?!(a.element.is("textarea")||CKEDITOR.dtd[a.element.getName()].p):!1;a.tabIndex=c.tabIndex||a.element&&a.element.getAttribute("tabindex")||0;a.activeEnterMode=a.enterMode=a.blockless?CKEDITOR.ENTER_BR:c.enterMode;
  361. a.activeShiftEnterMode=a.shiftEnterMode=a.blockless?CKEDITOR.ENTER_BR:c.shiftEnterMode;c.skin&&(CKEDITOR.skinName=c.skin);a.fireOnce("configLoaded");a.dataProcessor=new CKEDITOR.htmlDataProcessor(a);a.filter=a.activeFilter=new CKEDITOR.filter(a);q(a)});b&&null!=b.customConfig&&(a.config.customConfig=b.customConfig);k(a)||a.fireOnce("customConfigLoaded")}function q(a){CKEDITOR.skin.loadPart("editor",function(){v(a)})}function v(a){CKEDITOR.lang.load(a.config.language,a.config.defaultLanguage,function(b,
  362. c){var d=a.config.title;a.langCode=b;a.lang=CKEDITOR.tools.prototypedCopy(c);a.title="string"==typeof d||!1===d?d:[a.lang.editor,a.name].join(", ");a.config.contentsLangDirection||(a.config.contentsLangDirection=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.getDirection(1):a.lang.dir);a.fire("langLoaded");f(a)})}function f(a){a.getStylesSet(function(b){a.once("loaded",function(){a.fire("stylesSet",{styles:b})},null,null,1);y(a)})}function y(a){var b=a.config,c=b.plugins,d=b.extraPlugins,e=
  363. b.removePlugins;if(d)var h=new RegExp("(?:^|,)(?:"+d.replace(/\s*,\s*/g,"|")+")(?\x3d,|$)","g"),c=c.replace(h,""),c=c+(","+d);if(e)var p=new RegExp("(?:^|,)(?:"+e.replace(/\s*,\s*/g,"|")+")(?\x3d,|$)","g"),c=c.replace(p,"");CKEDITOR.env.air&&(c+=",adobeair");CKEDITOR.plugins.load(c.split(","),function(c){var d=[],h=[],e=[];a.plugins=c;for(var f in c){var g=c[f],t=g.lang,k=null,l=g.requires,q;CKEDITOR.tools.isArray(l)&&(l=l.join(","));if(l&&(q=l.match(p)))for(;l=q.pop();)CKEDITOR.error("editor-plugin-required",
  364. {plugin:l.replace(",",""),requiredBy:f});t&&!a.lang[f]&&(t.split&&(t=t.split(",")),0<=CKEDITOR.tools.indexOf(t,a.langCode)?k=a.langCode:(k=a.langCode.replace(/-.*/,""),k=k!=a.langCode&&0<=CKEDITOR.tools.indexOf(t,k)?k:0<=CKEDITOR.tools.indexOf(t,"en")?"en":t[0]),g.langEntries&&g.langEntries[k]?(a.lang[f]=g.langEntries[k],k=null):e.push(CKEDITOR.getUrl(g.path+"lang/"+k+".js")));h.push(k);d.push(g)}CKEDITOR.scriptLoader.load(e,function(){for(var c=["beforeInit","init","afterInit"],e=0;e<c.length;e++)for(var p=
  365. 0;p<d.length;p++){var m=d[p];0===e&&h[p]&&m.lang&&m.langEntries&&(a.lang[m.name]=m.langEntries[h[p]]);if(m[c[e]])m[c[e]](a)}a.fireOnce("pluginsLoaded");b.keystrokes&&a.setKeystroke(a.config.keystrokes);for(p=0;p<a.config.blockedKeystrokes.length;p++)a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[p]]=1;a.status="loaded";a.fireOnce("loaded");CKEDITOR.fire("instanceLoaded",null,a)})})}function A(){var a=this.element;if(a&&this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO){var b=this.getData();
  366. this.config.htmlEncodeOutput&&(b=CKEDITOR.tools.htmlEncode(b));a.is("textarea")?a.setValue(b):a.setHtml(b);return!0}return!1}a.prototype=CKEDITOR.editor.prototype;CKEDITOR.editor=a;var r=0,D={};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{addCommand:function(a,b){b.name=a.toLowerCase();var c=new CKEDITOR.command(this,b);this.mode&&e(this,c);return this.commands[a]=c},_attachToForm:function(){function a(b){c.updateElement();c._.required&&!d.getValue()&&!1===c.fire("required")&&b.data.preventDefault()}
  367. function b(a){return!!(a&&a.call&&a.apply)}var c=this,d=c.element,e=new CKEDITOR.dom.element(d.$.form);d.is("textarea")&&e&&(e.on("submit",a),b(e.$.submit)&&(e.$.submit=CKEDITOR.tools.override(e.$.submit,function(b){return function(){a();b.apply?b.apply(this):b()}})),c.on("destroy",function(){e.removeListener("submit",a)}))},destroy:function(a){this.fire("beforeDestroy");!a&&A.call(this);this.editable(null);this.filter&&(this.filter.destroy(),delete this.filter);delete this.activeFilter;this.status=
  368. "destroyed";this.fire("destroy");this.removeAllListeners();CKEDITOR.remove(this);CKEDITOR.fire("instanceDestroyed",null,this)},elementPath:function(a){if(!a){a=this.getSelection();if(!a)return null;a=a.getStartElement()}return a?new CKEDITOR.dom.elementPath(a,this.editable()):null},createRange:function(){var a=this.editable();return a?new CKEDITOR.dom.range(a):null},execCommand:function(a,b){var c=this.getCommand(a),d={name:a,commandData:b,command:c};return c&&c.state!=CKEDITOR.TRISTATE_DISABLED&&
  369. !1!==this.fire("beforeCommandExec",d)&&(d.returnValue=c.exec(d.commandData),!c.async&&!1!==this.fire("afterCommandExec",d))?d.returnValue:!1},getCommand:function(a){return this.commands[a]},getData:function(a){!a&&this.fire("beforeGetData");var b=this._.data;"string"!=typeof b&&(b=(b=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?b.is("textarea")?b.getValue():b.getHtml():"");b={dataValue:b};!a&&this.fire("getData",b);return b.dataValue},getSnapshot:function(){var a=this.fire("getSnapshot");
  370. "string"!=typeof a&&(a=(a=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?a.is("textarea")?a.getValue():a.getHtml():"");return a},loadSnapshot:function(a){this.fire("loadSnapshot",a)},setData:function(a,b,c){var d=!0,e=b;b&&"object"==typeof b&&(c=b.internal,e=b.callback,d=!b.noSnapshot);!c&&d&&this.fire("saveSnapshot");if(e||!c)this.once("dataReady",function(a){!c&&d&&this.fire("saveSnapshot");e&&e.call(a.editor)});a={dataValue:a};!c&&this.fire("setData",a);this._.data=a.dataValue;
  371. !c&&this.fire("afterSetData",a)},setReadOnly:function(a){a=null==a||a;this.readOnly!=a&&(this.readOnly=a,this.keystrokeHandler.blockedKeystrokes[8]=+a,this.editable().setReadOnly(a),this.fire("readOnly"))},insertHtml:function(a,b,c){this.fire("insertHtml",{dataValue:a,mode:b,range:c})},insertText:function(a){this.fire("insertText",a)},insertElement:function(a){this.fire("insertElement",a)},getSelectedHtml:function(a){var b=this.editable(),c=this.getSelection(),c=c&&c.getRanges();if(!b||!c||0===c.length)return null;
  372. for(var d=new CKEDITOR.dom.documentFragment,e,h,p,m=0;m<c.length;m++){var f=c[m],g=f.startContainer;g.getName&&"tr"==g.getName()?(e||(e=g.getAscendant("table").clone(),e.append(g.getAscendant("tbody").clone()),d.append(e),e=e.findOne("tbody")),h&&h.equals(g)||(h=g,p=g.clone(),e.append(p)),p.append(f.cloneContents())):d.append(f.cloneContents())}b=e?d:b.getHtmlFromRange(c[0]);return a?b.getHtml():b},extractSelectedHtml:function(a,b){var c=this.editable(),d=this.getSelection().getRanges();if(!c||0===
  373. d.length)return null;d=d[0];c=c.extractHtmlFromRange(d,b);b||this.getSelection().selectRanges([d]);return a?c.getHtml():c},focus:function(){this.fire("beforeFocus")},checkDirty:function(){return"ready"==this.status&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){this._.previousValue=this.getSnapshot()},updateElement:function(){return A.call(this)},setKeystroke:function(){for(var a=this.keystrokeHandler.keystrokes,b=CKEDITOR.tools.isArray(arguments[0])?arguments[0]:[[].slice.call(arguments,
  374. 0)],c,d,e=b.length;e--;)c=b[e],d=0,CKEDITOR.tools.isArray(c)&&(d=c[1],c=c[0]),d?a[c]=d:delete a[c]},addFeature:function(a){return this.filter.addFeature(a)},setActiveFilter:function(a){a||(a=this.filter);this.activeFilter!==a&&(this.activeFilter=a,this.fire("activeFilterChange"),a===this.filter?this.setActiveEnterMode(null,null):this.setActiveEnterMode(a.getAllowedEnterMode(this.enterMode),a.getAllowedEnterMode(this.shiftEnterMode,!0)))},setActiveEnterMode:function(a,b){a=a?this.blockless?CKEDITOR.ENTER_BR:
  375. a:this.enterMode;b=b?this.blockless?CKEDITOR.ENTER_BR:b:this.shiftEnterMode;if(this.activeEnterMode!=a||this.activeShiftEnterMode!=b)this.activeEnterMode=a,this.activeShiftEnterMode=b,this.fire("activeEnterModeChange")},showNotification:function(a){alert(a)}})})();CKEDITOR.ELEMENT_MODE_NONE=0;CKEDITOR.ELEMENT_MODE_REPLACE=1;CKEDITOR.ELEMENT_MODE_APPENDTO=2;CKEDITOR.ELEMENT_MODE_INLINE=3;CKEDITOR.htmlParser=function(){this._={htmlPartsRegex:/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}};
  376. (function(){var a=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,d={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(b){for(var c,e,g=0,k;c=this._.htmlPartsRegex.exec(b);){e=c.index;if(e>g)if(g=b.substring(g,e),k)k.push(g);else this.onText(g);
  377. g=this._.htmlPartsRegex.lastIndex;if(e=c[1])if(e=e.toLowerCase(),k&&CKEDITOR.dtd.$cdata[e]&&(this.onCDATA(k.join("")),k=null),!k){this.onTagClose(e);continue}if(k)k.push(c[0]);else if(e=c[3]){if(e=e.toLowerCase(),!/="/.test(e)){var l={},q,v=c[4];c=!!c[5];if(v)for(;q=a.exec(v);){var f=q[1].toLowerCase();q=q[2]||q[3]||q[4]||"";l[f]=!q&&d[f]?f:CKEDITOR.tools.htmlDecodeAttr(q)}this.onTagOpen(e,l,c);!k&&CKEDITOR.dtd.$cdata[e]&&(k=[])}}else if(e=c[2])this.onComment(e)}if(b.length>g)this.onText(b.substring(g,
  378. b.length))}}})();
  379. CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._={output:[]}},proto:{openTag:function(a){this._.output.push("\x3c",a)},openTagClose:function(a,d){d?this._.output.push(" /\x3e"):this._.output.push("\x3e")},attribute:function(a,d){"string"==typeof d&&(d=CKEDITOR.tools.htmlEncodeAttr(d));this._.output.push(" ",a,'\x3d"',d,'"')},closeTag:function(a){this._.output.push("\x3c/",a,"\x3e")},text:function(a){this._.output.push(a)},comment:function(a){this._.output.push("\x3c!--",a,
  380. "--\x3e")},write:function(a){this._.output.push(a)},reset:function(){this._.output=[];this._.indent=!1},getHtml:function(a){var d=this._.output.join("");a&&this.reset();return d}}});"use strict";
  381. (function(){CKEDITOR.htmlParser.node=function(){};CKEDITOR.htmlParser.node.prototype={remove:function(){var a=this.parent.children,d=CKEDITOR.tools.indexOf(a,this),b=this.previous,c=this.next;b&&(b.next=c);c&&(c.previous=b);a.splice(d,1);this.parent=null},replaceWith:function(a){var d=this.parent.children,b=CKEDITOR.tools.indexOf(d,this),c=a.previous=this.previous,e=a.next=this.next;c&&(c.next=a);e&&(e.previous=a);d[b]=a;a.parent=this.parent;this.parent=null},insertAfter:function(a){var d=a.parent.children,
  382. b=CKEDITOR.tools.indexOf(d,a),c=a.next;d.splice(b+1,0,this);this.next=a.next;this.previous=a;a.next=this;c&&(c.previous=this);this.parent=a.parent},insertBefore:function(a){var d=a.parent.children,b=CKEDITOR.tools.indexOf(d,a);d.splice(b,0,this);this.next=a;(this.previous=a.previous)&&(a.previous.next=this);a.previous=this;this.parent=a.parent},getAscendant:function(a){var d="function"==typeof a?a:"string"==typeof a?function(b){return b.name==a}:function(b){return b.name in a},b=this.parent;for(;b&&
  383. b.type==CKEDITOR.NODE_ELEMENT;){if(d(b))return b;b=b.parent}return null},wrapWith:function(a){this.replaceWith(a);a.add(this);return a},getIndex:function(){return CKEDITOR.tools.indexOf(this.parent.children,this)},getFilterContext:function(a){return a||{}}}})();"use strict";CKEDITOR.htmlParser.comment=function(a){this.value=a;this._={isBlockLike:!1}};
  384. CKEDITOR.htmlParser.comment.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_COMMENT,filter:function(a,d){var b=this.value;if(!(b=a.onComment(d,b,this)))return this.remove(),!1;if("string"!=typeof b)return this.replaceWith(b),!1;this.value=b;return!0},writeHtml:function(a,d){d&&this.filter(d);a.comment(this.value)}});"use strict";
  385. (function(){CKEDITOR.htmlParser.text=function(a){this.value=a;this._={isBlockLike:!1}};CKEDITOR.htmlParser.text.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(a,d){if(!(this.value=a.onText(d,this.value,this)))return this.remove(),!1},writeHtml:function(a,d){d&&this.filter(d);a.text(this.value)}})})();"use strict";
  386. (function(){CKEDITOR.htmlParser.cdata=function(a){this.value=a};CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(){},writeHtml:function(a){a.write(this.value)}})})();"use strict";CKEDITOR.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:!0,hasInlineStarted:!1}};
  387. (function(){function a(a){return a.attributes["data-cke-survive"]?!1:"a"==a.name&&a.attributes.href||CKEDITOR.dtd.$removeEmpty[a.name]}var d=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),b={ol:1,ul:1},c=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),e={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml=
  388. function(g,k,l){function q(a){var b;if(0<w.length)for(var c=0;c<w.length;c++){var d=w[c],h=d.name,e=CKEDITOR.dtd[h],f=u.name&&CKEDITOR.dtd[u.name];f&&!f[h]||a&&e&&!e[a]&&CKEDITOR.dtd[a]?h==u.name&&(y(u,u.parent,1),c--):(b||(v(),b=1),d=d.clone(),d.parent=u,u=d,w.splice(c,1),c--)}}function v(){for(;H.length;)y(H.shift(),u)}function f(a){if(a._.isBlockLike&&"pre"!=a.name&&"textarea"!=a.name){var b=a.children.length,c=a.children[b-1],d;c&&c.type==CKEDITOR.NODE_TEXT&&((d=CKEDITOR.tools.rtrim(c.value))?
  389. c.value=d:a.children.length=b-1)}}function y(b,c,d){c=c||u||n;var e=u;void 0===b.previous&&(A(c,b)&&(u=c,D.onTagOpen(l,{}),b.returnPoint=c=u),f(b),a(b)&&!b.children.length||c.add(b),"pre"==b.name&&(h=!1),"textarea"==b.name&&(t=!1));b.returnPoint?(u=b.returnPoint,delete b.returnPoint):u=d?c:e}function A(a,b){if((a==n||"body"==a.name)&&l&&(!a.name||CKEDITOR.dtd[a.name][l])){var c,d;return(c=b.attributes&&(d=b.attributes["data-cke-real-element-type"])?d:b.name)&&c in CKEDITOR.dtd.$inline&&!(c in CKEDITOR.dtd.head)&&
  390. !b.isOrphan||b.type==CKEDITOR.NODE_TEXT}}function r(a,b){return a in CKEDITOR.dtd.$listItem||a in CKEDITOR.dtd.$tableContent?a==b||"dt"==a&&"dd"==b||"dd"==a&&"dt"==b:!1}var D=new CKEDITOR.htmlParser,n=k instanceof CKEDITOR.htmlParser.element?k:"string"==typeof k?new CKEDITOR.htmlParser.element(k):new CKEDITOR.htmlParser.fragment,w=[],H=[],u=n,t="textarea"==n.name,h="pre"==n.name;D.onTagOpen=function(e,m,f,g){m=new CKEDITOR.htmlParser.element(e,m);m.isUnknown&&f&&(m.isEmpty=!0);m.isOptionalClose=g;
  391. if(a(m))w.push(m);else{if("pre"==e)h=!0;else{if("br"==e&&h){u.add(new CKEDITOR.htmlParser.text("\n"));return}"textarea"==e&&(t=!0)}if("br"==e)H.push(m);else{for(;!(g=(f=u.name)?CKEDITOR.dtd[f]||(u._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):c,m.isUnknown||u.isUnknown||g[e]);)if(u.isOptionalClose)D.onTagClose(f);else if(e in b&&f in b)f=u.children,(f=f[f.length-1])&&"li"==f.name||y(f=new CKEDITOR.htmlParser.element("li"),u),!m.returnPoint&&(m.returnPoint=u),u=f;else if(e in CKEDITOR.dtd.$listItem&&
  392. !r(e,f))D.onTagOpen("li"==e?"ul":"dl",{},0,1);else if(f in d&&!r(e,f))!m.returnPoint&&(m.returnPoint=u),u=u.parent;else if(f in CKEDITOR.dtd.$inline&&w.unshift(u),u.parent)y(u,u.parent,1);else{m.isOrphan=1;break}q(e);v();m.parent=u;m.isEmpty?y(m):u=m}}};D.onTagClose=function(a){for(var b=w.length-1;0<=b;b--)if(a==w[b].name){w.splice(b,1);return}for(var c=[],d=[],h=u;h!=n&&h.name!=a;)h._.isBlockLike||d.unshift(h),c.push(h),h=h.returnPoint||h.parent;if(h!=n){for(b=0;b<c.length;b++){var e=c[b];y(e,e.parent)}u=
  393. h;h._.isBlockLike&&v();y(h,h.parent);h==u&&(u=u.parent);w=w.concat(d)}"body"==a&&(l=!1)};D.onText=function(a){if(!(u._.hasInlineStarted&&!H.length||h||t)&&(a=CKEDITOR.tools.ltrim(a),0===a.length))return;var b=u.name,f=b?CKEDITOR.dtd[b]||(u._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):c;if(!t&&!f["#"]&&b in d)D.onTagOpen(e[b]||""),D.onText(a);else{v();q();h||t||(a=a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," "));a=new CKEDITOR.htmlParser.text(a);if(A(u,a))this.onTagOpen(l,{},0,1);u.add(a)}};D.onCDATA=
  394. function(a){u.add(new CKEDITOR.htmlParser.cdata(a))};D.onComment=function(a){v();q();u.add(new CKEDITOR.htmlParser.comment(a))};D.parse(g);for(v();u!=n;)y(u,u.parent,1);f(n);return n};CKEDITOR.htmlParser.fragment.prototype={type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,add:function(a,b){isNaN(b)&&(b=this.children.length);var c=0<b?this.children[b-1]:null;if(c){if(a._.isBlockLike&&c.type==CKEDITOR.NODE_TEXT&&(c.value=CKEDITOR.tools.rtrim(c.value),0===c.value.length)){this.children.pop();this.add(a);return}c.next=
  395. a}a.previous=c;a.parent=this;this.children.splice(b,0,a);this._.hasInlineStarted||(this._.hasInlineStarted=a.type==CKEDITOR.NODE_TEXT||a.type==CKEDITOR.NODE_ELEMENT&&!a._.isBlockLike)},filter:function(a,b){b=this.getFilterContext(b);a.onRoot(b,this);this.filterChildren(a,!1,b)},filterChildren:function(a,b,c){if(this.childrenFilteredBy!=a.id){c=this.getFilterContext(c);if(b&&!this.parent)a.onRoot(c,this);this.childrenFilteredBy=a.id;for(b=0;b<this.children.length;b++)!1===this.children[b].filter(a,
  396. c)&&b--}},writeHtml:function(a,b){b&&this.filter(b);this.writeChildrenHtml(a)},writeChildrenHtml:function(a,b,c){var d=this.getFilterContext();if(c&&!this.parent&&b)b.onRoot(d,this);b&&this.filterChildren(b,!1,d);b=0;c=this.children;for(d=c.length;b<d;b++)c[b].writeHtml(a)},forEach:function(a,b,c){if(!(c||b&&this.type!=b))var d=a(this);if(!1!==d){c=this.children;for(var e=0;e<c.length;e++)d=c[e],d.type==CKEDITOR.NODE_ELEMENT?d.forEach(a,b):b&&d.type!=b||a(d)}},getFilterContext:function(a){return a||
  397. {}}}})();"use strict";
  398. (function(){function a(){this.rules=[]}function d(b,c,d,g){var k,l;for(k in c)(l=b[k])||(l=b[k]=new a),l.add(c[k],d,g)}CKEDITOR.htmlParser.filter=CKEDITOR.tools.createClass({$:function(b){this.id=CKEDITOR.tools.getNextNumber();this.elementNameRules=new a;this.attributeNameRules=new a;this.elementsRules={};this.attributesRules={};this.textRules=new a;this.commentRules=new a;this.rootRules=new a;b&&this.addRules(b,10)},proto:{addRules:function(a,c){var e;"number"==typeof c?e=c:c&&"priority"in c&&(e=
  399. c.priority);"number"!=typeof e&&(e=10);"object"!=typeof c&&(c={});a.elementNames&&this.elementNameRules.addMany(a.elementNames,e,c);a.attributeNames&&this.attributeNameRules.addMany(a.attributeNames,e,c);a.elements&&d(this.elementsRules,a.elements,e,c);a.attributes&&d(this.attributesRules,a.attributes,e,c);a.text&&this.textRules.add(a.text,e,c);a.comment&&this.commentRules.add(a.comment,e,c);a.root&&this.rootRules.add(a.root,e,c)},applyTo:function(a){a.filter(this)},onElementName:function(a,c){return this.elementNameRules.execOnName(a,
  400. c)},onAttributeName:function(a,c){return this.attributeNameRules.execOnName(a,c)},onText:function(a,c,d){return this.textRules.exec(a,c,d)},onComment:function(a,c,d){return this.commentRules.exec(a,c,d)},onRoot:function(a,c){return this.rootRules.exec(a,c)},onElement:function(a,c){for(var d=[this.elementsRules["^"],this.elementsRules[c.name],this.elementsRules.$],g,k=0;3>k;k++)if(g=d[k]){g=g.exec(a,c,this);if(!1===g)return null;if(g&&g!=c)return this.onNode(a,g);if(c.parent&&!c.name)break}return c},
  401. onNode:function(a,c){var d=c.type;return d==CKEDITOR.NODE_ELEMENT?this.onElement(a,c):d==CKEDITOR.NODE_TEXT?new CKEDITOR.htmlParser.text(this.onText(a,c.value)):d==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(a,c.value)):null},onAttribute:function(a,c,d,g){return(d=this.attributesRules[d])?d.exec(a,g,c,this):g}}});CKEDITOR.htmlParser.filterRulesGroup=a;a.prototype={add:function(a,c,d){this.rules.splice(this.findIndex(c),0,{value:a,priority:c,options:d})},addMany:function(a,
  402. c,d){for(var g=[this.findIndex(c),0],k=0,l=a.length;k<l;k++)g.push({value:a[k],priority:c,options:d});this.rules.splice.apply(this.rules,g)},findIndex:function(a){for(var c=this.rules,d=c.length-1;0<=d&&a<c[d].priority;)d--;return d+1},exec:function(a,c){var d=c instanceof CKEDITOR.htmlParser.node||c instanceof CKEDITOR.htmlParser.fragment,g=Array.prototype.slice.call(arguments,1),k=this.rules,l=k.length,q,v,f,y;for(y=0;y<l;y++)if(d&&(q=c.type,v=c.name),f=k[y],!(a.nonEditable&&!f.options.applyToAll||
  403. a.nestedEditable&&f.options.excludeNestedEditable)){f=f.value.apply(null,g);if(!1===f||d&&f&&(f.name!=v||f.type!=q))return f;null!=f&&(g[0]=c=f)}return c},execOnName:function(a,c){for(var d=0,g=this.rules,k=g.length,l;c&&d<k;d++)l=g[d],a.nonEditable&&!l.options.applyToAll||a.nestedEditable&&l.options.excludeNestedEditable||(c=c.replace(l.value[0],l.value[1]));return c}}})();
  404. (function(){function a(a,d){function f(a){return a||CKEDITOR.env.needsNbspFiller?new CKEDITOR.htmlParser.text(" "):new CKEDITOR.htmlParser.element("br",{"data-cke-bogus":1})}function m(a,d){return function(h){if(h.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var e=[],m=b(h),t,G;if(m)for(p(m,1)&&e.push(m);m;)g(m)&&(t=c(m))&&p(t)&&((G=c(t))&&!g(G)?e.push(t):(f(x).insertAfter(t),t.remove())),m=m.previous;for(m=0;m<e.length;m++)e[m].remove();if(e=!a||!1!==("function"==typeof d?d(h):d))x||CKEDITOR.env.needsBrFiller||
  405. h.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT?x||CKEDITOR.env.needsBrFiller||!(7<document.documentMode||h.name in CKEDITOR.dtd.tr||h.name in CKEDITOR.dtd.$listItem)?(e=b(h),e=!e||"form"==h.name&&"input"==e.name):e=!1:e=!1;e&&h.add(f(a))}}}function p(a,b){if((!x||CKEDITOR.env.needsBrFiller)&&a.type==CKEDITOR.NODE_ELEMENT&&"br"==a.name&&!a.attributes["data-cke-eol"])return!0;var c;return a.type==CKEDITOR.NODE_TEXT&&(c=a.value.match(w))&&(c.index&&((new CKEDITOR.htmlParser.text(a.value.substring(0,c.index))).insertBefore(a),
  406. a.value=c[0]),!CKEDITOR.env.needsBrFiller&&x&&(!b||a.parent.name in F)||!x&&((c=a.previous)&&"br"==c.name||!c||g(c)))?!0:!1}var t={elements:{}},x="html"==d,F=CKEDITOR.tools.extend({},h),C;for(C in F)"#"in u[C]||delete F[C];for(C in F)t.elements[C]=m(x,a.config.fillEmptyBlocks);t.root=m(x,!1);t.elements.br=function(a){return function(b){if(b.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var d=b.attributes;if("data-cke-bogus"in d||"data-cke-eol"in d)delete d["data-cke-bogus"];else{for(d=b.next;d&&e(d);)d=
  407. d.next;var h=c(b);!d&&g(b.parent)?k(b.parent,f(a)):g(d)&&h&&!g(h)&&f(a).insertBefore(d)}}}}(x);return t}function d(a,b){return a!=CKEDITOR.ENTER_BR&&!1!==b?a==CKEDITOR.ENTER_DIV?"div":"p":!1}function b(a){for(a=a.children[a.children.length-1];a&&e(a);)a=a.previous;return a}function c(a){for(a=a.previous;a&&e(a);)a=a.previous;return a}function e(a){return a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(a.value)||a.type==CKEDITOR.NODE_ELEMENT&&a.attributes["data-cke-bookmark"]}function g(a){return a&&
  408. (a.type==CKEDITOR.NODE_ELEMENT&&a.name in h||a.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)}function k(a,b){var c=a.children[a.children.length-1];a.children.push(b);b.parent=a;c&&(c.next=b,b.previous=c)}function l(a){a=a.attributes;"false"!=a.contenteditable&&(a["data-cke-editable"]=a.contenteditable?"true":1);a.contenteditable="false"}function q(a){a=a.attributes;switch(a["data-cke-editable"]){case "true":a.contenteditable="true";break;case "1":delete a.contenteditable}}function v(a){return a.replace(F,
  409. function(a,b,c){return"\x3c"+b+c.replace(B,function(a,b){return E.test(b)&&-1==c.indexOf("data-cke-saved-"+b)?" data-cke-saved-"+a+" data-cke-"+CKEDITOR.rnd+"-"+a:a})+"\x3e"})}function f(a,b){return a.replace(b,function(a,b,c){0===a.indexOf("\x3ctextarea")&&(a=b+r(c).replace(/</g,"\x26lt;").replace(/>/g,"\x26gt;")+"\x3c/textarea\x3e");return"\x3ccke:encoded\x3e"+encodeURIComponent(a)+"\x3c/cke:encoded\x3e"})}function y(a){return a.replace(O,function(a,b){return decodeURIComponent(b)})}function A(a){return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g,
  410. function(a){return"\x3c!--"+H+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\x3e"})}function r(a){return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)})}function D(a,b){var c=b._.dataStore;return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)}).replace(/\{cke_protected_(\d+)\}/g,function(a,b){return c&&c[b]||""})}function n(a,b){var c=[],d=b.config.protectedSource,h=b._.dataStore||(b._.dataStore=
  411. {id:1}),e=/<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g,d=[/<script[\s\S]*?(<\/script>|$)/gi,/<noscript[\s\S]*?<\/noscript>/gi,/<meta[\s\S]*?\/?>/gi].concat(d);a=a.replace(/\x3c!--[\s\S]*?--\x3e/g,function(a){return"\x3c!--{cke_tempcomment}"+(c.push(a)-1)+"--\x3e"});for(var m=0;m<d.length;m++)a=a.replace(d[m],function(a){a=a.replace(e,function(a,b,d){return c[d]});return/cke_temp(comment)?/.test(a)?a:"\x3c!--{cke_temp}"+(c.push(a)-1)+"--\x3e"});a=a.replace(e,function(a,b,d){return"\x3c!--"+H+(b?"{C}":
  412. "")+encodeURIComponent(c[d]).replace(/--/g,"%2D%2D")+"--\x3e"});a=a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g,function(a){return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g,function(a,b){h[h.id]=decodeURIComponent(b);return"{cke_protected_"+h.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,c,d,h){return"\x3c"+c+d+"\x3e"+D(r(h),b)+"\x3c/"+c+"\x3e"})}CKEDITOR.htmlDataProcessor=function(b){var c,
  413. h,e=this;this.editor=b;this.dataFilter=c=new CKEDITOR.htmlParser.filter;this.htmlFilter=h=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;c.addRules(p);c.addRules(m,{applyToAll:!0});c.addRules(a(b,"data"),{applyToAll:!0});h.addRules(x);h.addRules(z,{applyToAll:!0});h.addRules(a(b,"html"),{applyToAll:!0});b.on("toHtml",function(a){a=a.data;var c=a.dataValue,h,c=n(c,b),c=f(c,P),c=v(c),c=f(c,Y),c=c.replace(N,"$1cke:$2"),c=c.replace(I,"\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"),
  414. c=c.replace(/(<pre\b[^>]*>)(\r\n|\n)/g,"$1$2$2"),c=c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+CKEDITOR.rnd+"-$2");h=a.context||b.editable().getName();var e;CKEDITOR.env.ie&&9>CKEDITOR.env.version&&"pre"==h&&(h="div",c="\x3cpre\x3e"+c+"\x3c/pre\x3e",e=1);h=b.document.createElement(h);h.setHtml("a"+c);c=h.getHtml().substr(1);c=c.replace(new RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");e&&(c=c.replace(/^<pre>|<\/pre>$/gi,""));c=c.replace(C,"$1$2");c=y(c);c=r(c);h=!1===a.fixForBody?!1:
  415. d(a.enterMode,b.config.autoParagraph);c=CKEDITOR.htmlParser.fragment.fromHtml(c,a.context,h);h&&(e=c,!e.children.length&&CKEDITOR.dtd[e.name][h]&&(h=new CKEDITOR.htmlParser.element(h),e.add(h)));a.dataValue=c},null,null,5);b.on("toHtml",function(a){a.data.filter.applyTo(a.data.dataValue,!0,a.data.dontFilter,a.data.enterMode)&&b.fire("dataFiltered")},null,null,6);b.on("toHtml",function(a){a.data.dataValue.filterChildren(e.dataFilter,!0)},null,null,10);b.on("toHtml",function(a){a=a.data;var b=a.dataValue,
  416. c=new CKEDITOR.htmlParser.basicWriter;b.writeChildrenHtml(c);b=c.getHtml(!0);a.dataValue=A(b)},null,null,15);b.on("toDataFormat",function(a){var c=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&(c=c.replace(/^<br *\/?>/i,""));a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(c,a.data.context,d(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(e.htmlFilter,!0)},null,null,10);b.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue,
  417. !1,!0)},null,null,11);b.on("toDataFormat",function(a){var c=a.data.dataValue,d=e.writer;d.reset();c.writeChildrenHtml(d);c=d.getHtml(!0);c=r(c);c=D(c,b);a.data.dataValue=c},null,null,15)};CKEDITOR.htmlDataProcessor.prototype={toHtml:function(a,b,c,d){var h=this.editor,e,m,f,p;b&&"object"==typeof b?(e=b.context,c=b.fixForBody,d=b.dontFilter,m=b.filter,f=b.enterMode,p=b.protectedWhitespaces):e=b;e||null===e||(e=h.editable().getName());return h.fire("toHtml",{dataValue:a,context:e,fixForBody:c,dontFilter:d,
  418. filter:m||h.filter,enterMode:f||h.enterMode,protectedWhitespaces:p}).dataValue},toDataFormat:function(a,b){var c,d,h;b&&(c=b.context,d=b.filter,h=b.enterMode);c||null===c||(c=this.editor.editable().getName());return this.editor.fire("toDataFormat",{dataValue:a,filter:d||this.editor.filter,context:c,enterMode:h||this.editor.enterMode}).dataValue}};var w=/(?:&nbsp;|\xa0)$/,H="{cke_protected}",u=CKEDITOR.dtd,t="caption colgroup col thead tfoot tbody".split(" "),h=CKEDITOR.tools.extend({},u.$blockLimit,
  419. u.$block),p={elements:{input:l,textarea:l}},m={attributeNames:[[/^on/,"data-cke-pa-on"],[/^data-cke-expando$/,""]]},x={elements:{embed:function(a){var b=a.parent;if(b&&"object"==b.name){var c=b.attributes.width,b=b.attributes.height;c&&(a.attributes.width=c);b&&(a.attributes.height=b)}},a:function(a){var b=a.attributes;if(!(a.children.length||b.name||b.id||a.attributes["data-cke-saved-name"]))return!1}}},z={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,
  420. ""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var b=a.attributes;if(b){if(b["data-cke-temp"])return!1;for(var c=["name","href","src"],d,h=0;h<c.length;h++)d="data-cke-saved-"+c[h],d in b&&delete b[c[h]]}return a},table:function(a){a.children.slice(0).sort(function(a,b){var c,d;a.type==CKEDITOR.NODE_ELEMENT&&b.type==a.type&&(c=CKEDITOR.tools.indexOf(t,a.name),d=CKEDITOR.tools.indexOf(t,b.name));-1<c&&-1<d&&c!=d||(c=a.parent?a.getIndex():-1,d=b.parent?b.getIndex():-1);return c>d?
  421. 1:-1})},param:function(a){a.children=[];a.isEmpty=!0;return a},span:function(a){"Apple-style-span"==a.attributes["class"]&&delete a.name},html:function(a){delete a.attributes.contenteditable;delete a.attributes["class"]},body:function(a){delete a.attributes.spellcheck;delete a.attributes.contenteditable},style:function(a){var b=a.children[0];b&&b.value&&(b.value=CKEDITOR.tools.trim(b.value));a.attributes.type||(a.attributes.type="text/css")},title:function(a){var b=a.children[0];!b&&k(a,b=new CKEDITOR.htmlParser.text);
  422. b.value=a.attributes["data-cke-title"]||""},input:q,textarea:q},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(z.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})});var F=/<(a|area|img|input|source)\b([^>]*)>/gi,B=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,E=/^(href|src|name)$/i,Y=/(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
  423. P=/(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,O=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,N=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,C=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,I=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi})();"use strict";
  424. CKEDITOR.htmlParser.element=function(a,d){this.name=a;this.attributes=d||{};this.children=[];var b=a||"",c=b.match(/^cke:(.*)/);c&&(b=c[1]);b=!!(CKEDITOR.dtd.$nonBodyContent[b]||CKEDITOR.dtd.$block[b]||CKEDITOR.dtd.$listItem[b]||CKEDITOR.dtd.$tableContent[b]||CKEDITOR.dtd.$nonEditable[b]||"br"==b);this.isEmpty=!!CKEDITOR.dtd.$empty[a];this.isUnknown=!CKEDITOR.dtd[a];this._={isBlockLike:b,hasInlineStarted:this.isEmpty||!b}};
  425. CKEDITOR.htmlParser.cssStyle=function(a){var d={};((a instanceof CKEDITOR.htmlParser.element?a.attributes.style:a)||"").replace(/&quot;/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,c,e){"font-family"==c&&(e=e.replace(/["']/g,""));d[c.toLowerCase()]=e});return{rules:d,populate:function(a){var c=this.toString();c&&(a instanceof CKEDITOR.dom.element?a.setAttribute("style",c):a instanceof CKEDITOR.htmlParser.element?a.attributes.style=c:a.style=c)},toString:function(){var a=[],c;
  426. for(c in d)d[c]&&a.push(c,":",d[c],";");return a.join("")}}};
  427. (function(){function a(a){return function(b){return b.type==CKEDITOR.NODE_ELEMENT&&("string"==typeof a?b.name==a:b.name in a)}}var d=function(a,b){a=a[0];b=b[0];return a<b?-1:a>b?1:0},b=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:b.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(a,b){var d=this,k,l;b=d.getFilterContext(b);if(b.off)return!0;
  428. if(!d.parent)a.onRoot(b,d);for(;;){k=d.name;if(!(l=a.onElementName(b,k)))return this.remove(),!1;d.name=l;if(!(d=a.onElement(b,d)))return this.remove(),!1;if(d!==this)return this.replaceWith(d),!1;if(d.name==k)break;if(d.type!=CKEDITOR.NODE_ELEMENT)return this.replaceWith(d),!1;if(!d.name)return this.replaceWithChildren(),!1}k=d.attributes;var q,v;for(q in k){for(l=k[q];;)if(v=a.onAttributeName(b,q))if(v!=q)delete k[q],q=v;else break;else{delete k[q];break}v&&(!1===(l=a.onAttribute(b,d,v,l))?delete k[v]:
  429. k[v]=l)}d.isEmpty||this.filterChildren(a,!1,b);return!0},filterChildren:b.filterChildren,writeHtml:function(a,b){b&&this.filter(b);var g=this.name,k=[],l=this.attributes,q,v;a.openTag(g,l);for(q in l)k.push([q,l[q]]);a.sortAttributes&&k.sort(d);q=0;for(v=k.length;q<v;q++)l=k[q],a.attribute(l[0],l[1]);a.openTagClose(g,this.isEmpty);this.writeChildrenHtml(a);this.isEmpty||a.closeTag(g)},writeChildrenHtml:b.writeChildrenHtml,replaceWithChildren:function(){for(var a=this.children,b=a.length;b;)a[--b].insertAfter(this);
  430. this.remove()},forEach:b.forEach,getFirst:function(b){if(!b)return this.children.length?this.children[0]:null;"function"!=typeof b&&(b=a(b));for(var d=0,g=this.children.length;d<g;++d)if(b(this.children[d]))return this.children[d];return null},getHtml:function(){var a=new CKEDITOR.htmlParser.basicWriter;this.writeChildrenHtml(a);return a.getHtml()},setHtml:function(a){a=this.children=CKEDITOR.htmlParser.fragment.fromHtml(a).children;for(var b=0,d=a.length;b<d;++b)a[b].parent=this},getOuterHtml:function(){var a=
  431. new CKEDITOR.htmlParser.basicWriter;this.writeHtml(a);return a.getHtml()},split:function(a){for(var b=this.children.splice(a,this.children.length-a),d=this.clone(),k=0;k<b.length;++k)b[k].parent=d;d.children=b;b[0]&&(b[0].previous=null);0<a&&(this.children[a-1].next=null);this.parent.add(d,this.getIndex()+1);return d},addClass:function(a){if(!this.hasClass(a)){var b=this.attributes["class"]||"";this.attributes["class"]=b+(b?" ":"")+a}},removeClass:function(a){var b=this.attributes["class"];b&&((b=
  432. CKEDITOR.tools.trim(b.replace(new RegExp("(?:\\s+|^)"+a+"(?:\\s+|$)")," ")))?this.attributes["class"]=b:delete this.attributes["class"])},hasClass:function(a){var b=this.attributes["class"];return b?(new RegExp("(?:^|\\s)"+a+"(?\x3d\\s|$)")).test(b):!1},getFilterContext:function(a){var b=[];a||(a={off:!1,nonEditable:!1,nestedEditable:!1});a.off||"off"!=this.attributes["data-cke-processor"]||b.push("off",!0);a.nonEditable||"false"!=this.attributes.contenteditable?a.nonEditable&&!a.nestedEditable&&
  433. "true"==this.attributes.contenteditable&&b.push("nestedEditable",!0):b.push("nonEditable",!0);if(b.length){a=CKEDITOR.tools.copy(a);for(var d=0;d<b.length;d+=2)a[b[d]]=b[d+1]}return a}},!0)})();
  434. (function(){var a={},d=/{([^}]+)}/g,b=/([\\'])/g,c=/\n/g,e=/\r/g;CKEDITOR.template=function(g){if(a[g])this.output=a[g];else{var k=g.replace(b,"\\$1").replace(c,"\\n").replace(e,"\\r").replace(d,function(a,b){return"',data['"+b+"']\x3d\x3dundefined?'{"+b+"}':data['"+b+"'],'"});this.output=a[g]=Function("data","buffer","return buffer?buffer.push('"+k+"'):['"+k+"'].join('');")}}})();delete CKEDITOR.loadFullCore;CKEDITOR.instances={};CKEDITOR.document=new CKEDITOR.dom.document(document);
  435. CKEDITOR.add=function(a){CKEDITOR.instances[a.name]=a;a.on("focus",function(){CKEDITOR.currentInstance!=a&&(CKEDITOR.currentInstance=a,CKEDITOR.fire("currentInstance"))});a.on("blur",function(){CKEDITOR.currentInstance==a&&(CKEDITOR.currentInstance=null,CKEDITOR.fire("currentInstance"))});CKEDITOR.fire("instance",null,a)};CKEDITOR.remove=function(a){delete CKEDITOR.instances[a.name]};
  436. (function(){var a={};CKEDITOR.addTemplate=function(d,b){var c=a[d];if(c)return c;c={name:d,source:b};CKEDITOR.fire("template",c);return a[d]=new CKEDITOR.template(c.source)};CKEDITOR.getTemplate=function(d){return a[d]}})();(function(){var a=[];CKEDITOR.addCss=function(d){a.push(d)};CKEDITOR.getCss=function(){return a.join("\n")}})();CKEDITOR.on("instanceDestroyed",function(){CKEDITOR.tools.isEmpty(this.instances)&&CKEDITOR.fire("reset")});CKEDITOR.TRISTATE_ON=1;CKEDITOR.TRISTATE_OFF=2;
  437. CKEDITOR.TRISTATE_DISABLED=0;
  438. (function(){CKEDITOR.inline=function(a,d){if(!CKEDITOR.env.isCompatible)return null;a=CKEDITOR.dom.element.get(a);if(a.getEditor())throw'The editor instance "'+a.getEditor().name+'" is already attached to the provided element.';var b=new CKEDITOR.editor(d,a,CKEDITOR.ELEMENT_MODE_INLINE),c=a.is("textarea")?a:null;c?(b.setData(c.getValue(),null,!0),a=CKEDITOR.dom.element.createFromHtml('\x3cdiv contenteditable\x3d"'+!!b.readOnly+'" class\x3d"cke_textarea_inline"\x3e'+c.getValue()+"\x3c/div\x3e",CKEDITOR.document),
  439. a.insertAfter(c),c.hide(),c.$.form&&b._attachToForm()):b.setData(a.getHtml(),null,!0);b.on("loaded",function(){b.fire("uiReady");b.editable(a);b.container=a;b.ui.contentsElement=a;b.setData(b.getData(1));b.resetDirty();b.fire("contentDom");b.mode="wysiwyg";b.fire("mode");b.status="ready";b.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,b)},null,null,1E4);b.on("destroy",function(){c&&(b.container.clearCustomData(),b.container.remove(),c.show());b.element.clearCustomData();delete b.element});
  440. return b};CKEDITOR.inlineAll=function(){var a,d,b;for(b in CKEDITOR.dtd.$editable)for(var c=CKEDITOR.document.getElementsByTag(b),e=0,g=c.count();e<g;e++)a=c.getItem(e),"true"==a.getAttribute("contenteditable")&&(d={element:a,config:{}},!1!==CKEDITOR.fire("inline",d)&&CKEDITOR.inline(a,d.config))};CKEDITOR.domReady(function(){!CKEDITOR.disableAutoInline&&CKEDITOR.inlineAll()})})();CKEDITOR.replaceClass="ckeditor";
  441. (function(){function a(a,e,g,k){if(!CKEDITOR.env.isCompatible)return null;a=CKEDITOR.dom.element.get(a);if(a.getEditor())throw'The editor instance "'+a.getEditor().name+'" is already attached to the provided element.';var l=new CKEDITOR.editor(e,a,k);k==CKEDITOR.ELEMENT_MODE_REPLACE&&(a.setStyle("visibility","hidden"),l._.required=a.hasAttribute("required"),a.removeAttribute("required"));g&&l.setData(g,null,!0);l.on("loaded",function(){b(l);k==CKEDITOR.ELEMENT_MODE_REPLACE&&l.config.autoUpdateElement&&
  442. a.$.form&&l._attachToForm();l.setMode(l.config.startupMode,function(){l.resetDirty();l.status="ready";l.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,l)})});l.on("destroy",d);return l}function d(){var a=this.container,b=this.element;a&&(a.clearCustomData(),a.remove());b&&(b.clearCustomData(),this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(b.show(),this._.required&&b.setAttribute("required","required")),delete this.element)}function b(a){var b=a.name,d=a.element,k=a.elementMode,l=
  443. a.fire("uiSpace",{space:"top",html:""}).html,q=a.fire("uiSpace",{space:"bottom",html:""}).html,v=new CKEDITOR.template('\x3c{outerEl} id\x3d"cke_{name}" class\x3d"{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} '+CKEDITOR.env.cssClass+'" dir\x3d"{langDir}" lang\x3d"{langCode}" role\x3d"application"'+(a.title?' aria-labelledby\x3d"cke_{name}_arialbl"':"")+"\x3e"+(a.title?'\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e':"")+'\x3c{outerEl} class\x3d"cke_inner cke_reset" role\x3d"presentation"\x3e{topHtml}\x3c{outerEl} id\x3d"{contentId}" class\x3d"cke_contents cke_reset" role\x3d"presentation"\x3e\x3c/{outerEl}\x3e{bottomHtml}\x3c/{outerEl}\x3e\x3c/{outerEl}\x3e'),
  444. b=CKEDITOR.dom.element.createFromHtml(v.output({id:a.id,name:b,langDir:a.lang.dir,langCode:a.langCode,voiceLabel:a.title,topHtml:l?'\x3cspan id\x3d"'+a.ui.spaceId("top")+'" class\x3d"cke_top cke_reset_all" role\x3d"presentation" style\x3d"height:auto"\x3e'+l+"\x3c/span\x3e":"",contentId:a.ui.spaceId("contents"),bottomHtml:q?'\x3cspan id\x3d"'+a.ui.spaceId("bottom")+'" class\x3d"cke_bottom cke_reset_all" role\x3d"presentation"\x3e'+q+"\x3c/span\x3e":"",outerEl:CKEDITOR.env.ie?"span":"div"}));k==CKEDITOR.ELEMENT_MODE_REPLACE?
  445. (d.hide(),b.insertAfter(d)):d.append(b);a.container=b;a.ui.contentsElement=a.ui.space("contents");l&&a.ui.space("top").unselectable();q&&a.ui.space("bottom").unselectable();d=a.config.width;k=a.config.height;d&&b.setStyle("width",CKEDITOR.tools.cssLength(d));k&&a.ui.space("contents").setStyle("height",CKEDITOR.tools.cssLength(k));b.disableContextMenu();CKEDITOR.env.webkit&&b.on("focus",function(){a.focus()});a.fireOnce("uiReady")}CKEDITOR.replace=function(b,d){return a(b,d,null,CKEDITOR.ELEMENT_MODE_REPLACE)};
  446. CKEDITOR.appendTo=function(b,d,g){return a(b,d,g,CKEDITOR.ELEMENT_MODE_APPENDTO)};CKEDITOR.replaceAll=function(){for(var a=document.getElementsByTagName("textarea"),b=0;b<a.length;b++){var d=null,k=a[b];if(k.name||k.id){if("string"==typeof arguments[0]){if(!(new RegExp("(?:^|\\s)"+arguments[0]+"(?:$|\\s)")).test(k.className))continue}else if("function"==typeof arguments[0]&&(d={},!1===arguments[0](k,d)))continue;this.replace(k,d)}}};CKEDITOR.editor.prototype.addMode=function(a,b){(this._.modes||(this._.modes=
  447. {}))[a]=b};CKEDITOR.editor.prototype.setMode=function(a,b){var d=this,k=this._.modes;if(a!=d.mode&&k&&k[a]){d.fire("beforeSetMode",a);if(d.mode){var l=d.checkDirty(),k=d._.previousModeData,q,v=0;d.fire("beforeModeUnload");d.editable(0);d._.previousMode=d.mode;d._.previousModeData=q=d.getData(1);"source"==d.mode&&k==q&&(d.fire("lockSnapshot",{forceUpdate:!0}),v=1);d.ui.space("contents").setHtml("");d.mode=""}else d._.previousModeData=d.getData(1);this._.modes[a](function(){d.mode=a;void 0!==l&&!l&&
  448. d.resetDirty();v?d.fire("unlockSnapshot"):"wysiwyg"==a&&d.fire("saveSnapshot");setTimeout(function(){d.fire("mode");b&&b.call(d)},0)})}};CKEDITOR.editor.prototype.resize=function(a,b,d,k){var l=this.container,q=this.ui.space("contents"),v=CKEDITOR.env.webkit&&this.document&&this.document.getWindow().$.frameElement;k=k?this.container.getFirst(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasClass("cke_inner")}):l;k.setSize("width",a,!0);v&&(v.style.width="1%");var f=(k.$.offsetHeight||0)-(q.$.clientHeight||
  449. 0),l=Math.max(b-(d?0:f),0);b=d?b+f:b;q.setStyle("height",l+"px");v&&(v.style.width="100%");this.fire("resize",{outerHeight:b,contentsHeight:l,outerWidth:a||k.getSize("width")})};CKEDITOR.editor.prototype.getResizable=function(a){return a?this.ui.space("contents"):this.container};CKEDITOR.domReady(function(){CKEDITOR.replaceClass&&CKEDITOR.replaceAll(CKEDITOR.replaceClass)})})();CKEDITOR.config.startupMode="wysiwyg";
  450. (function(){function a(a){var b=a.editor,e=a.data.path,m=e.blockLimit,f=a.data.selection,g=f.getRanges()[0],F;if(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)if(f=d(f,e))f.appendBogus(),F=CKEDITOR.env.ie;k(b,e.block,m)&&g.collapsed&&!g.getCommonAncestor().isReadOnly()&&(e=g.clone(),e.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS),m=new CKEDITOR.dom.walker(e),m.guard=function(a){return!c(a)||a.type==CKEDITOR.NODE_COMMENT||a.isReadOnly()},!m.checkForward()||e.checkStartOfBlock()&&e.checkEndOfBlock())&&
  451. (b=g.fixBlock(!0,b.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p"),CKEDITOR.env.needsBrFiller||(b=b.getFirst(c))&&b.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(b.getText()).match(/^(?:&nbsp;|\xa0)$/)&&b.remove(),F=1,a.cancel());F&&g.select()}function d(a,b){if(a.isFake)return 0;var d=b.block||b.blockLimit,e=d&&d.getLast(c);if(!(!d||!d.isBlockBoundary()||e&&e.type==CKEDITOR.NODE_ELEMENT&&e.isBlockBoundary()||d.is("pre")||d.getBogus()))return d}function b(a){var b=a.data.getTarget();b.is("input")&&
  452. (b=b.getAttribute("type"),"submit"!=b&&"reset"!=b||a.data.preventDefault())}function c(a){return f(a)&&y(a)}function e(a,b){return function(c){var d=c.data.$.toElement||c.data.$.fromElement||c.data.$.relatedTarget;(d=d&&d.nodeType==CKEDITOR.NODE_ELEMENT?new CKEDITOR.dom.element(d):null)&&(b.equals(d)||b.contains(d))||a.call(this,c)}}function g(a){function b(a){return function(b,h){h&&b.type==CKEDITOR.NODE_ELEMENT&&b.is(f)&&(d=b);if(!(h||!c(b)||a&&r(b)))return!1}}var d,e=a.getRanges()[0];a=a.root;
  453. var f={table:1,ul:1,ol:1,dl:1};if(e.startPath().contains(f)){var g=e.clone();g.collapse(1);g.setStartAt(a,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(g);a.guard=b();a.checkBackward();if(d)return g=e.clone(),g.collapse(),g.setEndAt(d,CKEDITOR.POSITION_AFTER_END),a=new CKEDITOR.dom.walker(g),a.guard=b(!0),d=!1,a.checkForward(),d}return null}function k(a,b,c){return!1!==a.config.autoParagraph&&a.activeEnterMode!=CKEDITOR.ENTER_BR&&(a.editable().equals(c)&&!b||b&&"true"==b.getAttribute("contenteditable"))}
  454. function l(a){return a.activeEnterMode!=CKEDITOR.ENTER_BR&&!1!==a.config.autoParagraph?a.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p":!1}function q(a){var b=a.editor;b.getSelection().scrollIntoView();setTimeout(function(){b.fire("saveSnapshot")},0)}function v(a,b,c){var d=a.getCommonAncestor(b);for(b=a=c?b:a;(a=a.getParent())&&!d.equals(a)&&1==a.getChildCount();)b=a;b.remove()}var f,y,A,r,D,n,w,H,u;CKEDITOR.editable=CKEDITOR.tools.createClass({base:CKEDITOR.dom.element,$:function(a,b){this.base(b.$||
  455. b);this.editor=a;this.status="unloaded";this.hasFocus=!1;this.setup()},proto:{focus:function(){var a;if(CKEDITOR.env.webkit&&!this.hasFocus&&(a=this.editor._.previousActive||this.getDocument().getActive(),this.contains(a))){a.focus();return}try{this.$[CKEDITOR.env.ie&&this.getDocument().equals(CKEDITOR.document)?"setActive":"focus"]()}catch(b){if(!CKEDITOR.env.ie)throw b;}CKEDITOR.env.safari&&!this.isInline()&&(a=CKEDITOR.document.getActive(),a.equals(this.getWindow().getFrame())||this.getWindow().focus())},
  456. on:function(a,b){var c=Array.prototype.slice.call(arguments,0);CKEDITOR.env.ie&&/^focus|blur$/.exec(a)&&(a="focus"==a?"focusin":"focusout",b=e(b,this),c[0]=a,c[1]=b);return CKEDITOR.dom.element.prototype.on.apply(this,c)},attachListener:function(a){!this._.listeners&&(this._.listeners=[]);var b=Array.prototype.slice.call(arguments,1),b=a.on.apply(a,b);this._.listeners.push(b);return b},clearListeners:function(){var a=this._.listeners;try{for(;a.length;)a.pop().removeListener()}catch(b){}},restoreAttrs:function(){var a=
  457. this._.attrChanges,b,c;for(c in a)a.hasOwnProperty(c)&&(b=a[c],null!==b?this.setAttribute(c,b):this.removeAttribute(c))},attachClass:function(a){var b=this.getCustomData("classes");this.hasClass(a)||(!b&&(b=[]),b.push(a),this.setCustomData("classes",b),this.addClass(a))},changeAttr:function(a,b){var c=this.getAttribute(a);b!==c&&(!this._.attrChanges&&(this._.attrChanges={}),a in this._.attrChanges||(this._.attrChanges[a]=c),this.setAttribute(a,b))},insertText:function(a){this.editor.focus();this.insertHtml(this.transformPlainTextToHtml(a),
  458. "text")},transformPlainTextToHtml:function(a){var b=this.editor.getSelection().getStartElement().hasAscendant("pre",!0)?CKEDITOR.ENTER_BR:this.editor.activeEnterMode;return CKEDITOR.tools.transformPlainTextToHtml(a,b)},insertHtml:function(a,b,c){var d=this.editor;d.focus();d.fire("saveSnapshot");c||(c=d.getSelection().getRanges()[0]);n(this,b||"html",a,c);c.select();q(this);this.editor.fire("afterInsertHtml",{})},insertHtmlIntoRange:function(a,b,c){n(this,c||"html",a,b);this.editor.fire("afterInsertHtml",
  459. {intoRange:b})},insertElement:function(a,b){var d=this.editor;d.focus();d.fire("saveSnapshot");var e=d.activeEnterMode,d=d.getSelection(),f=a.getName(),f=CKEDITOR.dtd.$block[f];b||(b=d.getRanges()[0]);this.insertElementIntoRange(a,b)&&(b.moveToPosition(a,CKEDITOR.POSITION_AFTER_END),f&&((f=a.getNext(function(a){return c(a)&&!r(a)}))&&f.type==CKEDITOR.NODE_ELEMENT&&f.is(CKEDITOR.dtd.$block)?f.getDtd()["#"]?b.moveToElementEditStart(f):b.moveToElementEditEnd(a):f||e==CKEDITOR.ENTER_BR||(f=b.fixBlock(!0,
  460. e==CKEDITOR.ENTER_DIV?"div":"p"),b.moveToElementEditStart(f))));d.selectRanges([b]);q(this)},insertElementIntoSelection:function(a){this.insertElement(a)},insertElementIntoRange:function(a,b){var c=this.editor,d=c.config.enterMode,e=a.getName(),f=CKEDITOR.dtd.$block[e];if(b.checkReadOnly())return!1;b.deleteContents(1);b.startContainer.type==CKEDITOR.NODE_ELEMENT&&b.startContainer.is({tr:1,table:1,tbody:1,thead:1,tfoot:1})&&w(b);var g,k;if(f)for(;(g=b.getCommonAncestor(0,1))&&(k=CKEDITOR.dtd[g.getName()])&&
  461. (!k||!k[e]);)g.getName()in CKEDITOR.dtd.span?b.splitElement(g):b.checkStartOfBlock()&&b.checkEndOfBlock()?(b.setStartBefore(g),b.collapse(!0),g.remove()):b.splitBlock(d==CKEDITOR.ENTER_DIV?"div":"p",c.editable());b.insertNode(a);return!0},setData:function(a,b){b||(a=this.editor.dataProcessor.toHtml(a));this.setHtml(a);this.fixInitialSelection();"unloaded"==this.status&&(this.status="ready");this.editor.fire("dataReady")},getData:function(a){var b=this.getHtml();a||(b=this.editor.dataProcessor.toDataFormat(b));
  462. return b},setReadOnly:function(a){this.setAttribute("contenteditable",!a)},detach:function(){this.removeClass("cke_editable");this.status="detached";var a=this.editor;this._.detach();delete a.document;delete a.window},isInline:function(){return this.getDocument().equals(CKEDITOR.document)},fixInitialSelection:function(){function a(){var b=c.getDocument().$,d=b.getSelection(),h;a:if(d.anchorNode&&d.anchorNode==c.$)h=!0;else{if(CKEDITOR.env.webkit&&(h=c.getDocument().getActive())&&h.equals(c)&&!d.anchorNode){h=
  463. !0;break a}h=void 0}h&&(h=new CKEDITOR.dom.range(c),h.moveToElementEditStart(c),b=b.createRange(),b.setStart(h.startContainer.$,h.startOffset),b.collapse(!0),d.removeAllRanges(),d.addRange(b))}function b(){var a=c.getDocument().$,d=a.selection,h=c.getDocument().getActive();"None"==d.type&&h.equals(c)&&(d=new CKEDITOR.dom.range(c),a=a.body.createTextRange(),d.moveToElementEditStart(c),d=d.startContainer,d.type!=CKEDITOR.NODE_ELEMENT&&(d=d.getParent()),a.moveToElementText(d.$),a.collapse(!0),a.select())}
  464. var c=this;if(CKEDITOR.env.ie&&(9>CKEDITOR.env.version||CKEDITOR.env.quirks))this.hasFocus&&(this.focus(),b());else if(this.hasFocus)this.focus(),a();else this.once("focus",function(){a()},null,null,-999)},getHtmlFromRange:function(a){if(a.collapsed)return new CKEDITOR.dom.documentFragment(a.document);a={doc:this.getDocument(),range:a.clone()};H.eol.detect(a,this);H.bogus.exclude(a);H.cell.shrink(a);a.fragment=a.range.cloneContents();H.tree.rebuild(a,this);H.eol.fix(a,this);return new CKEDITOR.dom.documentFragment(a.fragment.$)},
  465. extractHtmlFromRange:function(a,b){var c=u,d={range:a,doc:a.document},e=this.getHtmlFromRange(a);if(a.collapsed)return a.optimize(),e;a.enlarge(CKEDITOR.ENLARGE_INLINE,1);c.table.detectPurge(d);d.bookmark=a.createBookmark();delete d.range;var f=this.editor.createRange();f.moveToPosition(d.bookmark.startNode,CKEDITOR.POSITION_BEFORE_START);d.targetBookmark=f.createBookmark();c.list.detectMerge(d,this);c.table.detectRanges(d,this);c.block.detectMerge(d,this);d.tableContentsRanges?(c.table.deleteRanges(d),
  466. a.moveToBookmark(d.bookmark),d.range=a):(a.moveToBookmark(d.bookmark),d.range=a,a.extractContents(c.detectExtractMerge(d)));a.moveToBookmark(d.targetBookmark);a.optimize();c.fixUneditableRangePosition(a);c.list.merge(d,this);c.table.purge(d,this);c.block.merge(d,this);if(b){c=a.startPath();if(d=a.checkStartOfBlock()&&a.checkEndOfBlock()&&c.block&&!a.root.equals(c.block)){a:{var d=c.block.getElementsByTag("span"),f=0,g;if(d)for(;g=d.getItem(f++);)if(!y(g)){d=!0;break a}d=!1}d=!d}d&&(a.moveToPosition(c.block,
  467. CKEDITOR.POSITION_BEFORE_START),c.block.remove())}else c.autoParagraph(this.editor,a),A(a.startContainer)&&a.startContainer.appendBogus();a.startContainer.mergeSiblings();return e},setup:function(){var a=this.editor;this.attachListener(a,"beforeGetData",function(){var b=this.getData();this.is("textarea")||!1!==a.config.ignoreEmptyParagraph&&(b=b.replace(D,function(a,b){return b}));a.setData(b,null,1)},this);this.attachListener(a,"getSnapshot",function(a){a.data=this.getData(1)},this);this.attachListener(a,
  468. "afterSetData",function(){this.setData(a.getData(1))},this);this.attachListener(a,"loadSnapshot",function(a){this.setData(a.data,1)},this);this.attachListener(a,"beforeFocus",function(){var b=a.getSelection();(b=b&&b.getNative())&&"Control"==b.type||this.focus()},this);this.attachListener(a,"insertHtml",function(a){this.insertHtml(a.data.dataValue,a.data.mode,a.data.range)},this);this.attachListener(a,"insertElement",function(a){this.insertElement(a.data)},this);this.attachListener(a,"insertText",
  469. function(a){this.insertText(a.data)},this);this.setReadOnly(a.readOnly);this.attachClass("cke_editable");a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?this.attachClass("cke_editable_inline"):a.elementMode!=CKEDITOR.ELEMENT_MODE_REPLACE&&a.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO||this.attachClass("cke_editable_themed");this.attachClass("cke_contents_"+a.config.contentsLangDirection);a.keystrokeHandler.blockedKeystrokes[8]=+a.readOnly;a.keystrokeHandler.attach(this);this.on("blur",function(){this.hasFocus=
  470. !1},null,null,-1);this.on("focus",function(){this.hasFocus=!0},null,null,-1);a.focusManager.add(this);this.equals(CKEDITOR.document.getActive())&&(this.hasFocus=!0,a.once("contentDom",function(){a.focusManager.focus(this)},this));this.isInline()&&this.changeAttr("tabindex",a.tabIndex);if(!this.is("textarea")){a.document=this.getDocument();a.window=this.getWindow();var d=a.document;this.changeAttr("spellcheck",!a.config.disableNativeSpellChecker);var e=a.config.contentsLangDirection;this.getDirection(1)!=
  471. e&&this.changeAttr("dir",e);var m=CKEDITOR.getCss();if(m){var e=d.getHead(),k=e.getCustomData("stylesheet");k?m!=k.getText()&&(CKEDITOR.env.ie&&9>CKEDITOR.env.version?k.$.styleSheet.cssText=m:k.setText(m)):(m=d.appendStyleText(m),m=new CKEDITOR.dom.element(m.ownerNode||m.owningElement),e.setCustomData("stylesheet",m),m.data("cke-temp",1))}e=d.getCustomData("stylesheet_ref")||0;d.setCustomData("stylesheet_ref",e+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,
  472. "click",function(a){a=a.data;var b=(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");b&&2!=a.$.button&&b.isReadOnly()&&a.preventDefault()});var l={8:1,46:1};this.attachListener(a,"key",function(b){if(a.readOnly)return!0;var c=b.data.domEvent.getKey(),d;if(c in l){b=a.getSelection();var h,e=b.getRanges()[0],m=e.startPath(),p,k,x,c=8==c;CKEDITOR.env.ie&&11>CKEDITOR.env.version&&(h=b.getSelectedElement())||(h=g(b))?(a.fire("saveSnapshot"),e.moveToPosition(h,CKEDITOR.POSITION_BEFORE_START),
  473. h.remove(),e.select(),a.fire("saveSnapshot"),d=1):e.collapsed&&((p=m.block)&&(x=p[c?"getPrevious":"getNext"](f))&&x.type==CKEDITOR.NODE_ELEMENT&&x.is("table")&&e[c?"checkStartOfBlock":"checkEndOfBlock"]()?(a.fire("saveSnapshot"),e[c?"checkEndOfBlock":"checkStartOfBlock"]()&&p.remove(),e["moveToElementEdit"+(c?"End":"Start")](x),e.select(),a.fire("saveSnapshot"),d=1):m.blockLimit&&m.blockLimit.is("td")&&(k=m.blockLimit.getAscendant("table"))&&e.checkBoundaryOfElement(k,c?CKEDITOR.START:CKEDITOR.END)&&
  474. (x=k[c?"getPrevious":"getNext"](f))?(a.fire("saveSnapshot"),e["moveToElementEdit"+(c?"End":"Start")](x),e.checkStartOfBlock()&&e.checkEndOfBlock()?x.remove():e.select(),a.fire("saveSnapshot"),d=1):(k=m.contains(["td","th","caption"]))&&e.checkBoundaryOfElement(k,c?CKEDITOR.START:CKEDITOR.END)&&(d=1))}return!d});a.blockless&&CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller&&this.attachListener(this,"keyup",function(b){b.data.getKeystroke()in l&&!this.getFirst(c)&&(this.appendBogus(),b=a.createRange(),b.moveToPosition(this,
  475. CKEDITOR.POSITION_AFTER_START),b.select())});this.attachListener(this,"dblclick",function(b){if(a.readOnly)return!1;b={element:b.data.getTarget()};a.fire("doubleclick",b)});CKEDITOR.env.ie&&this.attachListener(this,"click",b);CKEDITOR.env.ie&&!CKEDITOR.env.edge||this.attachListener(this,"mousedown",function(b){var c=b.data.getTarget();c.is("img","hr","input","textarea","select")&&!c.isReadOnly()&&(a.getSelection().selectElement(c),c.is("input","textarea","select")&&b.data.preventDefault())});CKEDITOR.env.edge&&
  476. this.attachListener(this,"mouseup",function(b){(b=b.data.getTarget())&&b.is("img")&&a.getSelection().selectElement(b)});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(b){if(2==b.data.$.button&&(b=b.data.getTarget(),!b.getOuterHtml().replace(D,""))){var c=a.createRange();c.moveToElementEditStart(b);c.select(!0)}});CKEDITOR.env.webkit&&(this.attachListener(this,"click",function(a){a.data.getTarget().is("input","select")&&a.data.preventDefault()}),this.attachListener(this,"mouseup",
  477. function(a){a.data.getTarget().is("input","textarea")&&a.data.preventDefault()}));CKEDITOR.env.webkit&&this.attachListener(a,"key",function(b){if(a.readOnly)return!0;b=b.data.domEvent.getKey();if(b in l){var c=8==b,d=a.getSelection().getRanges()[0];b=d.startPath();if(d.collapsed)a:{var h=b.block;if(h&&d[c?"checkStartOfBlock":"checkEndOfBlock"]()&&d.moveToClosestEditablePosition(h,!c)&&d.collapsed){if(d.startContainer.type==CKEDITOR.NODE_ELEMENT){var e=d.startContainer.getChild(d.startOffset-(c?1:
  478. 0));if(e&&e.type==CKEDITOR.NODE_ELEMENT&&e.is("hr")){a.fire("saveSnapshot");e.remove();b=!0;break a}}d=d.startPath().block;if(!d||d&&d.contains(h))b=void 0;else{a.fire("saveSnapshot");var f;(f=(c?d:h).getBogus())&&f.remove();f=a.getSelection();e=f.createBookmarks();(c?h:d).moveChildren(c?d:h,!1);b.lastElement.mergeSiblings();v(h,d,!c);f.selectBookmarks(e);b=!0}}else b=!1}else c=d,f=b.block,d=c.endPath().block,f&&d&&!f.equals(d)?(a.fire("saveSnapshot"),(h=f.getBogus())&&h.remove(),c.enlarge(CKEDITOR.ENLARGE_INLINE),
  479. c.deleteContents(),d.getParent()&&(d.moveChildren(f,!1),b.lastElement.mergeSiblings(),v(f,d,!0)),c=a.getSelection().getRanges()[0],c.collapse(1),c.optimize(),""===c.startContainer.getHtml()&&c.startContainer.appendBogus(),c.select(),b=!0):b=!1;if(!b)return;a.getSelection().scrollIntoView();a.fire("saveSnapshot");return!1}},this,null,100)}}},_:{detach:function(){this.editor.setData(this.editor.getData(),0,1);this.clearListeners();this.restoreAttrs();var a;if(a=this.removeCustomData("classes"))for(;a.length;)this.removeClass(a.pop());
  480. if(!this.is("textarea")){a=this.getDocument();var b=a.getHead();if(b.getCustomData("stylesheet")){var c=a.getCustomData("stylesheet_ref");--c?a.setCustomData("stylesheet_ref",c):(a.removeCustomData("stylesheet_ref"),b.removeCustomData("stylesheet").remove())}}this.editor.fire("contentDomUnload");delete this.editor}}});CKEDITOR.editor.prototype.editable=function(a){var b=this._.editable;if(b&&a)return 0;arguments.length&&(b=this._.editable=a?a instanceof CKEDITOR.editable?a:new CKEDITOR.editable(this,
  481. a):(b&&b.detach(),null));return b};CKEDITOR.on("instanceLoaded",function(b){var c=b.editor;c.on("insertElement",function(a){a=a.data;a.type==CKEDITOR.NODE_ELEMENT&&(a.is("input")||a.is("textarea"))&&("false"!=a.getAttribute("contentEditable")&&a.data("cke-editable",a.hasAttribute("contenteditable")?"true":"1"),a.setAttribute("contentEditable",!1))});c.on("selectionChange",function(b){if(!c.readOnly){var d=c.getSelection();d&&!d.isLocked&&(d=c.checkDirty(),c.fire("lockSnapshot"),a(b),c.fire("unlockSnapshot"),
  482. !d&&c.resetDirty())}})});CKEDITOR.on("instanceCreated",function(a){var b=a.editor;b.on("mode",function(){var a=b.editable();if(a&&a.isInline()){var c=b.title;a.changeAttr("role","textbox");a.changeAttr("aria-label",c);c&&a.changeAttr("title",c);var d=b.fire("ariaEditorHelpLabel",{}).label;if(d&&(c=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents"))){var e=CKEDITOR.tools.getNextId(),d=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+e+'" class\x3d"cke_voice_label"\x3e'+
  483. d+"\x3c/span\x3e");c.append(d);a.changeAttr("aria-describedby",e)}}})});CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");f=CKEDITOR.dom.walker.whitespaces(!0);y=CKEDITOR.dom.walker.bookmark(!1,!0);A=CKEDITOR.dom.walker.empty();r=CKEDITOR.dom.walker.bogus();D=/(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;n=function(){function a(b){return b.type==
  484. CKEDITOR.NODE_ELEMENT}function b(c,d){var e,f,m,p,g=[],k=d.range.startContainer;e=d.range.startPath();for(var k=B[k.getName()],x=0,l=c.getChildren(),F=l.count(),z=-1,n=-1,q=0,v=e.contains(B.$list);x<F;++x)e=l.getItem(x),a(e)?(m=e.getName(),v&&m in CKEDITOR.dtd.$list?g=g.concat(b(e,d)):(p=!!k[m],"br"!=m||!e.data("cke-eol")||x&&x!=F-1||(q=(f=x?g[x-1].node:l.getItem(x+1))&&(!a(f)||!f.is("br")),f=f&&a(f)&&B.$block[f.getName()]),-1!=z||p||(z=x),p||(n=x),g.push({isElement:1,isLineBreak:q,isBlock:e.isBlockBoundary(),
  485. hasBlockSibling:f,node:e,name:m,allowed:p}),f=q=0)):g.push({isElement:0,node:e,allowed:1});-1<z&&(g[z].firstNotAllowed=1);-1<n&&(g[n].lastNotAllowed=1);return g}function d(b,c){var e=[],h=b.getChildren(),f=h.count(),m,g=0,k=B[c],x=!b.is(B.$inline)||b.is("br");for(x&&e.push(" ");g<f;g++)m=h.getItem(g),a(m)&&!m.is(k)?e=e.concat(d(m,c)):e.push(m);x&&e.push(" ");return e}function e(b){return a(b.startContainer)&&b.startContainer.getChild(b.startOffset-1)}function f(b){return b&&a(b)&&(b.is(B.$removeEmpty)||
  486. b.is("a")&&!b.isBlockBoundary())}function g(b,c,d,e){var h=b.clone(),f,m;h.setEndAt(c,CKEDITOR.POSITION_BEFORE_END);(f=(new CKEDITOR.dom.walker(h)).next())&&a(f)&&n[f.getName()]&&(m=f.getPrevious())&&a(m)&&!m.getParent().equals(b.startContainer)&&d.contains(m)&&e.contains(f)&&f.isIdentical(m)&&(f.moveChildren(m),f.remove(),g(b,c,d,e))}function F(b,c){function d(b,c){if(c.isBlock&&c.isElement&&!c.node.is("br")&&a(b)&&b.is("br"))return b.remove(),1}var e=c.endContainer.getChild(c.endOffset),h=c.endContainer.getChild(c.endOffset-
  487. 1);e&&d(e,b[b.length-1]);h&&d(h,b[0])&&(c.setEnd(c.endContainer,c.endOffset-1),c.collapse())}var B=CKEDITOR.dtd,n={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},q={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},v=CKEDITOR.tools.extend({},B.$inline);delete v.br;return function(n,E,C,I){var G=n.editor,K=!1;"unfiltered_html"==E&&(E="html",K=!0);if(!I.checkReadOnly()){var J=(new CKEDITOR.dom.elementPath(I.startContainer,I.root)).blockLimit||I.root;n={type:E,dontFilter:K,editable:n,
  488. editor:G,range:I,blockLimit:J,mergeCandidates:[],zombies:[]};E=n.range;I=n.mergeCandidates;var L,r;"text"==n.type&&E.shrink(CKEDITOR.SHRINK_ELEMENT,!0,!1)&&(L=CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",E.document),E.insertNode(L),E.setStartAfter(L));K=new CKEDITOR.dom.elementPath(E.startContainer);n.endPath=J=new CKEDITOR.dom.elementPath(E.endContainer);if(!E.collapsed){var G=J.block||J.blockLimit,w=E.getCommonAncestor();G&&!G.equals(w)&&!G.contains(w)&&E.checkEndOfBlock()&&
  489. n.zombies.push(G);E.deleteContents()}for(;(r=e(E))&&a(r)&&r.isBlockBoundary()&&K.contains(r);)E.moveToPosition(r,CKEDITOR.POSITION_BEFORE_END);g(E,n.blockLimit,K,J);L&&(E.setEndBefore(L),E.collapse(),L.remove());L=E.startPath();if(G=L.contains(f,!1,1))E.splitElement(G),n.inlineStylesRoot=G,n.inlineStylesPeak=L.lastElement;L=E.createBookmark();(G=L.startNode.getPrevious(c))&&a(G)&&f(G)&&I.push(G);(G=L.startNode.getNext(c))&&a(G)&&f(G)&&I.push(G);for(G=L.startNode;(G=G.getParent())&&f(G);)I.push(G);
  490. E.moveToBookmark(L);if(L=C){L=n.range;if("text"==n.type&&n.inlineStylesRoot){r=n.inlineStylesPeak;E=r.getDocument().createText("{cke-peak}");for(I=n.inlineStylesRoot.getParent();!r.equals(I);)E=E.appendTo(r.clone()),r=r.getParent();C=E.getOuterHtml().split("{cke-peak}").join(C)}r=n.blockLimit.getName();if(/^\s+|\s+$/.test(C)&&"span"in CKEDITOR.dtd[r]){var A='\x3cspan data-cke-marker\x3d"1"\x3e\x26nbsp;\x3c/span\x3e';C=A+C+A}C=n.editor.dataProcessor.toHtml(C,{context:null,fixForBody:!1,protectedWhitespaces:!!A,
  491. dontFilter:n.dontFilter,filter:n.editor.activeFilter,enterMode:n.editor.activeEnterMode});r=L.document.createElement("body");r.setHtml(C);A&&(r.getFirst().remove(),r.getLast().remove());if((A=L.startPath().block)&&(1!=A.getChildCount()||!A.getBogus()))a:{var y;if(1==r.getChildCount()&&a(y=r.getFirst())&&y.is(q)&&!y.hasAttribute("contenteditable")){A=y.getElementsByTag("*");L=0;for(I=A.count();L<I;L++)if(E=A.getItem(L),!E.is(v))break a;y.moveChildren(y.getParent(1));y.remove()}}n.dataWrapper=r;L=C}if(L){y=
  492. n.range;L=y.document;var u;r=n.blockLimit;I=0;var D,A=[],M,H;C=G=0;var R,W;E=y.startContainer;var K=n.endPath.elements[0],X,J=K.getPosition(E),w=!!K.getCommonAncestor(E)&&J!=CKEDITOR.POSITION_IDENTICAL&&!(J&CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED);E=b(n.dataWrapper,n);for(F(E,y);I<E.length;I++){J=E[I];if(u=J.isLineBreak){u=y;R=r;var T=void 0,aa=void 0;J.hasBlockSibling?u=1:(T=u.startContainer.getAscendant(B.$block,1))&&T.is({div:1,p:1})?(aa=T.getPosition(R),aa==CKEDITOR.POSITION_IDENTICAL||
  493. aa==CKEDITOR.POSITION_CONTAINS?u=0:(R=u.splitElement(T),u.moveToPosition(R,CKEDITOR.POSITION_AFTER_START),u=1)):u=0}if(u)C=0<I;else{u=y.startPath();!J.isBlock&&k(n.editor,u.block,u.blockLimit)&&(H=l(n.editor))&&(H=L.createElement(H),H.appendBogus(),y.insertNode(H),CKEDITOR.env.needsBrFiller&&(D=H.getBogus())&&D.remove(),y.moveToPosition(H,CKEDITOR.POSITION_BEFORE_END));if((u=y.startPath().block)&&!u.equals(M)){if(D=u.getBogus())D.remove(),A.push(u);M=u}J.firstNotAllowed&&(G=1);if(G&&J.isElement){u=
  494. y.startContainer;for(R=null;u&&!B[u.getName()][J.name];){if(u.equals(r)){u=null;break}R=u;u=u.getParent()}if(u)R&&(W=y.splitElement(R),n.zombies.push(W),n.zombies.push(R));else{R=r.getName();X=!I;u=I==E.length-1;R=d(J.node,R);for(var T=[],aa=R.length,ba=0,da=void 0,ea=0,ga=-1;ba<aa;ba++)da=R[ba]," "==da?(ea||X&&!ba||(T.push(new CKEDITOR.dom.text(" ")),ga=T.length),ea=1):(T.push(da),ea=0);u&&ga==T.length&&T.pop();X=T}}if(X){for(;u=X.pop();)y.insertNode(u);X=0}else y.insertNode(J.node);J.lastNotAllowed&&
  495. I<E.length-1&&((W=w?K:W)&&y.setEndAt(W,CKEDITOR.POSITION_AFTER_START),G=0);y.collapse()}}1!=E.length?D=!1:(D=E[0],D=D.isElement&&"false"==D.node.getAttribute("contenteditable"));D&&(C=!0,u=E[0].node,y.setStartAt(u,CKEDITOR.POSITION_BEFORE_START),y.setEndAt(u,CKEDITOR.POSITION_AFTER_END));n.dontMoveCaret=C;n.bogusNeededBlocks=A}D=n.range;var S;W=n.bogusNeededBlocks;for(X=D.createBookmark();M=n.zombies.pop();)M.getParent()&&(H=D.clone(),H.moveToElementEditStart(M),H.removeEmptyBlocksAtEnd());if(W)for(;M=
  496. W.pop();)CKEDITOR.env.needsBrFiller?M.appendBogus():M.append(D.document.createText(" "));for(;M=n.mergeCandidates.pop();)M.mergeSiblings();D.moveToBookmark(X);if(!n.dontMoveCaret){for(M=e(D);M&&a(M)&&!M.is(B.$empty);){if(M.isBlockBoundary())D.moveToPosition(M,CKEDITOR.POSITION_BEFORE_END);else{if(f(M)&&M.getHtml().match(/(\s|&nbsp;)$/g)){S=null;break}S=D.clone();S.moveToPosition(M,CKEDITOR.POSITION_BEFORE_END)}M=M.getLast(c)}S&&D.moveToRange(S)}}}}();w=function(){function a(b){b=new CKEDITOR.dom.walker(b);
  497. b.guard=function(a,b){if(b)return!1;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$tableContent)};b.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT};return b}function b(a,c,d){c=a.getDocument().createElement(c);a.append(c,d);return c}function c(a){var b=a.count(),d;for(b;0<b--;)d=a.getItem(b),CKEDITOR.tools.trim(d.getHtml())||(d.appendBogus(),CKEDITOR.env.ie&&9>CKEDITOR.env.version&&d.getChildCount()&&d.getFirst().remove())}return function(d){var e=d.startContainer,f=e.getAscendant("table",
  498. 1),g=!1;c(f.getElementsByTag("td"));c(f.getElementsByTag("th"));f=d.clone();f.setStart(e,0);f=a(f).lastBackward();f||(f=d.clone(),f.setEndAt(e,CKEDITOR.POSITION_BEFORE_END),f=a(f).lastForward(),g=!0);f||(f=e);f.is("table")?(d.setStartAt(f,CKEDITOR.POSITION_BEFORE_START),d.collapse(!0),f.remove()):(f.is({tbody:1,thead:1,tfoot:1})&&(f=b(f,"tr",g)),f.is("tr")&&(f=b(f,f.getParent().is("thead")?"th":"td",g)),(e=f.getBogus())&&e.remove(),d.moveToPosition(f,g?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END))}}();
  499. H={eol:{detect:function(a,b){var c=a.range,d=c.clone(),e=c.clone(),f=new CKEDITOR.dom.elementPath(c.startContainer,b),g=new CKEDITOR.dom.elementPath(c.endContainer,b);d.collapse(1);e.collapse();f.block&&d.checkBoundaryOfElement(f.block,CKEDITOR.END)&&(c.setStartAfter(f.block),a.prependEolBr=1);g.block&&e.checkBoundaryOfElement(g.block,CKEDITOR.START)&&(c.setEndBefore(g.block),a.appendEolBr=1)},fix:function(a,b){var c=b.getDocument(),d;a.appendEolBr&&(d=this.createEolBr(c),a.fragment.append(d));!a.prependEolBr||
  500. d&&!d.getPrevious()||a.fragment.append(this.createEolBr(c),1)},createEolBr:function(a){return a.createElement("br",{attributes:{"data-cke-eol":1}})}},bogus:{exclude:function(a){var b=a.range.getBoundaryNodes(),c=b.startNode,b=b.endNode;!b||!r(b)||c&&c.equals(b)||a.range.setEndBefore(b)}},tree:{rebuild:function(a,b){var c=a.range,d=c.getCommonAncestor(),e=new CKEDITOR.dom.elementPath(d,b),f=new CKEDITOR.dom.elementPath(c.startContainer,b),c=new CKEDITOR.dom.elementPath(c.endContainer,b),g;d.type==
  501. CKEDITOR.NODE_TEXT&&(d=d.getParent());if(e.blockLimit.is({tr:1,table:1})){var k=e.contains("table").getParent();g=function(a){return!a.equals(k)}}else if(e.block&&e.block.is(CKEDITOR.dtd.$listItem)&&(f=f.contains(CKEDITOR.dtd.$list),c=c.contains(CKEDITOR.dtd.$list),!f.equals(c))){var l=e.contains(CKEDITOR.dtd.$list).getParent();g=function(a){return!a.equals(l)}}g||(g=function(a){return!a.equals(e.block)&&!a.equals(e.blockLimit)});this.rebuildFragment(a,b,d,g)},rebuildFragment:function(a,b,c,d){for(var e;c&&
  502. !c.equals(b)&&d(c);)e=c.clone(0,1),a.fragment.appendTo(e),a.fragment=e,c=c.getParent()}},cell:{shrink:function(a){a=a.range;var b=a.startContainer,c=a.endContainer,d=a.startOffset,e=a.endOffset;b.type==CKEDITOR.NODE_ELEMENT&&b.equals(c)&&b.is("tr")&&++d==e&&a.shrink(CKEDITOR.SHRINK_TEXT)}}};u=function(){function a(b,c){var d=b.getParent();if(d.is(CKEDITOR.dtd.$inline))b[c?"insertBefore":"insertAfter"](d)}function b(c,d,e){a(d);a(e,1);for(var f;f=e.getNext();)f.insertAfter(d),d=f;A(c)&&c.remove()}
  503. function c(a,b){var d=new CKEDITOR.dom.range(a);d.setStartAfter(b.startNode);d.setEndBefore(b.endNode);return d}return{list:{detectMerge:function(a,b){var d=c(b,a.bookmark),e=d.startPath(),f=d.endPath(),h=e.contains(CKEDITOR.dtd.$list),g=f.contains(CKEDITOR.dtd.$list);a.mergeList=h&&g&&h.getParent().equals(g.getParent())&&!h.equals(g);a.mergeListItems=e.block&&f.block&&e.block.is(CKEDITOR.dtd.$listItem)&&f.block.is(CKEDITOR.dtd.$listItem);if(a.mergeList||a.mergeListItems)d=d.clone(),d.setStartBefore(a.bookmark.startNode),
  504. d.setEndAfter(a.bookmark.endNode),a.mergeListBookmark=d.createBookmark()},merge:function(a,c){if(a.mergeListBookmark){var d=a.mergeListBookmark.startNode,e=a.mergeListBookmark.endNode,f=new CKEDITOR.dom.elementPath(d,c),g=new CKEDITOR.dom.elementPath(e,c);if(a.mergeList){var p=f.contains(CKEDITOR.dtd.$list),k=g.contains(CKEDITOR.dtd.$list);p.equals(k)||(k.moveChildren(p),k.remove())}a.mergeListItems&&(f=f.contains(CKEDITOR.dtd.$listItem),g=g.contains(CKEDITOR.dtd.$listItem),f.equals(g)||b(g,d,e));
  505. d.remove();e.remove()}}},block:{detectMerge:function(a,b){if(!a.tableContentsRanges&&!a.mergeListBookmark){var c=new CKEDITOR.dom.range(b);c.setStartBefore(a.bookmark.startNode);c.setEndAfter(a.bookmark.endNode);a.mergeBlockBookmark=c.createBookmark()}},merge:function(a,c){if(a.mergeBlockBookmark&&!a.purgeTableBookmark){var d=a.mergeBlockBookmark.startNode,e=a.mergeBlockBookmark.endNode,f=new CKEDITOR.dom.elementPath(d,c),g=new CKEDITOR.dom.elementPath(e,c),f=f.block,g=g.block;f&&g&&!f.equals(g)&&
  506. b(g,d,e);d.remove();e.remove()}}},table:function(){function a(c){var e=[],f,h=new CKEDITOR.dom.walker(c),g=c.startPath().contains(d),m=c.endPath().contains(d),p={};h.guard=function(a,h){if(a.type==CKEDITOR.NODE_ELEMENT){var k="visited_"+(h?"out":"in");if(a.getCustomData(k))return;CKEDITOR.dom.element.setMarker(p,a,k,1)}if(h&&g&&a.equals(g))f=c.clone(),f.setEndAt(g,CKEDITOR.POSITION_BEFORE_END),e.push(f);else if(!h&&m&&a.equals(m))f=c.clone(),f.setStartAt(m,CKEDITOR.POSITION_AFTER_START),e.push(f);
  507. else{if(k=!h)k=a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&(!g||b(a,g))&&(!m||b(a,m));k&&(f=c.clone(),f.selectNodeContents(a),e.push(f))}};h.lastForward();CKEDITOR.dom.element.clearAllMarkers(p);return e}function b(a,c){var d=CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED,e=a.getPosition(c);return e===CKEDITOR.POSITION_IDENTICAL?!1:0===(e&d)}var d={td:1,th:1,caption:1};return{detectPurge:function(a){var b=a.range,c=b.clone();c.enlarge(CKEDITOR.ENLARGE_ELEMENT);var c=new CKEDITOR.dom.walker(c),
  508. e=0;c.evaluator=function(a){a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&++e};c.checkForward();if(1<e){var c=b.startPath().contains("table"),f=b.endPath().contains("table");c&&f&&b.checkBoundaryOfElement(c,CKEDITOR.START)&&b.checkBoundaryOfElement(f,CKEDITOR.END)&&(b=a.range.clone(),b.setStartBefore(c),b.setEndAfter(f),a.purgeTableBookmark=b.createBookmark())}},detectRanges:function(e,f){var h=c(f,e.bookmark),g=h.clone(),k,l,n=h.getCommonAncestor();n.is(CKEDITOR.dtd.$tableContent)&&!n.is(d)&&(n=n.getAscendant("table",
  509. !0));l=n;n=new CKEDITOR.dom.elementPath(h.startContainer,l);l=new CKEDITOR.dom.elementPath(h.endContainer,l);n=n.contains("table");l=l.contains("table");if(n||l)n&&l&&b(n,l)?(e.tableSurroundingRange=g,g.setStartAt(n,CKEDITOR.POSITION_AFTER_END),g.setEndAt(l,CKEDITOR.POSITION_BEFORE_START),g=h.clone(),g.setEndAt(n,CKEDITOR.POSITION_AFTER_END),k=h.clone(),k.setStartAt(l,CKEDITOR.POSITION_BEFORE_START),k=a(g).concat(a(k))):n?l||(e.tableSurroundingRange=g,g.setStartAt(n,CKEDITOR.POSITION_AFTER_END),h.setEndAt(n,
  510. CKEDITOR.POSITION_AFTER_END)):(e.tableSurroundingRange=g,g.setEndAt(l,CKEDITOR.POSITION_BEFORE_START),h.setStartAt(l,CKEDITOR.POSITION_AFTER_START)),e.tableContentsRanges=k?k:a(h)},deleteRanges:function(a){for(var b;b=a.tableContentsRanges.pop();)b.extractContents(),A(b.startContainer)&&b.startContainer.appendBogus();a.tableSurroundingRange&&a.tableSurroundingRange.extractContents()},purge:function(a){if(a.purgeTableBookmark){var b=a.doc,c=a.range.clone(),b=b.createElement("p");b.insertBefore(a.purgeTableBookmark.startNode);
  511. c.moveToBookmark(a.purgeTableBookmark);c.deleteContents();a.range.moveToPosition(b,CKEDITOR.POSITION_AFTER_START)}}}}(),detectExtractMerge:function(a){return!(a.range.startPath().contains(CKEDITOR.dtd.$listItem)&&a.range.endPath().contains(CKEDITOR.dtd.$listItem))},fixUneditableRangePosition:function(a){a.startContainer.getDtd()["#"]||a.moveToClosestEditablePosition(null,!0)},autoParagraph:function(a,b){var c=b.startPath(),d;k(a,c.block,c.blockLimit)&&(d=l(a))&&(d=b.document.createElement(d),d.appendBogus(),
  512. b.insertNode(d),b.moveToPosition(d,CKEDITOR.POSITION_AFTER_START))}}}()})();
  513. (function(){function a(){var a=this._.fakeSelection,b;a&&(b=this.getSelection(1),b&&b.isHidden()||(a.reset(),a=0));if(!a&&(a=b||this.getSelection(1),!a||a.getType()==CKEDITOR.SELECTION_NONE))return;this.fire("selectionCheck",a);b=this.elementPath();b.compare(this._.selectionPreviousPath)||(CKEDITOR.env.webkit&&(this._.previousActive=this.document.getActive()),this._.selectionPreviousPath=b,this.fire("selectionChange",{selection:a,path:b}))}function d(){A=!0;y||(b.call(this),y=CKEDITOR.tools.setTimeout(b,
  514. 200,this))}function b(){y=null;A&&(CKEDITOR.tools.setTimeout(a,0,this),A=!1)}function c(a){return r(a)||a.type==CKEDITOR.NODE_ELEMENT&&!a.is(CKEDITOR.dtd.$empty)?!0:!1}function e(a){function b(c,d){return c&&c.type!=CKEDITOR.NODE_TEXT?a.clone()["moveToElementEdit"+(d?"End":"Start")](c):!1}if(!(a.root instanceof CKEDITOR.editable))return!1;var d=a.startContainer,e=a.getPreviousNode(c,null,d),f=a.getNextNode(c,null,d);return b(e)||b(f,1)||!(e||f||d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()&&
  515. d.getBogus())?!0:!1}function g(a){k(a,!1);var b=a.getDocument().createText(u);a.setCustomData("cke-fillingChar",b);return b}function k(a,b){var c=a&&a.removeCustomData("cke-fillingChar");if(c){if(!1!==b){var d=a.getDocument().getSelection().getNative(),e=d&&"None"!=d.type&&d.getRangeAt(0),f=u.length;if(c.getLength()>f&&e&&e.intersectsNode(c.$)){var g=[{node:d.anchorNode,offset:d.anchorOffset},{node:d.focusNode,offset:d.focusOffset}];d.anchorNode==c.$&&d.anchorOffset>f&&(g[0].offset-=f);d.focusNode==
  516. c.$&&d.focusOffset>f&&(g[1].offset-=f)}}c.setText(l(c.getText(),1));g&&(c=a.getDocument().$,d=c.getSelection(),c=c.createRange(),c.setStart(g[0].node,g[0].offset),c.collapse(!0),d.removeAllRanges(),d.addRange(c),d.extend(g[1].node,g[1].offset))}}function l(a,b){return b?a.replace(t,function(a,b){return b?" ":""}):a.replace(u,"")}function q(a,b){var c=CKEDITOR.dom.element.createFromHtml('\x3cdiv data-cke-hidden-sel\x3d"1" data-cke-temp\x3d"1" style\x3d"'+(CKEDITOR.env.ie?"display:none":"position:fixed;top:0;left:-1000px")+
  517. '"\x3e'+(b||"\x26nbsp;")+"\x3c/div\x3e",a.document);a.fire("lockSnapshot");a.editable().append(c);var d=a.getSelection(1),e=a.createRange(),f=d.root.on("selectionchange",function(a){a.cancel()},null,null,0);e.setStartAt(c,CKEDITOR.POSITION_AFTER_START);e.setEndAt(c,CKEDITOR.POSITION_BEFORE_END);d.selectRanges([e]);f.removeListener();a.fire("unlockSnapshot");a._.hiddenSelectionContainer=c}function v(a){var b={37:1,39:1,8:1,46:1};return function(c){var d=c.data.getKeystroke();if(b[d]){var e=a.getSelection().getRanges(),
  518. f=e[0];1==e.length&&f.collapsed&&(d=f[38>d?"getPreviousEditableNode":"getNextEditableNode"]())&&d.type==CKEDITOR.NODE_ELEMENT&&"false"==d.getAttribute("contenteditable")&&(a.getSelection().fake(d),c.data.preventDefault(),c.cancel())}}}function f(a){for(var b=0;b<a.length;b++){var c=a[b];c.getCommonAncestor().isReadOnly()&&a.splice(b,1);if(!c.collapsed){if(c.startContainer.isReadOnly())for(var d=c.startContainer,e;d&&!((e=d.type==CKEDITOR.NODE_ELEMENT)&&d.is("body")||!d.isReadOnly());)e&&"false"==
  519. d.getAttribute("contentEditable")&&c.setStartAfter(d),d=d.getParent();d=c.startContainer;e=c.endContainer;var f=c.startOffset,g=c.endOffset,k=c.clone();d&&d.type==CKEDITOR.NODE_TEXT&&(f>=d.getLength()?k.setStartAfter(d):k.setStartBefore(d));e&&e.type==CKEDITOR.NODE_TEXT&&(g?k.setEndAfter(e):k.setEndBefore(e));d=new CKEDITOR.dom.walker(k);d.evaluator=function(d){if(d.type==CKEDITOR.NODE_ELEMENT&&d.isReadOnly()){var e=c.clone();c.setEndBefore(d);c.collapsed&&a.splice(b--,1);d.getPosition(k.endContainer)&
  520. CKEDITOR.POSITION_CONTAINS||(e.setStartAfter(d),e.collapsed||a.splice(b+1,0,e));return!0}return!1};d.next()}}return a}var y,A,r=CKEDITOR.dom.walker.invisible(1),D=function(){function a(b){return function(a){var c=a.editor.createRange();c.moveToClosestEditablePosition(a.selected,b)&&a.editor.getSelection().selectRanges([c]);return!1}}function b(a){return function(b){var c=b.editor,d=c.createRange(),e;(e=d.moveToClosestEditablePosition(b.selected,a))||(e=d.moveToClosestEditablePosition(b.selected,!a));
  521. e&&c.getSelection().selectRanges([d]);c.fire("saveSnapshot");b.selected.remove();e||(d.moveToElementEditablePosition(c.editable()),c.getSelection().selectRanges([d]));c.fire("saveSnapshot");return!1}}var c=a(),d=a(1);return{37:c,38:c,39:d,40:d,8:b(),46:b(1)}}();CKEDITOR.on("instanceCreated",function(b){function c(){var a=e.getSelection();a&&a.removeAllRanges()}var e=b.editor;e.on("contentDom",function(){function b(){C=new CKEDITOR.dom.selection(e.getSelection());C.lock()}function c(){h.removeListener("mouseup",
  522. c);l.removeListener("mouseup",c);var a=CKEDITOR.document.$.selection,b=a.createRange();"None"!=a.type&&b.parentElement().ownerDocument==f.$&&b.select()}var f=e.document,h=CKEDITOR.document,g=e.editable(),p=f.getBody(),l=f.getDocumentElement(),q=g.isInline(),r,C;CKEDITOR.env.gecko&&g.attachListener(g,"focus",function(a){a.removeListener();0!==r&&(a=e.getSelection().getNative())&&a.isCollapsed&&a.anchorNode==g.$&&(a=e.createRange(),a.moveToElementEditStart(g),a.select())},null,null,-2);g.attachListener(g,
  523. CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){r&&CKEDITOR.env.webkit&&(r=e._.previousActive&&e._.previousActive.equals(f.getActive()));e.unlockSelection(r);r=0},null,null,-1);g.attachListener(g,"mousedown",function(){r=0});if(CKEDITOR.env.ie||q)n?g.attachListener(g,"beforedeactivate",b,null,null,-1):g.attachListener(e,"selectionCheck",b,null,null,-1),g.attachListener(g,CKEDITOR.env.webkit?"DOMFocusOut":"blur",function(){e.lockSelection(C);r=1},null,null,-1),g.attachListener(g,"mousedown",function(){r=
  524. 0});if(CKEDITOR.env.ie&&!q){var I;g.attachListener(g,"mousedown",function(a){2==a.data.$.button&&((a=e.document.getSelection())&&a.getType()!=CKEDITOR.SELECTION_NONE||(I=e.window.getScrollPosition()))});g.attachListener(g,"mouseup",function(a){2==a.data.$.button&&I&&(e.document.$.documentElement.scrollLeft=I.x,e.document.$.documentElement.scrollTop=I.y);I=null});if("BackCompat"!=f.$.compatMode){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)l.on("mousedown",function(a){function b(a){a=a.data.$;
  525. if(d){var c=p.$.createTextRange();try{c.moveToPoint(a.clientX,a.clientY)}catch(e){}d.setEndPoint(0>f.compareEndPoints("StartToStart",c)?"EndToEnd":"StartToStart",c);d.select()}}function c(){l.removeListener("mousemove",b);h.removeListener("mouseup",c);l.removeListener("mouseup",c);d.select()}a=a.data;if(a.getTarget().is("html")&&a.$.y<l.$.clientHeight&&a.$.x<l.$.clientWidth){var d=p.$.createTextRange();try{d.moveToPoint(a.$.clientX,a.$.clientY)}catch(e){}var f=d.duplicate();l.on("mousemove",b);h.on("mouseup",
  526. c);l.on("mouseup",c)}});if(7<CKEDITOR.env.version&&11>CKEDITOR.env.version)l.on("mousedown",function(a){a.data.getTarget().is("html")&&(h.on("mouseup",c),l.on("mouseup",c))})}}g.attachListener(g,"selectionchange",a,e);g.attachListener(g,"keyup",d,e);g.attachListener(g,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){e.forceNextSelectionCheck();e.selectionChange(1)});if(q&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var G;g.attachListener(g,"mousedown",function(){G=1});g.attachListener(f.getDocumentElement(),
  527. "mouseup",function(){G&&d.call(e);G=0})}else g.attachListener(CKEDITOR.env.ie?g:f.getDocumentElement(),"mouseup",d,e);CKEDITOR.env.webkit&&g.attachListener(f,"keydown",function(a){switch(a.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:k(g)}},null,null,-1);g.attachListener(g,"keydown",v(e),null,null,-1)});e.on("setData",function(){e.unlockSelection();CKEDITOR.env.webkit&&c()});e.on("contentDomUnload",function(){e.unlockSelection()});if(CKEDITOR.env.ie9Compat)e.on("beforeDestroy",
  528. c,null,null,9);e.on("dataReady",function(){delete e._.fakeSelection;delete e._.hiddenSelectionContainer;e.selectionChange(1)});e.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),b=e.editable().getLast(a);b&&b.hasAttribute("data-cke-hidden-sel")&&(b.remove(),CKEDITOR.env.gecko&&(a=e.editable().getFirst(a))&&a.is("br")&&a.getAttribute("_moz_editor_bogus_node")&&a.remove())},null,null,100);e.on("key",function(a){if("wysiwyg"==e.mode){var b=e.getSelection();if(b.isFake){var c=
  529. D[a.data.keyCode];if(c)return c({editor:e,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});if(CKEDITOR.env.webkit)CKEDITOR.on("instanceReady",function(a){var b=a.editor;b.on("selectionChange",function(){var a=b.editable(),c=a.getCustomData("cke-fillingChar");c&&(c.getCustomData("ready")?k(a):c.setCustomData("ready",1))},null,null,-1);b.on("beforeSetMode",function(){k(b.editable())},null,null,-1);b.on("getSnapshot",function(a){a.data&&(a.data=l(a.data))},b,null,20);b.on("toDataFormat",
  530. function(a){a.data.dataValue=l(a.data.dataValue)},null,null,0)});CKEDITOR.editor.prototype.selectionChange=function(b){(b?a:d).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){return!this._.savedSelection&&!this._.fakeSelection||a?(a=this.editable())&&"wysiwyg"==this.mode?new CKEDITOR.dom.selection(a):null:this._.savedSelection||this._.fakeSelection};CKEDITOR.editor.prototype.lockSelection=function(a){a=a||this.getSelection(1);return a.getType()!=CKEDITOR.SELECTION_NONE?(!a.isLocked&&
  531. a.lock(),this._.savedSelection=a,!0):!1};CKEDITOR.editor.prototype.unlockSelection=function(a){var b=this._.savedSelection;return b?(b.unlock(a),delete this._.savedSelection,!0):!1};CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath};CKEDITOR.dom.document.prototype.getSelection=function(){return new CKEDITOR.dom.selection(this)};CKEDITOR.dom.range.prototype.select=function(){var a=this.root instanceof CKEDITOR.editable?this.root.editor.getSelection():
  532. new CKEDITOR.dom.selection(this.root);a.selectRanges([this]);return a};CKEDITOR.SELECTION_NONE=1;CKEDITOR.SELECTION_TEXT=2;CKEDITOR.SELECTION_ELEMENT=3;var n="function"!=typeof window.getSelection,w=1;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection){var b=a;a=a.root}var c=a instanceof CKEDITOR.dom.element;this.rev=b?b.rev:w++;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=c?a:this.document.getBody();this.isLocked=0;this._={cache:{}};if(b)return CKEDITOR.tools.extend(this._.cache,
  533. b._.cache),this.isFake=b.isFake,this.isLocked=b.isLocked,this;a=this.getNative();var d,e;if(a)if(a.getRangeAt)d=(e=a.rangeCount&&a.getRangeAt(0))&&new CKEDITOR.dom.node(e.commonAncestorContainer);else{try{e=a.createRange()}catch(f){}d=e&&CKEDITOR.dom.element.get(e.item&&e.item(0)||e.parentElement())}if(!d||d.type!=CKEDITOR.NODE_ELEMENT&&d.type!=CKEDITOR.NODE_TEXT||!this.root.equals(d)&&!this.root.contains(d))this._.cache.type=CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement=
  534. null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList;return this};var H={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1},u=CKEDITOR.tools.repeat("​",7),t=new RegExp(u+"( )?","g");CKEDITOR.tools.extend(CKEDITOR.dom.selection,{_removeFillingCharSequenceString:l,_createFillingCharSequenceNode:g,FILLING_CHAR_SEQUENCE:u});CKEDITOR.dom.selection.prototype={getNative:function(){return void 0!==
  535. this._.cache.nativeSel?this._.cache.nativeSel:this._.cache.nativeSel=n?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:n?function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_NONE;try{var c=this.getNative(),d=c.type;"Text"==d&&(b=CKEDITOR.SELECTION_TEXT);"Control"==d&&(b=CKEDITOR.SELECTION_ELEMENT);c.createRange().parentElement()&&(b=CKEDITOR.SELECTION_TEXT)}catch(e){}return a.type=b}:function(){var a=this._.cache;if(a.type)return a.type;var b=
  536. CKEDITOR.SELECTION_TEXT,c=this.getNative();if(!c||!c.rangeCount)b=CKEDITOR.SELECTION_NONE;else if(1==c.rangeCount){var c=c.getRangeAt(0),d=c.startContainer;d==c.endContainer&&1==d.nodeType&&1==c.endOffset-c.startOffset&&H[d.childNodes[c.startOffset].nodeName.toLowerCase()]&&(b=CKEDITOR.SELECTION_ELEMENT)}return a.type=b},getRanges:function(){var a=n?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()}var b=function(b,c){b=b.duplicate();b.collapse(c);var d=b.parentElement();if(!d.hasChildNodes())return{container:d,
  537. offset:0};for(var e=d.children,f,h,g=b.duplicate(),k=0,l=e.length-1,C=-1,m,n;k<=l;)if(C=Math.floor((k+l)/2),f=e[C],g.moveToElementText(f),m=g.compareEndPoints("StartToStart",b),0<m)l=C-1;else if(0>m)k=C+1;else return{container:d,offset:a(f)};if(-1==C||C==e.length-1&&0>m){g.moveToElementText(d);g.setEndPoint("StartToStart",b);g=g.text.replace(/(\r\n|\r)/g,"\n").length;e=d.childNodes;if(!g)return f=e[e.length-1],f.nodeType!=CKEDITOR.NODE_TEXT?{container:d,offset:e.length}:{container:f,offset:f.nodeValue.length};
  538. for(d=e.length;0<g&&0<d;)h=e[--d],h.nodeType==CKEDITOR.NODE_TEXT&&(n=h,g-=h.nodeValue.length);return{container:n,offset:-g}}g.collapse(0<m?!0:!1);g.setEndPoint(0<m?"StartToStart":"EndToStart",b);g=g.text.replace(/(\r\n|\r)/g,"\n").length;if(!g)return{container:d,offset:a(f)+(0<m?0:1)};for(;0<g;)try{h=f[0<m?"previousSibling":"nextSibling"],h.nodeType==CKEDITOR.NODE_TEXT&&(g-=h.nodeValue.length,n=h),f=h}catch(K){return{container:d,offset:a(f)}}return{container:n,offset:0<m?-g:n.nodeValue.length+g}};
  539. return function(){var a=this.getNative(),c=a&&a.createRange(),d=this.getType();if(!a)return[];if(d==CKEDITOR.SELECTION_TEXT)return a=new CKEDITOR.dom.range(this.root),d=b(c,!0),a.setStart(new CKEDITOR.dom.node(d.container),d.offset),d=b(c),a.setEnd(new CKEDITOR.dom.node(d.container),d.offset),a.endContainer.getPosition(a.startContainer)&CKEDITOR.POSITION_PRECEDING&&a.endOffset<=a.startContainer.getIndex()&&a.collapse(),[a];if(d==CKEDITOR.SELECTION_ELEMENT){for(var d=[],e=0;e<c.length;e++){for(var f=
  540. c.item(e),h=f.parentNode,g=0,a=new CKEDITOR.dom.range(this.root);g<h.childNodes.length&&h.childNodes[g]!=f;g++);a.setStart(new CKEDITOR.dom.node(h),g);a.setEnd(new CKEDITOR.dom.node(h),g+1);d.push(a)}return d}return[]}}():function(){var a=[],b,c=this.getNative();if(!c)return a;for(var d=0;d<c.rangeCount;d++){var e=c.getRangeAt(d);b=new CKEDITOR.dom.range(this.root);b.setStart(new CKEDITOR.dom.node(e.startContainer),e.startOffset);b.setEnd(new CKEDITOR.dom.node(e.endContainer),e.endOffset);a.push(b)}return a};
  541. return function(b){var c=this._.cache,d=c.ranges;d||(c.ranges=d=new CKEDITOR.dom.rangeList(a.call(this)));return b?f(new CKEDITOR.dom.rangeList(d.slice())):d}}(),getStartElement:function(){var a=this._.cache;if(void 0!==a.startElement)return a.startElement;var b;switch(this.getType()){case CKEDITOR.SELECTION_ELEMENT:return this.getSelectedElement();case CKEDITOR.SELECTION_TEXT:var c=this.getRanges()[0];if(c){if(c.collapsed)b=c.startContainer,b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent());else{for(c.optimize();b=
  542. c.startContainer,c.startOffset==(b.getChildCount?b.getChildCount():b.getLength())&&!b.isBlockBoundary();)c.setStartAfter(b);b=c.startContainer;if(b.type!=CKEDITOR.NODE_ELEMENT)return b.getParent();if((b=b.getChild(c.startOffset))&&b.type==CKEDITOR.NODE_ELEMENT)for(c=b.getFirst();c&&c.type==CKEDITOR.NODE_ELEMENT;)b=c,c=c.getFirst();else b=c.startContainer}b=b.$}}return a.startElement=b?new CKEDITOR.dom.element(b):null},getSelectedElement:function(){var a=this._.cache;if(void 0!==a.selectedElement)return a.selectedElement;
  543. var b=this,c=CKEDITOR.tools.tryThese(function(){return b.getNative().createRange().item(0)},function(){for(var a=b.getRanges()[0].clone(),c,d,e=2;e&&!((c=a.getEnclosedNode())&&c.type==CKEDITOR.NODE_ELEMENT&&H[c.getName()]&&(d=c));e--)a.shrink(CKEDITOR.SHRINK_ELEMENT);return d&&d.$});return a.selectedElement=c?new CKEDITOR.dom.element(c):null},getSelectedText:function(){var a=this._.cache;if(void 0!==a.selectedText)return a.selectedText;var b=this.getNative(),b=n?"Control"==b.type?"":b.createRange().text:
  544. b.toString();return a.selectedText=b},lock:function(){this.getRanges();this.getStartElement();this.getSelectedElement();this.getSelectedText();this._.cache.nativeSel=null;this.isLocked=1},unlock:function(a){if(this.isLocked){if(a)var b=this.getSelectedElement(),c=!b&&this.getRanges(),d=this.isFake;this.isLocked=0;this.reset();a&&(a=b||c[0]&&c[0].getCommonAncestor())&&a.getAscendant("body",1)&&(d?this.fake(b):b?this.selectElement(b):this.selectRanges(c))}},reset:function(){this._.cache={};this.isFake=
  545. 0;var a=this.root.editor;if(a&&a._.fakeSelection)if(this.rev==a._.fakeSelection.rev){delete a._.fakeSelection;var b=a._.hiddenSelectionContainer;if(b){var c=a.checkDirty();a.fire("lockSnapshot");b.remove();a.fire("unlockSnapshot");!c&&a.resetDirty()}delete a._.hiddenSelectionContainer}else CKEDITOR.warn("selection-fake-reset");this.rev=w++},selectElement:function(a){var b=new CKEDITOR.dom.range(this.root);b.setStartBefore(a);b.setEndAfter(a);this.selectRanges([b])},selectRanges:function(a){var b=
  546. this.root.editor,b=b&&b._.hiddenSelectionContainer;this.reset();if(b)for(var b=this.root,c,d=0;d<a.length;++d)c=a[d],c.endContainer.equals(b)&&(c.endOffset=Math.min(c.endOffset,b.getChildCount()));if(a.length)if(this.isLocked){var f=CKEDITOR.document.getActive();this.unlock();this.selectRanges(a);this.lock();f&&!f.equals(this.root)&&f.focus()}else{var l;a:{var q,v;if(1==a.length&&!(v=a[0]).collapsed&&(l=v.getEnclosedNode())&&l.type==CKEDITOR.NODE_ELEMENT&&(v=v.clone(),v.shrink(CKEDITOR.SHRINK_ELEMENT,
  547. !0),(q=v.getEnclosedNode())&&q.type==CKEDITOR.NODE_ELEMENT&&(l=q),"false"==l.getAttribute("contenteditable")))break a;l=void 0}if(l)this.fake(l);else{if(n){v=CKEDITOR.dom.walker.whitespaces(!0);q=/\ufeff|\u00a0/;b={table:1,tbody:1,tr:1};1<a.length&&(l=a[a.length-1],a[0].setEnd(l.endContainer,l.endOffset));l=a[0];a=l.collapsed;var r,u,t;if((c=l.getEnclosedNode())&&c.type==CKEDITOR.NODE_ELEMENT&&c.getName()in H&&(!c.is("a")||!c.getText()))try{t=c.$.createControlRange();t.addElement(c.$);t.select();
  548. return}catch(y){}if(l.startContainer.type==CKEDITOR.NODE_ELEMENT&&l.startContainer.getName()in b||l.endContainer.type==CKEDITOR.NODE_ELEMENT&&l.endContainer.getName()in b)l.shrink(CKEDITOR.NODE_ELEMENT,!0),a=l.collapsed;t=l.createBookmark();b=t.startNode;a||(f=t.endNode);t=l.document.$.body.createTextRange();t.moveToElementText(b.$);t.moveStart("character",1);f?(q=l.document.$.body.createTextRange(),q.moveToElementText(f.$),t.setEndPoint("EndToEnd",q),t.moveEnd("character",-1)):(r=b.getNext(v),u=
  549. b.hasAscendant("pre"),r=!(r&&r.getText&&r.getText().match(q))&&(u||!b.hasPrevious()||b.getPrevious().is&&b.getPrevious().is("br")),u=l.document.createElement("span"),u.setHtml("\x26#65279;"),u.insertBefore(b),r&&l.document.createText("").insertBefore(b));l.setStartBefore(b);b.remove();a?(r?(t.moveStart("character",-1),t.select(),l.document.$.selection.clear()):t.select(),l.moveToPosition(u,CKEDITOR.POSITION_BEFORE_START),u.remove()):(l.setEndBefore(f),f.remove(),t.select())}else{f=this.getNative();
  550. if(!f)return;this.removeAllRanges();for(t=0;t<a.length;t++){if(t<a.length-1&&(r=a[t],u=a[t+1],q=r.clone(),q.setStart(r.endContainer,r.endOffset),q.setEnd(u.startContainer,u.startOffset),!q.collapsed&&(q.shrink(CKEDITOR.NODE_ELEMENT,!0),l=q.getCommonAncestor(),q=q.getEnclosedNode(),l.isReadOnly()||q&&q.isReadOnly()))){u.setStart(r.startContainer,r.startOffset);a.splice(t--,1);continue}l=a[t];u=this.document.$.createRange();l.collapsed&&CKEDITOR.env.webkit&&e(l)&&(q=g(this.root),l.insertNode(q),(r=
  551. q.getNext())&&!q.getPrevious()&&r.type==CKEDITOR.NODE_ELEMENT&&"br"==r.getName()?(k(this.root),l.moveToPosition(r,CKEDITOR.POSITION_BEFORE_START)):l.moveToPosition(q,CKEDITOR.POSITION_AFTER_END));u.setStart(l.startContainer.$,l.startOffset);try{u.setEnd(l.endContainer.$,l.endOffset)}catch(C){if(0<=C.toString().indexOf("NS_ERROR_ILLEGAL_VALUE"))l.collapse(1),u.setEnd(l.endContainer.$,l.endOffset);else throw C;}f.addRange(u)}}this.reset();this.root.fire("selectionchange")}}},fake:function(a,b){var c=
  552. this.root.editor;void 0===b&&a.hasAttribute("aria-label")&&(b=a.getAttribute("aria-label"));this.reset();q(c,b);var d=this._.cache,e=new CKEDITOR.dom.range(this.root);e.setStartBefore(a);e.setEndAfter(a);d.ranges=new CKEDITOR.dom.rangeList(e);d.selectedElement=d.startElement=a;d.type=CKEDITOR.SELECTION_ELEMENT;d.selectedText=d.nativeSel=null;this.isFake=1;this.rev=w++;c._.fakeSelection=this;this.root.fire("selectionchange")},isHidden:function(){var a=this.getCommonAncestor();a&&a.type==CKEDITOR.NODE_TEXT&&
  553. (a=a.getParent());return!(!a||!a.data("cke-hidden-sel"))},createBookmarks:function(a){a=this.getRanges().createBookmarks(a);this.isFake&&(a.isFake=1);return a},createBookmarks2:function(a){a=this.getRanges().createBookmarks2(a);this.isFake&&(a.isFake=1);return a},selectBookmarks:function(a){for(var b=[],c,d=0;d<a.length;d++){var e=new CKEDITOR.dom.range(this.root);e.moveToBookmark(a[d]);b.push(e)}a.isFake&&(c=b[0].getEnclosedNode(),c&&c.type==CKEDITOR.NODE_ELEMENT||(CKEDITOR.warn("selection-not-fake"),
  554. a.isFake=0));a.isFake?this.fake(c):this.selectRanges(b);return this},getCommonAncestor:function(){var a=this.getRanges();return a.length?a[0].startContainer.getCommonAncestor(a[a.length-1].endContainer):null},scrollIntoView:function(){this.type!=CKEDITOR.SELECTION_NONE&&this.getRanges()[0].scrollIntoView()},removeAllRanges:function(){if(this.getType()!=CKEDITOR.SELECTION_NONE){var a=this.getNative();try{a&&a[n?"empty":"removeAllRanges"]()}catch(b){}this.reset()}}}})();"use strict";
  555. CKEDITOR.STYLE_BLOCK=1;CKEDITOR.STYLE_INLINE=2;CKEDITOR.STYLE_OBJECT=3;
  556. (function(){function a(a,b){for(var c,d;(a=a.getParent())&&!a.equals(b);)if(a.getAttribute("data-nostyle"))c=a;else if(!d){var e=a.getAttribute("contentEditable");"false"==e?c=a:"true"==e&&(d=1)}return c}function d(a,b,c,d){return(a.getPosition(b)|d)==d&&(!c.childRule||c.childRule(a))}function b(c){var f=c.document;if(c.collapsed)f=H(this,f),c.insertNode(f),c.moveToPosition(f,CKEDITOR.POSITION_BEFORE_END);else{var g=this.element,h=this._.definition,k,l=h.ignoreReadonly,n=l||h.includeReadonly;null==
  557. n&&(n=c.root.getCustomData("cke_includeReadonly"));var m=CKEDITOR.dtd[g];m||(k=!0,m=CKEDITOR.dtd.span);c.enlarge(CKEDITOR.ENLARGE_INLINE,1);c.trim();var p=c.createBookmark(),q=p.startNode,v=p.endNode,r=q,t;if(!l){var u=c.getCommonAncestor(),l=a(q,u),u=a(v,u);l&&(r=l.getNextSourceNode(!0));u&&(v=u)}for(r.getPosition(v)==CKEDITOR.POSITION_FOLLOWING&&(r=0);r;){l=!1;if(r.equals(v))r=null,l=!0;else{var y=r.type==CKEDITOR.NODE_ELEMENT?r.getName():null,u=y&&"false"==r.getAttribute("contentEditable"),w=y&&
  558. r.getAttribute("data-nostyle");if(y&&r.data("cke-bookmark")){r=r.getNextSourceNode(!0);continue}if(u&&n&&CKEDITOR.dtd.$block[y])for(var A=r,x=e(A),z=void 0,B=x.length,E=0,A=B&&new CKEDITOR.dom.range(A.getDocument());E<B;++E){var z=x[E],F=CKEDITOR.filter.instances[z.data("cke-filter")];if(F?F.check(this):1)A.selectNodeContents(z),b.call(this,A)}x=y?!m[y]||w?0:u&&!n?0:d(r,v,h,O):1;if(x)if(z=r.getParent(),x=h,B=g,E=k,!z||!(z.getDtd()||CKEDITOR.dtd.span)[B]&&!E||x.parentRule&&!x.parentRule(z))l=!0;else{if(t||
  559. y&&CKEDITOR.dtd.$removeEmpty[y]&&(r.getPosition(v)|O)!=O||(t=c.clone(),t.setStartBefore(r)),y=r.type,y==CKEDITOR.NODE_TEXT||u||y==CKEDITOR.NODE_ELEMENT&&!r.getChildCount()){for(var y=r,P;(l=!y.getNext(Y))&&(P=y.getParent(),m[P.getName()])&&d(P,q,h,N);)y=P;t.setEndAfter(y)}}else l=!0;r=r.getNextSourceNode(w||u)}if(l&&t&&!t.collapsed){for(var l=H(this,f),u=l.hasAttributes(),w=t.getCommonAncestor(),y={},x={},z={},B={},S,V,ca;l&&w;){if(w.getName()==g){for(S in h.attributes)!B[S]&&(ca=w.getAttribute(V))&&
  560. (l.getAttribute(S)==ca?x[S]=1:B[S]=1);for(V in h.styles)!z[V]&&(ca=w.getStyle(V))&&(l.getStyle(V)==ca?y[V]=1:z[V]=1)}w=w.getParent()}for(S in x)l.removeAttribute(S);for(V in y)l.removeStyle(V);u&&!l.hasAttributes()&&(l=null);l?(t.extractContents().appendTo(l),t.insertNode(l),D.call(this,l),l.mergeSiblings(),CKEDITOR.env.ie||l.$.normalize()):(l=new CKEDITOR.dom.element("span"),t.extractContents().appendTo(l),t.insertNode(l),D.call(this,l),l.remove(!0));t=null}}c.moveToBookmark(p);c.shrink(CKEDITOR.SHRINK_TEXT);
  561. c.shrink(CKEDITOR.NODE_ELEMENT,!0)}}function c(a){function b(){for(var a=new CKEDITOR.dom.elementPath(d.getParent()),c=new CKEDITOR.dom.elementPath(m.getParent()),e=null,f=null,g=0;g<a.elements.length;g++){var h=a.elements[g];if(h==a.block||h==a.blockLimit)break;p.checkElementRemovable(h,!0)&&(e=h)}for(g=0;g<c.elements.length;g++){h=c.elements[g];if(h==c.block||h==c.blockLimit)break;p.checkElementRemovable(h,!0)&&(f=h)}f&&m.breakParent(f);e&&d.breakParent(e)}a.enlarge(CKEDITOR.ENLARGE_INLINE,1);var c=
  562. a.createBookmark(),d=c.startNode;if(a.collapsed){for(var e=new CKEDITOR.dom.elementPath(d.getParent(),a.root),f,g=0,k;g<e.elements.length&&(k=e.elements[g])&&k!=e.block&&k!=e.blockLimit;g++)if(this.checkElementRemovable(k)){var l;a.collapsed&&(a.checkBoundaryOfElement(k,CKEDITOR.END)||(l=a.checkBoundaryOfElement(k,CKEDITOR.START)))?(f=k,f.match=l?"start":"end"):(k.mergeSiblings(),k.is(this.element)?r.call(this,k):n(k,h(this)[k.getName()]))}if(f){k=d;for(g=0;;g++){l=e.elements[g];if(l.equals(f))break;
  563. else if(l.match)continue;else l=l.clone();l.append(k);k=l}k["start"==f.match?"insertBefore":"insertAfter"](f)}}else{var m=c.endNode,p=this;b();for(e=d;!e.equals(m);)f=e.getNextSourceNode(),e.type==CKEDITOR.NODE_ELEMENT&&this.checkElementRemovable(e)&&(e.getName()==this.element?r.call(this,e):n(e,h(this)[e.getName()]),f.type==CKEDITOR.NODE_ELEMENT&&f.contains(d)&&(b(),f=d.getNext())),e=f}a.moveToBookmark(c);a.shrink(CKEDITOR.NODE_ELEMENT,!0)}function e(a){var b=[];a.forEach(function(a){if("true"==
  564. a.getAttribute("contenteditable"))return b.push(a),!1},CKEDITOR.NODE_ELEMENT,!0);return b}function g(a){var b=a.getEnclosedNode()||a.getCommonAncestor(!1,!0);(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1))&&!a.isReadOnly()&&u(a,this)}function k(a){var b=a.getCommonAncestor(!0,!0);if(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1)){var b=this._.definition,c=b.attributes;if(c)for(var d in c)a.removeAttribute(d,c[d]);if(b.styles)for(var e in b.styles)b.styles.hasOwnProperty(e)&&
  565. a.removeStyle(e)}}function l(a){var b=a.createBookmark(!0),c=a.createIterator();c.enforceRealBlocks=!0;this._.enterMode&&(c.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR);for(var d,e=a.document,f;d=c.getNextParagraph();)!d.isReadOnly()&&(c.activeFilter?c.activeFilter.check(this):1)&&(f=H(this,e,d),v(d,f));a.moveToBookmark(b)}function q(a){var b=a.createBookmark(1),c=a.createIterator();c.enforceRealBlocks=!0;c.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;for(var d,e;d=c.getNextParagraph();)this.checkElementRemovable(d)&&
  566. (d.is("pre")?((e=this._.enterMode==CKEDITOR.ENTER_BR?null:a.document.createElement(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))&&d.copyAttributes(e),v(d,e)):r.call(this,d));a.moveToBookmark(b)}function v(a,b){var c=!b;c&&(b=a.getDocument().createElement("div"),a.copyAttributes(b));var d=b&&b.is("pre"),e=a.is("pre"),g=!d&&e;if(d&&!e){e=b;(g=a.getBogus())&&g.remove();g=a.getHtml();g=y(g,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"");g=g.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1");g=g.replace(/([ \t\n\r]+|&nbsp;)/g,
  567. " ");g=g.replace(/<br\b[^>]*>/gi,"\n");if(CKEDITOR.env.ie){var h=a.getDocument().createElement("div");h.append(e);e.$.outerHTML="\x3cpre\x3e"+g+"\x3c/pre\x3e";e.copyAttributes(h.getFirst());e=h.getFirst().remove()}else e.setHtml(g);b=e}else g?b=A(c?[a.getHtml()]:f(a),b):a.moveChildren(b);b.replace(a);if(d){var c=b,k;(k=c.getPrevious(P))&&k.type==CKEDITOR.NODE_ELEMENT&&k.is("pre")&&(d=y(k.getHtml(),/\n$/,"")+"\n\n"+y(c.getHtml(),/^\n/,""),CKEDITOR.env.ie?c.$.outerHTML="\x3cpre\x3e"+d+"\x3c/pre\x3e":
  568. c.setHtml(d),k.remove())}else c&&w(b)}function f(a){var b=[];y(a.getOuterHtml(),/(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,c){return b+"\x3c/pre\x3e"+c+"\x3cpre\x3e"}).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(a,c){b.push(c)});return b}function y(a,b,c){var d="",e="";a=a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,function(a,b,c){b&&(d=b);c&&(e=c);return""});return d+a.replace(b,c)+e}function A(a,b){var c;
  569. 1<a.length&&(c=new CKEDITOR.dom.documentFragment(b.getDocument()));for(var d=0;d<a.length;d++){var e=a[d],e=e.replace(/(\r\n|\r)/g,"\n"),e=y(e,/^[ \t]*\n/,""),e=y(e,/\n$/,""),e=y(e,/^[ \t]+|[ \t]+$/g,function(a,b){return 1==a.length?"\x26nbsp;":b?" "+CKEDITOR.tools.repeat("\x26nbsp;",a.length-1):CKEDITOR.tools.repeat("\x26nbsp;",a.length-1)+" "}),e=e.replace(/\n/g,"\x3cbr\x3e"),e=e.replace(/[ \t]{2,}/g,function(a){return CKEDITOR.tools.repeat("\x26nbsp;",a.length-1)+" "});if(c){var f=b.clone();f.setHtml(e);
  570. c.append(f)}else b.setHtml(e)}return c||b}function r(a,b){var c=this._.definition,d=c.attributes,c=c.styles,e=h(this)[a.getName()],f=CKEDITOR.tools.isEmpty(d)&&CKEDITOR.tools.isEmpty(c),g;for(g in d)if("class"!=g&&!this._.definition.fullMatch||a.getAttribute(g)==p(g,d[g]))b&&"data-"==g.slice(0,5)||(f=a.hasAttribute(g),a.removeAttribute(g));for(var k in c)this._.definition.fullMatch&&a.getStyle(k)!=p(k,c[k],!0)||(f=f||!!a.getStyle(k),a.removeStyle(k));n(a,e,z[a.getName()]);f&&(this._.definition.alwaysRemoveElement?
  571. w(a,1):!CKEDITOR.dtd.$block[a.getName()]||this._.enterMode==CKEDITOR.ENTER_BR&&!a.hasAttributes()?w(a):a.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function D(a){for(var b=h(this),c=a.getElementsByTag(this.element),d,e=c.count();0<=--e;)d=c.getItem(e),d.isReadOnly()||r.call(this,d,!0);for(var f in b)if(f!=this.element)for(c=a.getElementsByTag(f),e=c.count()-1;0<=e;e--)d=c.getItem(e),d.isReadOnly()||n(d,b[f])}function n(a,b,c){if(b=b&&b.attributes)for(var d=0;d<b.length;d++){var e=b[d][0],
  572. f;if(f=a.getAttribute(e)){var g=b[d][1];(null===g||g.test&&g.test(f)||"string"==typeof g&&f==g)&&a.removeAttribute(e)}}c||w(a)}function w(a,b){if(!a.hasAttributes()||b)if(CKEDITOR.dtd.$block[a.getName()]){var c=a.getPrevious(P),d=a.getNext(P);!c||c.type!=CKEDITOR.NODE_TEXT&&c.isBlockBoundary({br:1})||a.append("br",1);!d||d.type!=CKEDITOR.NODE_TEXT&&d.isBlockBoundary({br:1})||a.append("br");a.remove(!0)}else c=a.getFirst(),d=a.getLast(),a.remove(!0),c&&(c.type==CKEDITOR.NODE_ELEMENT&&c.mergeSiblings(),
  573. d&&!c.equals(d)&&d.type==CKEDITOR.NODE_ELEMENT&&d.mergeSiblings())}function H(a,b,c){var d;d=a.element;"*"==d&&(d="span");d=new CKEDITOR.dom.element(d,b);c&&c.copyAttributes(d);d=u(d,a);b.getCustomData("doc_processing_style")&&d.hasAttribute("id")?d.removeAttribute("id"):b.setCustomData("doc_processing_style",1);return d}function u(a,b){var c=b._.definition,d=c.attributes,c=CKEDITOR.style.getStyleText(c);if(d)for(var e in d)a.setAttribute(e,d[e]);c&&a.setAttribute("style",c);return a}function t(a,
  574. b){for(var c in a)a[c]=a[c].replace(E,function(a,c){return b[c]})}function h(a){if(a._.overrides)return a._.overrides;var b=a._.overrides={},c=a._.definition.overrides;if(c){CKEDITOR.tools.isArray(c)||(c=[c]);for(var d=0;d<c.length;d++){var e=c[d],f,g;"string"==typeof e?f=e.toLowerCase():(f=e.element?e.element.toLowerCase():a.element,g=e.attributes);e=b[f]||(b[f]={});if(g){var e=e.attributes=e.attributes||[],h;for(h in g)e.push([h.toLowerCase(),g[h]])}}}return b}function p(a,b,c){var d=new CKEDITOR.dom.element("span");
  575. d[c?"setStyle":"setAttribute"](a,b);return d[c?"getStyle":"getAttribute"](a)}function m(a,b){function c(a,b){return"font-family"==b.toLowerCase()?a.replace(/["']/g,""):a}"string"==typeof a&&(a=CKEDITOR.tools.parseCssText(a));"string"==typeof b&&(b=CKEDITOR.tools.parseCssText(b,!0));for(var d in a)if(!(d in b)||c(b[d],d)!=c(a[d],d)&&"inherit"!=a[d]&&"inherit"!=b[d])return!1;return!0}function x(a,b,c){var d=a.document,e=a.getRanges();b=b?this.removeFromRange:this.applyToRange;for(var f,g=e.createIterator();f=
  576. g.getNextRange();)b.call(this,f,c);a.selectRanges(e);d.removeCustomData("doc_processing_style")}var z={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1},F={a:1,blockquote:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1,audio:1,video:1},B=/\s*(?:;\s*|$)/,E=/#\((.+?)\)/g,Y=CKEDITOR.dom.walker.bookmark(0,
  577. 1),P=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(a,b){if("string"==typeof a.type)return new CKEDITOR.style.customHandlers[a.type](a);var c=a.attributes;c&&c.style&&(a.styles=CKEDITOR.tools.extend({},a.styles,CKEDITOR.tools.parseCssText(c.style)),delete c.style);b&&(a=CKEDITOR.tools.clone(a),t(a.attributes,b),t(a.styles,b));c=this.element=a.element?"string"==typeof a.element?a.element.toLowerCase():a.element:"*";this.type=a.type||(z[c]?CKEDITOR.STYLE_BLOCK:F[c]?CKEDITOR.STYLE_OBJECT:
  578. CKEDITOR.STYLE_INLINE);"object"==typeof this.element&&(this.type=CKEDITOR.STYLE_OBJECT);this._={definition:a}};CKEDITOR.style.prototype={apply:function(a){if(a instanceof CKEDITOR.dom.document)return x.call(this,a.getSelection());if(this.checkApplicable(a.elementPath(),a)){var b=this._.enterMode;b||(this._.enterMode=a.activeEnterMode);x.call(this,a.getSelection(),0,a);this._.enterMode=b}},remove:function(a){if(a instanceof CKEDITOR.dom.document)return x.call(this,a.getSelection(),1);if(this.checkApplicable(a.elementPath(),
  579. a)){var b=this._.enterMode;b||(this._.enterMode=a.activeEnterMode);x.call(this,a.getSelection(),1,a);this._.enterMode=b}},applyToRange:function(a){this.applyToRange=this.type==CKEDITOR.STYLE_INLINE?b:this.type==CKEDITOR.STYLE_BLOCK?l:this.type==CKEDITOR.STYLE_OBJECT?g:null;return this.applyToRange(a)},removeFromRange:function(a){this.removeFromRange=this.type==CKEDITOR.STYLE_INLINE?c:this.type==CKEDITOR.STYLE_BLOCK?q:this.type==CKEDITOR.STYLE_OBJECT?k:null;return this.removeFromRange(a)},applyToObject:function(a){u(a,
  580. this)},checkActive:function(a,b){switch(this.type){case CKEDITOR.STYLE_BLOCK:return this.checkElementRemovable(a.block||a.blockLimit,!0,b);case CKEDITOR.STYLE_OBJECT:case CKEDITOR.STYLE_INLINE:for(var c=a.elements,d=0,e;d<c.length;d++)if(e=c[d],this.type!=CKEDITOR.STYLE_INLINE||e!=a.block&&e!=a.blockLimit){if(this.type==CKEDITOR.STYLE_OBJECT){var f=e.getName();if(!("string"==typeof this.element?f==this.element:f in this.element))continue}if(this.checkElementRemovable(e,!0,b))return!0}}return!1},checkApplicable:function(a,
  581. b,c){b&&b instanceof CKEDITOR.filter&&(c=b);if(c&&!c.check(this))return!1;switch(this.type){case CKEDITOR.STYLE_OBJECT:return!!a.contains(this.element);case CKEDITOR.STYLE_BLOCK:return!!a.blockLimit.getDtd()[this.element]}return!0},checkElementMatch:function(a,b){var c=this._.definition;if(!a||!c.ignoreReadonly&&a.isReadOnly())return!1;var d=a.getName();if("string"==typeof this.element?d==this.element:d in this.element){if(!b&&!a.hasAttributes())return!0;if(d=c._AC)c=d;else{var d={},e=0,f=c.attributes;
  582. if(f)for(var g in f)e++,d[g]=f[g];if(g=CKEDITOR.style.getStyleText(c))d.style||e++,d.style=g;d._length=e;c=c._AC=d}if(c._length){for(var h in c)if("_length"!=h)if(d=a.getAttribute(h)||"","style"==h?m(c[h],d):c[h]==d){if(!b)return!0}else if(b)return!1;if(b)return!0}else return!0}return!1},checkElementRemovable:function(a,b,c){if(this.checkElementMatch(a,b,c))return!0;if(b=h(this)[a.getName()]){var d;if(!(b=b.attributes))return!0;for(c=0;c<b.length;c++)if(d=b[c][0],d=a.getAttribute(d)){var e=b[c][1];
  583. if(null===e)return!0;if("string"==typeof e){if(d==e)return!0}else if(e.test(d))return!0}}return!1},buildPreview:function(a){var b=this._.definition,c=[],d=b.element;"bdo"==d&&(d="span");var c=["\x3c",d],e=b.attributes;if(e)for(var f in e)c.push(" ",f,'\x3d"',e[f],'"');(e=CKEDITOR.style.getStyleText(b))&&c.push(' style\x3d"',e,'"');c.push("\x3e",a||b.name,"\x3c/",d,"\x3e");return c.join("")},getDefinition:function(){return this._.definition}};CKEDITOR.style.getStyleText=function(a){var b=a._ST;if(b)return b;
  584. var b=a.styles,c=a.attributes&&a.attributes.style||"",d="";c.length&&(c=c.replace(B,";"));for(var e in b){var f=b[e],g=(e+":"+f).replace(B,";");"inherit"==f?d+=g:c+=g}c.length&&(c=CKEDITOR.tools.normalizeCssText(c,!0));return a._ST=c+d};CKEDITOR.style.customHandlers={};CKEDITOR.style.addCustomHandler=function(a){var b=function(a){this._={definition:a};this.setup&&this.setup(a)};b.prototype=CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype),{assignedTo:CKEDITOR.STYLE_OBJECT},
  585. a,!0);return this.customHandlers[a.type]=b};var O=CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED,N=CKEDITOR.POSITION_FOLLOWING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED})();CKEDITOR.styleCommand=function(a,d){this.requiredContent=this.allowedContent=this.style=a;CKEDITOR.tools.extend(this,d,!0)};
  586. CKEDITOR.styleCommand.prototype.exec=function(a){a.focus();this.state==CKEDITOR.TRISTATE_OFF?a.applyStyle(this.style):this.state==CKEDITOR.TRISTATE_ON&&a.removeStyle(this.style)};CKEDITOR.stylesSet=new CKEDITOR.resourceManager("","stylesSet");CKEDITOR.addStylesSet=CKEDITOR.tools.bind(CKEDITOR.stylesSet.add,CKEDITOR.stylesSet);CKEDITOR.loadStylesSet=function(a,d,b){CKEDITOR.stylesSet.addExternal(a,d,"");CKEDITOR.stylesSet.load(a,b)};
  587. CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{attachStyleStateChange:function(a,d){var b=this._.styleStateChangeCallbacks;b||(b=this._.styleStateChangeCallbacks=[],this.on("selectionChange",function(a){for(var d=0;d<b.length;d++){var g=b[d],k=g.style.checkActive(a.data.path,this)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF;g.fn.call(this,k)}}));b.push({style:a,fn:d})},applyStyle:function(a){a.apply(this)},removeStyle:function(a){a.remove(this)},getStylesSet:function(a){if(this._.stylesDefinitions)a(this._.stylesDefinitions);
  588. else{var d=this,b=d.config.stylesCombo_stylesSet||d.config.stylesSet;if(!1===b)a(null);else if(b instanceof Array)d._.stylesDefinitions=b,a(b);else{b||(b="default");var b=b.split(":"),c=b[0];CKEDITOR.stylesSet.addExternal(c,b[1]?b.slice(1).join(":"):CKEDITOR.getUrl("styles.js"),"");CKEDITOR.stylesSet.load(c,function(b){d._.stylesDefinitions=b[c];a(d._.stylesDefinitions)})}}}});
  589. CKEDITOR.dom.comment=function(a,d){"string"==typeof a&&(a=(d?d.$:document).createComment(a));CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.comment.prototype=new CKEDITOR.dom.node;CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype,{type:CKEDITOR.NODE_COMMENT,getOuterHtml:function(){return"\x3c!--"+this.$.nodeValue+"--\x3e"}});"use strict";
  590. (function(){var a={},d={},b;for(b in CKEDITOR.dtd.$blockLimit)b in CKEDITOR.dtd.$list||(a[b]=1);for(b in CKEDITOR.dtd.$block)b in CKEDITOR.dtd.$blockLimit||b in CKEDITOR.dtd.$empty||(d[b]=1);CKEDITOR.dom.elementPath=function(b,e){var g=null,k=null,l=[],q=b,v;e=e||b.getDocument().getBody();do if(q.type==CKEDITOR.NODE_ELEMENT){l.push(q);if(!this.lastElement&&(this.lastElement=q,q.is(CKEDITOR.dtd.$object)||"false"==q.getAttribute("contenteditable")))continue;if(q.equals(e))break;if(!k&&(v=q.getName(),
  591. "true"==q.getAttribute("contenteditable")?k=q:!g&&d[v]&&(g=q),a[v])){if(v=!g&&"div"==v){a:{v=q.getChildren();for(var f=0,y=v.count();f<y;f++){var A=v.getItem(f);if(A.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[A.getName()]){v=!0;break a}}v=!1}v=!v}v?g=q:k=q}}while(q=q.getParent());k||(k=e);this.block=g;this.blockLimit=k;this.root=e;this.elements=l}})();
  592. CKEDITOR.dom.elementPath.prototype={compare:function(a){var d=this.elements;a=a&&a.elements;if(!a||d.length!=a.length)return!1;for(var b=0;b<d.length;b++)if(!d[b].equals(a[b]))return!1;return!0},contains:function(a,d,b){var c;"string"==typeof a&&(c=function(b){return b.getName()==a});a instanceof CKEDITOR.dom.element?c=function(b){return b.equals(a)}:CKEDITOR.tools.isArray(a)?c=function(b){return-1<CKEDITOR.tools.indexOf(a,b.getName())}:"function"==typeof a?c=a:"object"==typeof a&&(c=function(b){return b.getName()in
  593. a});var e=this.elements,g=e.length;d&&g--;b&&(e=Array.prototype.slice.call(e,0),e.reverse());for(d=0;d<g;d++)if(c(e[d]))return e[d];return null},isContextFor:function(a){var d;return a in CKEDITOR.dtd.$block?(d=this.contains(CKEDITOR.dtd.$intermediate)||this.root.equals(this.block)&&this.block||this.blockLimit,!!d.getDtd()[a]):!0},direction:function(){return(this.block||this.blockLimit||this.root).getDirection(1)}};
  594. CKEDITOR.dom.text=function(a,d){"string"==typeof a&&(a=(d?d.$:document).createTextNode(a));this.$=a};CKEDITOR.dom.text.prototype=new CKEDITOR.dom.node;
  595. CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype,{type:CKEDITOR.NODE_TEXT,getLength:function(){return this.$.nodeValue.length},getText:function(){return this.$.nodeValue},setText:function(a){this.$.nodeValue=a},split:function(a){var d=this.$.parentNode,b=d.childNodes.length,c=this.getLength(),e=this.getDocument(),g=new CKEDITOR.dom.text(this.$.splitText(a),e);d.childNodes.length==b&&(a>=c?(g=e.createText(""),g.insertAfter(this)):(a=e.createText(""),a.insertAfter(g),a.remove()));return g},substring:function(a,
  596. d){return"number"!=typeof d?this.$.nodeValue.substr(a):this.$.nodeValue.substring(a,d)}});
  597. (function(){function a(a,c,d){var g=a.serializable,k=c[d?"endContainer":"startContainer"],l=d?"endOffset":"startOffset",q=g?c.document.getById(a.startNode):a.startNode;a=g?c.document.getById(a.endNode):a.endNode;k.equals(q.getPrevious())?(c.startOffset=c.startOffset-k.getLength()-a.getPrevious().getLength(),k=a.getNext()):k.equals(a.getPrevious())&&(c.startOffset-=k.getLength(),k=a.getNext());k.equals(q.getParent())&&c[l]++;k.equals(a.getParent())&&c[l]++;c[d?"endContainer":"startContainer"]=k;return c}
  598. CKEDITOR.dom.rangeList=function(a){if(a instanceof CKEDITOR.dom.rangeList)return a;a?a instanceof CKEDITOR.dom.range&&(a=[a]):a=[];return CKEDITOR.tools.extend(a,d)};var d={createIterator:function(){var a=this,c=CKEDITOR.dom.walker.bookmark(),d=[],g;return{getNextRange:function(k){g=void 0===g?0:g+1;var l=a[g];if(l&&1<a.length){if(!g)for(var q=a.length-1;0<=q;q--)d.unshift(a[q].createBookmark(!0));if(k)for(var v=0;a[g+v+1];){var f=l.document;k=0;q=f.getById(d[v].endNode);for(f=f.getById(d[v+1].startNode);;){q=
  599. q.getNextSourceNode(!1);if(f.equals(q))k=1;else if(c(q)||q.type==CKEDITOR.NODE_ELEMENT&&q.isBlockBoundary())continue;break}if(!k)break;v++}for(l.moveToBookmark(d.shift());v--;)q=a[++g],q.moveToBookmark(d.shift()),l.setEnd(q.endContainer,q.endOffset)}return l}}},createBookmarks:function(b){for(var c=[],d,g=0;g<this.length;g++){c.push(d=this[g].createBookmark(b,!0));for(var k=g+1;k<this.length;k++)this[k]=a(d,this[k]),this[k]=a(d,this[k],!0)}return c},createBookmarks2:function(a){for(var c=[],d=0;d<
  600. this.length;d++)c.push(this[d].createBookmark2(a));return c},moveToBookmarks:function(a){for(var c=0;c<this.length;c++)this[c].moveToBookmark(a[c])}}})();
  601. (function(){function a(){return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1]||"skins/"+CKEDITOR.skinName.split(",")[0]+"/")}function d(b){var c=CKEDITOR.skin["ua_"+b],d=CKEDITOR.env;if(c)for(var c=c.split(",").sort(function(a,b){return a>b?-1:1}),e=0,g;e<c.length;e++)if(g=c[e],d.ie&&(g.replace(/^ie/,"")==d.version||d.quirks&&"iequirks"==g)&&(g="ie"),d[g]){b+="_"+c[e];break}return CKEDITOR.getUrl(a()+b+".css")}function b(a,b){g[a]||(CKEDITOR.document.appendStyleSheet(d(a)),g[a]=1);b&&b()}function c(a){var b=
  602. a.getById(k);b||(b=a.getHead().append("style"),b.setAttribute("id",k),b.setAttribute("type","text/css"));return b}function e(a,b,c){var d,e,g;if(CKEDITOR.env.webkit)for(b=b.split("}").slice(0,-1),e=0;e<b.length;e++)b[e]=b[e].split("{");for(var k=0;k<a.length;k++)if(CKEDITOR.env.webkit)for(e=0;e<b.length;e++){g=b[e][1];for(d=0;d<c.length;d++)g=g.replace(c[d][0],c[d][1]);a[k].$.sheet.addRule(b[e][0],g)}else{g=b;for(d=0;d<c.length;d++)g=g.replace(c[d][0],c[d][1]);CKEDITOR.env.ie&&11>CKEDITOR.env.version?
  603. a[k].$.styleSheet.cssText+=g:a[k].$.innerHTML+=g}}var g={};CKEDITOR.skin={path:a,loadPart:function(c,d){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a()+"skin.js"),function(){b(c,d)}):b(c,d)},getPath:function(a){return CKEDITOR.getUrl(d(a))},icons:{},addIcon:function(a,b,c,d){a=a.toLowerCase();this.icons[a]||(this.icons[a]={path:b,offset:c||0,bgsize:d||"16px"})},getIconStyle:function(a,b,c,d,e){var g;a&&(a=a.toLowerCase(),b&&(g=this.icons[a+"-rtl"]),
  604. g||(g=this.icons[a]));a=c||g&&g.path||"";d=d||g&&g.offset;e=e||g&&g.bgsize||"16px";a&&(a=a.replace(/'/g,"\\'"));return a&&"background-image:url('"+CKEDITOR.getUrl(a)+"');background-position:0 "+d+"px;background-size:"+e+";"}};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{getUiColor:function(){return this.uiColor},setUiColor:function(a){var b=c(CKEDITOR.document);return(this.setUiColor=function(a){this.uiColor=a;var c=CKEDITOR.skin.chameleon,d="",g="";"function"==typeof c&&(d=c(this,"editor"),g=
  605. c(this,"panel"));a=[[q,a]];e([b],d,a);e(l,g,a)}).call(this,a)}});var k="cke_ui_color",l=[],q=/\$color/g;CKEDITOR.on("instanceLoaded",function(a){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var b=a.editor;a=function(a){a=(a.data[0]||a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();if(!a.getById("cke_ui_color")){a=c(a);l.push(a);var d=b.getUiColor();d&&e([a],CKEDITOR.skin.chameleon(b,"panel"),[[q,d]])}};b.on("panelShow",a);b.on("menuShow",a);b.config.uiColor&&b.setUiColor(b.config.uiColor)}})})();
  606. (function(){if(CKEDITOR.env.webkit)CKEDITOR.env.hc=!1;else{var a=CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"\x3e\x3c/div\x3e',CKEDITOR.document);a.appendTo(CKEDITOR.document.getHead());try{var d=a.getComputedStyle("border-top-color"),b=a.getComputedStyle("border-right-color");CKEDITOR.env.hc=!(!d||d!=b)}catch(c){CKEDITOR.env.hc=!1}a.remove()}CKEDITOR.env.hc&&(CKEDITOR.env.cssClass+=" cke_hc");CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");
  607. CKEDITOR.status="loaded";CKEDITOR.fireOnce("loaded");if(a=CKEDITOR._.pending)for(delete CKEDITOR._.pending,d=0;d<a.length;d++)CKEDITOR.editor.prototype.constructor.apply(a[d][0],a[d][1]),CKEDITOR.add(a[d][0])})();/*
  608. Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  609. For licensing, see LICENSE.md or http://ckeditor.com/license
  610. */
  611. CKEDITOR.skin.name="moono";CKEDITOR.skin.ua_editor="ie,iequirks,ie7,ie8,gecko";CKEDITOR.skin.ua_dialog="ie,iequirks,ie7,ie8";
  612. CKEDITOR.skin.chameleon=function(){var b=function(){return function(b,e){for(var a=b.match(/[^#]./g),c=0;3>c;c++){var f=c,d;d=parseInt(a[c],16);d=("0"+(0>e?0|d*(1+e):0|d+(255-d)*e).toString(16)).slice(-2);a[f]=d}return"#"+a.join("")}}(),c=function(){var b=new CKEDITOR.template("background:#{to};background-image:linear-gradient(to bottom,{from},{to});filter:progid:DXImageTransform.Microsoft.gradient(gradientType\x3d0,startColorstr\x3d'{from}',endColorstr\x3d'{to}');");return function(c,a){return b.output({from:c,
  613. to:a})}}(),f={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ {defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_bottom [{defaultGradient}border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [{defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [{defaultGradient}outline-color:{defaultBorder};border-top-color:{defaultBorder};] {id} .cke_dialog_tab [{lightGradient}border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [{mediumGradient}] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} .cke_toolgroup [{lightGradient}border-color:{defaultBorder};] {id} a.cke_button_off:hover, {id} a.cke_button_off:focus, {id} a.cke_button_off:active [{mediumGradient}] {id} .cke_button_on [{ckeButtonOn}] {id} .cke_toolbar_separator [background-color: {ckeToolbarSeparator};] {id} .cke_combo_button [border-color:{defaultBorder};{lightGradient}] {id} a.cke_combo_button:hover, {id} a.cke_combo_button:focus, {id} .cke_combo_on a.cke_combo_button [border-color:{defaultBorder};{mediumGradient}] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover, {id} a.cke_path_item:focus, {id} a.cke_path_item:active [background-color:{elementsPathBg};] {id}.cke_panel [border-color:{defaultBorder};] "),
  614. panel:new CKEDITOR.template(".cke_panel_grouptitle [{lightGradient}border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:focus.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:focus.cke_colorauto, a:focus.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")};
  615. return function(g,e){var a=g.uiColor,a={id:"."+g.id,defaultBorder:b(a,-.1),defaultGradient:c(b(a,.9),a),lightGradient:c(b(a,1),b(a,.7)),mediumGradient:c(b(a,.8),b(a,.5)),ckeButtonOn:c(b(a,.6),b(a,.7)),ckeResizer:b(a,-.4),ckeToolbarSeparator:b(a,.5),ckeColorauto:b(a,.8),dialogBody:b(a,.7),dialogTabSelected:c("#FFFFFF","#FFFFFF"),dialogTabSelectedBorder:"#FFF",elementsPathColor:b(a,-.6),elementsPathBg:a,menubuttonIcon:b(a,.5),menubuttonIconHover:b(a,.3)};return f[e].output(a).replace(/\[/g,"{").replace(/\]/g,
  616. "}")}}();CKEDITOR.plugins.add("dialogui",{onLoad:function(){var h=function(b){this._||(this._={});this._["default"]=this._.initValue=b["default"]||"";this._.required=b.required||!1;for(var a=[this._],d=1;d<arguments.length;d++)a.push(arguments[d]);a.push(!0);CKEDITOR.tools.extend.apply(CKEDITOR.tools,a);return this._},v={build:function(b,a,d){return new CKEDITOR.ui.dialog.textInput(b,a,d)}},n={build:function(b,a,d){return new CKEDITOR.ui.dialog[a.type](b,a,d)}},q={isChanged:function(){return this.getValue()!=
  617. this.getInitValue()},reset:function(b){this.setValue(this.getInitValue(),b)},setInitValue:function(){this._.initValue=this.getValue()},resetInitValue:function(){this._.initValue=this._["default"]},getInitValue:function(){return this._.initValue}},r=CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onChange:function(b,a){this._.domOnChangeRegistered||(b.on("load",function(){this.getInputElement().on("change",function(){b.parts.dialog.isVisible()&&this.fire("change",{value:this.getValue()})},
  618. this)},this),this._.domOnChangeRegistered=!0);this.on("change",a)}},!0),x=/^on([A-Z]\w+)/,t=function(b){for(var a in b)(x.test(a)||"title"==a||"type"==a)&&delete b[a];return b},w=function(b){b=b.data.getKeystroke();b==CKEDITOR.SHIFT+CKEDITOR.ALT+36?this.setDirectionMarker("ltr"):b==CKEDITOR.SHIFT+CKEDITOR.ALT+35&&this.setDirectionMarker("rtl")};CKEDITOR.tools.extend(CKEDITOR.ui.dialog,{labeledElement:function(b,a,d,f){if(!(4>arguments.length)){var c=h.call(this,a);c.labelId=CKEDITOR.tools.getNextId()+
  619. "_label";this._.children=[];var e={role:a.role||"presentation"};a.includeLabel&&(e["aria-labelledby"]=c.labelId);CKEDITOR.ui.dialog.uiElement.call(this,b,a,d,"div",null,e,function(){var e=[],g=a.required?" cke_required":"";"horizontal"!=a.labelLayout?e.push('\x3clabel class\x3d"cke_dialog_ui_labeled_label'+g+'" ',' id\x3d"'+c.labelId+'"',c.inputId?' for\x3d"'+c.inputId+'"':"",(a.labelStyle?' style\x3d"'+a.labelStyle+'"':"")+"\x3e",a.label,"\x3c/label\x3e",'\x3cdiv class\x3d"cke_dialog_ui_labeled_content"',
  620. a.controlStyle?' style\x3d"'+a.controlStyle+'"':"",' role\x3d"presentation"\x3e',f.call(this,b,a),"\x3c/div\x3e"):(g={type:"hbox",widths:a.widths,padding:0,children:[{type:"html",html:'\x3clabel class\x3d"cke_dialog_ui_labeled_label'+g+'" id\x3d"'+c.labelId+'" for\x3d"'+c.inputId+'"'+(a.labelStyle?' style\x3d"'+a.labelStyle+'"':"")+"\x3e"+CKEDITOR.tools.htmlEncode(a.label)+"\x3c/label\x3e"},{type:"html",html:'\x3cspan class\x3d"cke_dialog_ui_labeled_content"'+(a.controlStyle?' style\x3d"'+a.controlStyle+
  621. '"':"")+"\x3e"+f.call(this,b,a)+"\x3c/span\x3e"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,g,e));return e.join("")})}},textInput:function(b,a,d){if(!(3>arguments.length)){h.call(this,a);var f=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",c={"class":"cke_dialog_ui_input_"+a.type,id:f,type:a.type};a.validate&&(this.validate=a.validate);a.maxLength&&(c.maxlength=a.maxLength);a.size&&(c.size=a.size);a.inputStyle&&(c.style=a.inputStyle);var e=this,m=!1;b.on("load",function(){e.getInputElement().on("keydown",
  622. function(a){13==a.data.getKeystroke()&&(m=!0)});e.getInputElement().on("keyup",function(a){13==a.data.getKeystroke()&&m&&(b.getButton("ok")&&setTimeout(function(){b.getButton("ok").click()},0),m=!1);e.bidi&&w.call(e,a)},null,null,1E3)});CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){var b=['\x3cdiv class\x3d"cke_dialog_ui_input_',a.type,'" role\x3d"presentation"'];a.width&&b.push('style\x3d"width:'+a.width+'" ');b.push("\x3e\x3cinput ");c["aria-labelledby"]=this._.labelId;this._.required&&
  623. (c["aria-required"]=this._.required);for(var e in c)b.push(e+'\x3d"'+c[e]+'" ');b.push(" /\x3e\x3c/div\x3e");return b.join("")})}},textarea:function(b,a,d){if(!(3>arguments.length)){h.call(this,a);var f=this,c=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",e={};a.validate&&(this.validate=a.validate);e.rows=a.rows||5;e.cols=a.cols||20;e["class"]="cke_dialog_ui_input_textarea "+(a["class"]||"");"undefined"!=typeof a.inputStyle&&(e.style=a.inputStyle);a.dir&&(e.dir=a.dir);if(f.bidi)b.on("load",
  624. function(){f.getInputElement().on("keyup",w)},f);CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){e["aria-labelledby"]=this._.labelId;this._.required&&(e["aria-required"]=this._.required);var a=['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"',c,'" '],b;for(b in e)a.push(b+'\x3d"'+CKEDITOR.tools.htmlEncode(e[b])+'" ');a.push("\x3e",CKEDITOR.tools.htmlEncode(f._["default"]),"\x3c/textarea\x3e\x3c/div\x3e");return a.join("")})}},checkbox:function(b,
  625. a,d){if(!(3>arguments.length)){var f=h.call(this,a,{"default":!!a["default"]});a.validate&&(this.validate=a.validate);CKEDITOR.ui.dialog.uiElement.call(this,b,a,d,"span",null,null,function(){var c=CKEDITOR.tools.extend({},a,{id:a.id?a.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),e=[],d=CKEDITOR.tools.getNextId()+"_label",g={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":d};t(c);a["default"]&&(g.checked="checked");"undefined"!=typeof c.inputStyle&&(c.style=c.inputStyle);
  626. f.checkbox=new CKEDITOR.ui.dialog.uiElement(b,c,e,"input",null,g);e.push(' \x3clabel id\x3d"',d,'" for\x3d"',g.id,'"'+(a.labelStyle?' style\x3d"'+a.labelStyle+'"':"")+"\x3e",CKEDITOR.tools.htmlEncode(a.label),"\x3c/label\x3e");return e.join("")})}},radio:function(b,a,d){if(!(3>arguments.length)){h.call(this,a);this._["default"]||(this._["default"]=this._.initValue=a.items[0][1]);a.validate&&(this.validate=a.validate);var f=[],c=this;a.role="radiogroup";a.includeLabel=!0;CKEDITOR.ui.dialog.labeledElement.call(this,
  627. b,a,d,function(){for(var e=[],d=[],g=(a.id?a.id:CKEDITOR.tools.getNextId())+"_radio",k=0;k<a.items.length;k++){var l=a.items[k],h=void 0!==l[2]?l[2]:l[0],n=void 0!==l[1]?l[1]:l[0],p=CKEDITOR.tools.getNextId()+"_radio_input",q=p+"_label",p=CKEDITOR.tools.extend({},a,{id:p,title:null,type:null},!0),h=CKEDITOR.tools.extend({},p,{title:h},!0),r={type:"radio","class":"cke_dialog_ui_radio_input",name:g,value:n,"aria-labelledby":q},u=[];c._["default"]==n&&(r.checked="checked");t(p);t(h);"undefined"!=typeof p.inputStyle&&
  628. (p.style=p.inputStyle);p.keyboardFocusable=!0;f.push(new CKEDITOR.ui.dialog.uiElement(b,p,u,"input",null,r));u.push(" ");new CKEDITOR.ui.dialog.uiElement(b,h,u,"label",null,{id:q,"for":r.id},l[0]);e.push(u.join(""))}new CKEDITOR.ui.dialog.hbox(b,f,e,d);return d.join("")});this._.children=f}},button:function(b,a,d){if(arguments.length){"function"==typeof a&&(a=a(b.getParentEditor()));h.call(this,a,{disabled:a.disabled||!1});CKEDITOR.event.implementOn(this);var f=this;b.on("load",function(){var a=this.getElement();
  629. (function(){a.on("click",function(a){f.click();a.data.preventDefault()});a.on("keydown",function(a){a.data.getKeystroke()in{32:1}&&(f.click(),a.data.preventDefault())})})();a.unselectable()},this);var c=CKEDITOR.tools.extend({},a);delete c.style;var e=CKEDITOR.tools.getNextId()+"_label";CKEDITOR.ui.dialog.uiElement.call(this,b,c,d,"a",null,{style:a.style,href:"javascript:void(0)",title:a.label,hidefocus:"true","class":a["class"],role:"button","aria-labelledby":e},'\x3cspan id\x3d"'+e+'" class\x3d"cke_dialog_ui_button"\x3e'+
  630. CKEDITOR.tools.htmlEncode(a.label)+"\x3c/span\x3e")}},select:function(b,a,d){if(!(3>arguments.length)){var f=h.call(this,a);a.validate&&(this.validate=a.validate);f.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){var c=CKEDITOR.tools.extend({},a,{id:a.id?a.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),e=[],d=[],g={id:f.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};e.push('\x3cdiv class\x3d"cke_dialog_ui_input_',
  631. a.type,'" role\x3d"presentation"');a.width&&e.push('style\x3d"width:'+a.width+'" ');e.push("\x3e");void 0!==a.size&&(g.size=a.size);void 0!==a.multiple&&(g.multiple=a.multiple);t(c);for(var k=0,l;k<a.items.length&&(l=a.items[k]);k++)d.push('\x3coption value\x3d"',CKEDITOR.tools.htmlEncode(void 0!==l[1]?l[1]:l[0]).replace(/"/g,"\x26quot;"),'" /\x3e ',CKEDITOR.tools.htmlEncode(l[0]));"undefined"!=typeof c.inputStyle&&(c.style=c.inputStyle);f.select=new CKEDITOR.ui.dialog.uiElement(b,c,e,"select",null,
  632. g,d.join(""));e.push("\x3c/div\x3e");return e.join("")})}},file:function(b,a,d){if(!(3>arguments.length)){void 0===a["default"]&&(a["default"]="");var f=CKEDITOR.tools.extend(h.call(this,a),{definition:a,buttons:[]});a.validate&&(this.validate=a.validate);b.on("load",function(){CKEDITOR.document.getById(f.frameId).getParent().addClass("cke_dialog_ui_input_file")});CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){f.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var b=['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"',
  633. f.frameId,'" title\x3d"',a.label,'" src\x3d"javascript:void('];b.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0");b.push(')"\x3e\x3c/iframe\x3e');return b.join("")})}},fileButton:function(b,a,d){var f=this;if(!(3>arguments.length)){h.call(this,a);a.validate&&(this.validate=a.validate);var c=CKEDITOR.tools.extend({},a),e=c.onClick;c.className=(c.className?c.className+" ":"")+"cke_dialog_ui_button";c.onClick=function(c){var d=
  634. a["for"];e&&!1===e.call(this,c)||(b.getContentElement(d[0],d[1]).submit(),this.disable())};b.on("load",function(){b.getContentElement(a["for"][0],a["for"][1])._.buttons.push(f)});CKEDITOR.ui.dialog.button.call(this,b,c,d)}},html:function(){var b=/^\s*<[\w:]+\s+([^>]*)?>/,a=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,d=/\/$/;return function(f,c,e){if(!(3>arguments.length)){var m=[],g=c.html;"\x3c"!=g.charAt(0)&&(g="\x3cspan\x3e"+g+"\x3c/span\x3e");var k=c.focus;if(k){var l=this.focus;this.focus=function(){("function"==
  635. typeof k?k:l).call(this);this.fire("focus")};c.isFocusable&&(this.isFocusable=this.isFocusable);this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,f,c,m,"span",null,null,"");m=m.join("").match(b);g=g.match(a)||["","",""];d.test(g[1])&&(g[1]=g[1].slice(0,-1),g[2]="/"+g[2]);e.push([g[1]," ",m[1]||"",g[2]].join(""))}}}(),fieldset:function(b,a,d,f,c){var e=c.label;this._={children:a};CKEDITOR.ui.dialog.uiElement.call(this,b,c,f,"fieldset",null,null,function(){var a=[];e&&a.push("\x3clegend"+
  636. (c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e"+e+"\x3c/legend\x3e");for(var b=0;b<d.length;b++)a.push(d[b]);return a.join("")})}},!0);CKEDITOR.ui.dialog.html.prototype=new CKEDITOR.ui.dialog.uiElement;CKEDITOR.ui.dialog.labeledElement.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{setLabel:function(b){var a=CKEDITOR.document.getById(this._.labelId);1>a.getChildCount()?(new CKEDITOR.dom.text(b,CKEDITOR.document)).appendTo(a):a.getChild(0).$.nodeValue=b;return this},getLabel:function(){var b=
  637. CKEDITOR.document.getById(this._.labelId);return!b||1>b.getChildCount()?"":b.getChild(0).getText()},eventProcessors:r},!0);CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return this._.disabled?!1:this.fire("click",{dialog:this._.dialog})},enable:function(){this._.disabled=!1;var b=this.getElement();b&&b.removeClass("cke_disabled")},disable:function(){this._.disabled=!0;this.getElement().addClass("cke_disabled")},isVisible:function(){return this.getElement().getFirst().isVisible()},
  638. isEnabled:function(){return!this._.disabled},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(b,a){this.on("click",function(){a.apply(this,arguments)})}},!0),accessKeyUp:function(){this.click()},accessKeyDown:function(){this.focus()},keyboardFocusable:!0},!0);CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId)},
  639. focus:function(){var b=this.selectParentTab();setTimeout(function(){var a=b.getInputElement();a&&a.$.focus()},0)},select:function(){var b=this.selectParentTab();setTimeout(function(){var a=b.getInputElement();a&&(a.$.focus(),a.$.select())},0)},accessKeyUp:function(){this.select()},setValue:function(b){if(this.bidi){var a=b&&b.charAt(0);(a="‪"==a?"ltr":"‫"==a?"rtl":null)&&(b=b.slice(1));this.setDirectionMarker(a)}b||(b="");return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,arguments)},
  640. getValue:function(){var b=CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this);if(this.bidi&&b){var a=this.getDirectionMarker();a&&(b=("ltr"==a?"‪":"‫")+b)}return b},setDirectionMarker:function(b){var a=this.getInputElement();b?a.setAttributes({dir:b,"data-cke-dir-marker":b}):this.getDirectionMarker()&&a.removeAttributes(["dir","data-cke-dir-marker"])},getDirectionMarker:function(){return this.getInputElement().data("cke-dir-marker")},keyboardFocusable:!0},q,!0);CKEDITOR.ui.dialog.textarea.prototype=
  641. new CKEDITOR.ui.dialog.textInput;CKEDITOR.ui.dialog.select.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return this._.select.getElement()},add:function(b,a,d){var f=new CKEDITOR.dom.element("option",this.getDialog().getParentEditor().document),c=this.getInputElement().$;f.$.text=b;f.$.value=void 0===a||null===a?b:a;void 0===d||null===d?CKEDITOR.env.ie?c.add(f.$):c.add(f.$,null):c.add(f.$,d);return this},remove:function(b){this.getInputElement().$.remove(b);
  642. return this},clear:function(){for(var b=this.getInputElement().$;0<b.length;)b.remove(0);return this},keyboardFocusable:!0},q,!0);CKEDITOR.ui.dialog.checkbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getInputElement:function(){return this._.checkbox.getElement()},setValue:function(b,a){this.getInputElement().$.checked=b;!a&&this.fire("change",{value:b})},getValue:function(){return this.getInputElement().$.checked},accessKeyUp:function(){this.setValue(!this.getValue())},eventProcessors:{onChange:function(b,
  643. a){if(!CKEDITOR.env.ie||8<CKEDITOR.env.version)return r.onChange.apply(this,arguments);b.on("load",function(){var a=this._.checkbox.getElement();a.on("propertychange",function(b){b=b.data.$;"checked"==b.propertyName&&this.fire("change",{value:a.$.checked})},this)},this);this.on("change",a);return null}},keyboardFocusable:!0},q,!0);CKEDITOR.ui.dialog.radio.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{setValue:function(b,a){for(var d=this._.children,f,c=0;c<d.length&&(f=d[c]);c++)f.getElement().$.checked=
  644. f.getValue()==b;!a&&this.fire("change",{value:b})},getValue:function(){for(var b=this._.children,a=0;a<b.length;a++)if(b[a].getElement().$.checked)return b[a].getValue();return null},accessKeyUp:function(){var b=this._.children,a;for(a=0;a<b.length;a++)if(b[a].getElement().$.checked){b[a].getElement().focus();return}b[0].getElement().focus()},eventProcessors:{onChange:function(b,a){if(!CKEDITOR.env.ie||8<CKEDITOR.env.version)return r.onChange.apply(this,arguments);b.on("load",function(){for(var a=
  645. this._.children,b=this,c=0;c<a.length;c++)a[c].getElement().on("propertychange",function(a){a=a.data.$;"checked"==a.propertyName&&this.$.checked&&b.fire("change",{value:this.getAttribute("value")})})},this);this.on("change",a);return null}}},q,!0);CKEDITOR.ui.dialog.file.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,q,{getInputElement:function(){var b=CKEDITOR.document.getById(this._.frameId).getFrameDocument();return 0<b.$.forms.length?new CKEDITOR.dom.element(b.$.forms[0].elements[0]):
  646. this.getElement()},submit:function(){this.getInputElement().getParent().$.submit();return this},getAction:function(){return this.getInputElement().getParent().$.action},registerEvents:function(b){var a=/^on([A-Z]\w+)/,d,f=function(a,b,c,d){a.on("formLoaded",function(){a.getInputElement().on(c,d,a)})},c;for(c in b)if(d=c.match(a))this.eventProcessors[c]?this.eventProcessors[c].call(this,this._.dialog,b[c]):f(this,this._.dialog,d[1].toLowerCase(),b[c]);return this},reset:function(){function b(){d.$.open();
  647. var b="";f.size&&(b=f.size-(CKEDITOR.env.ie?7:0));var h=a.frameId+"_input";d.$.write(['\x3chtml dir\x3d"'+g+'" lang\x3d"'+k+'"\x3e\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e\x3cbody style\x3d"margin: 0; overflow: hidden; background: transparent;"\x3e','\x3cform enctype\x3d"multipart/form-data" method\x3d"POST" dir\x3d"'+g+'" lang\x3d"'+k+'" action\x3d"',CKEDITOR.tools.htmlEncode(f.action),'"\x3e\x3clabel id\x3d"',a.labelId,'" for\x3d"',h,'" style\x3d"display:none"\x3e',CKEDITOR.tools.htmlEncode(f.label),
  648. '\x3c/label\x3e\x3cinput style\x3d"width:100%" id\x3d"',h,'" aria-labelledby\x3d"',a.labelId,'" type\x3d"file" name\x3d"',CKEDITOR.tools.htmlEncode(f.id||"cke_upload"),'" size\x3d"',CKEDITOR.tools.htmlEncode(0<b?b:""),'" /\x3e\x3c/form\x3e\x3c/body\x3e\x3c/html\x3e\x3cscript\x3e',CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"","window.parent.CKEDITOR.tools.callFunction("+e+");","window.onbeforeunload \x3d function() {window.parent.CKEDITOR.tools.callFunction("+m+")}","\x3c/script\x3e"].join(""));
  649. d.$.close();for(b=0;b<c.length;b++)c[b].enable()}var a=this._,d=CKEDITOR.document.getById(a.frameId).getFrameDocument(),f=a.definition,c=a.buttons,e=this.formLoadedNumber,m=this.formUnloadNumber,g=a.dialog._.editor.lang.dir,k=a.dialog._.editor.langCode;e||(e=this.formLoadedNumber=CKEDITOR.tools.addFunction(function(){this.fire("formLoaded")},this),m=this.formUnloadNumber=CKEDITOR.tools.addFunction(function(){this.getInputElement().clearCustomData()},this),this.getDialog()._.editor.on("destroy",function(){CKEDITOR.tools.removeFunction(e);
  650. CKEDITOR.tools.removeFunction(m)}));CKEDITOR.env.gecko?setTimeout(b,500):b()},getValue:function(){return this.getInputElement().$.value||""},setInitValue:function(){this._.initValue=""},eventProcessors:{onChange:function(b,a){this._.domOnChangeRegistered||(this.on("formLoaded",function(){this.getInputElement().on("change",function(){this.fire("change",{value:this.getValue()})},this)},this),this._.domOnChangeRegistered=!0);this.on("change",a)}},keyboardFocusable:!0},!0);CKEDITOR.ui.dialog.fileButton.prototype=
  651. new CKEDITOR.ui.dialog.button;CKEDITOR.ui.dialog.fieldset.prototype=CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype);CKEDITOR.dialog.addUIElement("text",v);CKEDITOR.dialog.addUIElement("password",v);CKEDITOR.dialog.addUIElement("textarea",n);CKEDITOR.dialog.addUIElement("checkbox",n);CKEDITOR.dialog.addUIElement("radio",n);CKEDITOR.dialog.addUIElement("button",n);CKEDITOR.dialog.addUIElement("select",n);CKEDITOR.dialog.addUIElement("file",n);CKEDITOR.dialog.addUIElement("fileButton",n);CKEDITOR.dialog.addUIElement("html",
  652. n);CKEDITOR.dialog.addUIElement("fieldset",{build:function(b,a,d){for(var f=a.children,c,e=[],h=[],g=0;g<f.length&&(c=f[g]);g++){var k=[];e.push(k);h.push(CKEDITOR.dialog._.uiElementBuilders[c.type].build(b,c,k))}return new CKEDITOR.ui.dialog[a.type](b,h,e,d,a)}})}});CKEDITOR.DIALOG_RESIZE_NONE=0;CKEDITOR.DIALOG_RESIZE_WIDTH=1;CKEDITOR.DIALOG_RESIZE_HEIGHT=2;CKEDITOR.DIALOG_RESIZE_BOTH=3;CKEDITOR.DIALOG_STATE_IDLE=1;CKEDITOR.DIALOG_STATE_BUSY=2;
  653. (function(){function x(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId)+a,c=b-1;c>b-a;c--)if(this._.tabs[this._.tabIdList[c%a]][0].$.offsetHeight)return this._.tabIdList[c%a];return null}function A(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),c=b+1;c<b+a;c++)if(this._.tabs[this._.tabIdList[c%a]][0].$.offsetHeight)return this._.tabIdList[c%a];return null}function K(a,b){for(var c=a.$.getElementsByTagName("input"),
  654. d=0,e=c.length;d<e;d++){var f=new CKEDITOR.dom.element(c[d]);"text"==f.getAttribute("type").toLowerCase()&&(b?(f.setAttribute("value",f.getCustomData("fake_value")||""),f.removeCustomData("fake_value")):(f.setCustomData("fake_value",f.getAttribute("value")),f.setAttribute("value","")))}}function T(a,b){var c=this.getInputElement();c&&(a?c.removeAttribute("aria-invalid"):c.setAttribute("aria-invalid",!0));a||(this.select?this.select():this.focus());b&&alert(b);this.fire("validated",{valid:a,msg:b})}
  655. function U(){var a=this.getInputElement();a&&a.removeAttribute("aria-invalid")}function V(a){var b=CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog",W).output({id:CKEDITOR.tools.getNextNumber(),editorId:a.id,langDir:a.lang.dir,langCode:a.langCode,editorDialogClass:"cke_editor_"+a.name.replace(/\./g,"\\.")+"_dialog",closeTitle:a.lang.common.close,hidpi:CKEDITOR.env.hidpi?"cke_hidpi":""})),c=b.getChild([0,0,0,0,0]),d=c.getChild(0),e=c.getChild(1);a.plugins.clipboard&&CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(c);
  656. !CKEDITOR.env.ie||CKEDITOR.env.quirks||CKEDITOR.env.edge||(a="javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())",CKEDITOR.dom.element.createFromHtml('\x3ciframe frameBorder\x3d"0" class\x3d"cke_iframe_shim" src\x3d"'+a+'" tabIndex\x3d"-1"\x3e\x3c/iframe\x3e').appendTo(c.getParent()));d.unselectable();e.unselectable();return{element:b,parts:{dialog:b.getChild(0),title:d,close:e,tabs:c.getChild(2),contents:c.getChild([3,0,0,0]),
  657. footer:c.getChild([3,0,1,0])}}}function L(a,b,c){this.element=b;this.focusIndex=c;this.tabIndex=0;this.isFocusable=function(){return!b.getAttribute("disabled")&&b.isVisible()};this.focus=function(){a._.currentFocusIndex=this.focusIndex;this.element.focus()};b.on("keydown",function(a){a.data.getKeystroke()in{32:1,13:1}&&this.fire("click")});b.on("focus",function(){this.fire("mouseover")});b.on("blur",function(){this.fire("mouseout")})}function X(a){function b(){a.layout()}var c=CKEDITOR.document.getWindow();
  658. c.on("resize",b);a.on("hide",function(){c.removeListener("resize",b)})}function M(a,b){this._={dialog:a};CKEDITOR.tools.extend(this,b)}function Y(a){function b(b){var c=a.getSize(),k=CKEDITOR.document.getWindow().getViewPaneSize(),q=b.data.$.screenX,n=b.data.$.screenY,r=q-d.x,l=n-d.y;d={x:q,y:n};e.x+=r;e.y+=l;a.move(e.x+h[3]<g?-h[3]:e.x-h[1]>k.width-c.width-g?k.width-c.width+("rtl"==f.lang.dir?0:h[1]):e.x,e.y+h[0]<g?-h[0]:e.y-h[2]>k.height-c.height-g?k.height-c.height+h[2]:e.y,1);b.data.preventDefault()}
  659. function c(){CKEDITOR.document.removeListener("mousemove",b);CKEDITOR.document.removeListener("mouseup",c);if(CKEDITOR.env.ie6Compat){var a=u.getChild(0).getFrameDocument();a.removeListener("mousemove",b);a.removeListener("mouseup",c)}}var d=null,e=null,f=a.getParentEditor(),g=f.config.dialog_magnetDistance,h=CKEDITOR.skin.margins||[0,0,0,0];"undefined"==typeof g&&(g=20);a.parts.title.on("mousedown",function(g){d={x:g.data.$.screenX,y:g.data.$.screenY};CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",
  660. c);e=a.getPosition();if(CKEDITOR.env.ie6Compat){var f=u.getChild(0).getFrameDocument();f.on("mousemove",b);f.on("mouseup",c)}g.data.preventDefault()},a)}function Z(a){function b(b){var c="rtl"==f.lang.dir,n=k.width,q=k.height,G=n+(b.data.$.screenX-m.x)*(c?-1:1)*(a._.moved?1:2),H=q+(b.data.$.screenY-m.y)*(a._.moved?1:2),B=a._.element.getFirst(),B=c&&B.getComputedStyle("right"),C=a.getPosition();C.y+H>p.height&&(H=p.height-C.y);(c?B:C.x)+G>p.width&&(G=p.width-(c?B:C.x));if(e==CKEDITOR.DIALOG_RESIZE_WIDTH||
  661. e==CKEDITOR.DIALOG_RESIZE_BOTH)n=Math.max(d.minWidth||0,G-g);if(e==CKEDITOR.DIALOG_RESIZE_HEIGHT||e==CKEDITOR.DIALOG_RESIZE_BOTH)q=Math.max(d.minHeight||0,H-h);a.resize(n,q);a._.moved||a.layout();b.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mouseup",c);CKEDITOR.document.removeListener("mousemove",b);q&&(q.remove(),q=null);if(CKEDITOR.env.ie6Compat){var a=u.getChild(0).getFrameDocument();a.removeListener("mouseup",c);a.removeListener("mousemove",b)}}var d=a.definition,e=d.resizable;
  662. if(e!=CKEDITOR.DIALOG_RESIZE_NONE){var f=a.getParentEditor(),g,h,p,m,k,q,n=CKEDITOR.tools.addFunction(function(e){k=a.getSize();var d=a.parts.contents;d.$.getElementsByTagName("iframe").length&&(q=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_dialog_resize_cover" style\x3d"height: 100%; position: absolute; width: 100%;"\x3e\x3c/div\x3e'),d.append(q));h=k.height-a.parts.contents.getSize("height",!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks));g=k.width-a.parts.contents.getSize("width",
  663. 1);m={x:e.screenX,y:e.screenY};p=CKEDITOR.document.getWindow().getViewPaneSize();CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",c);CKEDITOR.env.ie6Compat&&(d=u.getChild(0).getFrameDocument(),d.on("mousemove",b),d.on("mouseup",c));e.preventDefault&&e.preventDefault()});a.on("load",function(){var b="";e==CKEDITOR.DIALOG_RESIZE_WIDTH?b=" cke_resizer_horizontal":e==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(b=" cke_resizer_vertical");b=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer'+
  664. b+" cke_resizer_"+f.lang.dir+'" title\x3d"'+CKEDITOR.tools.htmlEncode(f.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+n+', event )"\x3e'+("ltr"==f.lang.dir?"◢":"◣")+"\x3c/div\x3e");a.parts.footer.append(b,1)});f.on("destroy",function(){CKEDITOR.tools.removeFunction(n)})}}function I(a){a.data.preventDefault(1)}function N(a){var b=CKEDITOR.document.getWindow(),c=a.config,d=c.dialog_backgroundCoverColor||"white",e=c.dialog_backgroundCoverOpacity,f=c.baseFloatZIndex,c=CKEDITOR.tools.genKey(d,
  665. e,f),g=z[c];g?g.show():(f=['\x3cdiv tabIndex\x3d"-1" style\x3d"position: ',CKEDITOR.env.ie6Compat?"absolute":"fixed","; z-index: ",f,"; top: 0px; left: 0px; ",CKEDITOR.env.ie6Compat?"":"background-color: "+d,'" class\x3d"cke_dialog_background_cover"\x3e'],CKEDITOR.env.ie6Compat&&(d="\x3chtml\x3e\x3cbody style\x3d\\'background-color:"+d+";\\'\x3e\x3c/body\x3e\x3c/html\x3e",f.push('\x3ciframe hidefocus\x3d"true" frameborder\x3d"0" id\x3d"cke_dialog_background_iframe" src\x3d"javascript:'),f.push("void((function(){"+
  666. encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.write( '"+d+"' );document.close();")+"})())"),f.push('" style\x3d"position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity\x3d0)"\x3e\x3c/iframe\x3e')),f.push("\x3c/div\x3e"),g=CKEDITOR.dom.element.createFromHtml(f.join("")),g.setOpacity(void 0!==e?e:.5),g.on("keydown",I),g.on("keypress",I),g.on("keyup",I),g.appendTo(CKEDITOR.document.getBody()),z[c]=g);a.focusManager.add(g);
  667. u=g;a=function(){var a=b.getViewPaneSize();g.setStyles({width:a.width+"px",height:a.height+"px"})};var h=function(){var a=b.getScrollPosition(),c=CKEDITOR.dialog._.currentTop;g.setStyles({left:a.x+"px",top:a.y+"px"});if(c){do a=c.getPosition(),c.move(a.x,a.y);while(c=c._.parentDialog)}};J=a;b.on("resize",a);a();CKEDITOR.env.mac&&CKEDITOR.env.webkit||g.focus();if(CKEDITOR.env.ie6Compat){var p=function(){h();arguments.callee.prevScrollHandler.apply(this,arguments)};b.$.setTimeout(function(){p.prevScrollHandler=
  668. window.onscroll||function(){};window.onscroll=p},0);h()}}function O(a){u&&(a.focusManager.remove(u),a=CKEDITOR.document.getWindow(),u.hide(),a.removeListener("resize",J),CKEDITOR.env.ie6Compat&&a.$.setTimeout(function(){window.onscroll=window.onscroll&&window.onscroll.prevScrollHandler||null},0),J=null)}var v=CKEDITOR.tools.cssLength,W='\x3cdiv class\x3d"cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir\x3d"{langDir}" lang\x3d"{langCode}" role\x3d"dialog" aria-labelledby\x3d"cke_dialog_title_{id}"\x3e\x3ctable class\x3d"cke_dialog '+
  669. CKEDITOR.env.cssClass+' cke_{langDir}" style\x3d"position:absolute" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd role\x3d"presentation"\x3e\x3cdiv class\x3d"cke_dialog_body" role\x3d"presentation"\x3e\x3cdiv id\x3d"cke_dialog_title_{id}" class\x3d"cke_dialog_title" role\x3d"presentation"\x3e\x3c/div\x3e\x3ca id\x3d"cke_dialog_close_button_{id}" class\x3d"cke_dialog_close_button" href\x3d"javascript:void(0)" title\x3d"{closeTitle}" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e\x3cdiv id\x3d"cke_dialog_tabs_{id}" class\x3d"cke_dialog_tabs" role\x3d"tablist"\x3e\x3c/div\x3e\x3ctable class\x3d"cke_dialog_contents" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_contents_{id}" class\x3d"cke_dialog_contents_body" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_footer_{id}" class\x3d"cke_dialog_footer" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e';
  670. CKEDITOR.dialog=function(a,b){function c(){var a=l._.focusList;a.sort(function(a,b){return a.tabIndex!=b.tabIndex?b.tabIndex-a.tabIndex:a.focusIndex-b.focusIndex});for(var b=a.length,c=0;c<b;c++)a[c].focusIndex=c}function d(a){var b=l._.focusList;a=a||0;if(!(1>b.length)){var c=l._.currentFocusIndex;l._.tabBarMode&&0>a&&(c=0);try{b[c].getInputElement().$.blur()}catch(e){}var d=c,g=1<l._.pageCount;do{d+=a;if(g&&!l._.tabBarMode&&(d==b.length||-1==d)){l._.tabBarMode=!0;l._.tabs[l._.currentTabId][0].focus();
  671. l._.currentFocusIndex=-1;return}d=(d+b.length)%b.length;if(d==c)break}while(a&&!b[d].isFocusable());b[d].focus();"text"==b[d].type&&b[d].select()}}function e(b){if(l==CKEDITOR.dialog._.currentTop){var c=b.data.getKeystroke(),e="rtl"==a.lang.dir,g=[37,38,39,40];q=n=0;if(9==c||c==CKEDITOR.SHIFT+9)d(c==CKEDITOR.SHIFT+9?-1:1),q=1;else if(c==CKEDITOR.ALT+121&&!l._.tabBarMode&&1<l.getPageCount())l._.tabBarMode=!0,l._.tabs[l._.currentTabId][0].focus(),l._.currentFocusIndex=-1,q=1;else if(-1!=CKEDITOR.tools.indexOf(g,
  672. c)&&l._.tabBarMode)c=-1!=CKEDITOR.tools.indexOf([e?39:37,38],c)?x.call(l):A.call(l),l.selectPage(c),l._.tabs[c][0].focus(),q=1;else if(13!=c&&32!=c||!l._.tabBarMode)if(13==c)c=b.data.getTarget(),c.is("a","button","select","textarea")||c.is("input")&&"button"==c.$.type||((c=this.getButton("ok"))&&CKEDITOR.tools.setTimeout(c.click,0,c),q=1),n=1;else if(27==c)(c=this.getButton("cancel"))?CKEDITOR.tools.setTimeout(c.click,0,c):!1!==this.fire("cancel",{hide:!0}).hide&&this.hide(),n=1;else return;else this.selectPage(this._.currentTabId),
  673. this._.tabBarMode=!1,this._.currentFocusIndex=-1,d(1),q=1;f(b)}}function f(a){q?a.data.preventDefault(1):n&&a.data.stopPropagation()}var g=CKEDITOR.dialog._.dialogDefinitions[b],h=CKEDITOR.tools.clone(aa),p=a.config.dialog_buttonsOrder||"OS",m=a.lang.dir,k={},q,n;("OS"==p&&CKEDITOR.env.mac||"rtl"==p&&"ltr"==m||"ltr"==p&&"rtl"==m)&&h.buttons.reverse();g=CKEDITOR.tools.extend(g(a),h);g=CKEDITOR.tools.clone(g);g=new P(this,g);h=V(a);this._={editor:a,element:h.element,name:b,contentSize:{width:0,height:0},
  674. size:{width:0,height:0},contents:{},buttons:{},accessKeyMap:{},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:!1,focusList:[],currentFocusIndex:0,hasFocus:!1};this.parts=h.parts;CKEDITOR.tools.setTimeout(function(){a.fire("ariaWidget",this.parts.contents)},0,this);h={position:CKEDITOR.env.ie6Compat?"absolute":"fixed",top:0,visibility:"hidden"};h["rtl"==m?"right":"left"]=0;this.parts.dialog.setStyles(h);CKEDITOR.event.call(this);this.definition=g=CKEDITOR.fire("dialogDefinition",
  675. {name:b,definition:g},a).definition;if(!("removeDialogTabs"in a._)&&a.config.removeDialogTabs){h=a.config.removeDialogTabs.split(";");for(m=0;m<h.length;m++)if(p=h[m].split(":"),2==p.length){var r=p[0];k[r]||(k[r]=[]);k[r].push(p[1])}a._.removeDialogTabs=k}if(a._.removeDialogTabs&&(k=a._.removeDialogTabs[b]))for(m=0;m<k.length;m++)g.removeContents(k[m]);if(g.onLoad)this.on("load",g.onLoad);if(g.onShow)this.on("show",g.onShow);if(g.onHide)this.on("hide",g.onHide);if(g.onOk)this.on("ok",function(b){a.fire("saveSnapshot");
  676. setTimeout(function(){a.fire("saveSnapshot")},0);!1===g.onOk.call(this,b)&&(b.data.hide=!1)});this.state=CKEDITOR.DIALOG_STATE_IDLE;if(g.onCancel)this.on("cancel",function(a){!1===g.onCancel.call(this,a)&&(a.data.hide=!1)});var l=this,t=function(a){var b=l._.contents,c=!1,d;for(d in b)for(var e in b[d])if(c=a.call(this,b[d][e]))return};this.on("ok",function(a){t(function(b){if(b.validate){var c=b.validate(this),d="string"==typeof c||!1===c;d&&(a.data.hide=!1,a.stop());T.call(b,!d,"string"==typeof c?
  677. c:void 0);return d}})},this,null,0);this.on("cancel",function(b){t(function(c){if(c.isChanged())return a.config.dialog_noConfirmCancel||confirm(a.lang.common.confirmCancel)||(b.data.hide=!1),!0})},this,null,0);this.parts.close.on("click",function(a){!1!==this.fire("cancel",{hide:!0}).hide&&this.hide();a.data.preventDefault()},this);this.changeFocus=d;var y=this._.element;a.focusManager.add(y,1);this.on("show",function(){y.on("keydown",e,this);if(CKEDITOR.env.gecko)y.on("keypress",f,this)});this.on("hide",
  678. function(){y.removeListener("keydown",e);CKEDITOR.env.gecko&&y.removeListener("keypress",f);t(function(a){U.apply(a)})});this.on("iframeAdded",function(a){(new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown",e,this,null,0)});this.on("show",function(){c();var b=1<l._.pageCount;a.config.dialog_startupFocusTab&&b?(l._.tabBarMode=!0,l._.tabs[l._.currentTabId][0].focus(),l._.currentFocusIndex=-1):this._.hasFocus||(this._.currentFocusIndex=b?-1:this._.focusList.length-1,g.onFocus?
  679. (b=g.onFocus.call(this))&&b.focus():d(1))},this,null,4294967295);if(CKEDITOR.env.ie6Compat)this.on("load",function(){var a=this.getElement(),b=a.getFirst();b.remove();b.appendTo(a)},this);Y(this);Z(this);(new CKEDITOR.dom.text(g.title,CKEDITOR.document)).appendTo(this.parts.title);for(m=0;m<g.contents.length;m++)(k=g.contents[m])&&this.addPage(k);this.parts.tabs.on("click",function(a){var b=a.data.getTarget();b.hasClass("cke_dialog_tab")&&(b=b.$.id,this.selectPage(b.substring(4,b.lastIndexOf("_"))),
  680. this._.tabBarMode&&(this._.tabBarMode=!1,this._.currentFocusIndex=-1,d(1)),a.data.preventDefault())},this);m=[];k=CKEDITOR.dialog._.uiElementBuilders.hbox.build(this,{type:"hbox",className:"cke_dialog_footer_buttons",widths:[],children:g.buttons},m).getChild();this.parts.footer.setHtml(m.join(""));for(m=0;m<k.length;m++)this._.buttons[k[m].id]=k[m]};CKEDITOR.dialog.prototype={destroy:function(){this.hide();this._.element.remove()},resize:function(){return function(a,b){this._.contentSize&&this._.contentSize.width==
  681. a&&this._.contentSize.height==b||(CKEDITOR.dialog.fire("resize",{dialog:this,width:a,height:b},this._.editor),this.fire("resize",{width:a,height:b},this._.editor),this.parts.contents.setStyles({width:a+"px",height:b+"px"}),"rtl"==this._.editor.lang.dir&&this._.position&&(this._.position.x=CKEDITOR.document.getWindow().getViewPaneSize().width-this._.contentSize.width-parseInt(this._.element.getFirst().getStyle("right"),10)),this._.contentSize={width:a,height:b})}}(),getSize:function(){var a=this._.element.getFirst();
  682. return{width:a.$.offsetWidth||0,height:a.$.offsetHeight||0}},move:function(a,b,c){var d=this._.element.getFirst(),e="rtl"==this._.editor.lang.dir,f="fixed"==d.getComputedStyle("position");CKEDITOR.env.ie&&d.setStyle("zoom","100%");f&&this._.position&&this._.position.x==a&&this._.position.y==b||(this._.position={x:a,y:b},f||(f=CKEDITOR.document.getWindow().getScrollPosition(),a+=f.x,b+=f.y),e&&(f=this.getSize(),a=CKEDITOR.document.getWindow().getViewPaneSize().width-f.width-a),b={top:(0<b?b:0)+"px"},
  683. b[e?"right":"left"]=(0<a?a:0)+"px",d.setStyles(b),c&&(this._.moved=1))},getPosition:function(){return CKEDITOR.tools.extend({},this._.position)},show:function(){var a=this._.element,b=this.definition;a.getParent()&&a.getParent().equals(CKEDITOR.document.getBody())?a.setStyle("display","block"):a.appendTo(CKEDITOR.document.getBody());this.resize(this._.contentSize&&this._.contentSize.width||b.width||b.minWidth,this._.contentSize&&this._.contentSize.height||b.height||b.minHeight);this.reset();this.selectPage(this.definition.contents[0].id);
  684. null===CKEDITOR.dialog._.currentZIndex&&(CKEDITOR.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex);this._.element.getFirst().setStyle("z-index",CKEDITOR.dialog._.currentZIndex+=10);null===CKEDITOR.dialog._.currentTop?(CKEDITOR.dialog._.currentTop=this,this._.parentDialog=null,N(this._.editor)):(this._.parentDialog=CKEDITOR.dialog._.currentTop,this._.parentDialog.getElement().getFirst().$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2),CKEDITOR.dialog._.currentTop=this);
  685. a.on("keydown",Q);a.on("keyup",R);this._.hasFocus=!1;for(var c in b.contents)if(b.contents[c]){var a=b.contents[c],d=this._.tabs[a.id],e=a.requiredContent,f=0;if(d){for(var g in this._.contents[a.id]){var h=this._.contents[a.id][g];"hbox"!=h.type&&"vbox"!=h.type&&h.getInputElement()&&(h.requiredContent&&!this._.editor.activeFilter.check(h.requiredContent)?h.disable():(h.enable(),f++))}!f||e&&!this._.editor.activeFilter.check(e)?d[0].addClass("cke_dialog_tab_disabled"):d[0].removeClass("cke_dialog_tab_disabled")}}CKEDITOR.tools.setTimeout(function(){this.layout();
  686. X(this);this.parts.dialog.setStyle("visibility","");this.fireOnce("load",{});CKEDITOR.ui.fire("ready",this);this.fire("show",{});this._.editor.fire("dialogShow",this);this._.parentDialog||this._.editor.focusManager.lock();this.foreach(function(a){a.setInitValue&&a.setInitValue()})},100,this)},layout:function(){var a=this.parts.dialog,b=this.getSize(),c=CKEDITOR.document.getWindow().getViewPaneSize(),d=(c.width-b.width)/2,e=(c.height-b.height)/2;CKEDITOR.env.ie6Compat||(b.height+(0<e?e:0)>c.height||
  687. b.width+(0<d?d:0)>c.width?a.setStyle("position","absolute"):a.setStyle("position","fixed"));this.move(this._.moved?this._.position.x:d,this._.moved?this._.position.y:e)},foreach:function(a){for(var b in this._.contents)for(var c in this._.contents[b])a.call(this,this._.contents[b][c]);return this},reset:function(){var a=function(a){a.reset&&a.reset(1)};return function(){this.foreach(a);return this}}(),setupContent:function(){var a=arguments;this.foreach(function(b){b.setup&&b.setup.apply(b,a)})},
  688. commitContent:function(){var a=arguments;this.foreach(function(b){CKEDITOR.env.ie&&this._.currentFocusIndex==b.focusIndex&&b.getInputElement().$.blur();b.commit&&b.commit.apply(b,a)})},hide:function(){if(this.parts.dialog.isVisible()){this.fire("hide",{});this._.editor.fire("dialogHide",this);this.selectPage(this._.tabIdList[0]);var a=this._.element;a.setStyle("display","none");this.parts.dialog.setStyle("visibility","hidden");for(ba(this);CKEDITOR.dialog._.currentTop!=this;)CKEDITOR.dialog._.currentTop.hide();
  689. if(this._.parentDialog){var b=this._.parentDialog.getElement().getFirst();b.setStyle("z-index",parseInt(b.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}else O(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex-=10;else{CKEDITOR.dialog._.currentZIndex=null;a.removeListener("keydown",Q);a.removeListener("keyup",R);var c=this._.editor;c.focus();setTimeout(function(){c.focusManager.unlock();CKEDITOR.env.iOS&&c.window.focus()},0)}delete this._.parentDialog;
  690. this.foreach(function(a){a.resetInitValue&&a.resetInitValue()});this.setState(CKEDITOR.DIALOG_STATE_IDLE)}},addPage:function(a){if(!a.requiredContent||this._.editor.filter.check(a.requiredContent)){for(var b=[],c=a.label?' title\x3d"'+CKEDITOR.tools.htmlEncode(a.label)+'"':"",d=CKEDITOR.dialog._.uiElementBuilders.vbox.build(this,{type:"vbox",className:"cke_dialog_page_contents",children:a.elements,expand:!!a.expand,padding:a.padding,style:a.style||"width: 100%;"},b),e=this._.contents[a.id]={},f=d.getChild(),
  691. g=0;d=f.shift();)d.notAllowed||"hbox"==d.type||"vbox"==d.type||g++,e[d.id]=d,"function"==typeof d.getChild&&f.push.apply(f,d.getChild());g||(a.hidden=!0);b=CKEDITOR.dom.element.createFromHtml(b.join(""));b.setAttribute("role","tabpanel");d=CKEDITOR.env;e="cke_"+a.id+"_"+CKEDITOR.tools.getNextNumber();c=CKEDITOR.dom.element.createFromHtml(['\x3ca class\x3d"cke_dialog_tab"',0<this._.pageCount?" cke_last":"cke_first",c,a.hidden?' style\x3d"display:none"':"",' id\x3d"',e,'"',d.gecko&&!d.hc?"":' href\x3d"javascript:void(0)"',
  692. ' tabIndex\x3d"-1" hidefocus\x3d"true" role\x3d"tab"\x3e',a.label,"\x3c/a\x3e"].join(""));b.setAttribute("aria-labelledby",e);this._.tabs[a.id]=[c,b];this._.tabIdList.push(a.id);!a.hidden&&this._.pageCount++;this._.lastTab=c;this.updateStyle();b.setAttribute("name",a.id);b.appendTo(this.parts.contents);c.unselectable();this.parts.tabs.append(c);a.accessKey&&(S(this,this,"CTRL+"+a.accessKey,ca,da),this._.accessKeyMap["CTRL+"+a.accessKey]=a.id)}},selectPage:function(a){if(this._.currentTabId!=a&&!this._.tabs[a][0].hasClass("cke_dialog_tab_disabled")&&
  693. !1!==this.fire("selectPage",{page:a,currentPage:this._.currentTabId})){for(var b in this._.tabs){var c=this._.tabs[b][0],d=this._.tabs[b][1];b!=a&&(c.removeClass("cke_dialog_tab_selected"),d.hide());d.setAttribute("aria-hidden",b!=a)}var e=this._.tabs[a];e[0].addClass("cke_dialog_tab_selected");CKEDITOR.env.ie6Compat||CKEDITOR.env.ie7Compat?(K(e[1]),e[1].show(),setTimeout(function(){K(e[1],1)},0)):e[1].show();this._.currentTabId=a;this._.currentTabIndex=CKEDITOR.tools.indexOf(this._.tabIdList,a)}},
  694. updateStyle:function(){this.parts.dialog[(1===this._.pageCount?"add":"remove")+"Class"]("cke_single_page")},hidePage:function(a){var b=this._.tabs[a]&&this._.tabs[a][0];b&&1!=this._.pageCount&&b.isVisible()&&(a==this._.currentTabId&&this.selectPage(x.call(this)),b.hide(),this._.pageCount--,this.updateStyle())},showPage:function(a){if(a=this._.tabs[a]&&this._.tabs[a][0])a.show(),this._.pageCount++,this.updateStyle()},getElement:function(){return this._.element},getName:function(){return this._.name},
  695. getContentElement:function(a,b){var c=this._.contents[a];return c&&c[b]},getValueOf:function(a,b){return this.getContentElement(a,b).getValue()},setValueOf:function(a,b,c){return this.getContentElement(a,b).setValue(c)},getButton:function(a){return this._.buttons[a]},click:function(a){return this._.buttons[a].click()},disableButton:function(a){return this._.buttons[a].disable()},enableButton:function(a){return this._.buttons[a].enable()},getPageCount:function(){return this._.pageCount},getParentEditor:function(){return this._.editor},
  696. getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement()},addFocusable:function(a,b){if("undefined"==typeof b)b=this._.focusList.length,this._.focusList.push(new L(this,a,b));else{this._.focusList.splice(b,0,new L(this,a,b));for(var c=b+1;c<this._.focusList.length;c++)this._.focusList[c].focusIndex++}},setState:function(a){if(this.state!=a){this.state=a;if(a==CKEDITOR.DIALOG_STATE_BUSY){if(!this.parts.spinner){var b=this.getParentEditor().lang.dir,c={attributes:{"class":"cke_dialog_spinner"},
  697. styles:{"float":"rtl"==b?"right":"left"}};c.styles["margin-"+("rtl"==b?"left":"right")]="8px";this.parts.spinner=CKEDITOR.document.createElement("div",c);this.parts.spinner.setHtml("\x26#8987;");this.parts.spinner.appendTo(this.parts.title,1)}this.parts.spinner.show();this.getButton("ok").disable()}else a==CKEDITOR.DIALOG_STATE_IDLE&&(this.parts.spinner&&this.parts.spinner.hide(),this.getButton("ok").enable());this.fire("state",a)}}};CKEDITOR.tools.extend(CKEDITOR.dialog,{add:function(a,b){this._.dialogDefinitions[a]&&
  698. "function"!=typeof b||(this._.dialogDefinitions[a]=b)},exists:function(a){return!!this._.dialogDefinitions[a]},getCurrent:function(){return CKEDITOR.dialog._.currentTop},isTabEnabled:function(a,b,c){a=a.config.removeDialogTabs;return!(a&&a.match(new RegExp("(?:^|;)"+b+":"+c+"(?:$|;)","i")))},okButton:function(){var a=function(a,c){c=c||{};return CKEDITOR.tools.extend({id:"ok",type:"button",label:a.lang.common.ok,"class":"cke_dialog_ui_button_ok",onClick:function(a){a=a.data.dialog;!1!==a.fire("ok",
  699. {hide:!0}).hide&&a.hide()}},c,!0)};a.type="button";a.override=function(b){return CKEDITOR.tools.extend(function(c){return a(c,b)},{type:"button"},!0)};return a}(),cancelButton:function(){var a=function(a,c){c=c||{};return CKEDITOR.tools.extend({id:"cancel",type:"button",label:a.lang.common.cancel,"class":"cke_dialog_ui_button_cancel",onClick:function(a){a=a.data.dialog;!1!==a.fire("cancel",{hide:!0}).hide&&a.hide()}},c,!0)};a.type="button";a.override=function(b){return CKEDITOR.tools.extend(function(c){return a(c,
  700. b)},{type:"button"},!0)};return a}(),addUIElement:function(a,b){this._.uiElementBuilders[a]=b}});CKEDITOR.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null};CKEDITOR.event.implementOn(CKEDITOR.dialog);CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);var aa={resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:600,minHeight:400,buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton]},D=function(a,b,c){for(var d=0,e;e=a[d];d++)if(e.id==b||c&&e[c]&&(e=D(e[c],
  701. b,c)))return e;return null},E=function(a,b,c,d,e){if(c){for(var f=0,g;g=a[f];f++){if(g.id==c)return a.splice(f,0,b),b;if(d&&g[d]&&(g=E(g[d],b,c,d,!0)))return g}if(e)return null}a.push(b);return b},F=function(a,b,c){for(var d=0,e;e=a[d];d++){if(e.id==b)return a.splice(d,1);if(c&&e[c]&&(e=F(e[c],b,c)))return e}return null},P=function(a,b){this.dialog=a;for(var c=b.contents,d=0,e;e=c[d];d++)c[d]=e&&new M(a,e);CKEDITOR.tools.extend(this,b)};P.prototype={getContents:function(a){return D(this.contents,
  702. a)},getButton:function(a){return D(this.buttons,a)},addContents:function(a,b){return E(this.contents,a,b)},addButton:function(a,b){return E(this.buttons,a,b)},removeContents:function(a){F(this.contents,a)},removeButton:function(a){F(this.buttons,a)}};M.prototype={get:function(a){return D(this.elements,a,"children")},add:function(a,b){return E(this.elements,a,b,"children")},remove:function(a){F(this.elements,a,"children")}};var J,z={},u,w={},Q=function(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=
  703. a.data.$.altKey,d=a.data.$.shiftKey,e=String.fromCharCode(a.data.$.keyCode);(b=w[(b?"CTRL+":"")+(c?"ALT+":"")+(d?"SHIFT+":"")+e])&&b.length&&(b=b[b.length-1],b.keydown&&b.keydown.call(b.uiElement,b.dialog,b.key),a.data.preventDefault())},R=function(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=a.data.$.altKey,d=a.data.$.shiftKey,e=String.fromCharCode(a.data.$.keyCode);(b=w[(b?"CTRL+":"")+(c?"ALT+":"")+(d?"SHIFT+":"")+e])&&b.length&&(b=b[b.length-1],b.keyup&&(b.keyup.call(b.uiElement,b.dialog,b.key),
  704. a.data.preventDefault()))},S=function(a,b,c,d,e){(w[c]||(w[c]=[])).push({uiElement:a,dialog:b,key:c,keyup:e||a.accessKeyUp,keydown:d||a.accessKeyDown})},ba=function(a){for(var b in w){for(var c=w[b],d=c.length-1;0<=d;d--)c[d].dialog!=a&&c[d].uiElement!=a||c.splice(d,1);0===c.length&&delete w[b]}},da=function(a,b){a._.accessKeyMap[b]&&a.selectPage(a._.accessKeyMap[b])},ca=function(){};(function(){CKEDITOR.ui.dialog={uiElement:function(a,b,c,d,e,f,g){if(!(4>arguments.length)){var h=(d.call?d(b):d)||
  705. "div",p=["\x3c",h," "],m=(e&&e.call?e(b):e)||{},k=(f&&f.call?f(b):f)||{},q=(g&&g.call?g.call(this,a,b):g)||"",n=this.domId=k.id||CKEDITOR.tools.getNextId()+"_uiElement";b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)&&(m.display="none",this.notAllowed=!0);k.id=n;var r={};b.type&&(r["cke_dialog_ui_"+b.type]=1);b.className&&(r[b.className]=1);b.disabled&&(r.cke_disabled=1);for(var l=k["class"]&&k["class"].split?k["class"].split(" "):[],n=0;n<l.length;n++)l[n]&&(r[l[n]]=1);l=
  706. [];for(n in r)l.push(n);k["class"]=l.join(" ");b.title&&(k.title=b.title);r=(b.style||"").split(";");b.align&&(l=b.align,m["margin-left"]="left"==l?0:"auto",m["margin-right"]="right"==l?0:"auto");for(n in m)r.push(n+":"+m[n]);b.hidden&&r.push("display:none");for(n=r.length-1;0<=n;n--)""===r[n]&&r.splice(n,1);0<r.length&&(k.style=(k.style?k.style+"; ":"")+r.join("; "));for(n in k)p.push(n+'\x3d"'+CKEDITOR.tools.htmlEncode(k[n])+'" ');p.push("\x3e",q,"\x3c/",h,"\x3e");c.push(p.join(""));(this._||(this._=
  707. {})).dialog=a;"boolean"==typeof b.isChanged&&(this.isChanged=function(){return b.isChanged});"function"==typeof b.isChanged&&(this.isChanged=b.isChanged);"function"==typeof b.setValue&&(this.setValue=CKEDITOR.tools.override(this.setValue,function(a){return function(c){a.call(this,b.setValue.call(this,c))}}));"function"==typeof b.getValue&&(this.getValue=CKEDITOR.tools.override(this.getValue,function(a){return function(){return b.getValue.call(this,a.call(this))}}));CKEDITOR.event.implementOn(this);
  708. this.registerEvents(b);this.accessKeyUp&&this.accessKeyDown&&b.accessKey&&S(this,a,"CTRL+"+b.accessKey);var t=this;a.on("load",function(){var b=t.getInputElement();if(b){var c=t.type in{checkbox:1,ratio:1}&&CKEDITOR.env.ie&&8>CKEDITOR.env.version?"cke_dialog_ui_focused":"";b.on("focus",function(){a._.tabBarMode=!1;a._.hasFocus=!0;t.fire("focus");c&&this.addClass(c)});b.on("blur",function(){t.fire("blur");c&&this.removeClass(c)})}});CKEDITOR.tools.extend(this,b);this.keyboardFocusable&&(this.tabIndex=
  709. b.tabIndex||0,this.focusIndex=a._.focusList.push(this)-1,this.on("focus",function(){a._.currentFocusIndex=t.focusIndex}))}},hbox:function(a,b,c,d,e){if(!(4>arguments.length)){this._||(this._={});var f=this._.children=b,g=e&&e.widths||null,h=e&&e.height||null,p,m={role:"presentation"};e&&e.align&&(m.align=e.align);CKEDITOR.ui.dialog.uiElement.call(this,a,e||{type:"hbox"},d,"table",{},m,function(){var a=['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e'];for(p=0;p<c.length;p++){var b="cke_dialog_ui_hbox_child",
  710. d=[];0===p&&(b="cke_dialog_ui_hbox_first");p==c.length-1&&(b="cke_dialog_ui_hbox_last");a.push('\x3ctd class\x3d"',b,'" role\x3d"presentation" ');g?g[p]&&d.push("width:"+v(g[p])):d.push("width:"+Math.floor(100/c.length)+"%");h&&d.push("height:"+v(h));e&&void 0!==e.padding&&d.push("padding:"+v(e.padding));CKEDITOR.env.ie&&CKEDITOR.env.quirks&&f[p].align&&d.push("text-align:"+f[p].align);0<d.length&&a.push('style\x3d"'+d.join("; ")+'" ');a.push("\x3e",c[p],"\x3c/td\x3e")}a.push("\x3c/tr\x3e\x3c/tbody\x3e");
  711. return a.join("")})}},vbox:function(a,b,c,d,e){if(!(3>arguments.length)){this._||(this._={});var f=this._.children=b,g=e&&e.width||null,h=e&&e.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,a,e||{type:"vbox"},d,"div",null,{role:"presentation"},function(){var b=['\x3ctable role\x3d"presentation" cellspacing\x3d"0" border\x3d"0" '];b.push('style\x3d"');e&&e.expand&&b.push("height:100%;");b.push("width:"+v(g||"100%"),";");CKEDITOR.env.webkit&&b.push("float:none;");b.push('"');b.push('align\x3d"',
  712. CKEDITOR.tools.htmlEncode(e&&e.align||("ltr"==a.getParentEditor().lang.dir?"left":"right")),'" ');b.push("\x3e\x3ctbody\x3e");for(var d=0;d<c.length;d++){var k=[];b.push('\x3ctr\x3e\x3ctd role\x3d"presentation" ');g&&k.push("width:"+v(g||"100%"));h?k.push("height:"+v(h[d])):e&&e.expand&&k.push("height:"+Math.floor(100/c.length)+"%");e&&void 0!==e.padding&&k.push("padding:"+v(e.padding));CKEDITOR.env.ie&&CKEDITOR.env.quirks&&f[d].align&&k.push("text-align:"+f[d].align);0<k.length&&b.push('style\x3d"',
  713. k.join("; "),'" ');b.push(' class\x3d"cke_dialog_ui_vbox_child"\x3e',c[d],"\x3c/td\x3e\x3c/tr\x3e")}b.push("\x3c/tbody\x3e\x3c/table\x3e");return b.join("")})}}}})();CKEDITOR.ui.dialog.uiElement.prototype={getElement:function(){return CKEDITOR.document.getById(this.domId)},getInputElement:function(){return this.getElement()},getDialog:function(){return this._.dialog},setValue:function(a,b){this.getInputElement().setValue(a);!b&&this.fire("change",{value:a});return this},getValue:function(){return this.getInputElement().getValue()},
  714. isChanged:function(){return!1},selectParentTab:function(){for(var a=this.getInputElement();(a=a.getParent())&&-1==a.$.className.search("cke_dialog_page_contents"););if(!a)return this;a=a.getAttribute("name");this._.dialog._.currentTabId!=a&&this._.dialog.selectPage(a);return this},focus:function(){this.selectParentTab().getInputElement().focus();return this},registerEvents:function(a){var b=/^on([A-Z]\w+)/,c,d=function(a,b,c,d){b.on("load",function(){a.getInputElement().on(c,d,a)})},e;for(e in a)if(c=
  715. e.match(b))this.eventProcessors[e]?this.eventProcessors[e].call(this,this._.dialog,a[e]):d(this,this._.dialog,c[1].toLowerCase(),a[e]);return this},eventProcessors:{onLoad:function(a,b){a.on("load",b,this)},onShow:function(a,b){a.on("show",b,this)},onHide:function(a,b){a.on("hide",b,this)}},accessKeyDown:function(){this.focus()},accessKeyUp:function(){},disable:function(){var a=this.getElement();this.getInputElement().setAttribute("disabled","true");a.addClass("cke_disabled")},enable:function(){var a=
  716. this.getElement();this.getInputElement().removeAttribute("disabled");a.removeClass("cke_disabled")},isEnabled:function(){return!this.getElement().hasClass("cke_disabled")},isVisible:function(){return this.getInputElement().isVisible()},isFocusable:function(){return this.isEnabled()&&this.isVisible()?!0:!1}};CKEDITOR.ui.dialog.hbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getChild:function(a){if(1>arguments.length)return this._.children.concat();a.splice||(a=[a]);return 2>
  717. a.length?this._.children[a[0]]:this._.children[a[0]]&&this._.children[a[0]].getChild?this._.children[a[0]].getChild(a.slice(1,a.length)):null}},!0);CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox;(function(){var a={build:function(a,c,d){for(var e=c.children,f,g=[],h=[],p=0;p<e.length&&(f=e[p]);p++){var m=[];g.push(m);h.push(CKEDITOR.dialog._.uiElementBuilders[f.type].build(a,f,m))}return new CKEDITOR.ui.dialog[c.type](a,h,g,d,c)}};CKEDITOR.dialog.addUIElement("hbox",a);CKEDITOR.dialog.addUIElement("vbox",
  718. a)})();CKEDITOR.dialogCommand=function(a,b){this.dialogName=a;CKEDITOR.tools.extend(this,b,!0)};CKEDITOR.dialogCommand.prototype={exec:function(a){a.openDialog(this.dialogName)},canUndo:!1,editorFocus:1};(function(){var a=/^([a]|[^a])+$/,b=/^\d*$/,c=/^\d*(?:\.\d+)?$/,d=/^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,e=/^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,f=/^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;CKEDITOR.VALIDATE_OR=1;CKEDITOR.VALIDATE_AND=2;CKEDITOR.dialog.validate={functions:function(){var a=
  719. arguments;return function(){var b=this&&this.getValue?this.getValue():a[0],c,d=CKEDITOR.VALIDATE_AND,e=[],f;for(f=0;f<a.length;f++)if("function"==typeof a[f])e.push(a[f]);else break;f<a.length&&"string"==typeof a[f]&&(c=a[f],f++);f<a.length&&"number"==typeof a[f]&&(d=a[f]);var n=d==CKEDITOR.VALIDATE_AND?!0:!1;for(f=0;f<e.length;f++)n=d==CKEDITOR.VALIDATE_AND?n&&e[f](b):n||e[f](b);return n?!0:c}},regex:function(a,b){return function(c){c=this&&this.getValue?this.getValue():c;return a.test(c)?!0:b}},
  720. notEmpty:function(b){return this.regex(a,b)},integer:function(a){return this.regex(b,a)},number:function(a){return this.regex(c,a)},cssLength:function(a){return this.functions(function(a){return e.test(CKEDITOR.tools.trim(a))},a)},htmlLength:function(a){return this.functions(function(a){return d.test(CKEDITOR.tools.trim(a))},a)},inlineStyle:function(a){return this.functions(function(a){return f.test(CKEDITOR.tools.trim(a))},a)},equals:function(a,b){return this.functions(function(b){return b==a},b)},
  721. notEqual:function(a,b){return this.functions(function(b){return b!=a},b)}};CKEDITOR.on("instanceDestroyed",function(a){if(CKEDITOR.tools.isEmpty(CKEDITOR.instances)){for(var b;b=CKEDITOR.dialog._.currentTop;)b.hide();for(var c in z)z[c].remove();z={}}a=a.editor._.storedDialogs;for(var d in a)a[d].destroy()})})();CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{openDialog:function(a,b){var c=null,d=CKEDITOR.dialog._.dialogDefinitions[a];null===CKEDITOR.dialog._.currentTop&&N(this);if("function"==typeof d)c=
  722. this._.storedDialogs||(this._.storedDialogs={}),c=c[a]||(c[a]=new CKEDITOR.dialog(this,a)),b&&b.call(c,c),c.show();else{if("failed"==d)throw O(this),Error('[CKEDITOR.dialog.openDialog] Dialog "'+a+'" failed when loading definition.');"string"==typeof d&&CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(d),function(){"function"!=typeof CKEDITOR.dialog._.dialogDefinitions[a]&&(CKEDITOR.dialog._.dialogDefinitions[a]="failed");this.openDialog(a,b)},this,0,1)}CKEDITOR.skin.loadPart("dialog");return c}})})();
  723. CKEDITOR.plugins.add("dialog",{requires:"dialogui",init:function(x){x.on("doubleclick",function(A){A.data.dialog&&x.openDialog(A.data.dialog)},null,null,999)}});CKEDITOR.plugins.add("about",{requires:"dialog",init:function(a){var b=a.addCommand("about",new CKEDITOR.dialogCommand("about"));b.modes={wysiwyg:1,source:1};b.canUndo=!1;b.readOnly=1;a.ui.addButton&&a.ui.addButton("About",{label:a.lang.about.title,command:"about",toolbar:"about"});CKEDITOR.dialog.add("about",this.path+"dialogs/about.js")}});(function(){CKEDITOR.plugins.add("a11yhelp",{requires:"dialog",availableLangs:{af:1,ar:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,"de-ch":1,el:1,en:1,"en-gb":1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,fr:1,"fr-ca":1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,nb:1,nl:1,no:1,pl:1,pt:1,"pt-br":1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,sr:1,"sr-latn":1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},init:function(b){var c=this;b.addCommand("a11yHelp",{exec:function(){var a=b.langCode,a=c.availableLangs[a]?
  724. a:c.availableLangs[a.replace(/-.*/,"")]?a.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(c.path+"dialogs/lang/"+a+".js"),function(){b.lang.a11yhelp=c.langEntries[a];b.openDialog("a11yHelp")})},modes:{wysiwyg:1,source:1},readOnly:1,canUndo:!1});b.setKeystroke(CKEDITOR.ALT+48,"a11yHelp");CKEDITOR.dialog.add("a11yHelp",this.path+"dialogs/a11yhelp.js");b.on("ariaEditorHelpLabel",function(a){a.data.label=b.lang.common.editorHelp})}})})();(function(){function f(c){var a=this.att;c=c&&c.hasAttribute(a)&&c.getAttribute(a)||"";void 0!==c&&this.setValue(c)}function g(){for(var c,a=0;a<arguments.length;a++)if(arguments[a]instanceof CKEDITOR.dom.element){c=arguments[a];break}if(c){var a=this.att,b=this.getValue();b?c.setAttribute(a,b):c.removeAttribute(a,b)}}var k={id:1,dir:1,classes:1,styles:1};CKEDITOR.plugins.add("dialogadvtab",{requires:"dialog",allowedContent:function(c){c||(c=k);var a=[];c.id&&a.push("id");c.dir&&a.push("dir");var b=
  725. "";a.length&&(b+="["+a.join(",")+"]");c.classes&&(b+="(*)");c.styles&&(b+="{*}");return b},createAdvancedTab:function(c,a,b){a||(a=k);var d=c.lang.common,h={id:"advanced",label:d.advancedTab,title:d.advancedTab,elements:[{type:"vbox",padding:1,children:[]}]},e=[];if(a.id||a.dir)a.id&&e.push({id:"advId",att:"id",type:"text",requiredContent:b?b+"[id]":null,label:d.id,setup:f,commit:g}),a.dir&&e.push({id:"advLangDir",att:"dir",type:"select",requiredContent:b?b+"[dir]":null,label:d.langDir,"default":"",
  726. style:"width:100%",items:[[d.notSet,""],[d.langDirLTR,"ltr"],[d.langDirRTL,"rtl"]],setup:f,commit:g}),h.elements[0].children.push({type:"hbox",widths:["50%","50%"],children:[].concat(e)});if(a.styles||a.classes)e=[],a.styles&&e.push({id:"advStyles",att:"style",type:"text",requiredContent:b?b+"{cke-xyz}":null,label:d.styles,"default":"",validate:CKEDITOR.dialog.validate.inlineStyle(d.invalidInlineStyle),onChange:function(){},getStyle:function(a,c){var b=this.getValue().match(new RegExp("(?:^|;)\\s*"+
  727. a+"\\s*:\\s*([^;]*)","i"));return b?b[1]:c},updateStyle:function(a,b){var d=this.getValue(),e=c.document.createElement("span");e.setAttribute("style",d);e.setStyle(a,b);d=CKEDITOR.tools.normalizeCssText(e.getAttribute("style"));this.setValue(d,1)},setup:f,commit:g}),a.classes&&e.push({type:"hbox",widths:["45%","55%"],children:[{id:"advCSSClasses",att:"class",type:"text",requiredContent:b?b+"(cke-xyz)":null,label:d.cssClasses,"default":"",setup:f,commit:g}]}),h.elements[0].children.push({type:"hbox",
  728. widths:["50%","50%"],children:[].concat(e)});return h}})})();CKEDITOR.plugins.add("basicstyles",{init:function(c){var e=0,d=function(g,d,b,a){if(a){a=new CKEDITOR.style(a);var f=h[b];f.unshift(a);c.attachStyleStateChange(a,function(a){!c.readOnly&&c.getCommand(b).setState(a)});c.addCommand(b,new CKEDITOR.styleCommand(a,{contentForms:f}));c.ui.addButton&&c.ui.addButton(g,{label:d,command:b,toolbar:"basicstyles,"+(e+=10)})}},h={bold:["strong","b",["span",function(a){a=a.styles["font-weight"];return"bold"==a||700<=+a}]],italic:["em","i",["span",function(a){return"italic"==
  729. a.styles["font-style"]}]],underline:["u",["span",function(a){return"underline"==a.styles["text-decoration"]}]],strike:["s","strike",["span",function(a){return"line-through"==a.styles["text-decoration"]}]],subscript:["sub"],superscript:["sup"]},b=c.config,a=c.lang.basicstyles;d("Bold",a.bold,"bold",b.coreStyles_bold);d("Italic",a.italic,"italic",b.coreStyles_italic);d("Underline",a.underline,"underline",b.coreStyles_underline);d("Strike",a.strike,"strike",b.coreStyles_strike);d("Subscript",a.subscript,
  730. "subscript",b.coreStyles_subscript);d("Superscript",a.superscript,"superscript",b.coreStyles_superscript);c.setKeystroke([[CKEDITOR.CTRL+66,"bold"],[CKEDITOR.CTRL+73,"italic"],[CKEDITOR.CTRL+85,"underline"]])}});CKEDITOR.config.coreStyles_bold={element:"strong",overrides:"b"};CKEDITOR.config.coreStyles_italic={element:"em",overrides:"i"};CKEDITOR.config.coreStyles_underline={element:"u"};CKEDITOR.config.coreStyles_strike={element:"s",overrides:"strike"};CKEDITOR.config.coreStyles_subscript={element:"sub"};
  731. CKEDITOR.config.coreStyles_superscript={element:"sup"};(function(){function q(a,f,d,b){if(!a.isReadOnly()&&!a.equals(d.editable())){CKEDITOR.dom.element.setMarker(b,a,"bidi_processed",1);b=a;for(var c=d.editable();(b=b.getParent())&&!b.equals(c);)if(b.getCustomData("bidi_processed")){a.removeStyle("direction");a.removeAttribute("dir");return}b="useComputedState"in d.config?d.config.useComputedState:1;(b?a.getComputedStyle("direction"):a.getStyle("direction")||a.hasAttribute("dir"))!=f&&(a.removeStyle("direction"),b?(a.removeAttribute("dir"),f!=a.getComputedStyle("direction")&&
  732. a.setAttribute("dir",f)):a.setAttribute("dir",f),d.forceNextSelectionCheck())}}function v(a,f,d){var b=a.getCommonAncestor(!1,!0);a=a.clone();a.enlarge(d==CKEDITOR.ENTER_BR?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);if(a.checkBoundaryOfElement(b,CKEDITOR.START)&&a.checkBoundaryOfElement(b,CKEDITOR.END)){for(var c;b&&b.type==CKEDITOR.NODE_ELEMENT&&(c=b.getParent())&&1==c.getChildCount()&&!(b.getName()in f);)b=c;return b.type==CKEDITOR.NODE_ELEMENT&&b.getName()in f&&b}}function p(a){return{context:"p",
  733. allowedContent:{"h1 h2 h3 h4 h5 h6 table ul ol blockquote div tr p div li td":{propertiesOnly:!0,attributes:"dir"}},requiredContent:"p[dir]",refresh:function(a,d){var b=a.config.useComputedState,c,b=void 0===b||b;if(!b){c=d.lastElement;for(var h=a.editable();c&&!(c.getName()in u||c.equals(h));){var e=c.getParent();if(!e)break;c=e}}c=c||d.block||d.blockLimit;c.equals(a.editable())&&(h=a.getSelection().getRanges()[0].getEnclosedNode())&&h.type==CKEDITOR.NODE_ELEMENT&&(c=h);c&&(b=b?c.getComputedStyle("direction"):
  734. c.getStyle("direction")||c.getAttribute("dir"),a.getCommand("bidirtl").setState("rtl"==b?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF),a.getCommand("bidiltr").setState("ltr"==b?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF));b=(d.block||d.blockLimit||a.editable()).getDirection(1);b!=(a._.selDir||a.lang.dir)&&(a._.selDir=b,a.fire("contentDirChanged",b))},exec:function(f){var d=f.getSelection(),b=f.config.enterMode,c=d.getRanges();if(c&&c.length){for(var h={},e=d.createBookmarks(),c=c.createIterator(),g,
  735. l=0;g=c.getNextRange(1);){var k=g.getEnclosedNode();k&&(!k||k.type==CKEDITOR.NODE_ELEMENT&&k.getName()in r)||(k=v(g,t,b));k&&q(k,a,f,h);var m=new CKEDITOR.dom.walker(g),n=e[l].startNode,p=e[l++].endNode;m.evaluator=function(a){var c=b==CKEDITOR.ENTER_P?"p":"div",d;if(d=(a?a.type==CKEDITOR.NODE_ELEMENT:!1)&&a.getName()in t){if(c=a.is(c))c=(c=a.getParent())?c.type==CKEDITOR.NODE_ELEMENT:!1;d=!(c&&a.getParent().is("blockquote"))}return!!(d&&a.getPosition(n)&CKEDITOR.POSITION_FOLLOWING&&(a.getPosition(p)&
  736. CKEDITOR.POSITION_PRECEDING+CKEDITOR.POSITION_CONTAINS)==CKEDITOR.POSITION_PRECEDING)};for(;k=m.next();)q(k,a,f,h);g=g.createIterator();for(g.enlargeBr=b!=CKEDITOR.ENTER_BR;k=g.getNextParagraph(b==CKEDITOR.ENTER_P?"p":"div");)q(k,a,f,h)}CKEDITOR.dom.element.clearAllMarkers(h);f.forceNextSelectionCheck();d.selectBookmarks(e);f.focus()}}}}function w(a){var f=a==l.setAttribute,d=a==l.removeAttribute,b=/\bdirection\s*:\s*(.*?)\s*(:?$|;)/;return function(c,h){if(!this.isReadOnly()){var e;if(e=c==(f||d?
  737. "dir":"direction")||"style"==c&&(d||b.test(h))){a:{e=this;for(var g=e.getDocument().getBody().getParent();e;){if(e.equals(g)){e=!1;break a}e=e.getParent()}e=!0}e=!e}if(e&&(e=this.getDirection(1),g=a.apply(this,arguments),e!=this.getDirection(1)))return this.getDocument().fire("dirChanged",this),g}return a.apply(this,arguments)}}var t={table:1,ul:1,ol:1,blockquote:1,div:1},r={},u={};CKEDITOR.tools.extend(r,t,{tr:1,p:1,div:1,li:1});CKEDITOR.tools.extend(u,r,{td:1});CKEDITOR.plugins.add("bidi",{init:function(a){function f(b,
  738. c,d,e,f){a.addCommand(d,new CKEDITOR.command(a,e));a.ui.addButton&&a.ui.addButton(b,{label:c,command:d,toolbar:"bidi,"+f})}if(!a.blockless){var d=a.lang.bidi;f("BidiLtr",d.ltr,"bidiltr",p("ltr"),10);f("BidiRtl",d.rtl,"bidirtl",p("rtl"),20);a.on("contentDom",function(){a.document.on("dirChanged",function(b){a.fire("dirChanged",{node:b.data,dir:b.data.getDirection(1)})})});a.on("contentDirChanged",function(b){b=(a.lang.dir!=b.data?"add":"remove")+"Class";var c=a.ui.space(a.config.toolbarLocation);if(c)c[b]("cke_mixed_dir_content")})}}});
  739. for(var l=CKEDITOR.dom.element.prototype,n=["setStyle","removeStyle","setAttribute","removeAttribute"],m=0;m<n.length;m++)l[n[m]]=CKEDITOR.tools.override(l[n[m]],w)})();(function(){var m={exec:function(g){var a=g.getCommand("blockquote").state,k=g.getSelection(),c=k&&k.getRanges()[0];if(c){var h=k.createBookmarks();if(CKEDITOR.env.ie){var e=h[0].startNode,b=h[0].endNode,d;if(e&&"blockquote"==e.getParent().getName())for(d=e;d=d.getNext();)if(d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()){e.move(d,!0);break}if(b&&"blockquote"==b.getParent().getName())for(d=b;d=d.getPrevious();)if(d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()){b.move(d);break}}var f=c.createIterator();
  740. f.enlargeBr=g.config.enterMode!=CKEDITOR.ENTER_BR;if(a==CKEDITOR.TRISTATE_OFF){for(e=[];a=f.getNextParagraph();)e.push(a);1>e.length&&(a=g.document.createElement(g.config.enterMode==CKEDITOR.ENTER_P?"p":"div"),b=h.shift(),c.insertNode(a),a.append(new CKEDITOR.dom.text("",g.document)),c.moveToBookmark(b),c.selectNodeContents(a),c.collapse(!0),b=c.createBookmark(),e.push(a),h.unshift(b));d=e[0].getParent();c=[];for(b=0;b<e.length;b++)a=e[b],d=d.getCommonAncestor(a.getParent());for(a={table:1,tbody:1,
  741. tr:1,ol:1,ul:1};a[d.getName()];)d=d.getParent();for(b=null;0<e.length;){for(a=e.shift();!a.getParent().equals(d);)a=a.getParent();a.equals(b)||c.push(a);b=a}for(;0<c.length;)if(a=c.shift(),"blockquote"==a.getName()){for(b=new CKEDITOR.dom.documentFragment(g.document);a.getFirst();)b.append(a.getFirst().remove()),e.push(b.getLast());b.replace(a)}else e.push(a);c=g.document.createElement("blockquote");for(c.insertBefore(e[0]);0<e.length;)a=e.shift(),c.append(a)}else if(a==CKEDITOR.TRISTATE_ON){b=[];
  742. for(d={};a=f.getNextParagraph();){for(e=c=null;a.getParent();){if("blockquote"==a.getParent().getName()){c=a.getParent();e=a;break}a=a.getParent()}c&&e&&!e.getCustomData("blockquote_moveout")&&(b.push(e),CKEDITOR.dom.element.setMarker(d,e,"blockquote_moveout",!0))}CKEDITOR.dom.element.clearAllMarkers(d);a=[];e=[];for(d={};0<b.length;)f=b.shift(),c=f.getParent(),f.getPrevious()?f.getNext()?(f.breakParent(f.getParent()),e.push(f.getNext())):f.remove().insertAfter(c):f.remove().insertBefore(c),c.getCustomData("blockquote_processed")||
  743. (e.push(c),CKEDITOR.dom.element.setMarker(d,c,"blockquote_processed",!0)),a.push(f);CKEDITOR.dom.element.clearAllMarkers(d);for(b=e.length-1;0<=b;b--){c=e[b];a:{d=c;for(var f=0,m=d.getChildCount(),l=void 0;f<m&&(l=d.getChild(f));f++)if(l.type==CKEDITOR.NODE_ELEMENT&&l.isBlockBoundary()){d=!1;break a}d=!0}d&&c.remove()}if(g.config.enterMode==CKEDITOR.ENTER_BR)for(c=!0;a.length;)if(f=a.shift(),"div"==f.getName()){b=new CKEDITOR.dom.documentFragment(g.document);!c||!f.getPrevious()||f.getPrevious().type==
  744. CKEDITOR.NODE_ELEMENT&&f.getPrevious().isBlockBoundary()||b.append(g.document.createElement("br"));for(c=f.getNext()&&!(f.getNext().type==CKEDITOR.NODE_ELEMENT&&f.getNext().isBlockBoundary());f.getFirst();)f.getFirst().remove().appendTo(b);c&&b.append(g.document.createElement("br"));b.replace(f);c=!1}}k.selectBookmarks(h);g.focus()}},refresh:function(g,a){this.setState(g.elementPath(a.block||a.blockLimit).contains("blockquote",1)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)},context:"blockquote",allowedContent:"blockquote",
  745. requiredContent:"blockquote"};CKEDITOR.plugins.add("blockquote",{init:function(g){g.blockless||(g.addCommand("blockquote",m),g.ui.addButton&&g.ui.addButton("Blockquote",{label:g.lang.blockquote.toolbar,command:"blockquote",toolbar:"blocks,10"}))}})})();(function(){function r(b,a,c){a.type||(a.type="auto");if(c&&!1===b.fire("beforePaste",a)||!a.dataValue&&a.dataTransfer.isEmpty())return!1;a.dataValue||(a.dataValue="");if(CKEDITOR.env.gecko&&"drop"==a.method&&b.toolbox)b.once("afterPaste",function(){b.toolbox.focus()});return b.fire("paste",a)}function y(b){function a(){var a=b.editable();if(CKEDITOR.plugins.clipboard.isCustomCopyCutSupported){var d=function(a){b.readOnly&&"cut"==a.name||n.initPasteDataTransfer(a,b);a.data.preventDefault()};a.on("copy",
  746. d);a.on("cut",d);a.on("cut",function(){b.readOnly||b.extractSelectedHtml()},null,null,999)}a.on(n.mainPasteEvent,function(b){"beforepaste"==n.mainPasteEvent&&p||k(b)});"beforepaste"==n.mainPasteEvent&&(a.on("paste",function(a){v||(e(),a.data.preventDefault(),k(a),f("paste")||b.openDialog("paste"))}),a.on("contextmenu",g,null,null,0),a.on("beforepaste",function(b){!b.data||b.data.$.ctrlKey||b.data.$.shiftKey||g()},null,null,0));a.on("beforecut",function(){!p&&h(b)});var c;a.attachListener(CKEDITOR.env.ie?
  747. a:b.document.getDocumentElement(),"mouseup",function(){c=setTimeout(function(){t()},0)});b.on("destroy",function(){clearTimeout(c)});a.on("keyup",t)}function c(a){return{type:a,canUndo:"cut"==a,startDisabled:!0,exec:function(){"cut"==this.type&&h();var a;var d=this.type;if(CKEDITOR.env.ie)a=f(d);else try{a=b.document.$.execCommand(d,!1,null)}catch(c){a=!1}a||b.showNotification(b.lang.clipboard[this.type+"Error"]);return a}}}function d(){return{canUndo:!1,async:!0,exec:function(b,a){var d=this,c=function(a,
  748. c){a&&r(b,a,!!c);b.fire("afterCommandExec",{name:"paste",command:d,returnValue:!!a})};"string"==typeof a?c({dataValue:a,method:"paste",dataTransfer:n.initPasteDataTransfer()},1):b.getClipboardData(c)}}}function e(){v=1;setTimeout(function(){v=0},100)}function g(){p=1;setTimeout(function(){p=0},10)}function f(a){var d=b.document,c=d.getBody(),e=!1,f=function(){e=!0};c.on(a,f);7<CKEDITOR.env.version?d.$.execCommand(a):d.$.selection.createRange().execCommand(a);c.removeListener(a,f);return e}function h(){if(CKEDITOR.env.ie&&
  749. !CKEDITOR.env.quirks){var a=b.getSelection(),d,c,e;a.getType()==CKEDITOR.SELECTION_ELEMENT&&(d=a.getSelectedElement())&&(c=a.getRanges()[0],e=b.document.createText(""),e.insertBefore(d),c.setStartBefore(e),c.setEndAfter(d),a.selectRanges([c]),setTimeout(function(){d.getParent()&&(e.remove(),a.selectElement(d))},0))}}function l(a,d){var c=b.document,e=b.editable(),f=function(b){b.cancel()},q;if(!c.getById("cke_pastebin")){var g=b.getSelection(),h=g.createBookmarks();CKEDITOR.env.ie&&g.root.fire("selectionchange");
  750. var m=new CKEDITOR.dom.element(!CKEDITOR.env.webkit&&!e.is("body")||CKEDITOR.env.ie?"div":"body",c);m.setAttributes({id:"cke_pastebin","data-cke-temp":"1"});var k=0,c=c.getWindow();CKEDITOR.env.webkit?(e.append(m),m.addClass("cke_editable"),e.is("body")||(k="static"!=e.getComputedStyle("position")?e:CKEDITOR.dom.element.get(e.$.offsetParent),k=k.getDocumentPosition().y)):e.getAscendant(CKEDITOR.env.ie?"body":"html",1).append(m);m.setStyles({position:"absolute",top:c.getScrollPosition().y-k+10+"px",
  751. width:"1px",height:Math.max(1,c.getViewPaneSize().height-20)+"px",overflow:"hidden",margin:0,padding:0});CKEDITOR.env.safari&&m.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","text"));(k=m.getParent().isReadOnly())?(m.setOpacity(0),m.setAttribute("contenteditable",!0)):m.setStyle("ltr"==b.config.contentsLangDirection?"left":"right","-10000px");b.on("selectionChange",f,null,null,0);if(CKEDITOR.env.webkit||CKEDITOR.env.gecko)q=e.once("blur",f,null,null,-100);k&&m.focus();k=new CKEDITOR.dom.range(m);
  752. k.selectNodeContents(m);var t=k.select();CKEDITOR.env.ie&&(q=e.once("blur",function(){b.lockSelection(t)}));var l=CKEDITOR.document.getWindow().getScrollPosition().y;setTimeout(function(){CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=l);q&&q.removeListener();CKEDITOR.env.ie&&e.focus();g.selectBookmarks(h);m.remove();var a;CKEDITOR.env.webkit&&(a=m.getFirst())&&a.is&&a.hasClass("Apple-style-span")&&(m=a);b.removeListener("selectionChange",f);d(m.getHtml())},0)}}function z(){if("paste"==
  753. n.mainPasteEvent)return b.fire("beforePaste",{type:"auto",method:"paste"}),!1;b.focus();e();var a=b.focusManager;a.lock();if(b.editable().fire(n.mainPasteEvent)&&!f("paste"))return a.unlock(),!1;a.unlock();return!0}function q(a){if("wysiwyg"==b.mode)switch(a.data.keyCode){case CKEDITOR.CTRL+86:case CKEDITOR.SHIFT+45:a=b.editable();e();"paste"==n.mainPasteEvent&&a.fire("beforepaste");break;case CKEDITOR.CTRL+88:case CKEDITOR.SHIFT+46:b.fire("saveSnapshot"),setTimeout(function(){b.fire("saveSnapshot")},
  754. 50)}}function k(a){var d={type:"auto",method:"paste",dataTransfer:n.initPasteDataTransfer(a)};d.dataTransfer.cacheData();var c=!1!==b.fire("beforePaste",d);c&&n.canClipboardApiBeTrusted(d.dataTransfer,b)?(a.data.preventDefault(),setTimeout(function(){r(b,d)},0)):l(a,function(a){d.dataValue=a.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,"");c&&r(b,d)})}function t(){if("wysiwyg"==b.mode){var a=u("paste");b.getCommand("cut").setState(u("cut"));b.getCommand("copy").setState(u("copy"));b.getCommand("paste").setState(a);
  755. b.fire("pasteState",a)}}function u(a){if(w&&a in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==a)return CKEDITOR.TRISTATE_OFF;a=b.getSelection();var d=a.getRanges();return a.getType()==CKEDITOR.SELECTION_NONE||1==d.length&&d[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var n=CKEDITOR.plugins.clipboard,p=0,v=0,w=0;(function(){b.on("key",q);b.on("contentDom",a);b.on("selectionChange",function(b){w=b.data.selection.getRanges()[0].checkReadOnly();t()});b.contextMenu&&b.contextMenu.addListener(function(b,
  756. a){w=a.getRanges()[0].checkReadOnly();return{cut:u("cut"),copy:u("copy"),paste:u("paste")}})})();(function(){function a(d,c,e,f,q){var g=b.lang.clipboard[c];b.addCommand(c,e);b.ui.addButton&&b.ui.addButton(d,{label:g,command:c,toolbar:"clipboard,"+f});b.addMenuItems&&b.addMenuItem(c,{label:g,command:c,group:"clipboard",order:q})}a("Cut","cut",c("cut"),10,1);a("Copy","copy",c("copy"),20,4);a("Paste","paste",d(),30,8)})();b.getClipboardData=function(a,d){function c(a){a.removeListener();a.cancel();
  757. d(a.data)}function e(a){a.removeListener();a.cancel();k=!0;d({type:g,dataValue:a.data.dataValue,dataTransfer:a.data.dataTransfer,method:"paste"})}function f(){this.customTitle=a&&a.title}var q=!1,g="auto",k=!1;d||(d=a,a=null);b.on("paste",c,null,null,0);b.on("beforePaste",function(a){a.removeListener();q=!0;g=a.data.type},null,null,1E3);!1===z()&&(b.removeListener("paste",c),q&&b.fire("pasteDialog",f)?(b.on("pasteDialogCommit",e),b.on("dialogHide",function(a){a.removeListener();a.data.removeListener("pasteDialogCommit",
  758. e);setTimeout(function(){k||d(null)},10)})):d(null))}}function A(b){if(CKEDITOR.env.webkit){if(!b.match(/^[^<]*$/g)&&!b.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!b.match(/^([^<]|<br( ?\/)?>)*$/gi)&&!b.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi))return"html"}else if(CKEDITOR.env.gecko){if(!b.match(/^([^<]|<br( ?\/)?>)*$/gi))return"html"}else return"html";return"htmlifiedtext"}function B(b,a){function c(a){return CKEDITOR.tools.repeat("\x3c/p\x3e\x3cp\x3e",
  759. ~~(a/2))+(1==a%2?"\x3cbr\x3e":"")}a=a.replace(/\s+/g," ").replace(/> +</g,"\x3e\x3c").replace(/<br ?\/>/gi,"\x3cbr\x3e");a=a.replace(/<\/?[A-Z]+>/g,function(a){return a.toLowerCase()});if(a.match(/^[^<]$/))return a;CKEDITOR.env.webkit&&-1<a.indexOf("\x3cdiv\x3e")&&(a=a.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g,"\x3cbr\x3e").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g,"\x3cdiv\x3e\x3c/div\x3e"),a.match(/<div>(<br>|)<\/div>/)&&(a="\x3cp\x3e"+a.replace(/(<div>(<br>|)<\/div>)+/g,function(a){return c(a.split("\x3c/div\x3e\x3cdiv\x3e").length+
  760. 1)})+"\x3c/p\x3e"),a=a.replace(/<\/div><div>/g,"\x3cbr\x3e"),a=a.replace(/<\/?div>/g,""));CKEDITOR.env.gecko&&b.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&(a=a.replace(/^<br><br>$/,"\x3cbr\x3e")),-1<a.indexOf("\x3cbr\x3e\x3cbr\x3e")&&(a="\x3cp\x3e"+a.replace(/(<br>){2,}/g,function(a){return c(a.length/4)})+"\x3c/p\x3e"));return C(b,a)}function D(){function b(){var a={},b;for(b in CKEDITOR.dtd)"$"!=b.charAt(0)&&"div"!=b&&"span"!=b&&(a[b]=1);return a}var a={};return{get:function(c){return"plain-text"==
  761. c?a.plainText||(a.plainText=new CKEDITOR.filter("br")):"semantic-content"==c?((c=a.semanticContent)||(c=new CKEDITOR.filter,c.allow({$1:{elements:b(),attributes:!0,styles:!1,classes:!1}}),c=a.semanticContent=c),c):c?new CKEDITOR.filter(c):null}}}function x(b,a,c){a=CKEDITOR.htmlParser.fragment.fromHtml(a);var d=new CKEDITOR.htmlParser.basicWriter;c.applyTo(a,!0,!1,b.activeEnterMode);a.writeHtml(d);return d.getHtml()}function C(b,a){b.enterMode==CKEDITOR.ENTER_BR?a=a.replace(/(<\/p><p>)+/g,function(a){return CKEDITOR.tools.repeat("\x3cbr\x3e",
  762. a.length/7*2)}).replace(/<\/?p>/g,""):b.enterMode==CKEDITOR.ENTER_DIV&&(a=a.replace(/<(\/)?p>/g,"\x3c$1div\x3e"));return a}function E(b){b.data.preventDefault();b.data.$.dataTransfer.dropEffect="none"}function F(b){var a=CKEDITOR.plugins.clipboard;b.on("contentDom",function(){function c(a,d,c){d.select();r(b,{dataTransfer:c,method:"drop"},1);c.sourceEditor.fire("saveSnapshot");c.sourceEditor.editable().extractHtmlFromRange(a);c.sourceEditor.getSelection().selectRanges([a]);c.sourceEditor.fire("saveSnapshot")}
  763. function d(d,c){d.select();r(b,{dataTransfer:c,method:"drop"},1);a.resetDragDataTransfer()}function e(a,d,c){var e={$:a.data.$,target:a.data.getTarget()};d&&(e.dragRange=d);c&&(e.dropRange=c);!1===b.fire(a.name,e)&&a.data.preventDefault()}function g(a){a.type!=CKEDITOR.NODE_ELEMENT&&(a=a.getParent());return a.getChildCount()}var f=b.editable(),h=CKEDITOR.plugins.clipboard.getDropTarget(b),l=b.ui.space("top"),p=b.ui.space("bottom");a.preventDefaultDropOnElement(l);a.preventDefaultDropOnElement(p);
  764. f.attachListener(h,"dragstart",e);f.attachListener(b,"dragstart",a.resetDragDataTransfer,a,null,1);f.attachListener(b,"dragstart",function(d){a.initDragDataTransfer(d,b)},null,null,2);f.attachListener(b,"dragstart",function(){var d=a.dragRange=b.getSelection().getRanges()[0];CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(a.dragStartContainerChildCount=d?g(d.startContainer):null,a.dragEndContainerChildCount=d?g(d.endContainer):null)},null,null,100);f.attachListener(h,"dragend",e);f.attachListener(b,"dragend",
  765. a.initDragDataTransfer,a,null,1);f.attachListener(b,"dragend",a.resetDragDataTransfer,a,null,100);f.attachListener(h,"dragover",function(a){var b=a.data.getTarget();b&&b.is&&b.is("html")?a.data.preventDefault():CKEDITOR.env.ie&&CKEDITOR.plugins.clipboard.isFileApiSupported&&a.data.$.dataTransfer.types.contains("Files")&&a.data.preventDefault()});f.attachListener(h,"drop",function(d){if(!d.data.$.defaultPrevented){d.data.preventDefault();var c=d.data.getTarget();if(!c.isReadOnly()||c.type==CKEDITOR.NODE_ELEMENT&&
  766. c.is("html")){var c=a.getRangeAtDropPosition(d,b),f=a.dragRange;c&&e(d,f,c)}}},null,null,9999);f.attachListener(b,"drop",a.initDragDataTransfer,a,null,1);f.attachListener(b,"drop",function(e){if(e=e.data){var f=e.dropRange,g=e.dragRange,h=e.dataTransfer;h.getTransferType(b)==CKEDITOR.DATA_TRANSFER_INTERNAL?setTimeout(function(){a.internalDrop(g,f,h,b)},0):h.getTransferType(b)==CKEDITOR.DATA_TRANSFER_CROSS_EDITORS?c(g,f,h):d(f,h)}},null,null,9999)})}CKEDITOR.plugins.add("clipboard",{requires:"dialog",
  767. init:function(b){var a,c=D();b.config.forcePasteAsPlainText?a="plain-text":b.config.pasteFilter?a=b.config.pasteFilter:!CKEDITOR.env.webkit||"pasteFilter"in b.config||(a="semantic-content");b.pasteFilter=c.get(a);y(b);F(b);CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js"));b.on("paste",function(a){a.data.dataTransfer||(a.data.dataTransfer=new CKEDITOR.plugins.clipboard.dataTransfer);if(!a.data.dataValue){var c=a.data.dataTransfer,g=c.getData("text/html");if(g)a.data.dataValue=
  768. g,a.data.type="html";else if(g=c.getData("text/plain"))a.data.dataValue=b.editable().transformPlainTextToHtml(g),a.data.type="text"}},null,null,1);b.on("paste",function(a){var b=a.data.dataValue,c=CKEDITOR.dtd.$block;-1<b.indexOf("Apple-")&&(b=b.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi," "),"html"!=a.data.type&&(b=b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi,function(a,b){return b.replace(/\t/g,"\x26nbsp;\x26nbsp; \x26nbsp;")})),-1<b.indexOf('\x3cbr class\x3d"Apple-interchange-newline"\x3e')&&
  769. (a.data.startsWithEOL=1,a.data.preSniffing="html",b=b.replace(/<br class="Apple-interchange-newline">/,"")),b=b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(b.match(/^<[^<]+cke_(editable|contents)/i)){var f,h,l=new CKEDITOR.dom.element("div");for(l.setHtml(b);1==l.getChildCount()&&(f=l.getFirst())&&f.type==CKEDITOR.NODE_ELEMENT&&(f.hasClass("cke_editable")||f.hasClass("cke_contents"));)l=h=f;h&&(b=h.getHtml().replace(/<br>$/i,""))}CKEDITOR.env.ie?b=b.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g,function(b,
  770. f){return f.toLowerCase()in c?(a.data.preSniffing="html","\x3c"+f):b}):CKEDITOR.env.webkit?b=b.replace(/<\/(\w+)><div><br><\/div>$/,function(b,f){return f in c?(a.data.endsWithEOL=1,"\x3c/"+f+"\x3e"):b}):CKEDITOR.env.gecko&&(b=b.replace(/(\s)<br>$/,"$1"));a.data.dataValue=b},null,null,3);b.on("paste",function(a){a=a.data;var e=a.type,g=a.dataValue,f,h=b.config.clipboard_defaultContentType||"html",l=a.dataTransfer.getTransferType(b);f="html"==e||"html"==a.preSniffing?"html":A(g);"htmlifiedtext"==f&&
  771. (g=B(b.config,g));"text"==e&&"html"==f?g=x(b,g,c.get("plain-text")):l==CKEDITOR.DATA_TRANSFER_EXTERNAL&&b.pasteFilter&&!a.dontFilter&&(g=x(b,g,b.pasteFilter));a.startsWithEOL&&(g='\x3cbr data-cke-eol\x3d"1"\x3e'+g);a.endsWithEOL&&(g+='\x3cbr data-cke-eol\x3d"1"\x3e');"auto"==e&&(e="html"==f||"html"==h?"html":"text");a.type=e;a.dataValue=g;delete a.preSniffing;delete a.startsWithEOL;delete a.endsWithEOL},null,null,6);b.on("paste",function(a){a=a.data;a.dataValue&&(b.insertHtml(a.dataValue,a.type,a.range),
  772. setTimeout(function(){b.fire("afterPaste")},0))},null,null,1E3);b.on("pasteDialog",function(a){setTimeout(function(){b.openDialog("paste",a.data)},0)})}});CKEDITOR.plugins.clipboard={isCustomCopyCutSupported:!CKEDITOR.env.ie&&!CKEDITOR.env.iOS,isCustomDataTypesSupported:!CKEDITOR.env.ie,isFileApiSupported:!CKEDITOR.env.ie||9<CKEDITOR.env.version,mainPasteEvent:CKEDITOR.env.ie&&!CKEDITOR.env.edge?"beforepaste":"paste",canClipboardApiBeTrusted:function(b,a){return b.getTransferType(a)!=CKEDITOR.DATA_TRANSFER_EXTERNAL||
  773. CKEDITOR.env.chrome&&!b.isEmpty()||CKEDITOR.env.gecko&&(b.getData("text/html")||b.getFilesCount())?!0:!1},getDropTarget:function(b){var a=b.editable();return CKEDITOR.env.ie&&9>CKEDITOR.env.version||a.isInline()?a:b.document},fixSplitNodesAfterDrop:function(b,a,c,d){function e(b,c,d){var e=b;e.type==CKEDITOR.NODE_TEXT&&(e=b.getParent());if(e.equals(c)&&d!=c.getChildCount())return b=a.startContainer.getChild(a.startOffset-1),c=a.startContainer.getChild(a.startOffset),b&&b.type==CKEDITOR.NODE_TEXT&&
  774. c&&c.type==CKEDITOR.NODE_TEXT&&(d=b.getLength(),b.setText(b.getText()+c.getText()),c.remove(),a.setStart(b,d),a.collapse(!0)),!0}var g=a.startContainer;"number"==typeof d&&"number"==typeof c&&g.type==CKEDITOR.NODE_ELEMENT&&(e(b.startContainer,g,c)||e(b.endContainer,g,d))},isDropRangeAffectedByDragRange:function(b,a){var c=a.startContainer,d=a.endOffset;return b.endContainer.equals(c)&&b.endOffset<=d||b.startContainer.getParent().equals(c)&&b.startContainer.getIndex()<d||b.endContainer.getParent().equals(c)&&
  775. b.endContainer.getIndex()<d?!0:!1},internalDrop:function(b,a,c,d){var e=CKEDITOR.plugins.clipboard,g=d.editable(),f,h;d.fire("saveSnapshot");d.fire("lockSnapshot",{dontUpdate:1});CKEDITOR.env.ie&&10>CKEDITOR.env.version&&this.fixSplitNodesAfterDrop(b,a,e.dragStartContainerChildCount,e.dragEndContainerChildCount);(h=this.isDropRangeAffectedByDragRange(b,a))||(f=b.createBookmark(!1));e=a.clone().createBookmark(!1);h&&(f=b.createBookmark(!1));b=f.startNode;a=f.endNode;h=e.startNode;a&&b.getPosition(h)&
  776. CKEDITOR.POSITION_PRECEDING&&a.getPosition(h)&CKEDITOR.POSITION_FOLLOWING&&h.insertBefore(b);b=d.createRange();b.moveToBookmark(f);g.extractHtmlFromRange(b,1);a=d.createRange();a.moveToBookmark(e);r(d,{dataTransfer:c,method:"drop",range:a},1);d.fire("unlockSnapshot")},getRangeAtDropPosition:function(b,a){var c=b.data.$,d=c.clientX,e=c.clientY,g=a.getSelection(!0).getRanges()[0],f=a.createRange();if(b.data.testRange)return b.data.testRange;if(document.caretRangeFromPoint)c=a.document.$.caretRangeFromPoint(d,
  777. e),f.setStart(CKEDITOR.dom.node(c.startContainer),c.startOffset),f.collapse(!0);else if(c.rangeParent)f.setStart(CKEDITOR.dom.node(c.rangeParent),c.rangeOffset),f.collapse(!0);else{if(CKEDITOR.env.ie&&8<CKEDITOR.env.version&&g&&a.editable().hasFocus)return g;if(document.body.createTextRange){a.focus();c=a.document.getBody().$.createTextRange();try{for(var h=!1,l=0;20>l&&!h;l++){if(!h)try{c.moveToPoint(d,e-l),h=!0}catch(p){}if(!h)try{c.moveToPoint(d,e+l),h=!0}catch(q){}}if(h){var k="cke-temp-"+(new Date).getTime();
  778. c.pasteHTML('\x3cspan id\x3d"'+k+'"\x3e​\x3c/span\x3e');var t=a.document.getById(k);f.moveToPosition(t,CKEDITOR.POSITION_BEFORE_START);t.remove()}else{var u=a.document.$.elementFromPoint(d,e),n=new CKEDITOR.dom.element(u),r;if(n.equals(a.editable())||"html"==n.getName())return g&&g.startContainer&&!g.startContainer.equals(a.editable())?g:null;r=n.getClientRect();d<r.left?f.setStartAt(n,CKEDITOR.POSITION_AFTER_START):f.setStartAt(n,CKEDITOR.POSITION_BEFORE_END);f.collapse(!0)}}catch(v){return null}}else return null}return f},
  779. initDragDataTransfer:function(b,a){var c=b.data.$?b.data.$.dataTransfer:null,d=new this.dataTransfer(c,a);c?this.dragData&&d.id==this.dragData.id?d=this.dragData:this.dragData=d:this.dragData?d=this.dragData:this.dragData=d;b.data.dataTransfer=d},resetDragDataTransfer:function(){this.dragData=null},initPasteDataTransfer:function(b,a){if(this.isCustomCopyCutSupported&&b&&b.data&&b.data.$){var c=new this.dataTransfer(b.data.$.clipboardData,a);this.copyCutData&&c.id==this.copyCutData.id?(c=this.copyCutData,
  780. c.$=b.data.$.clipboardData):this.copyCutData=c;return c}return new this.dataTransfer(null,a)},preventDefaultDropOnElement:function(b){b&&b.on("dragover",E)}};var p=CKEDITOR.plugins.clipboard.isCustomDataTypesSupported?"cke/id":"Text";CKEDITOR.plugins.clipboard.dataTransfer=function(b,a){b&&(this.$=b);this._={metaRegExp:/^<meta.*?>/i,bodyRegExp:/<body(?:[\s\S]*?)>([\s\S]*)<\/body>/i,fragmentRegExp:/\x3c!--(?:Start|End)Fragment--\x3e/g,data:{},files:[],normalizeType:function(a){a=a.toLowerCase();return"text"==
  781. a||"text/plain"==a?"Text":"url"==a?"URL":a}};this.id=this.getData(p);this.id||(this.id="Text"==p?"":"cke-"+CKEDITOR.tools.getUniqueId());if("Text"!=p)try{this.$.setData(p,this.id)}catch(c){}a&&(this.sourceEditor=a,this.setData("text/html",a.getSelectedHtml(1)),"Text"==p||this.getData("text/plain")||this.setData("text/plain",a.getSelection().getSelectedText()))};CKEDITOR.DATA_TRANSFER_INTERNAL=1;CKEDITOR.DATA_TRANSFER_CROSS_EDITORS=2;CKEDITOR.DATA_TRANSFER_EXTERNAL=3;CKEDITOR.plugins.clipboard.dataTransfer.prototype=
  782. {getData:function(b){b=this._.normalizeType(b);var a=this._.data[b];if(void 0===a||null===a||""===a)try{a=this.$.getData(b)}catch(c){}if(void 0===a||null===a||""===a)a="";"text/html"==b?(a=a.replace(this._.metaRegExp,""),(b=this._.bodyRegExp.exec(a))&&b.length&&(a=b[1],a=a.replace(this._.fragmentRegExp,""))):"Text"==b&&CKEDITOR.env.gecko&&this.getFilesCount()&&"file://"==a.substring(0,7)&&(a="");return a},setData:function(b,a){b=this._.normalizeType(b);this._.data[b]=a;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||
  783. "URL"==b||"Text"==b){"Text"==p&&"Text"==b&&(this.id=a);try{this.$.setData(b,a)}catch(c){}}},getTransferType:function(b){return this.sourceEditor?this.sourceEditor==b?CKEDITOR.DATA_TRANSFER_INTERNAL:CKEDITOR.DATA_TRANSFER_CROSS_EDITORS:CKEDITOR.DATA_TRANSFER_EXTERNAL},cacheData:function(){function b(b){b=a._.normalizeType(b);var c=a.getData(b);c&&(a._.data[b]=c)}if(this.$){var a=this,c,d;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(c=0;c<this.$.types.length;c++)b(this.$.types[c])}else b("Text"),
  784. b("URL");d=this._getImageFromClipboard();if(this.$&&this.$.files||d){this._.files=[];for(c=0;c<this.$.files.length;c++)this._.files.push(this.$.files[c]);0===this._.files.length&&d&&this._.files.push(d)}}},getFilesCount:function(){return this._.files.length?this._.files.length:this.$&&this.$.files&&this.$.files.length?this.$.files.length:this._getImageFromClipboard()?1:0},getFile:function(b){return this._.files.length?this._.files[b]:this.$&&this.$.files&&this.$.files.length?this.$.files[b]:0===b?
  785. this._getImageFromClipboard():void 0},isEmpty:function(){var b={},a;if(this.getFilesCount())return!1;for(a in this._.data)b[a]=1;if(this.$)if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(var c=0;c<this.$.types.length;c++)b[this.$.types[c]]=1}else b.Text=1,b.URL=1;"Text"!=p&&(b[p]=0);for(a in b)if(b[a]&&""!==this.getData(a))return!1;return!0},_getImageFromClipboard:function(){var b;if(this.$&&this.$.items&&this.$.items[0])try{if((b=this.$.items[0].getAsFile())&&b.type)return b}catch(a){}}}})();(function(){var c='\x3ca id\x3d"{id}" class\x3d"cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' title\x3d"{title}" tabindex\x3d"-1" hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-haspopup\x3d"{hasArrow}" aria-disabled\x3d"{ariaDisabled}"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(c+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(c+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');
  786. var c=c+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" '+(CKEDITOR.env.ie?'onclick\x3d"return false;" onmouseup':"onclick")+'\x3d"CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{style}"'),c=c+'\x3e\x26nbsp;\x3c/span\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_button_label cke_button__{name}_label" aria-hidden\x3d"false"\x3e{label}\x3c/span\x3e{arrowHtml}\x3c/a\x3e',
  787. r=CKEDITOR.addTemplate("buttonArrow",'\x3cspan class\x3d"cke_button_arrow"\x3e'+(CKEDITOR.env.hc?"\x26#9660;":"")+"\x3c/span\x3e"),t=CKEDITOR.addTemplate("button",c);CKEDITOR.plugins.add("button",{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_BUTTON,CKEDITOR.ui.button.handler)}});CKEDITOR.UI_BUTTON="button";CKEDITOR.ui.button=function(a){CKEDITOR.tools.extend(this,a,{title:a.label,click:a.click||function(b){b.execCommand(a.command)}});this._={}};CKEDITOR.ui.button.handler={create:function(a){return new CKEDITOR.ui.button(a)}};
  788. CKEDITOR.ui.button.prototype={render:function(a,b){function c(){var e=a.mode;e&&(e=this.modes[e]?void 0!==k[e]?k[e]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,e=a.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:e,this.setState(e),this.refresh&&this.refresh())}var l=CKEDITOR.env,m=this._.id=CKEDITOR.tools.getNextId(),f="",g=this.command,n;this._.editor=a;var d={id:m,button:this,editor:a,focus:function(){CKEDITOR.document.getById(m).focus()},execute:function(){this.button.click(a)},attach:function(a){this.button.attach(a)}},
  789. u=CKEDITOR.tools.addFunction(function(a){if(d.onkey)return a=new CKEDITOR.dom.event(a),!1!==d.onkey(d,a.getKeystroke())}),v=CKEDITOR.tools.addFunction(function(a){var b;d.onfocus&&(b=!1!==d.onfocus(d,new CKEDITOR.dom.event(a)));return b}),p=0;d.clickFn=n=CKEDITOR.tools.addFunction(function(){p&&(a.unlockSelection(1),p=0);d.execute();l.iOS&&a.focus()});if(this.modes){var k={};a.on("beforeModeUnload",function(){a.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(k[a.mode]=this._.state)},this);a.on("activeFilterChange",
  790. c,this);a.on("mode",c,this);!this.readOnly&&a.on("readOnly",c,this)}else g&&(g=a.getCommand(g))&&(g.on("state",function(){this.setState(g.state)},this),f+=g.state==CKEDITOR.TRISTATE_ON?"on":g.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");if(this.directional)a.on("contentDirChanged",function(b){var c=CKEDITOR.document.getById(this._.id),d=c.getFirst();b=b.data;b!=a.lang.dir?c.addClass("cke_"+b):c.removeClass("cke_ltr").removeClass("cke_rtl");d.setAttribute("style",CKEDITOR.skin.getIconStyle(h,
  791. "rtl"==b,this.icon,this.iconOffset))},this);g||(f+="off");var q=this.name||this.command,h=q;this.icon&&!/\./.test(this.icon)&&(h=this.icon,this.icon=null);f={id:m,name:q,iconName:h,label:this.label,cls:this.className||"",state:f,ariaDisabled:"disabled"==f?"true":"false",title:this.title,titleJs:l.gecko&&!l.hc?"":(this.title||"").replace("'",""),hasArrow:this.hasArrow?"true":"false",keydownFn:u,focusFn:v,clickFn:n,style:CKEDITOR.skin.getIconStyle(h,"rtl"==a.lang.dir,this.icon,this.iconOffset),arrowHtml:this.hasArrow?
  792. r.output():""};t.output(f,b);if(this.onRender)this.onRender();return d},setState:function(a){if(this._.state==a)return!1;this._.state=a;var b=CKEDITOR.document.getById(this._.id);return b?(b.setState(a,"cke_button"),a==CKEDITOR.TRISTATE_DISABLED?b.setAttribute("aria-disabled",!0):b.removeAttribute("aria-disabled"),this.hasArrow?(a=a==CKEDITOR.TRISTATE_ON?this._.editor.lang.button.selectedLabel.replace(/%1/g,this.label):this.label,CKEDITOR.document.getById(this._.id+"_label").setText(a)):a==CKEDITOR.TRISTATE_ON?
  793. b.setAttribute("aria-pressed",!0):b.removeAttribute("aria-pressed"),!0):!1},getState:function(){return this._.state},toFeature:function(a){if(this._.feature)return this._.feature;var b=this;this.allowedContent||this.requiredContent||!this.command||(b=a.getCommand(this.command)||b);return this._.feature=b}};CKEDITOR.ui.prototype.addButton=function(a,b){this.add(a,CKEDITOR.UI_BUTTON,b)}})();CKEDITOR.plugins.add("panelbutton",{requires:"button",onLoad:function(){function e(c){var a=this._;a.state!=CKEDITOR.TRISTATE_DISABLED&&(this.createPanel(c),a.on?a.panel.hide():a.panel.showBlock(this._.id,this.document.getById(this._.id),4))}CKEDITOR.ui.panelButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(c){var a=c.panel||{};delete c.panel;this.base(c);this.document=a.parent&&a.parent.getDocument()||CKEDITOR.document;a.block={attributes:a.attributes};this.hasArrow=a.toolbarRelated=
  794. !0;this.click=e;this._={panelDefinition:a}},statics:{handler:{create:function(c){return new CKEDITOR.ui.panelButton(c)}}},proto:{createPanel:function(c){var a=this._;if(!a.panel){var f=this._.panelDefinition,e=this._.panelDefinition.block,g=f.parent||CKEDITOR.document.getBody(),d=this._.panel=new CKEDITOR.ui.floatPanel(c,g,f),f=d.addBlock(a.id,e),b=this;d.onShow=function(){b.className&&this.element.addClass(b.className+"_panel");b.setState(CKEDITOR.TRISTATE_ON);a.on=1;b.editorFocus&&c.focus();if(b.onOpen)b.onOpen()};
  795. d.onHide=function(d){b.className&&this.element.getFirst().removeClass(b.className+"_panel");b.setState(b.modes&&b.modes[c.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);a.on=0;if(!d&&b.onClose)b.onClose()};d.onEscape=function(){d.hide(1);b.document.getById(a.id).focus()};if(this.onBlock)this.onBlock(d,f);f.onHide=function(){a.on=0;b.setState(CKEDITOR.TRISTATE_OFF)}}}}})},beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_PANELBUTTON,CKEDITOR.ui.panelButton.handler)}});
  796. CKEDITOR.UI_PANELBUTTON="panelbutton";(function(){CKEDITOR.plugins.add("panel",{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_PANEL,CKEDITOR.ui.panel.handler)}});CKEDITOR.UI_PANEL="panel";CKEDITOR.ui.panel=function(a,b){b&&CKEDITOR.tools.extend(this,b);CKEDITOR.tools.extend(this,{className:"",css:[]});this.id=CKEDITOR.tools.getNextId();this.document=a;this.isFramed=this.forceIFrame||this.css.length;this._={blocks:{}}};CKEDITOR.ui.panel.handler={create:function(a){return new CKEDITOR.ui.panel(a)}};var f=CKEDITOR.addTemplate("panel",
  797. '\x3cdiv lang\x3d"{langCode}" id\x3d"{id}" dir\x3d{dir} class\x3d"cke cke_reset_all {editorId} cke_panel cke_panel {cls} cke_{dir}" style\x3d"z-index:{z-index}" role\x3d"presentation"\x3e{frame}\x3c/div\x3e'),g=CKEDITOR.addTemplate("panel-frame",'\x3ciframe id\x3d"{id}" class\x3d"cke_panel_frame" role\x3d"presentation" frameborder\x3d"0" src\x3d"{src}"\x3e\x3c/iframe\x3e'),h=CKEDITOR.addTemplate("panel-frame-inner",'\x3c!DOCTYPE html\x3e\x3chtml class\x3d"cke_panel_container {env}" dir\x3d"{dir}" lang\x3d"{langCode}"\x3e\x3chead\x3e{css}\x3c/head\x3e\x3cbody class\x3d"cke_{dir}" style\x3d"margin:0;padding:0" onload\x3d"{onload}"\x3e\x3c/body\x3e\x3c/html\x3e');
  798. CKEDITOR.ui.panel.prototype={render:function(a,b){this.getHolderElement=function(){var a=this._.holder;if(!a){if(this.isFramed){var a=this.document.getById(this.id+"_frame"),b=a.getParent(),a=a.getFrameDocument();CKEDITOR.env.iOS&&b.setStyles({overflow:"scroll","-webkit-overflow-scrolling":"touch"});b=CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function(){this.isLoaded=!0;if(this.onLoad)this.onLoad()},this));a.write(h.output(CKEDITOR.tools.extend({css:CKEDITOR.tools.buildStyleHtml(this.css),onload:"window.parent.CKEDITOR.tools.callFunction("+
  799. b+");"},d)));a.getWindow().$.CKEDITOR=CKEDITOR;a.on("keydown",function(a){var b=a.data.getKeystroke(),c=this.document.getById(this.id).getAttribute("dir");this._.onKeyDown&&!1===this._.onKeyDown(b)?a.data.preventDefault():(27==b||b==("rtl"==c?39:37))&&this.onEscape&&!1===this.onEscape(b)&&a.data.preventDefault()},this);a=a.getBody();a.unselectable();CKEDITOR.env.air&&CKEDITOR.tools.callFunction(b)}else a=this.document.getById(this.id);this._.holder=a}return a};var d={editorId:a.id,id:this.id,langCode:a.langCode,
  800. dir:a.lang.dir,cls:this.className,frame:"",env:CKEDITOR.env.cssClass,"z-index":a.config.baseFloatZIndex+1};if(this.isFramed){var e=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie?"javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())":"";d.frame=g.output({id:this.id+"_frame",src:e})}e=f.output(d);b&&b.push(e);return e},addBlock:function(a,b){b=this._.blocks[a]=b instanceof CKEDITOR.ui.panel.block?b:new CKEDITOR.ui.panel.block(this.getHolderElement(),
  801. b);this._.currentBlock||this.showBlock(a);return b},getBlock:function(a){return this._.blocks[a]},showBlock:function(a){a=this._.blocks[a];var b=this._.currentBlock,d=!this.forceIFrame||CKEDITOR.env.ie?this._.holder:this.document.getById(this.id+"_frame");b&&b.hide();this._.currentBlock=a;CKEDITOR.fire("ariaWidget",d);a._.focusIndex=-1;this._.onKeyDown=a.onKeyDown&&CKEDITOR.tools.bind(a.onKeyDown,a);a.show();return a},destroy:function(){this.element&&this.element.remove()}};CKEDITOR.ui.panel.block=
  802. CKEDITOR.tools.createClass({$:function(a,b){this.element=a.append(a.getDocument().createElement("div",{attributes:{tabindex:-1,"class":"cke_panel_block"},styles:{display:"none"}}));b&&CKEDITOR.tools.extend(this,b);this.element.setAttributes({role:this.attributes.role||"presentation","aria-label":this.attributes["aria-label"],title:this.attributes.title||this.attributes["aria-label"]});this.keys={};this._.focusIndex=-1;this.element.disableContextMenu()},_:{markItem:function(a){-1!=a&&(a=this.element.getElementsByTag("a").getItem(this._.focusIndex=
  803. a),CKEDITOR.env.webkit&&a.getDocument().getWindow().focus(),a.focus(),this.onMark&&this.onMark(a))}},proto:{show:function(){this.element.setStyle("display","")},hide:function(){this.onHide&&!0===this.onHide.call(this)||this.element.setStyle("display","none")},onKeyDown:function(a,b){var d=this.keys[a];switch(d){case "next":for(var e=this._.focusIndex,d=this.element.getElementsByTag("a"),c;c=d.getItem(++e);)if(c.getAttribute("_cke_focus")&&c.$.offsetWidth){this._.focusIndex=e;c.focus();break}return c||
  804. b?!1:(this._.focusIndex=-1,this.onKeyDown(a,1));case "prev":e=this._.focusIndex;for(d=this.element.getElementsByTag("a");0<e&&(c=d.getItem(--e));){if(c.getAttribute("_cke_focus")&&c.$.offsetWidth){this._.focusIndex=e;c.focus();break}c=null}return c||b?!1:(this._.focusIndex=d.count(),this.onKeyDown(a,1));case "click":case "mouseup":return e=this._.focusIndex,(c=0<=e&&this.element.getElementsByTag("a").getItem(e))&&(c.$[d]?c.$[d]():c.$["on"+d]()),!1}return!0}}})})();CKEDITOR.plugins.add("floatpanel",{requires:"panel"});
  805. (function(){function v(a,b,c,l,h){h=CKEDITOR.tools.genKey(b.getUniqueId(),c.getUniqueId(),a.lang.dir,a.uiColor||"",l.css||"",h||"");var g=f[h];g||(g=f[h]=new CKEDITOR.ui.panel(b,l),g.element=c.append(CKEDITOR.dom.element.createFromHtml(g.render(a),b)),g.element.setStyles({display:"none",position:"absolute"}));return g}var f={};CKEDITOR.ui.floatPanel=CKEDITOR.tools.createClass({$:function(a,b,c,l){function h(){e.hide()}c.forceIFrame=1;c.toolbarRelated&&a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&
  806. (b=CKEDITOR.document.getById("cke_"+a.name));var g=b.getDocument();l=v(a,g,b,c,l||0);var m=l.element,p=m.getFirst(),e=this;m.disableContextMenu();this.element=m;this._={editor:a,panel:l,parentElement:b,definition:c,document:g,iframe:p,children:[],dir:a.lang.dir,showBlockParams:null};a.on("mode",h);a.on("resize",h);g.getWindow().on("resize",function(){this.reposition()},this)},proto:{addBlock:function(a,b){return this._.panel.addBlock(a,b)},addListBlock:function(a,b){return this._.panel.addListBlock(a,
  807. b)},getBlock:function(a){return this._.panel.getBlock(a)},showBlock:function(a,b,c,l,h,g){var m=this._.panel,p=m.showBlock(a);this._.showBlockParams=[].slice.call(arguments);this.allowBlur(!1);var e=this._.editor.editable();this._.returnFocus=e.hasFocus?e:new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement);this._.hideTimeout=0;var k=this.element,e=this._.iframe,e=CKEDITOR.env.ie&&!CKEDITOR.env.edge?e:new CKEDITOR.dom.window(e.$.contentWindow),f=k.getDocument(),r=this._.parentElement.getPositionedAncestor(),
  808. t=b.getDocumentPosition(f),f=r?r.getDocumentPosition(f):{x:0,y:0},q="rtl"==this._.dir,d=t.x+(l||0)-f.x,n=t.y+(h||0)-f.y;!q||1!=c&&4!=c?q||2!=c&&3!=c||(d+=b.$.offsetWidth-1):d+=b.$.offsetWidth;if(3==c||4==c)n+=b.$.offsetHeight-1;this._.panel._.offsetParentId=b.getId();k.setStyles({top:n+"px",left:0,display:""});k.setOpacity(0);k.getFirst().removeStyle("width");this._.editor.focusManager.add(e);this._.blurSet||(CKEDITOR.event.useCapture=!0,e.on("blur",function(a){function u(){delete this._.returnFocus;
  809. this.hide()}this.allowBlur()&&a.data.getPhase()==CKEDITOR.EVENT_PHASE_AT_TARGET&&this.visible&&!this._.activeChild&&(CKEDITOR.env.iOS?this._.hideTimeout||(this._.hideTimeout=CKEDITOR.tools.setTimeout(u,0,this)):u.call(this))},this),e.on("focus",function(){this._.focused=!0;this.hideChild();this.allowBlur(!0)},this),CKEDITOR.env.iOS&&(e.on("touchstart",function(){clearTimeout(this._.hideTimeout)},this),e.on("touchend",function(){this._.hideTimeout=0;this.focus()},this)),CKEDITOR.event.useCapture=!1,
  810. this._.blurSet=1);m.onEscape=CKEDITOR.tools.bind(function(a){if(this.onEscape&&!1===this.onEscape(a))return!1},this);CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.tools.bind(function(){var a=k;a.removeStyle("width");if(p.autoSize){var b=p.element.getDocument(),b=(CKEDITOR.env.webkit||CKEDITOR.env.edge?p.element:b.getBody()).$.scrollWidth;CKEDITOR.env.ie&&CKEDITOR.env.quirks&&0<b&&(b+=(a.$.offsetWidth||0)-(a.$.clientWidth||0)+3);a.setStyle("width",b+10+"px");b=p.element.$.scrollHeight;CKEDITOR.env.ie&&
  811. CKEDITOR.env.quirks&&0<b&&(b+=(a.$.offsetHeight||0)-(a.$.clientHeight||0)+3);a.setStyle("height",b+"px");m._.currentBlock.element.setStyle("display","none").removeStyle("display")}else a.removeStyle("height");q&&(d-=k.$.offsetWidth);k.setStyle("left",d+"px");var b=m.element.getWindow(),a=k.$.getBoundingClientRect(),b=b.getViewPaneSize(),c=a.width||a.right-a.left,e=a.height||a.bottom-a.top,l=q?a.right:b.width-a.left,h=q?b.width-a.right:a.left;q?l<c&&(d=h>c?d+c:b.width>c?d-a.left:d-a.right+b.width):
  812. l<c&&(d=h>c?d-c:b.width>c?d-a.right+b.width:d-a.left);c=a.top;b.height-a.top<e&&(n=c>e?n-e:b.height>e?n-a.bottom+b.height:n-a.top);CKEDITOR.env.ie&&(b=a=new CKEDITOR.dom.element(k.$.offsetParent),"html"==b.getName()&&(b=b.getDocument().getBody()),"rtl"==b.getComputedStyle("direction")&&(d=CKEDITOR.env.ie8Compat?d-2*k.getDocument().getDocumentElement().$.scrollLeft:d-(a.$.scrollWidth-a.$.clientWidth)));var a=k.getFirst(),f;(f=a.getCustomData("activePanel"))&&f.onHide&&f.onHide.call(this,1);a.setCustomData("activePanel",
  813. this);k.setStyles({top:n+"px",left:d+"px"});k.setOpacity(1);g&&g()},this);m.isLoaded?a():m.onLoad=a;CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.env.webkit&&CKEDITOR.document.getWindow().getScrollPosition().y;this.focus();p.element.focus();CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=a);this.allowBlur(!0);this._.editor.fire("panelShow",this)},0,this)},CKEDITOR.env.air?200:0,this);this.visible=1;this.onShow&&this.onShow.call(this)},reposition:function(){var a=this._.showBlockParams;
  814. this.visible&&this._.showBlockParams&&(this.hide(),this.showBlock.apply(this,a))},focus:function(){if(CKEDITOR.env.webkit){var a=CKEDITOR.document.getActive();a&&!a.equals(this._.iframe)&&a.$.blur()}(this._.lastFocused||this._.iframe.getFrameDocument().getWindow()).focus()},blur:function(){var a=this._.iframe.getFrameDocument().getActive();a&&a.is("a")&&(this._.lastFocused=a)},hide:function(a){if(this.visible&&(!this.onHide||!0!==this.onHide.call(this))){this.hideChild();CKEDITOR.env.gecko&&this._.iframe.getFrameDocument().$.activeElement.blur();
  815. this.element.setStyle("display","none");this.visible=0;this.element.getFirst().removeCustomData("activePanel");if(a=a&&this._.returnFocus)CKEDITOR.env.webkit&&a.type&&a.getWindow().$.focus(),a.focus();delete this._.lastFocused;this._.showBlockParams=null;this._.editor.fire("panelHide",this)}},allowBlur:function(a){var b=this._.panel;void 0!==a&&(b.allowBlur=a);return b.allowBlur},showAsChild:function(a,b,c,f,h,g){if(this._.activeChild!=a||a._.panel._.offsetParentId!=c.getId())this.hideChild(),a.onHide=
  816. CKEDITOR.tools.bind(function(){CKEDITOR.tools.setTimeout(function(){this._.focused||this.hide()},0,this)},this),this._.activeChild=a,this._.focused=!1,a.showBlock(b,c,f,h,g),this.blur(),(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&setTimeout(function(){a.element.getChild(0).$.style.cssText+=""},100)},hideChild:function(a){var b=this._.activeChild;b&&(delete b.onHide,delete this._.activeChild,b.hide(),a&&this.focus())}}});CKEDITOR.on("instanceDestroyed",function(){var a=CKEDITOR.tools.isEmpty(CKEDITOR.instances),
  817. b;for(b in f){var c=f[b];a?c.destroy():c.element.hide()}a&&(f={})})})();CKEDITOR.plugins.add("colorbutton",{requires:"panelbutton,floatpanel",init:function(c){function r(p,h,e,f){var l=new CKEDITOR.style(k["colorButton_"+h+"Style"]),m=CKEDITOR.tools.getNextId()+"_colorBox";c.ui.add(p,CKEDITOR.UI_PANELBUTTON,{label:e,title:e,modes:{wysiwyg:1},editorFocus:0,toolbar:"colors,"+f,allowedContent:l,requiredContent:l,panel:{css:CKEDITOR.skin.getPath("editor"),attributes:{role:"listbox","aria-label":g.panelTitle}},onBlock:function(a,b){b.autoSize=!0;b.element.addClass("cke_colorblock");
  818. b.element.setHtml(u(a,h,m));b.element.getDocument().getBody().setStyle("overflow","hidden");CKEDITOR.ui.fire("ready",this);var d=b.keys,e="rtl"==c.lang.dir;d[e?37:39]="next";d[40]="next";d[9]="next";d[e?39:37]="prev";d[38]="prev";d[CKEDITOR.SHIFT+9]="prev";d[32]="click"},refresh:function(){c.activeFilter.check(l)||this.setState(CKEDITOR.TRISTATE_DISABLED)},onOpen:function(){var a=c.getSelection(),a=a&&a.getStartElement(),a=c.elementPath(a),b;if(a){a=a.block||a.blockLimit||c.document.getBody();do b=
  819. a&&a.getComputedStyle("back"==h?"background-color":"color")||"transparent";while("back"==h&&"transparent"==b&&a&&(a=a.getParent()));b&&"transparent"!=b||(b="#ffffff");!1!==k.colorButton_enableAutomatic&&this._.panel._.iframe.getFrameDocument().getById(m).setStyle("background-color",b);return b}}})}function u(p,h,e){var f=[],l=k.colorButton_colors.split(","),m=c.plugins.colordialog&&!1!==k.colorButton_enableMore,a=l.length+(m?2:1),b=CKEDITOR.tools.addFunction(function(a,b){function d(a){this.removeListener("ok",
  820. d);this.removeListener("cancel",d);"ok"==a.name&&e(this.getContentElement("picker","selectedColor").getValue(),b)}var e=arguments.callee;if("?"==a)c.openDialog("colordialog",function(){this.on("ok",d);this.on("cancel",d)});else{c.focus();p.hide();c.fire("saveSnapshot");c.removeStyle(new CKEDITOR.style(k["colorButton_"+b+"Style"],{color:"inherit"}));if(a){var f=k["colorButton_"+b+"Style"];f.childRule="back"==b?function(a){return t(a)}:function(a){return!(a.is("a")||a.getElementsByTag("a").count())||
  821. t(a)};c.applyStyle(new CKEDITOR.style(f,{color:a}))}c.fire("saveSnapshot")}});!1!==k.colorButton_enableAutomatic&&f.push('\x3ca class\x3d"cke_colorauto" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',g.auto,'" onclick\x3d"CKEDITOR.tools.callFunction(',b,",null,'",h,"');return false;\" href\x3d\"javascript:void('",g.auto,'\')" role\x3d"option" aria-posinset\x3d"1" aria-setsize\x3d"',a,'"\x3e\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e\x3ctr\x3e\x3ctd\x3e\x3cspan class\x3d"cke_colorbox" id\x3d"',
  822. e,'"\x3e\x3c/span\x3e\x3c/td\x3e\x3ctd colspan\x3d7 align\x3dcenter\x3e',g.auto,"\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/a\x3e");f.push('\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e');for(e=0;e<l.length;e++){0===e%8&&f.push("\x3c/tr\x3e\x3ctr\x3e");var d=l[e].split("/"),n=d[0],q=d[1]||n;d[1]||(n="#"+n.replace(/^(.)(.)(.)$/,"$1$1$2$2$3$3"));d=c.lang.colorbutton.colors[q]||q;f.push('\x3ctd\x3e\x3ca class\x3d"cke_colorbox" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',
  823. d,'" onclick\x3d"CKEDITOR.tools.callFunction(',b,",'",n,"','",h,"'); return false;\" href\x3d\"javascript:void('",d,'\')" role\x3d"option" aria-posinset\x3d"',e+2,'" aria-setsize\x3d"',a,'"\x3e\x3cspan class\x3d"cke_colorbox" style\x3d"background-color:#',q,'"\x3e\x3c/span\x3e\x3c/a\x3e\x3c/td\x3e')}m&&f.push('\x3c/tr\x3e\x3ctr\x3e\x3ctd colspan\x3d8 align\x3dcenter\x3e\x3ca class\x3d"cke_colormore" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',g.more,'" onclick\x3d"CKEDITOR.tools.callFunction(',
  824. b,",'?','",h,"');return false;\" href\x3d\"javascript:void('",g.more,"')\"",' role\x3d"option" aria-posinset\x3d"',a,'" aria-setsize\x3d"',a,'"\x3e',g.more,"\x3c/a\x3e\x3c/td\x3e");f.push("\x3c/tr\x3e\x3c/table\x3e");return f.join("")}function t(c){return"false"==c.getAttribute("contentEditable")||c.getAttribute("data-nostyle")}var k=c.config,g=c.lang.colorbutton;CKEDITOR.env.hc||(r("TextColor","fore",g.textColorTitle,10),r("BGColor","back",g.bgColorTitle,20))}});
  825. CKEDITOR.config.colorButton_colors="000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF";CKEDITOR.config.colorButton_foreStyle={element:"span",styles:{color:"#(color)"},overrides:[{element:"font",attributes:{color:null}}]};CKEDITOR.config.colorButton_backStyle={element:"span",styles:{"background-color":"#(color)"}};CKEDITOR.plugins.colordialog={requires:"dialog",init:function(b){var c=new CKEDITOR.dialogCommand("colordialog");c.editorFocus=!1;b.addCommand("colordialog",c);CKEDITOR.dialog.add("colordialog",this.path+"dialogs/colordialog.js");b.getColorFromDialog=function(c,f){var d=function(a){this.removeListener("ok",d);this.removeListener("cancel",d);a="ok"==a.name?this.getValueOf("picker","selectedColor"):null;c.call(f,a)},e=function(a){a.on("ok",d);a.on("cancel",d)};b.execCommand("colordialog");if(b._.storedDialogs&&
  826. b._.storedDialogs.colordialog)e(b._.storedDialogs.colordialog);else CKEDITOR.on("dialogDefinition",function(a){if("colordialog"==a.data.name){var b=a.data.definition;a.removeListener();b.onLoad=CKEDITOR.tools.override(b.onLoad,function(a){return function(){e(this);b.onLoad=a;"function"==typeof a&&a.call(this)}})}})}}};CKEDITOR.plugins.add("colordialog",CKEDITOR.plugins.colordialog);(function(){CKEDITOR.plugins.add("templates",{requires:"dialog",init:function(a){CKEDITOR.dialog.add("templates",CKEDITOR.getUrl(this.path+"dialogs/templates.js"));a.addCommand("templates",new CKEDITOR.dialogCommand("templates"));a.ui.addButton&&a.ui.addButton("Templates",{label:a.lang.templates.button,command:"templates",toolbar:"doctools,10"})}});var c={},f={};CKEDITOR.addTemplates=function(a,d){c[a]=d};CKEDITOR.getTemplates=function(a){return c[a]};CKEDITOR.loadTemplates=function(a,d){for(var e=
  827. [],b=0,c=a.length;b<c;b++)f[a[b]]||(e.push(a[b]),f[a[b]]=1);e.length?CKEDITOR.scriptLoader.load(e,d):setTimeout(d,0)}})();CKEDITOR.config.templates_files=[CKEDITOR.getUrl("plugins/templates/templates/default.js")];CKEDITOR.config.templates_replaceContent=!0;CKEDITOR.plugins.add("menu",{requires:"floatpanel",beforeInit:function(g){for(var h=g.config.menu_groups.split(","),p=g._.menuGroups={},n=g._.menuItems={},a=0;a<h.length;a++)p[h[a]]=a+1;g.addMenuGroup=function(b,a){p[b]=a||100};g.addMenuItem=function(a,c){p[c.group]&&(n[a]=new CKEDITOR.menuItem(this,a,c))};g.addMenuItems=function(a){for(var c in a)this.addMenuItem(c,a[c])};g.getMenuItem=function(a){return n[a]};g.removeMenuItem=function(a){delete n[a]}}});
  828. (function(){function g(a){a.sort(function(a,c){return a.group<c.group?-1:a.group>c.group?1:a.order<c.order?-1:a.order>c.order?1:0})}var h='\x3cspan class\x3d"cke_menuitem"\x3e\x3ca id\x3d"{id}" class\x3d"cke_menubutton cke_menubutton__{name} cke_menubutton_{state} {cls}" href\x3d"{href}" title\x3d"{title}" tabindex\x3d"-1"_cke_focus\x3d1 hidefocus\x3d"true" role\x3d"{role}" aria-haspopup\x3d"{hasPopup}" aria-disabled\x3d"{disabled}" {ariaChecked}';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(h+=' onkeypress\x3d"return false;"');
  829. CKEDITOR.env.gecko&&(h+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');var h=h+(' onmouseover\x3d"CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout\x3d"CKEDITOR.tools.callFunction({moveOutFn},{index});" '+(CKEDITOR.env.ie?'onclick\x3d"return false;" onmouseup':"onclick")+'\x3d"CKEDITOR.tools.callFunction({clickFn},{index}); return false;"\x3e'),p=CKEDITOR.addTemplate("menuItem",h+'\x3cspan class\x3d"cke_menubutton_inner"\x3e\x3cspan class\x3d"cke_menubutton_icon"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{iconStyle}"\x3e\x3c/span\x3e\x3c/span\x3e\x3cspan class\x3d"cke_menubutton_label"\x3e{label}\x3c/span\x3e{arrowHtml}\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e'),
  830. n=CKEDITOR.addTemplate("menuArrow",'\x3cspan class\x3d"cke_menuarrow"\x3e\x3cspan\x3e{label}\x3c/span\x3e\x3c/span\x3e');CKEDITOR.menu=CKEDITOR.tools.createClass({$:function(a,b){b=this._.definition=b||{};this.id=CKEDITOR.tools.getNextId();this.editor=a;this.items=[];this._.listeners=[];this._.level=b.level||1;var c=CKEDITOR.tools.extend({},b.panel,{css:[CKEDITOR.skin.getPath("editor")],level:this._.level-1,block:{}}),m=c.block.attributes=c.attributes||{};!m.role&&(m.role="menu");this._.panelDefinition=
  831. c},_:{onShow:function(){var a=this.editor.getSelection(),b=a&&a.getStartElement(),c=this.editor.elementPath(),m=this._.listeners;this.removeAll();for(var e=0;e<m.length;e++){var l=m[e](b,a,c);if(l)for(var k in l){var f=this.editor.getMenuItem(k);!f||f.command&&!this.editor.getCommand(f.command).state||(f.state=l[k],this.add(f))}}},onClick:function(a){this.hide();if(a.onClick)a.onClick();else a.command&&this.editor.execCommand(a.command)},onEscape:function(a){var b=this.parent;b?b._.panel.hideChild(1):
  832. 27==a&&this.hide(1);return!1},onHide:function(){this.onHide&&this.onHide()},showSubMenu:function(a){var b=this._.subMenu,c=this.items[a];if(c=c.getItems&&c.getItems()){b?b.removeAll():(b=this._.subMenu=new CKEDITOR.menu(this.editor,CKEDITOR.tools.extend({},this._.definition,{level:this._.level+1},!0)),b.parent=this,b._.onClick=CKEDITOR.tools.bind(this._.onClick,this));for(var m in c){var e=this.editor.getMenuItem(m);e&&(e.state=c[m],b.add(e))}var l=this._.panel.getBlock(this.id).element.getDocument().getById(this.id+
  833. String(a));setTimeout(function(){b.show(l,2)},0)}else this._.panel.hideChild(1)}},proto:{add:function(a){a.order||(a.order=this.items.length);this.items.push(a)},removeAll:function(){this.items=[]},show:function(a,b,c,m){if(!this.parent&&(this._.onShow(),!this.items.length))return;b=b||("rtl"==this.editor.lang.dir?2:1);var e=this.items,l=this.editor,k=this._.panel,f=this._.element;if(!k){k=this._.panel=new CKEDITOR.ui.floatPanel(this.editor,CKEDITOR.document.getBody(),this._.panelDefinition,this._.level);
  834. k.onEscape=CKEDITOR.tools.bind(function(a){if(!1===this._.onEscape(a))return!1},this);k.onShow=function(){k._.panel.getHolderElement().getParent().addClass("cke").addClass("cke_reset_all")};k.onHide=CKEDITOR.tools.bind(function(){this._.onHide&&this._.onHide()},this);f=k.addBlock(this.id,this._.panelDefinition.block);f.autoSize=!0;var d=f.keys;d[40]="next";d[9]="next";d[38]="prev";d[CKEDITOR.SHIFT+9]="prev";d["rtl"==l.lang.dir?37:39]=CKEDITOR.env.ie?"mouseup":"click";d[32]=CKEDITOR.env.ie?"mouseup":
  835. "click";CKEDITOR.env.ie&&(d[13]="mouseup");f=this._.element=f.element;d=f.getDocument();d.getBody().setStyle("overflow","hidden");d.getElementsByTag("html").getItem(0).setStyle("overflow","hidden");this._.itemOverFn=CKEDITOR.tools.addFunction(function(a){clearTimeout(this._.showSubTimeout);this._.showSubTimeout=CKEDITOR.tools.setTimeout(this._.showSubMenu,l.config.menu_subMenuDelay||400,this,[a])},this);this._.itemOutFn=CKEDITOR.tools.addFunction(function(){clearTimeout(this._.showSubTimeout)},this);
  836. this._.itemClickFn=CKEDITOR.tools.addFunction(function(a){var b=this.items[a];if(b.state==CKEDITOR.TRISTATE_DISABLED)this.hide(1);else if(b.getItems)this._.showSubMenu(a);else this._.onClick(b)},this)}g(e);for(var d=l.elementPath(),d=['\x3cdiv class\x3d"cke_menu'+(d&&d.direction()!=l.lang.dir?" cke_mixed_dir_content":"")+'" role\x3d"presentation"\x3e'],h=e.length,p=h&&e[0].group,n=0;n<h;n++){var q=e[n];p!=q.group&&(d.push('\x3cdiv class\x3d"cke_menuseparator" role\x3d"separator"\x3e\x3c/div\x3e'),
  837. p=q.group);q.render(this,n,d)}d.push("\x3c/div\x3e");f.setHtml(d.join(""));CKEDITOR.ui.fire("ready",this);this.parent?this.parent._.panel.showAsChild(k,this.id,a,b,c,m):k.showBlock(this.id,a,b,c,m);l.fire("menuShow",[k])},addListener:function(a){this._.listeners.push(a)},hide:function(a){this._.onHide&&this._.onHide();this._.panel&&this._.panel.hide(a)}}});CKEDITOR.menuItem=CKEDITOR.tools.createClass({$:function(a,b,c){CKEDITOR.tools.extend(this,c,{order:0,className:"cke_menubutton__"+b});this.group=
  838. a._.menuGroups[this.group];this.editor=a;this.name=b},proto:{render:function(a,b,c){var h=a.id+String(b),e="undefined"==typeof this.state?CKEDITOR.TRISTATE_OFF:this.state,l="",k=e==CKEDITOR.TRISTATE_ON?"on":e==CKEDITOR.TRISTATE_DISABLED?"disabled":"off";this.role in{menuitemcheckbox:1,menuitemradio:1}&&(l=' aria-checked\x3d"'+(e==CKEDITOR.TRISTATE_ON?"true":"false")+'"');var f=this.getItems,d="\x26#"+("rtl"==this.editor.lang.dir?"9668":"9658")+";",g=this.name;this.icon&&!/\./.test(this.icon)&&(g=
  839. this.icon);a={id:h,name:this.name,iconName:g,label:this.label,cls:this.className||"",state:k,hasPopup:f?"true":"false",disabled:e==CKEDITOR.TRISTATE_DISABLED,title:this.label,href:"javascript:void('"+(this.label||"").replace("'")+"')",hoverFn:a._.itemOverFn,moveOutFn:a._.itemOutFn,clickFn:a._.itemClickFn,index:b,iconStyle:CKEDITOR.skin.getIconStyle(g,"rtl"==this.editor.lang.dir,g==this.icon?null:this.icon,this.iconOffset),arrowHtml:f?n.output({label:d}):"",role:this.role?this.role:"menuitem",ariaChecked:l};
  840. p.output(a,c)}}})})();CKEDITOR.config.menu_groups="clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div";CKEDITOR.plugins.add("contextmenu",{requires:"menu",onLoad:function(){CKEDITOR.plugins.contextMenu=CKEDITOR.tools.createClass({base:CKEDITOR.menu,$:function(a){this.base.call(this,a,{panel:{className:"cke_menu_panel",attributes:{"aria-label":a.lang.contextmenu.options}}})},proto:{addTarget:function(a,e){a.on("contextmenu",function(a){a=a.data;var c=CKEDITOR.env.webkit?f:CKEDITOR.env.mac?a.$.metaKey:a.$.ctrlKey;if(!e||!c){a.preventDefault();if(CKEDITOR.env.mac&&CKEDITOR.env.webkit){var c=this.editor,
  841. b=(new CKEDITOR.dom.elementPath(a.getTarget(),c.editable())).contains(function(a){return a.hasAttribute("contenteditable")},!0);b&&"false"==b.getAttribute("contenteditable")&&c.getSelection().fake(b)}var b=a.getTarget().getDocument(),d=a.getTarget().getDocument().getDocumentElement(),c=!b.equals(CKEDITOR.document),b=b.getWindow().getScrollPosition(),g=c?a.$.clientX:a.$.pageX||b.x+a.$.clientX,h=c?a.$.clientY:a.$.pageY||b.y+a.$.clientY;CKEDITOR.tools.setTimeout(function(){this.open(d,null,g,h)},CKEDITOR.env.ie?
  842. 200:0,this)}},this);if(CKEDITOR.env.webkit){var f,d=function(){f=0};a.on("keydown",function(a){f=CKEDITOR.env.mac?a.data.$.metaKey:a.data.$.ctrlKey});a.on("keyup",d);a.on("contextmenu",d)}},open:function(a,e,f,d){this.editor.focus();a=a||CKEDITOR.document.getDocumentElement();this.editor.selectionChange(1);this.show(a,e,f,d)}}})},beforeInit:function(a){var e=a.contextMenu=new CKEDITOR.plugins.contextMenu(a);a.on("contentDom",function(){e.addTarget(a.editable(),!1!==a.config.browserContextMenuOnCtrl)});
  843. a.addCommand("contextMenu",{exec:function(){a.contextMenu.open(a.document.getBody())}});a.setKeystroke(CKEDITOR.SHIFT+121,"contextMenu");a.setKeystroke(CKEDITOR.CTRL+CKEDITOR.SHIFT+121,"contextMenu")}});(function(){CKEDITOR.plugins.add("div",{requires:"dialog",init:function(a){if(!a.blockless){var c=a.lang.div,b="div(*)";CKEDITOR.dialog.isTabEnabled(a,"editdiv","advanced")&&(b+=";div[dir,id,lang,title]{*}");a.addCommand("creatediv",new CKEDITOR.dialogCommand("creatediv",{allowedContent:b,requiredContent:"div",contextSensitive:!0,refresh:function(a,c){this.setState("div"in(a.config.div_wrapTable?c.root:c.blockLimit).getDtd()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}}));a.addCommand("editdiv",
  844. new CKEDITOR.dialogCommand("editdiv",{requiredContent:"div"}));a.addCommand("removediv",{requiredContent:"div",exec:function(a){function c(b){(b=CKEDITOR.plugins.div.getSurroundDiv(a,b))&&!b.data("cke-div-added")&&(f.push(b),b.data("cke-div-added"))}for(var b=a.getSelection(),g=b&&b.getRanges(),e,h=b.createBookmarks(),f=[],d=0;d<g.length;d++)e=g[d],e.collapsed?c(b.getStartElement()):(e=new CKEDITOR.dom.walker(e),e.evaluator=c,e.lastForward());for(d=0;d<f.length;d++)f[d].remove(!0);b.selectBookmarks(h)}});
  845. a.ui.addButton&&a.ui.addButton("CreateDiv",{label:c.toolbar,command:"creatediv",toolbar:"blocks,50"});a.addMenuItems&&(a.addMenuItems({editdiv:{label:c.edit,command:"editdiv",group:"div",order:1},removediv:{label:c.remove,command:"removediv",group:"div",order:5}}),a.contextMenu&&a.contextMenu.addListener(function(b){return!b||b.isReadOnly()?null:CKEDITOR.plugins.div.getSurroundDiv(a)?{editdiv:CKEDITOR.TRISTATE_OFF,removediv:CKEDITOR.TRISTATE_OFF}:null}));CKEDITOR.dialog.add("creatediv",this.path+
  846. "dialogs/div.js");CKEDITOR.dialog.add("editdiv",this.path+"dialogs/div.js")}}});CKEDITOR.plugins.div={getSurroundDiv:function(a,c){var b=a.elementPath(c);return a.elementPath(b.blockLimit).contains(function(a){return a.is("div")&&!a.isReadOnly()},1)}}})();CKEDITOR.plugins.add("resize",{init:function(b){function f(d){var e=c.width,m=c.height,f=e+(d.data.$.screenX-n.x)*("rtl"==g?-1:1);d=m+(d.data.$.screenY-n.y);h&&(e=Math.max(a.resize_minWidth,Math.min(f,a.resize_maxWidth)));p&&(m=Math.max(a.resize_minHeight,Math.min(d,a.resize_maxHeight)));b.resize(h?e:null,m)}function k(){CKEDITOR.document.removeListener("mousemove",f);CKEDITOR.document.removeListener("mouseup",k);b.document&&(b.document.removeListener("mousemove",f),b.document.removeListener("mouseup",
  847. k))}var a=b.config,r=b.ui.spaceId("resizer"),g=b.element?b.element.getDirection(1):"ltr";!a.resize_dir&&(a.resize_dir="vertical");void 0===a.resize_maxWidth&&(a.resize_maxWidth=3E3);void 0===a.resize_maxHeight&&(a.resize_maxHeight=3E3);void 0===a.resize_minWidth&&(a.resize_minWidth=750);void 0===a.resize_minHeight&&(a.resize_minHeight=250);if(!1!==a.resize_enabled){var l=null,n,c,h=("both"==a.resize_dir||"horizontal"==a.resize_dir)&&a.resize_minWidth!=a.resize_maxWidth,p=("both"==a.resize_dir||"vertical"==
  848. a.resize_dir)&&a.resize_minHeight!=a.resize_maxHeight,q=CKEDITOR.tools.addFunction(function(d){l||(l=b.getResizable());c={width:l.$.offsetWidth||0,height:l.$.offsetHeight||0};n={x:d.screenX,y:d.screenY};a.resize_minWidth>c.width&&(a.resize_minWidth=c.width);a.resize_minHeight>c.height&&(a.resize_minHeight=c.height);CKEDITOR.document.on("mousemove",f);CKEDITOR.document.on("mouseup",k);b.document&&(b.document.on("mousemove",f),b.document.on("mouseup",k));d.preventDefault&&d.preventDefault()});b.on("destroy",
  849. function(){CKEDITOR.tools.removeFunction(q)});b.on("uiSpace",function(a){if("bottom"==a.data.space){var e="";h&&!p&&(e=" cke_resizer_horizontal");!h&&p&&(e=" cke_resizer_vertical");var c='\x3cspan id\x3d"'+r+'" class\x3d"cke_resizer'+e+" cke_resizer_"+g+'" title\x3d"'+CKEDITOR.tools.htmlEncode(b.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+q+', event)"\x3e'+("ltr"==g?"◢":"◣")+"\x3c/span\x3e";"ltr"==g&&"ltr"==e?a.data.html+=c:a.data.html=c+a.data.html}},b,null,100);b.on("maximize",
  850. function(a){b.ui.space("resizer")[a.data==CKEDITOR.TRISTATE_ON?"hide":"show"]()})}}});(function(){function B(a){function d(){for(var b=g(),e=CKEDITOR.tools.clone(a.config.toolbarGroups)||q(a),f=0;f<e.length;f++){var l=e[f];if("/"!=l){"string"==typeof l&&(l=e[f]={name:l});var m,d=l.groups;if(d)for(var h=0;h<d.length;h++)m=d[h],(m=b[m])&&c(l,m);(m=b[l.name])&&c(l,m)}}return e}function g(){var b={},c,f,e;for(c in a.ui.items)f=a.ui.items[c],e=f.toolbar||"others",e=e.split(","),f=e[0],e=parseInt(e[1]||-1,10),b[f]||(b[f]=[]),b[f].push({name:c,order:e});for(f in b)b[f]=b[f].sort(function(b,
  851. a){return b.order==a.order?0:0>a.order?-1:0>b.order?1:b.order<a.order?-1:1});return b}function c(c,e){if(e.length){c.items?c.items.push(a.ui.create("-")):c.items=[];for(var f;f=e.shift();)f="string"==typeof f?f:f.name,b&&-1!=CKEDITOR.tools.indexOf(b,f)||(f=a.ui.create(f))&&a.addFeature(f)&&c.items.push(f)}}function h(b){var a=[],e,d,h;for(e=0;e<b.length;++e)d=b[e],h={},"/"==d?a.push(d):CKEDITOR.tools.isArray(d)?(c(h,CKEDITOR.tools.clone(d)),a.push(h)):d.items&&(c(h,CKEDITOR.tools.clone(d.items)),
  852. h.name=d.name,a.push(h));return a}var b=a.config.removeButtons,b=b&&b.split(","),e=a.config.toolbar;"string"==typeof e&&(e=a.config["toolbar_"+e]);return a.toolbar=e?h(e):d()}function q(a){return a._.toolbarGroups||(a._.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"forms"},"/",{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list",
  853. "indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},"/",{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}])}var y=function(){this.toolbars=[];this.focusCommandExecuted=!1};y.prototype.focus=function(){for(var a=0,d;d=this.toolbars[a++];)for(var g=0,c;c=d.items[g++];)if(c.focus){c.focus();return}};var C={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(a){a.toolbox&&(a.toolbox.focusCommandExecuted=!0,CKEDITOR.env.ie||CKEDITOR.env.air?setTimeout(function(){a.toolbox.focus()},
  854. 100):a.toolbox.focus())}};CKEDITOR.plugins.add("toolbar",{requires:"button",init:function(a){var d,g=function(c,h){var b,e="rtl"==a.lang.dir,k=a.config.toolbarGroupCycling,r=e?37:39,e=e?39:37,k=void 0===k||k;switch(h){case 9:case CKEDITOR.SHIFT+9:for(;!b||!b.items.length;)if(b=9==h?(b?b.next:c.toolbar.next)||a.toolbox.toolbars[0]:(b?b.previous:c.toolbar.previous)||a.toolbox.toolbars[a.toolbox.toolbars.length-1],b.items.length)for(c=b.items[d?b.items.length-1:0];c&&!c.focus;)(c=d?c.previous:c.next)||
  855. (b=0);c&&c.focus();return!1;case r:b=c;do b=b.next,!b&&k&&(b=c.toolbar.items[0]);while(b&&!b.focus);b?b.focus():g(c,9);return!1;case 40:return c.button&&c.button.hasArrow?(a.once("panelShow",function(b){b.data._.panel._.currentBlock.onKeyDown(40)}),c.execute()):g(c,40==h?r:e),!1;case e:case 38:b=c;do b=b.previous,!b&&k&&(b=c.toolbar.items[c.toolbar.items.length-1]);while(b&&!b.focus);b?b.focus():(d=1,g(c,CKEDITOR.SHIFT+9),d=0);return!1;case 27:return a.focus(),!1;case 13:case 32:return c.execute(),
  856. !1}return!0};a.on("uiSpace",function(c){if(c.data.space==a.config.toolbarLocation){c.removeListener();a.toolbox=new y;var d=CKEDITOR.tools.getNextId(),b=['\x3cspan id\x3d"',d,'" class\x3d"cke_voice_label"\x3e',a.lang.toolbar.toolbars,"\x3c/span\x3e",'\x3cspan id\x3d"'+a.ui.spaceId("toolbox")+'" class\x3d"cke_toolbox" role\x3d"group" aria-labelledby\x3d"',d,'" onmousedown\x3d"return false;"\x3e'],d=!1!==a.config.toolbarStartupExpanded,e,k;a.config.toolbarCanCollapse&&a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&
  857. b.push('\x3cspan class\x3d"cke_toolbox_main"'+(d?"\x3e":' style\x3d"display:none"\x3e'));for(var r=a.toolbox.toolbars,f=B(a),l=0;l<f.length;l++){var m,n=0,v,p=f[l],w;if(p)if(e&&(b.push("\x3c/span\x3e"),k=e=0),"/"===p)b.push('\x3cspan class\x3d"cke_toolbar_break"\x3e\x3c/span\x3e');else{w=p.items||p;for(var x=0;x<w.length;x++){var t=w[x],q;if(t){var z=function(c){c=c.render(a,b);u=n.items.push(c)-1;0<u&&(c.previous=n.items[u-1],c.previous.next=c);c.toolbar=n;c.onkey=g;c.onfocus=function(){a.toolbox.focusCommandExecuted||
  858. a.focus()}};if(t.type==CKEDITOR.UI_SEPARATOR)k=e&&t;else{q=!1!==t.canGroup;if(!n){m=CKEDITOR.tools.getNextId();n={id:m,items:[]};v=p.name&&(a.lang.toolbar.toolbarGroups[p.name]||p.name);b.push('\x3cspan id\x3d"',m,'" class\x3d"cke_toolbar"',v?' aria-labelledby\x3d"'+m+'_label"':"",' role\x3d"toolbar"\x3e');v&&b.push('\x3cspan id\x3d"',m,'_label" class\x3d"cke_voice_label"\x3e',v,"\x3c/span\x3e");b.push('\x3cspan class\x3d"cke_toolbar_start"\x3e\x3c/span\x3e');var u=r.push(n)-1;0<u&&(n.previous=r[u-
  859. 1],n.previous.next=n)}q?e||(b.push('\x3cspan class\x3d"cke_toolgroup" role\x3d"presentation"\x3e'),e=1):e&&(b.push("\x3c/span\x3e"),e=0);k&&(z(k),k=0);z(t)}}}e&&(b.push("\x3c/span\x3e"),k=e=0);n&&b.push('\x3cspan class\x3d"cke_toolbar_end"\x3e\x3c/span\x3e\x3c/span\x3e')}}a.config.toolbarCanCollapse&&b.push("\x3c/span\x3e");if(a.config.toolbarCanCollapse&&a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var A=CKEDITOR.tools.addFunction(function(){a.execCommand("toolbarCollapse")});a.on("destroy",function(){CKEDITOR.tools.removeFunction(A)});
  860. a.addCommand("toolbarCollapse",{readOnly:1,exec:function(b){var a=b.ui.space("toolbar_collapser"),c=a.getPrevious(),e=b.ui.space("contents"),d=c.getParent(),f=parseInt(e.$.style.height,10),h=d.$.offsetHeight,g=a.hasClass("cke_toolbox_collapser_min");g?(c.show(),a.removeClass("cke_toolbox_collapser_min"),a.setAttribute("title",b.lang.toolbar.toolbarCollapse)):(c.hide(),a.addClass("cke_toolbox_collapser_min"),a.setAttribute("title",b.lang.toolbar.toolbarExpand));a.getFirst().setText(g?"▲":"◀");e.setStyle("height",
  861. f-(d.$.offsetHeight-h)+"px");b.fire("resize",{outerHeight:b.container.$.offsetHeight,contentsHeight:e.$.offsetHeight,outerWidth:b.container.$.offsetWidth})},modes:{wysiwyg:1,source:1}});a.setKeystroke(CKEDITOR.ALT+(CKEDITOR.env.ie||CKEDITOR.env.webkit?189:109),"toolbarCollapse");b.push('\x3ca title\x3d"'+(d?a.lang.toolbar.toolbarCollapse:a.lang.toolbar.toolbarExpand)+'" id\x3d"'+a.ui.spaceId("toolbar_collapser")+'" tabIndex\x3d"-1" class\x3d"cke_toolbox_collapser');d||b.push(" cke_toolbox_collapser_min");
  862. b.push('" onclick\x3d"CKEDITOR.tools.callFunction('+A+')"\x3e','\x3cspan class\x3d"cke_arrow"\x3e\x26#9650;\x3c/span\x3e',"\x3c/a\x3e")}b.push("\x3c/span\x3e");c.data.html+=b.join("")}});a.on("destroy",function(){if(this.toolbox){var a,d=0,b,e,g;for(a=this.toolbox.toolbars;d<a.length;d++)for(e=a[d].items,b=0;b<e.length;b++)g=e[b],g.clickFn&&CKEDITOR.tools.removeFunction(g.clickFn),g.keyDownFn&&CKEDITOR.tools.removeFunction(g.keyDownFn)}});a.on("uiReady",function(){var c=a.ui.space("toolbox");c&&a.focusManager.add(c,
  863. 1)});a.addCommand("toolbarFocus",C);a.setKeystroke(CKEDITOR.ALT+121,"toolbarFocus");a.ui.add("-",CKEDITOR.UI_SEPARATOR,{});a.ui.addHandler(CKEDITOR.UI_SEPARATOR,{create:function(){return{render:function(a,d){d.push('\x3cspan class\x3d"cke_toolbar_separator" role\x3d"separator"\x3e\x3c/span\x3e');return{}}}}})}});CKEDITOR.ui.prototype.addToolbarGroup=function(a,d,g){var c=q(this.editor),h=0===d,b={name:a};if(g){if(g=CKEDITOR.tools.search(c,function(a){return a.name==g})){!g.groups&&(g.groups=[]);if(d&&
  864. (d=CKEDITOR.tools.indexOf(g.groups,d),0<=d)){g.groups.splice(d+1,0,a);return}h?g.groups.splice(0,0,a):g.groups.push(a);return}d=null}d&&(d=CKEDITOR.tools.indexOf(c,function(a){return a.name==d}));h?c.splice(0,0,a):"number"==typeof d?c.splice(d+1,0,b):c.push(a)}})();CKEDITOR.UI_SEPARATOR="separator";CKEDITOR.config.toolbarLocation="top";(function(){function q(a,d){function l(c){c=k.list[c];if(c.equals(a.editable())||"true"==c.getAttribute("contenteditable")){var e=a.createRange();e.selectNodeContents(c);e.select()}else a.getSelection().selectElement(c);a.focus()}function m(){n&&n.setHtml('\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e');delete k.list}var p=a.ui.spaceId("path"),n,k=a._.elementsPath,q=k.idBase;d.html+='\x3cspan id\x3d"'+p+'_label" class\x3d"cke_voice_label"\x3e'+a.lang.elementspath.eleLabel+'\x3c/span\x3e\x3cspan id\x3d"'+
  865. p+'" class\x3d"cke_path" role\x3d"group" aria-labelledby\x3d"'+p+'_label"\x3e\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e\x3c/span\x3e';a.on("uiReady",function(){var c=a.ui.space("path");c&&a.focusManager.add(c,1)});k.onClick=l;var v=CKEDITOR.tools.addFunction(l),w=CKEDITOR.tools.addFunction(function(c,e){var g=k.idBase,b;e=new CKEDITOR.dom.event(e);b="rtl"==a.lang.dir;switch(e.getKeystroke()){case b?39:37:case 9:return(b=CKEDITOR.document.getById(g+(c+1)))||(b=CKEDITOR.document.getById(g+
  866. "0")),b.focus(),!1;case b?37:39:case CKEDITOR.SHIFT+9:return(b=CKEDITOR.document.getById(g+(c-1)))||(b=CKEDITOR.document.getById(g+(k.list.length-1))),b.focus(),!1;case 27:return a.focus(),!1;case 13:case 32:return l(c),!1}return!0});a.on("selectionChange",function(){for(var c=[],e=k.list=[],g=[],b=k.filters,d=!0,l=a.elementPath().elements,f,u=l.length;u--;){var h=l[u],r=0;f=h.data("cke-display-name")?h.data("cke-display-name"):h.data("cke-real-element-type")?h.data("cke-real-element-type"):h.getName();
  867. (d=h.hasAttribute("contenteditable")?"true"==h.getAttribute("contenteditable"):d)||h.hasAttribute("contenteditable")||(r=1);for(var t=0;t<b.length;t++){var m=b[t](h,f);if(!1===m){r=1;break}f=m||f}r||(e.unshift(h),g.unshift(f))}e=e.length;for(b=0;b<e;b++)f=g[b],d=a.lang.elementspath.eleTitle.replace(/%1/,f),f=x.output({id:q+b,label:d,text:f,jsTitle:"javascript:void('"+f+"')",index:b,keyDownFn:w,clickFn:v}),c.unshift(f);n||(n=CKEDITOR.document.getById(p));g=n;g.setHtml(c.join("")+'\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e');
  868. a.fire("elementsPathUpdate",{space:g})});a.on("readOnly",m);a.on("contentDomUnload",m);a.addCommand("elementsPathFocus",y.toolbarFocus);a.setKeystroke(CKEDITOR.ALT+122,"elementsPathFocus")}var y={toolbarFocus:{editorFocus:!1,readOnly:1,exec:function(a){(a=CKEDITOR.document.getById(a._.elementsPath.idBase+"0"))&&a.focus(CKEDITOR.env.ie||CKEDITOR.env.air)}}},d="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(d+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(d+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');
  869. var x=CKEDITOR.addTemplate("pathItem",'\x3ca id\x3d"{id}" href\x3d"{jsTitle}" tabindex\x3d"-1" class\x3d"cke_path_item" title\x3d"{label}"'+d+' hidefocus\x3d"true" onkeydown\x3d"return CKEDITOR.tools.callFunction({keyDownFn},{index}, event );" onclick\x3d"CKEDITOR.tools.callFunction({clickFn},{index}); return false;" role\x3d"button" aria-label\x3d"{label}"\x3e{text}\x3c/a\x3e');CKEDITOR.plugins.add("elementspath",{init:function(a){a._.elementsPath={idBase:"cke_elementspath_"+CKEDITOR.tools.getNextNumber()+
  870. "_",filters:[]};a.on("uiSpace",function(d){"bottom"==d.data.space&&q(a,d.data)})}})})();(function(){function q(b,d,a){a=b.config.forceEnterMode||a;"wysiwyg"==b.mode&&(d||(d=b.activeEnterMode),b.elementPath().isContextFor("p")||(d=CKEDITOR.ENTER_BR,a=1),b.fire("saveSnapshot"),d==CKEDITOR.ENTER_BR?t(b,d,null,a):u(b,d,null,a),b.fire("saveSnapshot"))}function v(b){b=b.getSelection().getRanges(!0);for(var d=b.length-1;0<d;d--)b[d].deleteContents();return b[0]}function y(b){var d=b.startContainer.getAscendant(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&"true"==a.getAttribute("contenteditable")},
  871. !0);if(b.root.equals(d))return b;d=new CKEDITOR.dom.range(d);d.moveToRange(b);return d}CKEDITOR.plugins.add("enterkey",{init:function(b){b.addCommand("enter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(b){q(b)}});b.addCommand("shiftEnter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(b){q(b,b.activeShiftEnterMode,1)}});b.setKeystroke([[13,"enter"],[CKEDITOR.SHIFT+13,"shiftEnter"]])}});var z=CKEDITOR.dom.walker.whitespaces(),A=CKEDITOR.dom.walker.bookmark();CKEDITOR.plugins.enterkey={enterBlock:function(b,
  872. d,a,h){if(a=a||v(b)){a=y(a);var f=a.document,k=a.checkStartOfBlock(),m=a.checkEndOfBlock(),l=b.elementPath(a.startContainer),c=l.block,n=d==CKEDITOR.ENTER_DIV?"div":"p",e;if(k&&m){if(c&&(c.is("li")||c.getParent().is("li"))){c.is("li")||(c=c.getParent());a=c.getParent();e=a.getParent();h=!c.hasPrevious();var p=!c.hasNext(),n=b.getSelection(),g=n.createBookmarks(),k=c.getDirection(1),m=c.getAttribute("class"),r=c.getAttribute("style"),q=e.getDirection(1)!=k;b=b.enterMode!=CKEDITOR.ENTER_BR||q||r||m;
  873. if(e.is("li"))h||p?(h&&p&&a.remove(),c[p?"insertAfter":"insertBefore"](e)):c.breakParent(e);else{if(b)if(l.block.is("li")?(e=f.createElement(d==CKEDITOR.ENTER_P?"p":"div"),q&&e.setAttribute("dir",k),r&&e.setAttribute("style",r),m&&e.setAttribute("class",m),c.moveChildren(e)):e=l.block,h||p)e[h?"insertBefore":"insertAfter"](a);else c.breakParent(a),e.insertAfter(a);else if(c.appendBogus(!0),h||p)for(;f=c[h?"getFirst":"getLast"]();)f[h?"insertBefore":"insertAfter"](a);else for(c.breakParent(a);f=c.getLast();)f.insertAfter(a);
  874. c.remove()}n.selectBookmarks(g);return}if(c&&c.getParent().is("blockquote")){c.breakParent(c.getParent());c.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1))||c.getPrevious().remove();c.getNext().getFirst(CKEDITOR.dom.walker.invisible(1))||c.getNext().remove();a.moveToElementEditStart(c);a.select();return}}else if(c&&c.is("pre")&&!m){t(b,d,a,h);return}if(k=a.splitBlock(n)){d=k.previousBlock;c=k.nextBlock;l=k.wasStartOfBlock;b=k.wasEndOfBlock;c?(g=c.getParent(),g.is("li")&&(c.breakParent(g),
  875. c.move(c.getNext(),1))):d&&(g=d.getParent())&&g.is("li")&&(d.breakParent(g),g=d.getNext(),a.moveToElementEditStart(g),d.move(d.getPrevious()));if(l||b){if(d){if(d.is("li")||!w.test(d.getName())&&!d.is("pre"))e=d.clone()}else c&&(e=c.clone());e?h&&!e.is("li")&&e.renameNode(n):g&&g.is("li")?e=g:(e=f.createElement(n),d&&(p=d.getDirection())&&e.setAttribute("dir",p));if(f=k.elementPath)for(h=0,n=f.elements.length;h<n;h++){g=f.elements[h];if(g.equals(f.block)||g.equals(f.blockLimit))break;CKEDITOR.dtd.$removeEmpty[g.getName()]&&
  876. (g=g.clone(),e.moveChildren(g),e.append(g))}e.appendBogus();e.getParent()||a.insertNode(e);e.is("li")&&e.removeAttribute("value");!CKEDITOR.env.ie||!l||b&&d.getChildCount()||(a.moveToElementEditStart(b?d:e),a.select());a.moveToElementEditStart(l&&!b?c:e)}else c.is("li")&&(e=a.clone(),e.selectNodeContents(c),e=new CKEDITOR.dom.walker(e),e.evaluator=function(a){return!(A(a)||z(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in CKEDITOR.dtd.$inline&&!(a.getName()in CKEDITOR.dtd.$empty))},(g=e.next())&&
  877. g.type==CKEDITOR.NODE_ELEMENT&&g.is("ul","ol")&&(CKEDITOR.env.needsBrFiller?f.createElement("br"):f.createText(" ")).insertBefore(g)),c&&a.moveToElementEditStart(c);a.select();a.scrollIntoView()}}},enterBr:function(b,d,a,h){if(a=a||v(b)){var f=a.document,k=a.checkEndOfBlock(),m=new CKEDITOR.dom.elementPath(b.getSelection().getStartElement()),l=m.block,c=l&&m.block.getName();h||"li"!=c?(!h&&k&&w.test(c)?(k=l.getDirection())?(f=f.createElement("div"),f.setAttribute("dir",k),f.insertAfter(l),a.setStart(f,
  878. 0)):(f.createElement("br").insertAfter(l),CKEDITOR.env.gecko&&f.createText("").insertAfter(l),a.setStartAt(l.getNext(),CKEDITOR.env.ie?CKEDITOR.POSITION_BEFORE_START:CKEDITOR.POSITION_AFTER_START)):(b="pre"==c&&CKEDITOR.env.ie&&8>CKEDITOR.env.version?f.createText("\r"):f.createElement("br"),a.deleteContents(),a.insertNode(b),CKEDITOR.env.needsBrFiller?(f.createText("").insertAfter(b),k&&(l||m.blockLimit).appendBogus(),b.getNext().$.nodeValue="",a.setStartAt(b.getNext(),CKEDITOR.POSITION_AFTER_START)):
  879. a.setStartAt(b,CKEDITOR.POSITION_AFTER_END)),a.collapse(!0),a.select(),a.scrollIntoView()):u(b,d,a,h)}}};var x=CKEDITOR.plugins.enterkey,t=x.enterBr,u=x.enterBlock,w=/^h[1-6]$/})();(function(){function k(b,f){var g={},c=[],e={nbsp:" ",shy:"­",gt:"\x3e",lt:"\x3c",amp:"\x26",apos:"'",quot:'"'};b=b.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(b,a){var d=f?"\x26"+a+";":e[a];g[d]=f?e[a]:"\x26"+a+";";c.push(d);return""});if(!f&&b){b=b.split(",");var a=document.createElement("div"),d;a.innerHTML="\x26"+b.join(";\x26")+";";d=a.innerHTML;a=null;for(a=0;a<d.length;a++){var h=d.charAt(a);g[h]="\x26"+b[a]+";";c.push(h)}}g.regex=c.join(f?"|":"");return g}CKEDITOR.plugins.add("entities",
  880. {afterInit:function(b){function f(a){return h[a]}function g(b){return"force"!=c.entities_processNumerical&&a[b]?a[b]:"\x26#"+b.charCodeAt(0)+";"}var c=b.config;if(b=(b=b.dataProcessor)&&b.htmlFilter){var e=[];!1!==c.basicEntities&&e.push("nbsp,gt,lt,amp");c.entities&&(e.length&&e.push("quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro"),
  881. c.entities_latin&&e.push("Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml"),c.entities_greek&&e.push("Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv"),
  882. c.entities_additional&&e.push(c.entities_additional));var a=k(e.join(",")),d=a.regex?"["+a.regex+"]":"a^";delete a.regex;c.entities&&c.entities_processNumerical&&(d="[^ -~]|"+d);var d=new RegExp(d,"g"),h=k("nbsp,gt,lt,amp,shy",!0),l=new RegExp(h.regex,"g");b.addRules({text:function(a){return a.replace(l,f).replace(d,g)}},{applyToAll:!0,excludeNestedEditable:!0})}}})})();CKEDITOR.config.basicEntities=!0;CKEDITOR.config.entities=!0;CKEDITOR.config.entities_latin=!0;CKEDITOR.config.entities_greek=!0;
  883. CKEDITOR.config.entities_additional="#39";CKEDITOR.plugins.add("popup");
  884. CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{popup:function(e,a,b,d){a=a||"80%";b=b||"70%";"string"==typeof a&&1<a.length&&"%"==a.substr(a.length-1,1)&&(a=parseInt(window.screen.width*parseInt(a,10)/100,10));"string"==typeof b&&1<b.length&&"%"==b.substr(b.length-1,1)&&(b=parseInt(window.screen.height*parseInt(b,10)/100,10));640>a&&(a=640);420>b&&(b=420);var f=parseInt((window.screen.height-b)/2,10),g=parseInt((window.screen.width-a)/2,10);d=(d||"location\x3dno,menubar\x3dno,toolbar\x3dno,dependent\x3dyes,minimizable\x3dno,modal\x3dyes,alwaysRaised\x3dyes,resizable\x3dyes,scrollbars\x3dyes")+",width\x3d"+
  885. a+",height\x3d"+b+",top\x3d"+f+",left\x3d"+g;var c=window.open("",null,d,!0);if(!c)return!1;try{-1==navigator.userAgent.toLowerCase().indexOf(" chrome/")&&(c.moveTo(g,f),c.resizeTo(a,b)),c.focus(),c.location.href=e}catch(h){window.open(e,null,d,!0)}return!0}});(function(){function g(a,c){var d=[];if(c)for(var b in c)d.push(b+"\x3d"+encodeURIComponent(c[b]));else return a;return a+(-1!=a.indexOf("?")?"\x26":"?")+d.join("\x26")}function k(a){a+="";return a.charAt(0).toUpperCase()+a.substr(1)}function m(){var a=this.getDialog(),c=a.getParentEditor();c._.filebrowserSe=this;var d=c.config["filebrowser"+k(a.getName())+"WindowWidth"]||c.config.filebrowserWindowWidth||"80%",a=c.config["filebrowser"+k(a.getName())+"WindowHeight"]||c.config.filebrowserWindowHeight||
  886. "70%",b=this.filebrowser.params||{};b.CKEditor=c.name;b.CKEditorFuncNum=c._.filebrowserFn;b.langCode||(b.langCode=c.langCode);b=g(this.filebrowser.url,b);c.popup(b,d,a,c.config.filebrowserWindowFeatures||c.config.fileBrowserWindowFeatures)}function n(){var a=this.getDialog();a.getParentEditor()._.filebrowserSe=this;return a.getContentElement(this["for"][0],this["for"][1]).getInputElement().$.value&&a.getContentElement(this["for"][0],this["for"][1]).getAction()?!0:!1}function p(a,c,d){var b=d.params||
  887. {};b.CKEditor=a.name;b.CKEditorFuncNum=a._.filebrowserFn;b.langCode||(b.langCode=a.langCode);c.action=g(d.url,b);c.filebrowser=d}function l(a,c,d,b){if(b&&b.length)for(var e,g=b.length;g--;)if(e=b[g],"hbox"!=e.type&&"vbox"!=e.type&&"fieldset"!=e.type||l(a,c,d,e.children),e.filebrowser)if("string"==typeof e.filebrowser&&(e.filebrowser={action:"fileButton"==e.type?"QuickUpload":"Browse",target:e.filebrowser}),"Browse"==e.filebrowser.action){var f=e.filebrowser.url;void 0===f&&(f=a.config["filebrowser"+
  888. k(c)+"BrowseUrl"],void 0===f&&(f=a.config.filebrowserBrowseUrl));f&&(e.onClick=m,e.filebrowser.url=f,e.hidden=!1)}else if("QuickUpload"==e.filebrowser.action&&e["for"]&&(f=e.filebrowser.url,void 0===f&&(f=a.config["filebrowser"+k(c)+"UploadUrl"],void 0===f&&(f=a.config.filebrowserUploadUrl)),f)){var h=e.onClick;e.onClick=function(a){var b=a.sender;if(h&&!1===h.call(b,a))return!1;if(n.call(b,a)){a=b.getDialog().getContentElement(this["for"][0],this["for"][1]).getInputElement();if(b=new CKEDITOR.dom.element(a.$.form))(a=
  889. b.$.elements.ckCsrfToken)?a=new CKEDITOR.dom.element(a):(a=new CKEDITOR.dom.element("input"),a.setAttributes({name:"ckCsrfToken",type:"hidden"}),b.append(a)),a.setAttribute("value",CKEDITOR.tools.getCsrfToken());return!0}return!1};e.filebrowser.url=f;e.hidden=!1;p(a,d.getContents(e["for"][0]).get(e["for"][1]),e.filebrowser)}}function h(a,c,d){if(-1!==d.indexOf(";")){d=d.split(";");for(var b=0;b<d.length;b++)if(h(a,c,d[b]))return!0;return!1}return(a=a.getContents(c).get(d).filebrowser)&&a.url}function q(a,
  890. c){var d=this._.filebrowserSe.getDialog(),b=this._.filebrowserSe["for"],e=this._.filebrowserSe.filebrowser.onSelect;b&&d.getContentElement(b[0],b[1]).reset();if("function"!=typeof c||!1!==c.call(this._.filebrowserSe))if(!e||!1!==e.call(this._.filebrowserSe,a,c))if("string"==typeof c&&c&&alert(c),a&&(b=this._.filebrowserSe,d=b.getDialog(),b=b.filebrowser.target||null))if(b=b.split(":"),e=d.getContentElement(b[0],b[1]))e.setValue(a),d.selectPage(b[0])}CKEDITOR.plugins.add("filebrowser",{requires:"popup",
  891. init:function(a){a._.filebrowserFn=CKEDITOR.tools.addFunction(q,a);a.on("destroy",function(){CKEDITOR.tools.removeFunction(this._.filebrowserFn)})}});CKEDITOR.on("dialogDefinition",function(a){if(a.editor.plugins.filebrowser)for(var c=a.data.definition,d,b=0;b<c.contents.length;++b)if(d=c.contents[b])l(a.editor,a.data.name,c,d.elements),d.hidden&&d.filebrowser&&(d.hidden=!h(c,d.id,d.filebrowser))})})();CKEDITOR.plugins.add("find",{requires:"dialog",init:function(a){var b=a.addCommand("find",new CKEDITOR.dialogCommand("find"));b.canUndo=!1;b.readOnly=1;a.addCommand("replace",new CKEDITOR.dialogCommand("replace")).canUndo=!1;a.ui.addButton&&(a.ui.addButton("Find",{label:a.lang.find.find,command:"find",toolbar:"find,10"}),a.ui.addButton("Replace",{label:a.lang.find.replace,command:"replace",toolbar:"find,20"}));CKEDITOR.dialog.add("find",this.path+"dialogs/find.js");CKEDITOR.dialog.add("replace",this.path+
  892. "dialogs/find.js")}});CKEDITOR.config.find_highlight={element:"span",styles:{"background-color":"#004",color:"#fff"}};(function(){function g(a,b){var c=l.exec(a),d=l.exec(b);if(c){if(!c[2]&&"px"==d[2])return d[1];if("px"==c[2]&&!d[2])return d[1]+"px"}return b}var k=CKEDITOR.htmlParser.cssStyle,h=CKEDITOR.tools.cssLength,l=/^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,m={elements:{$:function(a){var b=a.attributes;if((b=(b=(b=b&&b["data-cke-realelement"])&&new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(b)))&&b.children[0])&&a.attributes["data-cke-resizable"]){var c=(new k(a)).rules;a=b.attributes;var d=c.width,
  893. c=c.height;d&&(a.width=g(a.width,d));c&&(a.height=g(a.height,c))}return b}}};CKEDITOR.plugins.add("fakeobjects",{init:function(a){a.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}","fakeobjects")},afterInit:function(a){(a=(a=a.dataProcessor)&&a.htmlFilter)&&a.addRules(m,{applyToAll:!0})}});CKEDITOR.editor.prototype.createFakeElement=function(a,b,c,d){var e=this.lang.fakeobjects,e=e[c]||e.unknown;b={"class":b,"data-cke-realelement":encodeURIComponent(a.getOuterHtml()),"data-cke-real-node-type":a.type,
  894. alt:e,title:e,align:a.getAttribute("align")||""};CKEDITOR.env.hc||(b.src=CKEDITOR.tools.transparentImageData);c&&(b["data-cke-real-element-type"]=c);d&&(b["data-cke-resizable"]=d,c=new k,d=a.getAttribute("width"),a=a.getAttribute("height"),d&&(c.rules.width=h(d)),a&&(c.rules.height=h(a)),c.populate(b));return this.document.createElement("img",{attributes:b})};CKEDITOR.editor.prototype.createFakeParserElement=function(a,b,c,d){var e=this.lang.fakeobjects,e=e[c]||e.unknown,f;f=new CKEDITOR.htmlParser.basicWriter;
  895. a.writeHtml(f);f=f.getHtml();b={"class":b,"data-cke-realelement":encodeURIComponent(f),"data-cke-real-node-type":a.type,alt:e,title:e,align:a.attributes.align||""};CKEDITOR.env.hc||(b.src=CKEDITOR.tools.transparentImageData);c&&(b["data-cke-real-element-type"]=c);d&&(b["data-cke-resizable"]=d,d=a.attributes,a=new k,c=d.width,d=d.height,void 0!==c&&(a.rules.width=h(c)),void 0!==d&&(a.rules.height=h(d)),a.populate(b));return new CKEDITOR.htmlParser.element("img",b)};CKEDITOR.editor.prototype.restoreRealElement=
  896. function(a){if(a.data("cke-real-node-type")!=CKEDITOR.NODE_ELEMENT)return null;var b=CKEDITOR.dom.element.createFromHtml(decodeURIComponent(a.data("cke-realelement")),this.document);if(a.data("cke-resizable")){var c=a.getStyle("width");a=a.getStyle("height");c&&b.setAttribute("width",g(b.getAttribute("width"),c));a&&b.setAttribute("height",g(b.getAttribute("height"),a))}return b}})();(function(){function d(a){a=a.attributes;return"application/x-shockwave-flash"==a.type||f.test(a.src||"")}function e(a,b){return a.createFakeParserElement(b,"cke_flash","flash",!0)}var f=/\.swf(?:$|\?)/i;CKEDITOR.plugins.add("flash",{requires:"dialog,fakeobjects",onLoad:function(){CKEDITOR.addCss("img.cke_flash{background-image: url("+CKEDITOR.getUrl(this.path+"images/placeholder.png")+");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;}")},
  897. init:function(a){var b="object[classid,codebase,height,hspace,vspace,width];param[name,value];embed[height,hspace,pluginspage,src,type,vspace,width]";CKEDITOR.dialog.isTabEnabled(a,"flash","properties")&&(b+=";object[align]; embed[allowscriptaccess,quality,scale,wmode]");CKEDITOR.dialog.isTabEnabled(a,"flash","advanced")&&(b+=";object[id]{*}; embed[bgcolor]{*}(*)");a.addCommand("flash",new CKEDITOR.dialogCommand("flash",{allowedContent:b,requiredContent:"embed"}));a.ui.addButton&&a.ui.addButton("Flash",
  898. {label:a.lang.common.flash,command:"flash",toolbar:"insert,20"});CKEDITOR.dialog.add("flash",this.path+"dialogs/flash.js");a.addMenuItems&&a.addMenuItems({flash:{label:a.lang.flash.properties,command:"flash",group:"flash"}});a.on("doubleclick",function(a){var b=a.data.element;b.is("img")&&"flash"==b.data("cke-real-element-type")&&(a.data.dialog="flash")});a.contextMenu&&a.contextMenu.addListener(function(a){if(a&&a.is("img")&&!a.isReadOnly()&&"flash"==a.data("cke-real-element-type"))return{flash:CKEDITOR.TRISTATE_OFF}})},
  899. afterInit:function(a){var b=a.dataProcessor;(b=b&&b.dataFilter)&&b.addRules({elements:{"cke:object":function(b){var c=b.attributes;if(!(c.classid&&String(c.classid).toLowerCase()||d(b))){for(c=0;c<b.children.length;c++)if("cke:embed"==b.children[c].name){if(!d(b.children[c]))break;return e(a,b)}return null}return e(a,b)},"cke:embed":function(b){return d(b)?e(a,b):null}}},5)}})})();CKEDITOR.tools.extend(CKEDITOR.config,{flashEmbedTagOnly:!1,flashAddEmbedTag:!0,flashConvertOnEdit:!1});(function(){function k(a){var l=a.config,p=a.fire("uiSpace",{space:"top",html:""}).html,t=function(){function f(a,c,e){b.setStyle(c,w(e));b.setStyle("position",a)}function e(a){var b=k.getDocumentPosition();switch(a){case "top":f("absolute","top",b.y-q-r);break;case "pin":f("fixed","top",x);break;case "bottom":f("absolute","top",b.y+(c.height||c.bottom-c.top)+r)}m=a}var m,k,n,c,h,q,v,p=l.floatSpaceDockedOffsetX||0,r=l.floatSpaceDockedOffsetY||0,u=l.floatSpacePinnedOffsetX||0,x=l.floatSpacePinnedOffsetY||
  900. 0;return function(d){if(k=a.editable()){var f=d&&"focus"==d.name;f&&b.show();a.fire("floatingSpaceLayout",{show:f});b.removeStyle("left");b.removeStyle("right");n=b.getClientRect();c=k.getClientRect();h=g.getViewPaneSize();q=n.height;v="pageXOffset"in g.$?g.$.pageXOffset:CKEDITOR.document.$.documentElement.scrollLeft;m?(q+r<=c.top?e("top"):q+r>h.height-c.bottom?e("pin"):e("bottom"),d=h.width/2,d=l.floatSpacePreferRight?"right":0<c.left&&c.right<h.width&&c.width>n.width?"rtl"==l.contentsLangDirection?
  901. "right":"left":d-c.left>c.right-d?"left":"right",n.width>h.width?(d="left",f=0):(f="left"==d?0<c.left?c.left:0:c.right<h.width?h.width-c.right:0,f+n.width>h.width&&(d="left"==d?"right":"left",f=0)),b.setStyle(d,w(("pin"==m?u:p)+f+("pin"==m?0:"left"==d?v:-v)))):(m="pin",e("pin"),t(d))}}}();if(p){var k=new CKEDITOR.template('\x3cdiv id\x3d"cke_{name}" class\x3d"cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+CKEDITOR.env.cssClass+'" dir\x3d"{langDir}" title\x3d"'+(CKEDITOR.env.gecko?
  902. " ":"")+'" lang\x3d"{langCode}" role\x3d"application" style\x3d"{style}"'+(a.title?' aria-labelledby\x3d"cke_{name}_arialbl"':" ")+"\x3e"+(a.title?'\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e':" ")+'\x3cdiv class\x3d"cke_inner"\x3e\x3cdiv id\x3d"{topId}" class\x3d"cke_top" role\x3d"presentation"\x3e{content}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'),b=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(k.output({content:p,id:a.id,langDir:a.lang.dir,
  903. langCode:a.langCode,name:a.name,style:"display:none;z-index:"+(l.baseFloatZIndex-1),topId:a.ui.spaceId("top"),voiceLabel:a.title}))),u=CKEDITOR.tools.eventsBuffer(500,t),e=CKEDITOR.tools.eventsBuffer(100,t);b.unselectable();b.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});a.on("focus",function(b){t(b);a.on("change",u.input);g.on("scroll",e.input);g.on("resize",e.input)});a.on("blur",function(){b.hide();a.removeListener("change",u.input);g.removeListener("scroll",
  904. e.input);g.removeListener("resize",e.input)});a.on("destroy",function(){g.removeListener("scroll",e.input);g.removeListener("resize",e.input);b.clearCustomData();b.remove()});a.focusManager.hasFocus&&b.show();a.focusManager.add(b,1)}}var g=CKEDITOR.document.getWindow(),w=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(a){a.on("loaded",function(){k(this)},null,null,20)}})})();CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var f=CKEDITOR.addTemplate("panel-list",'\x3cul role\x3d"presentation" class\x3d"cke_panel_list"\x3e{items}\x3c/ul\x3e'),g=CKEDITOR.addTemplate("panel-list-item",'\x3cli id\x3d"{id}" class\x3d"cke_panel_listItem" role\x3dpresentation\x3e\x3ca id\x3d"{id}_option" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"{title}" href\x3d"javascript:void(\'{val}\')" {onclick}\x3d"CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role\x3d"option"\x3e{text}\x3c/a\x3e\x3c/li\x3e'),
  905. h=CKEDITOR.addTemplate("panel-list-group",'\x3ch1 id\x3d"{id}" class\x3d"cke_panel_grouptitle" role\x3d"presentation" \x3e{label}\x3c/h1\x3e'),k=/\'/g;CKEDITOR.ui.panel.prototype.addListBlock=function(a,b){return this.addBlock(a,new CKEDITOR.ui.listBlock(this.getHolderElement(),b))};CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(a,b){b=b||{};var c=b.attributes||(b.attributes={});(this.multiSelect=!!b.multiSelect)&&(c["aria-multiselectable"]=!0);!c.role&&
  906. (c.role="listbox");this.base.apply(this,arguments);this.element.setAttribute("role",c.role);c=this.keys;c[40]="next";c[9]="next";c[38]="prev";c[CKEDITOR.SHIFT+9]="prev";c[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(c[13]="mouseup");this._.pendingHtml=[];this._.pendingList=[];this._.items={};this._.groups={}},_:{close:function(){if(this._.started){var a=f.output({items:this._.pendingList.join("")});this._.pendingList=[];this._.pendingHtml.push(a);delete this._.started}},getClick:function(){this._.click||
  907. (this._.click=CKEDITOR.tools.addFunction(function(a){var b=this.toggle(a);if(this.onClick)this.onClick(a,b)},this));return this._.click}},proto:{add:function(a,b,c){var d=CKEDITOR.tools.getNextId();this._.started||(this._.started=1,this._.size=this._.size||0);this._.items[a]=d;var e;e=CKEDITOR.tools.htmlEncodeAttr(a).replace(k,"\\'");a={id:d,val:e,onclick:CKEDITOR.env.ie?'onclick\x3d"return false;" onmouseup':"onclick",clickFn:this._.getClick(),title:CKEDITOR.tools.htmlEncodeAttr(c||a),text:b||a};
  908. this._.pendingList.push(g.output(a))},startGroup:function(a){this._.close();var b=CKEDITOR.tools.getNextId();this._.groups[a]=b;this._.pendingHtml.push(h.output({id:b,label:a}))},commit:function(){this._.close();this.element.appendHtml(this._.pendingHtml.join(""));delete this._.size;this._.pendingHtml=[]},toggle:function(a){var b=this.isMarked(a);b?this.unmark(a):this.mark(a);return!b},hideGroup:function(a){var b=(a=this.element.getDocument().getById(this._.groups[a]))&&a.getNext();a&&(a.setStyle("display",
  909. "none"),b&&"ul"==b.getName()&&b.setStyle("display","none"))},hideItem:function(a){this.element.getDocument().getById(this._.items[a]).setStyle("display","none")},showAll:function(){var a=this._.items,b=this._.groups,c=this.element.getDocument(),d;for(d in a)c.getById(a[d]).setStyle("display","");for(var e in b)a=c.getById(b[e]),d=a.getNext(),a.setStyle("display",""),d&&"ul"==d.getName()&&d.setStyle("display","")},mark:function(a){this.multiSelect||this.unmarkAll();a=this._.items[a];var b=this.element.getDocument().getById(a);
  910. b.addClass("cke_selected");this.element.getDocument().getById(a+"_option").setAttribute("aria-selected",!0);this.onMark&&this.onMark(b)},unmark:function(a){var b=this.element.getDocument();a=this._.items[a];var c=b.getById(a);c.removeClass("cke_selected");b.getById(a+"_option").removeAttribute("aria-selected");this.onUnmark&&this.onUnmark(c)},unmarkAll:function(){var a=this._.items,b=this.element.getDocument(),c;for(c in a){var d=a[c];b.getById(d).removeClass("cke_selected");b.getById(d+"_option").removeAttribute("aria-selected")}this.onUnmark&&
  911. this.onUnmark()},isMarked:function(a){return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")},focus:function(a){this._.focusIndex=-1;var b=this.element.getElementsByTag("a"),c,d=-1;if(a)for(c=this.element.getDocument().getById(this._.items[a]).getFirst();a=b.getItem(++d);){if(a.equals(c)){this._.focusIndex=d;break}}else this.element.focus();c&&setTimeout(function(){c.focus()},0)}}})}});CKEDITOR.plugins.add("richcombo",{requires:"floatpanel,listblock,button",beforeInit:function(d){d.ui.addHandler(CKEDITOR.UI_RICHCOMBO,CKEDITOR.ui.richCombo.handler)}});
  912. (function(){var d='\x3cspan id\x3d"{id}" class\x3d"cke_combo cke_combo__{name} {cls}" role\x3d"presentation"\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_combo_label"\x3e{label}\x3c/span\x3e\x3ca class\x3d"cke_combo_button" title\x3d"{title}" tabindex\x3d"-1"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-haspopup\x3d"true"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(d+=' onkeypress\x3d"return false;"');
  913. CKEDITOR.env.gecko&&(d+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');var d=d+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" '+(CKEDITOR.env.ie?'onclick\x3d"return false;" onmouseup':"onclick")+'\x3d"CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan id\x3d"{id}_text" class\x3d"cke_combo_text cke_combo_inlinelabel"\x3e{label}\x3c/span\x3e\x3cspan class\x3d"cke_combo_open"\x3e\x3cspan class\x3d"cke_combo_arrow"\x3e'+
  914. (CKEDITOR.env.hc?"\x26#9660;":CKEDITOR.env.air?"\x26nbsp;":"")+"\x3c/span\x3e\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e"),k=CKEDITOR.addTemplate("combo",d);CKEDITOR.UI_RICHCOMBO="richcombo";CKEDITOR.ui.richCombo=CKEDITOR.tools.createClass({$:function(a){CKEDITOR.tools.extend(this,a,{canGroup:!1,title:a.label,modes:{wysiwyg:1},editorFocus:1});a=this.panel||{};delete this.panel;this.id=CKEDITOR.tools.getNextNumber();this.document=a.parent&&a.parent.getDocument()||CKEDITOR.document;a.className="cke_combopanel";
  915. a.block={multiSelect:a.multiSelect,attributes:a.attributes};a.toolbarRelated=!0;this._={panelDefinition:a,items:{}}},proto:{renderHtml:function(a){var b=[];this.render(a,b);return b.join("")},render:function(a,b){function g(){if(this.getState()!=CKEDITOR.TRISTATE_ON){var c=this.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;a.readOnly&&!this.readOnly&&(c=CKEDITOR.TRISTATE_DISABLED);this.setState(c);this.setValue("");c!=CKEDITOR.TRISTATE_DISABLED&&this.refresh&&this.refresh()}}var d=
  916. CKEDITOR.env,h="cke_"+this.id,e=CKEDITOR.tools.addFunction(function(b){l&&(a.unlockSelection(1),l=0);c.execute(b)},this),f=this,c={id:h,combo:this,focus:function(){CKEDITOR.document.getById(h).getChild(1).focus()},execute:function(c){var b=f._;if(b.state!=CKEDITOR.TRISTATE_DISABLED)if(f.createPanel(a),b.on)b.panel.hide();else{f.commit();var d=f.getValue();d?b.list.mark(d):b.list.unmarkAll();b.panel.showBlock(f.id,new CKEDITOR.dom.element(c),4)}},clickFn:e};a.on("activeFilterChange",g,this);a.on("mode",
  917. g,this);a.on("selectionChange",g,this);!this.readOnly&&a.on("readOnly",g,this);var m=CKEDITOR.tools.addFunction(function(b,d){b=new CKEDITOR.dom.event(b);var g=b.getKeystroke();if(40==g)a.once("panelShow",function(a){a.data._.panel._.currentBlock.onKeyDown(40)});switch(g){case 13:case 32:case 40:CKEDITOR.tools.callFunction(e,d);break;default:c.onkey(c,g)}b.preventDefault()}),n=CKEDITOR.tools.addFunction(function(){c.onfocus&&c.onfocus()}),l=0;c.keyDownFn=m;d={id:h,name:this.name||this.command,label:this.label,
  918. title:this.title,cls:this.className||"",titleJs:d.gecko&&!d.hc?"":(this.title||"").replace("'",""),keydownFn:m,focusFn:n,clickFn:e};k.output(d,b);if(this.onRender)this.onRender();return c},createPanel:function(a){if(!this._.panel){var b=this._.panelDefinition,d=this._.panelDefinition.block,k=b.parent||CKEDITOR.document.getBody(),h="cke_combopanel__"+this.name,e=new CKEDITOR.ui.floatPanel(a,k,b),f=e.addListBlock(this.id,d),c=this;e.onShow=function(){this.element.addClass(h);c.setState(CKEDITOR.TRISTATE_ON);
  919. c._.on=1;c.editorFocus&&!a.focusManager.hasFocus&&a.focus();if(c.onOpen)c.onOpen();a.once("panelShow",function(){f.focus(!f.multiSelect&&c.getValue())})};e.onHide=function(b){this.element.removeClass(h);c.setState(c.modes&&c.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);c._.on=0;if(!b&&c.onClose)c.onClose()};e.onEscape=function(){e.hide(1)};f.onClick=function(a,b){c.onClick&&c.onClick.call(c,a,b);e.hide()};this._.panel=e;this._.list=f;e.getBlock(this.id).onHide=function(){c._.on=
  920. 0;c.setState(CKEDITOR.TRISTATE_OFF)};this.init&&this.init()}},setValue:function(a,b){this._.value=a;var d=this.document.getById("cke_"+this.id+"_text");d&&(a||b?d.removeClass("cke_combo_inlinelabel"):(b=this.label,d.addClass("cke_combo_inlinelabel")),d.setText("undefined"!=typeof b?b:a))},getValue:function(){return this._.value||""},unmarkAll:function(){this._.list.unmarkAll()},mark:function(a){this._.list.mark(a)},hideItem:function(a){this._.list.hideItem(a)},hideGroup:function(a){this._.list.hideGroup(a)},
  921. showAll:function(){this._.list.showAll()},add:function(a,b,d){this._.items[a]=d||a;this._.list.add(a,b,d)},startGroup:function(a){this._.list.startGroup(a)},commit:function(){this._.committed||(this._.list.commit(),this._.committed=1,CKEDITOR.ui.fire("ready",this));this._.committed=1},setState:function(a){if(this._.state!=a){var b=this.document.getById("cke_"+this.id);b.setState(a,"cke_combo");a==CKEDITOR.TRISTATE_DISABLED?b.setAttribute("aria-disabled",!0):b.removeAttribute("aria-disabled");this._.state=
  922. a}},getState:function(){return this._.state},enable:function(){this._.state==CKEDITOR.TRISTATE_DISABLED&&this.setState(this._.lastState)},disable:function(){this._.state!=CKEDITOR.TRISTATE_DISABLED&&(this._.lastState=this._.state,this.setState(CKEDITOR.TRISTATE_DISABLED))}},statics:{handler:{create:function(a){return new CKEDITOR.ui.richCombo(a)}}}});CKEDITOR.ui.prototype.addRichCombo=function(a,b){this.add(a,CKEDITOR.UI_RICHCOMBO,b)}})();(function(){function l(a,b,c,f,p,l,t,v){var w=a.config,q=new CKEDITOR.style(t),k=p.split(";");p=[];for(var m={},d=0;d<k.length;d++){var h=k[d];if(h){var h=h.split("/"),u={},n=k[d]=h[0];u[c]=p[d]=h[1]||n;m[n]=new CKEDITOR.style(t,u);m[n]._.definition.name=n}else k.splice(d--,1)}a.ui.addRichCombo(b,{label:f.label,title:f.panelTitle,toolbar:"styles,"+v,allowedContent:q,requiredContent:q,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(w.contentsCss),multiSelect:!1,attributes:{"aria-label":f.panelTitle}},
  923. init:function(){this.startGroup(f.panelTitle);for(var a=0;a<k.length;a++){var b=k[a];this.add(b,m[b].buildPreview(),b)}},onClick:function(b){a.focus();a.fire("saveSnapshot");var c=this.getValue(),f=m[b];if(c&&b!=c){var k=m[c],e=a.getSelection().getRanges()[0];if(e.collapsed){var d=a.elementPath(),g=d.contains(function(a){return k.checkElementRemovable(a)});if(g){var h=e.checkBoundaryOfElement(g,CKEDITOR.START),l=e.checkBoundaryOfElement(g,CKEDITOR.END);if(h&&l){for(h=e.createBookmark();d=g.getFirst();)d.insertBefore(g);
  924. g.remove();e.moveToBookmark(h)}else h?e.moveToPosition(g,CKEDITOR.POSITION_BEFORE_START):l?e.moveToPosition(g,CKEDITOR.POSITION_AFTER_END):(e.splitElement(g),e.moveToPosition(g,CKEDITOR.POSITION_AFTER_END),r(e,d.elements.slice(),g));a.getSelection().selectRanges([e])}}else a.removeStyle(k)}a[c==b?"removeStyle":"applyStyle"](f);a.fire("saveSnapshot")},onRender:function(){a.on("selectionChange",function(b){var c=this.getValue();b=b.data.path.elements;for(var d=0,f;d<b.length;d++){f=b[d];for(var e in m)if(m[e].checkElementMatch(f,
  925. !0,a)){e!=c&&this.setValue(e);return}}this.setValue("",l)},this)},refresh:function(){a.activeFilter.check(q)||this.setState(CKEDITOR.TRISTATE_DISABLED)}})}function r(a,b,c){var f=b.pop();if(f){if(c)return r(a,b,f.equals(c)?null:c);c=f.clone();a.insertNode(c);a.moveToPosition(c,CKEDITOR.POSITION_AFTER_START);r(a,b)}}CKEDITOR.plugins.add("font",{requires:"richcombo",init:function(a){var b=a.config;l(a,"Font","family",a.lang.font,b.font_names,b.font_defaultLabel,b.font_style,30);l(a,"FontSize","size",
  926. a.lang.font.fontSize,b.fontSize_sizes,b.fontSize_defaultLabel,b.fontSize_style,40)}})})();CKEDITOR.config.font_names="Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif";
  927. CKEDITOR.config.font_defaultLabel="";CKEDITOR.config.font_style={element:"span",styles:{"font-family":"#(family)"},overrides:[{element:"font",attributes:{face:null}}]};CKEDITOR.config.fontSize_sizes="8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px";CKEDITOR.config.fontSize_defaultLabel="";CKEDITOR.config.fontSize_style={element:"span",styles:{"font-size":"#(size)"},overrides:[{element:"font",attributes:{size:null}}]};CKEDITOR.plugins.add("forms",{requires:"dialog,fakeobjects",onLoad:function(){CKEDITOR.addCss(".cke_editable form{border: 1px dotted #FF0000;padding: 2px;}\n");CKEDITOR.addCss("img.cke_hidden{background-image: url("+CKEDITOR.getUrl(this.path+"images/hiddenfield.gif")+");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 16px !important;height: 16px !important;}")},init:function(a){var b=a.lang,g=0,h={email:1,password:1,search:1,tel:1,text:1,url:1},l={checkbox:"input[type,name,checked,required]",
  928. radio:"input[type,name,checked,required]",textfield:"input[type,name,value,size,maxlength,required]",textarea:"textarea[cols,rows,name,required]",select:"select[name,size,multiple,required]; option[value,selected]",button:"input[type,name,value]",form:"form[action,name,id,enctype,target,method]",hiddenfield:"input[type,name,value]",imagebutton:"input[type,alt,src]{width,height,border,border-width,border-style,margin,float}"},m={checkbox:"input",radio:"input",textfield:"input",textarea:"textarea",
  929. select:"select",button:"input",form:"form",hiddenfield:"input",imagebutton:"input"},e=function(d,c,e){var h={allowedContent:l[c],requiredContent:m[c]};"form"==c&&(h.context="form");a.addCommand(c,new CKEDITOR.dialogCommand(c,h));a.ui.addButton&&a.ui.addButton(d,{label:b.common[d.charAt(0).toLowerCase()+d.slice(1)],command:c,toolbar:"forms,"+(g+=10)});CKEDITOR.dialog.add(c,e)},f=this.path+"dialogs/";!a.blockless&&e("Form","form",f+"form.js");e("Checkbox","checkbox",f+"checkbox.js");e("Radio","radio",
  930. f+"radio.js");e("TextField","textfield",f+"textfield.js");e("Textarea","textarea",f+"textarea.js");e("Select","select",f+"select.js");e("Button","button",f+"button.js");var k=a.plugins.image;k&&!a.plugins.image2&&e("ImageButton","imagebutton",CKEDITOR.plugins.getPath("image")+"dialogs/image.js");e("HiddenField","hiddenfield",f+"hiddenfield.js");a.addMenuItems&&(e={checkbox:{label:b.forms.checkboxAndRadio.checkboxTitle,command:"checkbox",group:"checkbox"},radio:{label:b.forms.checkboxAndRadio.radioTitle,
  931. command:"radio",group:"radio"},textfield:{label:b.forms.textfield.title,command:"textfield",group:"textfield"},hiddenfield:{label:b.forms.hidden.title,command:"hiddenfield",group:"hiddenfield"},button:{label:b.forms.button.title,command:"button",group:"button"},select:{label:b.forms.select.title,command:"select",group:"select"},textarea:{label:b.forms.textarea.title,command:"textarea",group:"textarea"}},k&&(e.imagebutton={label:b.image.titleButton,command:"imagebutton",group:"imagebutton"}),!a.blockless&&
  932. (e.form={label:b.forms.form.menu,command:"form",group:"form"}),a.addMenuItems(e));a.contextMenu&&(!a.blockless&&a.contextMenu.addListener(function(d,c,a){if((d=a.contains("form",1))&&!d.isReadOnly())return{form:CKEDITOR.TRISTATE_OFF}}),a.contextMenu.addListener(function(d){if(d&&!d.isReadOnly()){var c=d.getName();if("select"==c)return{select:CKEDITOR.TRISTATE_OFF};if("textarea"==c)return{textarea:CKEDITOR.TRISTATE_OFF};if("input"==c){var a=d.getAttribute("type")||"text";switch(a){case "button":case "submit":case "reset":return{button:CKEDITOR.TRISTATE_OFF};
  933. case "checkbox":return{checkbox:CKEDITOR.TRISTATE_OFF};case "radio":return{radio:CKEDITOR.TRISTATE_OFF};case "image":return k?{imagebutton:CKEDITOR.TRISTATE_OFF}:null}if(h[a])return{textfield:CKEDITOR.TRISTATE_OFF}}if("img"==c&&"hiddenfield"==d.data("cke-real-element-type"))return{hiddenfield:CKEDITOR.TRISTATE_OFF}}}));a.on("doubleclick",function(d){var c=d.data.element;if(!a.blockless&&c.is("form"))d.data.dialog="form";else if(c.is("select"))d.data.dialog="select";else if(c.is("textarea"))d.data.dialog=
  934. "textarea";else if(c.is("img")&&"hiddenfield"==c.data("cke-real-element-type"))d.data.dialog="hiddenfield";else if(c.is("input")){c=c.getAttribute("type")||"text";switch(c){case "button":case "submit":case "reset":d.data.dialog="button";break;case "checkbox":d.data.dialog="checkbox";break;case "radio":d.data.dialog="radio";break;case "image":d.data.dialog="imagebutton"}h[c]&&(d.data.dialog="textfield")}})},afterInit:function(a){var b=a.dataProcessor,g=b&&b.htmlFilter,b=b&&b.dataFilter;CKEDITOR.env.ie&&
  935. g&&g.addRules({elements:{input:function(a){a=a.attributes;var b=a.type;b||(a.type="text");"checkbox"!=b&&"radio"!=b||"on"!=a.value||delete a.value}}},{applyToAll:!0});b&&b.addRules({elements:{input:function(b){if("hidden"==b.attributes.type)return a.createFakeParserElement(b,"cke_hidden","hiddenfield")}}},{applyToAll:!0})}});CKEDITOR.plugins.add("format",{requires:"richcombo",init:function(a){if(!a.blockless){for(var f=a.config,c=a.lang.format,l=f.format_tags.split(";"),d={},m=0,n=[],g=0;g<l.length;g++){var h=l[g],k=new CKEDITOR.style(f["format_"+h]);if(!a.filter.customConfig||a.filter.check(k))m++,d[h]=k,d[h]._.enterMode=a.config.enterMode,n.push(k)}0!==m&&a.ui.addRichCombo("Format",{label:c.label,title:c.panelTitle,toolbar:"styles,20",allowedContent:n,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(f.contentsCss),
  936. multiSelect:!1,attributes:{"aria-label":c.panelTitle}},init:function(){this.startGroup(c.panelTitle);for(var a in d){var e=c["tag_"+a];this.add(a,d[a].buildPreview(e),e)}},onClick:function(b){a.focus();a.fire("saveSnapshot");b=d[b];var e=a.elementPath();a[b.checkActive(e,a)?"removeStyle":"applyStyle"](b);setTimeout(function(){a.fire("saveSnapshot")},0)},onRender:function(){a.on("selectionChange",function(b){var e=this.getValue();b=b.data.path;this.refresh();for(var c in d)if(d[c].checkActive(b,a)){c!=
  937. e&&this.setValue(c,a.lang.format["tag_"+c]);return}this.setValue("")},this)},onOpen:function(){this.showAll();for(var b in d)a.activeFilter.check(d[b])||this.hideItem(b)},refresh:function(){var b=a.elementPath();if(b){if(b.isContextFor("p"))for(var c in d)if(a.activeFilter.check(d[c]))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}}})}}});CKEDITOR.config.format_tags="p;h1;h2;h3;h4;h5;h6;pre;address;div";CKEDITOR.config.format_p={element:"p"};CKEDITOR.config.format_div={element:"div"};
  938. CKEDITOR.config.format_pre={element:"pre"};CKEDITOR.config.format_address={element:"address"};CKEDITOR.config.format_h1={element:"h1"};CKEDITOR.config.format_h2={element:"h2"};CKEDITOR.config.format_h3={element:"h3"};CKEDITOR.config.format_h4={element:"h4"};CKEDITOR.config.format_h5={element:"h5"};CKEDITOR.config.format_h6={element:"h6"};(function(){var b={canUndo:!1,exec:function(a){var b=a.document.createElement("hr");a.insertElement(b)},allowedContent:"hr",requiredContent:"hr"};CKEDITOR.plugins.add("horizontalrule",{init:function(a){a.blockless||(a.addCommand("horizontalrule",b),a.ui.addButton&&a.ui.addButton("HorizontalRule",{label:a.lang.horizontalrule.toolbar,command:"horizontalrule",toolbar:"insert,40"}))}})})();CKEDITOR.plugins.add("htmlwriter",{init:function(b){var a=new CKEDITOR.htmlWriter;a.forceSimpleAmpersand=b.config.forceSimpleAmpersand;a.indentationChars=b.config.dataIndentationChars||"\t";b.dataProcessor.writer=a}});
  939. CKEDITOR.htmlWriter=CKEDITOR.tools.createClass({base:CKEDITOR.htmlParser.basicWriter,$:function(){this.base();this.indentationChars="\t";this.selfClosingEnd=" /\x3e";this.lineBreakChars="\n";this.sortAttributes=1;this._.indent=0;this._.indentation="";this._.inPre=0;this._.rules={};var b=CKEDITOR.dtd,a;for(a in CKEDITOR.tools.extend({},b.$nonBodyContent,b.$block,b.$listItem,b.$tableContent))this.setRules(a,{indent:!b[a]["#"],breakBeforeOpen:1,breakBeforeClose:!b[a]["#"],breakAfterClose:1,needsSpace:a in
  940. b.$block&&!(a in{li:1,dt:1,dd:1})});this.setRules("br",{breakAfterOpen:1});this.setRules("title",{indent:0,breakAfterOpen:0});this.setRules("style",{indent:0,breakBeforeClose:1});this.setRules("pre",{breakAfterOpen:1,indent:0})},proto:{openTag:function(b){var a=this._.rules[b];this._.afterCloser&&a&&a.needsSpace&&this._.needsSpace&&this._.output.push("\n");this._.indent?this.indentation():a&&a.breakBeforeOpen&&(this.lineBreak(),this.indentation());this._.output.push("\x3c",b);this._.afterCloser=0},
  941. openTagClose:function(b,a){var c=this._.rules[b];a?(this._.output.push(this.selfClosingEnd),c&&c.breakAfterClose&&(this._.needsSpace=c.needsSpace)):(this._.output.push("\x3e"),c&&c.indent&&(this._.indentation+=this.indentationChars));c&&c.breakAfterOpen&&this.lineBreak();"pre"==b&&(this._.inPre=1)},attribute:function(b,a){"string"==typeof a&&(this.forceSimpleAmpersand&&(a=a.replace(/&amp;/g,"\x26")),a=CKEDITOR.tools.htmlEncodeAttr(a));this._.output.push(" ",b,'\x3d"',a,'"')},closeTag:function(b){var a=
  942. this._.rules[b];a&&a.indent&&(this._.indentation=this._.indentation.substr(this.indentationChars.length));this._.indent?this.indentation():a&&a.breakBeforeClose&&(this.lineBreak(),this.indentation());this._.output.push("\x3c/",b,"\x3e");"pre"==b&&(this._.inPre=0);a&&a.breakAfterClose&&(this.lineBreak(),this._.needsSpace=a.needsSpace);this._.afterCloser=1},text:function(b){this._.indent&&(this.indentation(),!this._.inPre&&(b=CKEDITOR.tools.ltrim(b)));this._.output.push(b)},comment:function(b){this._.indent&&
  943. this.indentation();this._.output.push("\x3c!--",b,"--\x3e")},lineBreak:function(){!this._.inPre&&0<this._.output.length&&this._.output.push(this.lineBreakChars);this._.indent=1},indentation:function(){!this._.inPre&&this._.indentation&&this._.output.push(this._.indentation);this._.indent=0},reset:function(){this._.output=[];this._.indent=0;this._.indentation="";this._.afterCloser=0;this._.inPre=0;this._.needsSpace=0},setRules:function(b,a){var c=this._.rules[b];c?CKEDITOR.tools.extend(c,a,!0):this._.rules[b]=
  944. a}}});(function(){CKEDITOR.plugins.add("iframe",{requires:"dialog,fakeobjects",onLoad:function(){CKEDITOR.addCss("img.cke_iframe{background-image: url("+CKEDITOR.getUrl(this.path+"images/placeholder.png")+");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;}")},init:function(a){var b=a.lang.iframe,c="iframe[align,longdesc,frameborder,height,name,scrolling,src,title,width]";a.plugins.dialogadvtab&&(c+=";iframe"+a.plugins.dialogadvtab.allowedContent({id:1,
  945. classes:1,styles:1}));CKEDITOR.dialog.add("iframe",this.path+"dialogs/iframe.js");a.addCommand("iframe",new CKEDITOR.dialogCommand("iframe",{allowedContent:c,requiredContent:"iframe"}));a.ui.addButton&&a.ui.addButton("Iframe",{label:b.toolbar,command:"iframe",toolbar:"insert,80"});a.on("doubleclick",function(a){var b=a.data.element;b.is("img")&&"iframe"==b.data("cke-real-element-type")&&(a.data.dialog="iframe")});a.addMenuItems&&a.addMenuItems({iframe:{label:b.title,command:"iframe",group:"image"}});
  946. a.contextMenu&&a.contextMenu.addListener(function(a){if(a&&a.is("img")&&"iframe"==a.data("cke-real-element-type"))return{iframe:CKEDITOR.TRISTATE_OFF}})},afterInit:function(a){var b=a.dataProcessor;(b=b&&b.dataFilter)&&b.addRules({elements:{iframe:function(b){return a.createFakeParserElement(b,"cke_iframe","iframe",!0)}}})}})})();(function(){function m(a){function f(a){var b=!1;g.attachListener(g,"keydown",function(){var d=c.getBody().getElementsByTag(a);if(!b){for(var e=0;e<d.count();e++)d.getItem(e).setCustomData("retain",!0);b=!0}},null,null,1);g.attachListener(g,"keyup",function(){var d=c.getElementsByTag(a);b&&(1!=d.count()||d.getItem(0).getCustomData("retain")||d.getItem(0).remove(1),b=!1)})}var b=this.editor,c=a.document,d=c.body,e=c.getElementById("cke_actscrpt");e&&e.parentNode.removeChild(e);(e=c.getElementById("cke_shimscrpt"))&&
  947. e.parentNode.removeChild(e);(e=c.getElementById("cke_basetagscrpt"))&&e.parentNode.removeChild(e);d.contentEditable=!0;CKEDITOR.env.ie&&(d.hideFocus=!0,d.disabled=!0,d.removeAttribute("disabled"));delete this._.isLoadingData;this.$=d;c=new CKEDITOR.dom.document(c);this.setup();this.fixInitialSelection();var g=this;CKEDITOR.env.ie&&!CKEDITOR.env.edge&&c.getDocumentElement().addClass(c.$.compatMode);CKEDITOR.env.ie&&!CKEDITOR.env.edge&&b.enterMode!=CKEDITOR.ENTER_P?f("p"):CKEDITOR.env.edge&&b.enterMode!=
  948. CKEDITOR.ENTER_DIV&&f("div");if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&10<CKEDITOR.env.version)c.getDocumentElement().on("mousedown",function(a){a.data.getTarget().is("html")&&setTimeout(function(){b.editable().focus()})});n(b);try{b.document.$.execCommand("2D-position",!1,!0)}catch(h){}(CKEDITOR.env.gecko||CKEDITOR.env.ie&&"CSS1Compat"==b.document.$.compatMode)&&this.attachListener(this,"keydown",function(a){var c=a.data.getKeystroke();if(33==c||34==c)if(CKEDITOR.env.ie)setTimeout(function(){b.getSelection().scrollIntoView()},
  949. 0);else if(b.window.$.innerHeight>this.$.offsetHeight){var d=b.createRange();d[33==c?"moveToElementEditStart":"moveToElementEditEnd"](this);d.select();a.data.preventDefault()}});CKEDITOR.env.ie&&this.attachListener(c,"blur",function(){try{c.$.selection.empty()}catch(a){}});CKEDITOR.env.iOS&&this.attachListener(c,"touchend",function(){a.focus()});d=b.document.getElementsByTag("title").getItem(0);d.data("cke-title",d.getText());CKEDITOR.env.ie&&(b.document.$.title=this._.docTitle);CKEDITOR.tools.setTimeout(function(){"unloaded"==
  950. this.status&&(this.status="ready");b.fire("contentDom");this._.isPendingFocus&&(b.focus(),this._.isPendingFocus=!1);setTimeout(function(){b.fire("dataReady")},0)},0,this)}function n(a){function f(){var c;a.editable().attachListener(a,"selectionChange",function(){var d=a.getSelection().getSelectedElement();d&&(c&&(c.detachEvent("onresizestart",b),c=null),d.$.attachEvent("onresizestart",b),c=d.$)})}function b(a){a.returnValue=!1}if(CKEDITOR.env.gecko)try{var c=a.document.$;c.execCommand("enableObjectResizing",
  951. !1,!a.config.disableObjectResizing);c.execCommand("enableInlineTableEditing",!1,!a.config.disableNativeTableHandles)}catch(d){}else CKEDITOR.env.ie&&11>CKEDITOR.env.version&&a.config.disableObjectResizing&&f(a)}function p(){var a=[];if(8<=CKEDITOR.document.$.documentMode){a.push("html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}");var f=[],b;for(b in CKEDITOR.dtd.$removeEmpty)f.push("html.CSS1Compat "+b+"[contenteditable\x3dfalse]");a.push(f.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&
  952. (a.push("html{height:100% !important}"),a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));a.push("html{cursor:text;*cursor:auto}");a.push("img,input,textarea{cursor:default}");return a.join("\n")}CKEDITOR.plugins.add("wysiwygarea",{init:function(a){a.config.fullPage&&a.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]",requiredContent:"body"});a.addMode("wysiwyg",function(f){function b(b){b&&b.removeListener();a.editable(new l(a,
  953. d.$.contentWindow.document.body));a.setData(a.getData(1),f)}var c="document.open();"+(CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"")+"document.close();",c=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void(function(){"+encodeURIComponent(c)+"}())":"",d=CKEDITOR.dom.element.createFromHtml('\x3ciframe src\x3d"'+c+'" frameBorder\x3d"0"\x3e\x3c/iframe\x3e');d.setStyles({width:"100%",height:"100%"});d.addClass("cke_wysiwyg_frame").addClass("cke_reset");
  954. c=a.ui.space("contents");c.append(d);var e=CKEDITOR.env.ie&&!CKEDITOR.env.edge||CKEDITOR.env.gecko;if(e)d.on("load",b);var g=a.title,h=a.fire("ariaEditorHelpLabel",{}).label;g&&(CKEDITOR.env.ie&&h&&(g+=", "+h),d.setAttribute("title",g));if(h){var g=CKEDITOR.tools.getNextId(),k=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+g+'" class\x3d"cke_voice_label"\x3e'+h+"\x3c/span\x3e");c.append(k,1);d.setAttribute("aria-describedby",g)}a.on("beforeModeUnload",function(a){a.removeListener();k&&k.remove()});
  955. d.setAttributes({tabIndex:a.tabIndex,allowTransparency:"true"});!e&&b();a.fire("ariaWidget",d)})}});CKEDITOR.editor.prototype.addContentsCss=function(a){var f=this.config,b=f.contentsCss;CKEDITOR.tools.isArray(b)||(f.contentsCss=b?[b]:[]);f.contentsCss.push(a)};var l=CKEDITOR.tools.createClass({$:function(){this.base.apply(this,arguments);this._.frameLoadedHandler=CKEDITOR.tools.addFunction(function(a){CKEDITOR.tools.setTimeout(m,0,this,a)},this);this._.docTitle=this.getWindow().getFrame().getAttribute("title")},
  956. base:CKEDITOR.editable,proto:{setData:function(a,f){var b=this.editor;if(f)this.setHtml(a),this.fixInitialSelection(),b.fire("dataReady");else{this._.isLoadingData=!0;b._.dataStore={id:1};var c=b.config,d=c.fullPage,e=c.docType,g=CKEDITOR.tools.buildStyleHtml(p()).replace(/<style>/,'\x3cstyle data-cke-temp\x3d"1"\x3e');d||(g+=CKEDITOR.tools.buildStyleHtml(b.config.contentsCss));var h=c.baseHref?'\x3cbase href\x3d"'+c.baseHref+'" data-cke-temp\x3d"1" /\x3e':"";d&&(a=a.replace(/<!DOCTYPE[^>]*>/i,function(a){b.docType=
  957. e=a;return""}).replace(/<\?xml\s[^\?]*\?>/i,function(a){b.xmlDeclaration=a;return""}));a=b.dataProcessor.toHtml(a);d?(/<body[\s|>]/.test(a)||(a="\x3cbody\x3e"+a),/<html[\s|>]/.test(a)||(a="\x3chtml\x3e"+a+"\x3c/html\x3e"),/<head[\s|>]/.test(a)?/<title[\s|>]/.test(a)||(a=a.replace(/<head[^>]*>/,"$\x26\x3ctitle\x3e\x3c/title\x3e")):a=a.replace(/<html[^>]*>/,"$\x26\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e"),h&&(a=a.replace(/<head[^>]*?>/,"$\x26"+h)),a=a.replace(/<\/head\s*>/,g+"$\x26"),a=
  958. e+a):a=c.docType+'\x3chtml dir\x3d"'+c.contentsLangDirection+'" lang\x3d"'+(c.contentsLanguage||b.langCode)+'"\x3e\x3chead\x3e\x3ctitle\x3e'+this._.docTitle+"\x3c/title\x3e"+h+g+"\x3c/head\x3e\x3cbody"+(c.bodyId?' id\x3d"'+c.bodyId+'"':"")+(c.bodyClass?' class\x3d"'+c.bodyClass+'"':"")+"\x3e"+a+"\x3c/body\x3e\x3c/html\x3e";CKEDITOR.env.gecko&&(a=a.replace(/<body/,'\x3cbody contenteditable\x3d"true" '),2E4>CKEDITOR.env.version&&(a=a.replace(/<body[^>]*>/,"$\x26\x3c!-- cke-content-start --\x3e")));
  959. c='\x3cscript id\x3d"cke_actscrpt" type\x3d"text/javascript"'+(CKEDITOR.env.ie?' defer\x3d"defer" ':"")+"\x3evar wasLoaded\x3d0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction("+this._.frameLoadedHandler+",window);wasLoaded\x3d1;}"+(CKEDITOR.env.ie?"onload();":'document.addEventListener("DOMContentLoaded", onload, false );')+"\x3c/script\x3e";CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(c+='\x3cscript id\x3d"cke_shimscrpt"\x3ewindow.parent.CKEDITOR.tools.enableHtml5Elements(document)\x3c/script\x3e');
  960. h&&CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(c+='\x3cscript id\x3d"cke_basetagscrpt"\x3evar baseTag \x3d document.querySelector( "base" );baseTag.href \x3d baseTag.href;\x3c/script\x3e');a=a.replace(/(?=\s*<\/(:?head)>)/,c);this.clearCustomData();this.clearListeners();b.fire("contentDomUnload");var k=this.getDocument();try{k.write(a)}catch(l){setTimeout(function(){k.write(a)},0)}}},getData:function(a){if(a)return this.getHtml();a=this.editor;var f=a.config,b=f.fullPage,c=b&&a.docType,d=b&&a.xmlDeclaration,
  961. e=this.getDocument(),b=b?e.getDocumentElement().getOuterHtml():e.getBody().getHtml();CKEDITOR.env.gecko&&f.enterMode!=CKEDITOR.ENTER_BR&&(b=b.replace(/<br>(?=\s*(:?$|<\/body>))/,""));b=a.dataProcessor.toDataFormat(b);d&&(b=d+"\n"+b);c&&(b=c+"\n"+b);return b},focus:function(){this._.isLoadingData?this._.isPendingFocus=!0:l.baseProto.focus.call(this)},detach:function(){var a=this.editor,f=a.document,b;try{b=a.window.getFrame()}catch(c){}l.baseProto.detach.call(this);this.clearCustomData();f.getDocumentElement().clearCustomData();
  962. CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);b&&b.getParent()?(b.clearCustomData(),(a=b.removeCustomData("onResize"))&&a.removeListener(),b.remove()):CKEDITOR.warn("editor-destroy-iframe")}}})})();CKEDITOR.config.disableObjectResizing=!1;CKEDITOR.config.disableNativeTableHandles=!0;CKEDITOR.config.disableNativeSpellChecker=!0;(function(){function e(b,a){a||(a=b.getSelection().getSelectedElement());if(a&&a.is("img")&&!a.data("cke-realelement")&&!a.isReadOnly())return a}function f(b){var a=b.getStyle("float");if("inherit"==a||"none"==a)a=0;a||(a=b.getAttribute("align"));return a}CKEDITOR.plugins.add("image",{requires:"dialog",init:function(b){if(!b.plugins.image2){CKEDITOR.dialog.add("image",this.path+"dialogs/image.js");var a="img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}";
  963. CKEDITOR.dialog.isTabEnabled(b,"image","advanced")&&(a="img[alt,dir,id,lang,longdesc,!src,title]{*}(*)");b.addCommand("image",new CKEDITOR.dialogCommand("image",{allowedContent:a,requiredContent:"img[alt,src]",contentTransformations:[["img{width}: sizeToStyle","img[width]: sizeToAttribute"],["img{float}: alignmentToStyle","img[align]: alignmentToAttribute"]]}));b.ui.addButton&&b.ui.addButton("Image",{label:b.lang.common.image,command:"image",toolbar:"insert,10"});b.on("doubleclick",function(b){var a=
  964. b.data.element;!a.is("img")||a.data("cke-realelement")||a.isReadOnly()||(b.data.dialog="image")});b.addMenuItems&&b.addMenuItems({image:{label:b.lang.image.menu,command:"image",group:"image"}});b.contextMenu&&b.contextMenu.addListener(function(a){if(e(b,a))return{image:CKEDITOR.TRISTATE_OFF}})}},afterInit:function(b){function a(a){var d=b.getCommand("justify"+a);if(d){if("left"==a||"right"==a)d.on("exec",function(d){var c=e(b),g;c&&(g=f(c),g==a?(c.removeStyle("float"),a==f(c)&&c.removeAttribute("align")):
  965. c.setStyle("float",a),d.cancel())});d.on("refresh",function(d){var c=e(b);c&&(c=f(c),this.setState(c==a?CKEDITOR.TRISTATE_ON:"right"==a||"left"==a?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),d.cancel())})}}b.plugins.image2||(a("left"),a("right"),a("center"),a("block"))}})})();CKEDITOR.config.image_removeLinkByEmptyURL=!0;(function(){function m(a,b){var e,f;b.on("refresh",function(a){var b=[k],c;for(c in a.data.states)b.push(a.data.states[c]);this.setState(CKEDITOR.tools.search(b,p)?p:k)},b,null,100);b.on("exec",function(b){e=a.getSelection();f=e.createBookmarks(1);b.data||(b.data={});b.data.done=!1},b,null,0);b.on("exec",function(){a.forceNextSelectionCheck();e.selectBookmarks(f)},b,null,100)}var k=CKEDITOR.TRISTATE_DISABLED,p=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indent",{init:function(a){var b=CKEDITOR.plugins.indent.genericDefinition;
  966. m(a,a.addCommand("indent",new b(!0)));m(a,a.addCommand("outdent",new b));a.ui.addButton&&(a.ui.addButton("Indent",{label:a.lang.indent.indent,command:"indent",directional:!0,toolbar:"indent,20"}),a.ui.addButton("Outdent",{label:a.lang.indent.outdent,command:"outdent",directional:!0,toolbar:"indent,10"}));a.on("dirChanged",function(b){var f=a.createRange(),l=b.data.node;f.setStartBefore(l);f.setEndAfter(l);for(var n=new CKEDITOR.dom.walker(f),c;c=n.next();)if(c.type==CKEDITOR.NODE_ELEMENT)if(!c.equals(l)&&
  967. c.getDirection())f.setStartAfter(c),n=new CKEDITOR.dom.walker(f);else{var d=a.config.indentClasses;if(d)for(var g="ltr"==b.data.dir?["_rtl",""]:["","_rtl"],h=0;h<d.length;h++)c.hasClass(d[h]+g[0])&&(c.removeClass(d[h]+g[0]),c.addClass(d[h]+g[1]));d=c.getStyle("margin-right");g=c.getStyle("margin-left");d?c.setStyle("margin-left",d):c.removeStyle("margin-left");g?c.setStyle("margin-right",g):c.removeStyle("margin-right")}})}});CKEDITOR.plugins.indent={genericDefinition:function(a){this.isIndent=!!a;
  968. this.startDisabled=!this.isIndent},specificDefinition:function(a,b,e){this.name=b;this.editor=a;this.jobs={};this.enterBr=a.config.enterMode==CKEDITOR.ENTER_BR;this.isIndent=!!e;this.relatedGlobal=e?"indent":"outdent";this.indentKey=e?9:CKEDITOR.SHIFT+9;this.database={}},registerCommands:function(a,b){a.on("pluginsLoaded",function(){for(var a in b)(function(a,b){var e=a.getCommand(b.relatedGlobal),c;for(c in b.jobs)e.on("exec",function(d){d.data.done||(a.fire("lockSnapshot"),b.execJob(a,c)&&(d.data.done=
  969. !0),a.fire("unlockSnapshot"),CKEDITOR.dom.element.clearAllMarkers(b.database))},this,null,c),e.on("refresh",function(d){d.data.states||(d.data.states={});d.data.states[b.name+"@"+c]=b.refreshJob(a,c,d.data.path)},this,null,c);a.addFeature(b)})(this,b[a])})}};CKEDITOR.plugins.indent.genericDefinition.prototype={context:"p",exec:function(){}};CKEDITOR.plugins.indent.specificDefinition.prototype={execJob:function(a,b){var e=this.jobs[b];if(e.state!=k)return e.exec.call(this,a)},refreshJob:function(a,
  970. b,e){b=this.jobs[b];a.activeFilter.checkFeature(this)?b.state=b.refresh.call(this,a,e):b.state=k;return b.state},getContext:function(a){return a.contains(this.context)}}})();(function(){function f(b,c,a){if(!b.getCustomData("indent_processed")){var d=this.editor,l=this.isIndent;if(c){d=b.$.className.match(this.classNameRegex);a=0;d&&(d=d[1],a=CKEDITOR.tools.indexOf(c,d)+1);if(0>(a+=l?1:-1))return;a=Math.min(a,c.length);a=Math.max(a,0);b.$.className=CKEDITOR.tools.ltrim(b.$.className.replace(this.classNameRegex,""));0<a&&b.addClass(c[a-1])}else{c=m(b,a);a=parseInt(b.getStyle(c),10);var g=d.config.indentOffset||40;isNaN(a)&&(a=0);a+=(l?1:-1)*g;if(0>a)return;a=Math.max(a,
  971. 0);a=Math.ceil(a/g)*g;b.setStyle(c,a?a+(d.config.indentUnit||"px"):"");""===b.getAttribute("style")&&b.removeAttribute("style")}CKEDITOR.dom.element.setMarker(this.database,b,"indent_processed",1)}}function m(b,c){return"ltr"==(c||b.getComputedStyle("direction"))?"margin-left":"margin-right"}var h=CKEDITOR.dtd.$listItem,p=CKEDITOR.dtd.$list,k=CKEDITOR.TRISTATE_DISABLED,n=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentblock",{requires:"indent",init:function(b){function c(){a.specificDefinition.apply(this,
  972. arguments);this.allowedContent={"div h1 h2 h3 h4 h5 h6 ol p pre ul":{propertiesOnly:!0,styles:d?null:"margin-left,margin-right",classes:d||null}};this.enterBr&&(this.allowedContent.div=!0);this.requiredContent=(this.enterBr?"div":"p")+(d?"("+d.join(",")+")":"{margin-left}");this.jobs={20:{refresh:function(a,b){var e=b.block||b.blockLimit;if(!e.is(h))var c=e.getAscendant(h),e=c&&b.contains(c)||e;e.is(h)&&(e=e.getParent());if(this.enterBr||this.getContext(b)){if(d){var c=d,e=e.$.className.match(this.classNameRegex),
  973. f=this.isIndent,c=e?f?e[1]!=c.slice(-1):!0:f;return c?n:k}return this.isIndent?n:e?CKEDITOR[0>=(parseInt(e.getStyle(m(e)),10)||0)?"TRISTATE_DISABLED":"TRISTATE_OFF"]:k}return k},exec:function(a){var b=a.getSelection(),b=b&&b.getRanges()[0],c;if(c=a.elementPath().contains(p))f.call(this,c,d);else for(b=b.createIterator(),a=a.config.enterMode,b.enforceRealBlocks=!0,b.enlargeBr=a!=CKEDITOR.ENTER_BR;c=b.getNextParagraph(a==CKEDITOR.ENTER_P?"p":"div");)c.isReadOnly()||f.call(this,c,d);return!0}}}}var a=
  974. CKEDITOR.plugins.indent,d=b.config.indentClasses;a.registerCommands(b,{indentblock:new c(b,"indentblock",!0),outdentblock:new c(b,"outdentblock")});CKEDITOR.tools.extend(c.prototype,a.specificDefinition.prototype,{context:{div:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,p:1,pre:1,table:1},classNameRegex:d?new RegExp("(?:^|\\s+)("+d.join("|")+")(?\x3d$|\\s)"):null})}})})();(function(){function w(c){function f(b){for(var e=d.startContainer,a=d.endContainer;e&&!e.getParent().equals(b);)e=e.getParent();for(;a&&!a.getParent().equals(b);)a=a.getParent();if(!e||!a)return!1;for(var g=e,e=[],k=!1;!k;)g.equals(a)&&(k=!0),e.push(g),g=g.getNext();if(1>e.length)return!1;g=b.getParents(!0);for(a=0;a<g.length;a++)if(g[a].getName&&p[g[a].getName()]){b=g[a];break}for(var g=l.isIndent?1:-1,a=e[0],e=e[e.length-1],k=CKEDITOR.plugins.list.listToArray(b,q),n=k[e.getCustomData("listarray_index")].indent,
  975. a=a.getCustomData("listarray_index");a<=e.getCustomData("listarray_index");a++)if(k[a].indent+=g,0<g){var h=k[a].parent;k[a].parent=new CKEDITOR.dom.element(h.getName(),h.getDocument())}for(a=e.getCustomData("listarray_index")+1;a<k.length&&k[a].indent>n;a++)k[a].indent+=g;e=CKEDITOR.plugins.list.arrayToList(k,q,null,c.config.enterMode,b.getDirection());if(!l.isIndent){var f;if((f=b.getParent())&&f.is("li"))for(var g=e.listNode.getChildren(),r=[],m,a=g.count()-1;0<=a;a--)(m=g.getItem(a))&&m.is&&m.is("li")&&
  976. r.push(m)}e&&e.listNode.replace(b);if(r&&r.length)for(a=0;a<r.length;a++){for(m=b=r[a];(m=m.getNext())&&m.is&&m.getName()in p;)CKEDITOR.env.needsNbspFiller&&!b.getFirst(x)&&b.append(d.document.createText(" ")),b.append(m);b.insertAfter(f)}e&&c.fire("contentDomInvalidated");return!0}for(var l=this,q=this.database,p=this.context,n=c.getSelection(),n=(n&&n.getRanges()).createIterator(),d;d=n.getNextRange();){for(var b=d.getCommonAncestor();b&&(b.type!=CKEDITOR.NODE_ELEMENT||!p[b.getName()]);){if(c.editable().equals(b)){b=
  977. !1;break}b=b.getParent()}b||(b=d.startPath().contains(p))&&d.setEndAt(b,CKEDITOR.POSITION_BEFORE_END);if(!b){var h=d.getEnclosedNode();h&&h.type==CKEDITOR.NODE_ELEMENT&&h.getName()in p&&(d.setStartAt(h,CKEDITOR.POSITION_AFTER_START),d.setEndAt(h,CKEDITOR.POSITION_BEFORE_END),b=h)}b&&d.startContainer.type==CKEDITOR.NODE_ELEMENT&&d.startContainer.getName()in p&&(h=new CKEDITOR.dom.walker(d),h.evaluator=t,d.startContainer=h.next());b&&d.endContainer.type==CKEDITOR.NODE_ELEMENT&&d.endContainer.getName()in
  978. p&&(h=new CKEDITOR.dom.walker(d),h.evaluator=t,d.endContainer=h.previous());if(b)return f(b)}return 0}function t(c){return c.type==CKEDITOR.NODE_ELEMENT&&c.is("li")}function x(c){return y(c)&&z(c)}var y=CKEDITOR.dom.walker.whitespaces(!0),z=CKEDITOR.dom.walker.bookmark(!1,!0),u=CKEDITOR.TRISTATE_DISABLED,v=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentlist",{requires:"indent",init:function(c){function f(c){l.specificDefinition.apply(this,arguments);this.requiredContent=["ul","ol"];c.on("key",
  979. function(f){if("wysiwyg"==c.mode&&f.data.keyCode==this.indentKey){var n=this.getContext(c.elementPath());!n||this.isIndent&&CKEDITOR.plugins.indentList.firstItemInPath(this.context,c.elementPath(),n)||(c.execCommand(this.relatedGlobal),f.cancel())}},this);this.jobs[this.isIndent?10:30]={refresh:this.isIndent?function(c,f){var d=this.getContext(f),b=CKEDITOR.plugins.indentList.firstItemInPath(this.context,f,d);return d&&this.isIndent&&!b?v:u}:function(c,f){return!this.getContext(f)||this.isIndent?
  980. u:v},exec:CKEDITOR.tools.bind(w,this)}}var l=CKEDITOR.plugins.indent;l.registerCommands(c,{indentlist:new f(c,"indentlist",!0),outdentlist:new f(c,"outdentlist")});CKEDITOR.tools.extend(f.prototype,l.specificDefinition.prototype,{context:{ol:1,ul:1}})}});CKEDITOR.plugins.indentList={};CKEDITOR.plugins.indentList.firstItemInPath=function(c,f,l){var q=f.contains(t);l||(l=f.contains(c));return l&&q&&q.equals(l.getFirst(t))}})();CKEDITOR.plugins.add("smiley",{requires:"dialog",init:function(a){a.config.smiley_path=a.config.smiley_path||this.path+"images/";a.addCommand("smiley",new CKEDITOR.dialogCommand("smiley",{allowedContent:"img[alt,height,!src,title,width]",requiredContent:"img"}));a.ui.addButton&&a.ui.addButton("Smiley",{label:a.lang.smiley.toolbar,command:"smiley",toolbar:"insert,50"});CKEDITOR.dialog.add("smiley",this.path+"dialogs/smiley.js")}});CKEDITOR.config.smiley_images="regular_smile.png sad_smile.png wink_smile.png teeth_smile.png confused_smile.png tongue_smile.png embarrassed_smile.png omg_smile.png whatchutalkingabout_smile.png angry_smile.png angel_smile.png shades_smile.png devil_smile.png cry_smile.png lightbulb.png thumbs_down.png thumbs_up.png heart.png broken_heart.png kiss.png envelope.png".split(" ");
  981. CKEDITOR.config.smiley_descriptions="smiley;sad;wink;laugh;frown;cheeky;blush;surprise;indecision;angry;angel;cool;devil;crying;enlightened;no;yes;heart;broken heart;kiss;mail".split(";");(function(){function n(a,c){c=void 0===c||c;var b;if(c)b=a.getComputedStyle("text-align");else{for(;!a.hasAttribute||!a.hasAttribute("align")&&!a.getStyle("text-align");){b=a.getParent();if(!b)break;a=b}b=a.getStyle("text-align")||a.getAttribute("align")||""}b&&(b=b.replace(/(?:-(?:moz|webkit)-)?(?:start|auto)/i,""));!b&&c&&(b="rtl"==a.getComputedStyle("direction")?"right":"left");return b}function g(a,c,b){this.editor=a;this.name=c;this.value=b;this.context="p";c=a.config.justifyClasses;var h=a.config.enterMode==
  982. CKEDITOR.ENTER_P?"p":"div";if(c){switch(b){case "left":this.cssClassName=c[0];break;case "center":this.cssClassName=c[1];break;case "right":this.cssClassName=c[2];break;case "justify":this.cssClassName=c[3]}this.cssClassRegex=new RegExp("(?:^|\\s+)(?:"+c.join("|")+")(?\x3d$|\\s)");this.requiredContent=h+"("+this.cssClassName+")"}else this.requiredContent=h+"{text-align}";this.allowedContent={"caption div h1 h2 h3 h4 h5 h6 p pre td th li":{propertiesOnly:!0,styles:this.cssClassName?null:"text-align",
  983. classes:this.cssClassName||null}};a.config.enterMode==CKEDITOR.ENTER_BR&&(this.allowedContent.div=!0)}function l(a){var c=a.editor,b=c.createRange();b.setStartBefore(a.data.node);b.setEndAfter(a.data.node);for(var h=new CKEDITOR.dom.walker(b),d;d=h.next();)if(d.type==CKEDITOR.NODE_ELEMENT)if(!d.equals(a.data.node)&&d.getDirection())b.setStartAfter(d),h=new CKEDITOR.dom.walker(b);else{var e=c.config.justifyClasses;e&&(d.hasClass(e[0])?(d.removeClass(e[0]),d.addClass(e[2])):d.hasClass(e[2])&&(d.removeClass(e[2]),
  984. d.addClass(e[0])));e=d.getStyle("text-align");"left"==e?d.setStyle("text-align","right"):"right"==e&&d.setStyle("text-align","left")}}g.prototype={exec:function(a){var c=a.getSelection(),b=a.config.enterMode;if(c){for(var h=c.createBookmarks(),d=c.getRanges(),e=this.cssClassName,g,f,k=a.config.useComputedState,k=void 0===k||k,m=d.length-1;0<=m;m--)for(g=d[m].createIterator(),g.enlargeBr=b!=CKEDITOR.ENTER_BR;f=g.getNextParagraph(b==CKEDITOR.ENTER_P?"p":"div");)if(!f.isReadOnly()){f.removeAttribute("align");
  985. f.removeStyle("text-align");var l=e&&(f.$.className=CKEDITOR.tools.ltrim(f.$.className.replace(this.cssClassRegex,""))),p=this.state==CKEDITOR.TRISTATE_OFF&&(!k||n(f,!0)!=this.value);e?p?f.addClass(e):l||f.removeAttribute("class"):p&&f.setStyle("text-align",this.value)}a.focus();a.forceNextSelectionCheck();c.selectBookmarks(h)}},refresh:function(a,c){var b=c.block||c.blockLimit;this.setState("body"!=b.getName()&&n(b,this.editor.config.useComputedState)==this.value?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)}};
  986. CKEDITOR.plugins.add("justify",{init:function(a){if(!a.blockless){var c=new g(a,"justifyleft","left"),b=new g(a,"justifycenter","center"),h=new g(a,"justifyright","right"),d=new g(a,"justifyblock","justify");a.addCommand("justifyleft",c);a.addCommand("justifycenter",b);a.addCommand("justifyright",h);a.addCommand("justifyblock",d);a.ui.addButton&&(a.ui.addButton("JustifyLeft",{label:a.lang.justify.left,command:"justifyleft",toolbar:"align,10"}),a.ui.addButton("JustifyCenter",{label:a.lang.justify.center,
  987. command:"justifycenter",toolbar:"align,20"}),a.ui.addButton("JustifyRight",{label:a.lang.justify.right,command:"justifyright",toolbar:"align,30"}),a.ui.addButton("JustifyBlock",{label:a.lang.justify.block,command:"justifyblock",toolbar:"align,40"}));a.on("dirChanged",l)}}})})();CKEDITOR.plugins.add("menubutton",{requires:"button,menu",onLoad:function(){var d=function(c){var a=this._,b=a.menu;a.state!==CKEDITOR.TRISTATE_DISABLED&&(a.on&&b?b.hide():(a.previousState=a.state,b||(b=a.menu=new CKEDITOR.menu(c,{panel:{className:"cke_menu_panel",attributes:{"aria-label":c.lang.common.options}}}),b.onHide=CKEDITOR.tools.bind(function(){var b=this.command?c.getCommand(this.command).modes:this.modes;this.setState(!b||b[c.mode]?a.previousState:CKEDITOR.TRISTATE_DISABLED);a.on=0},this),
  988. this.onMenu&&b.addListener(this.onMenu)),this.setState(CKEDITOR.TRISTATE_ON),a.on=1,setTimeout(function(){b.show(CKEDITOR.document.getById(a.id),4)},0)))};CKEDITOR.ui.menuButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(c){delete c.panel;this.base(c);this.hasArrow=!0;this.click=d},statics:{handler:{create:function(c){return new CKEDITOR.ui.menuButton(c)}}}})},beforeInit:function(d){d.ui.addHandler(CKEDITOR.UI_MENUBUTTON,CKEDITOR.ui.menuButton.handler)}});
  989. CKEDITOR.UI_MENUBUTTON="menubutton";(function(){CKEDITOR.plugins.add("language",{requires:"menubutton",init:function(a){var b=a.config.language_list||["ar:Arabic:rtl","fr:French","es:Spanish"],c=this,d=a.lang.language,e={},g,h,k,f;a.addCommand("language",{allowedContent:"span[!lang,!dir]",requiredContent:"span[lang,dir]",contextSensitive:!0,exec:function(a,b){var c=e["language_"+b];if(c)a[c.style.checkActive(a.elementPath(),a)?"removeStyle":"applyStyle"](c.style)},refresh:function(a){this.setState(c.getCurrentLangElement(a)?CKEDITOR.TRISTATE_ON:
  990. CKEDITOR.TRISTATE_OFF)}});for(f=0;f<b.length;f++)g=b[f].split(":"),h=g[0],k="language_"+h,e[k]={label:g[1],langId:h,group:"language",order:f,ltr:"rtl"!=(""+g[2]).toLowerCase(),onClick:function(){a.execCommand("language",this.langId)},role:"menuitemcheckbox"},e[k].style=new CKEDITOR.style({element:"span",attributes:{lang:h,dir:e[k].ltr?"ltr":"rtl"}});e.language_remove={label:d.remove,group:"language_remove",state:CKEDITOR.TRISTATE_DISABLED,order:e.length,onClick:function(){var b=c.getCurrentLangElement(a);
  991. b&&a.execCommand("language",b.getAttribute("lang"))}};a.addMenuGroup("language",1);a.addMenuGroup("language_remove");a.addMenuItems(e);a.ui.add("Language",CKEDITOR.UI_MENUBUTTON,{label:d.button,allowedContent:"span[!lang,!dir]",requiredContent:"span[lang,dir]",toolbar:"bidi,30",command:"language",onMenu:function(){var b={},d=c.getCurrentLangElement(a),f;for(f in e)b[f]=CKEDITOR.TRISTATE_OFF;b.language_remove=d?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;d&&(b["language_"+d.getAttribute("lang")]=
  992. CKEDITOR.TRISTATE_ON);return b}})},getCurrentLangElement:function(a){var b=a.elementPath();a=b&&b.elements;var c;if(b)for(var d=0;d<a.length;d++)b=a[d],!c&&"span"==b.getName()&&b.hasAttribute("dir")&&b.hasAttribute("lang")&&(c=b);return c}})})();(function(){function p(c){return c.replace(/'/g,"\\$\x26")}function q(c){for(var b,a=c.length,f=[],e=0;e<a;e++)b=c.charCodeAt(e),f.push(b);return"String.fromCharCode("+f.join(",")+")"}function r(c,b){var a=c.plugins.link,f=a.compiledProtectionFunction.params,e,d;d=[a.compiledProtectionFunction.name,"("];for(var g=0;g<f.length;g++)a=f[g].toLowerCase(),e=b[a],0<g&&d.push(","),d.push("'",e?p(encodeURIComponent(b[a])):"","'");d.push(")");return d.join("")}function n(c){c=c.config.emailProtection||"";
  993. var b;c&&"encode"!=c&&(b={},c.replace(/^([^(]+)\(([^)]+)\)$/,function(a,c,e){b.name=c;b.params=[];e.replace(/[^,\s]+/g,function(a){b.params.push(a)})}));return b}CKEDITOR.plugins.add("link",{requires:"dialog,fakeobjects",onLoad:function(){function c(b){return a.replace(/%1/g,"rtl"==b?"right":"left").replace(/%2/g,"cke_contents_"+b)}var b="background:url("+CKEDITOR.getUrl(this.path+"images"+(CKEDITOR.env.hidpi?"/hidpi":"")+"/anchor.png")+") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",
  994. a=".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{"+b+"padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{"+b+"width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";CKEDITOR.addCss(c("ltr")+c("rtl"))},init:function(c){var b="a[!href]";CKEDITOR.dialog.isTabEnabled(c,"link","advanced")&&(b=b.replace("]",",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type]{*}(*)"));CKEDITOR.dialog.isTabEnabled(c,"link","target")&&(b=b.replace("]",
  995. ",target,onclick]"));c.addCommand("link",new CKEDITOR.dialogCommand("link",{allowedContent:b,requiredContent:"a[href]"}));c.addCommand("anchor",new CKEDITOR.dialogCommand("anchor",{allowedContent:"a[!name,id]",requiredContent:"a[name]"}));c.addCommand("unlink",new CKEDITOR.unlinkCommand);c.addCommand("removeAnchor",new CKEDITOR.removeAnchorCommand);c.setKeystroke(CKEDITOR.CTRL+76,"link");c.ui.addButton&&(c.ui.addButton("Link",{label:c.lang.link.toolbar,command:"link",toolbar:"links,10"}),c.ui.addButton("Unlink",
  996. {label:c.lang.link.unlink,command:"unlink",toolbar:"links,20"}),c.ui.addButton("Anchor",{label:c.lang.link.anchor.toolbar,command:"anchor",toolbar:"links,30"}));CKEDITOR.dialog.add("link",this.path+"dialogs/link.js");CKEDITOR.dialog.add("anchor",this.path+"dialogs/anchor.js");c.on("doubleclick",function(a){var b=CKEDITOR.plugins.link.getSelectedLink(c)||a.data.element;b.isReadOnly()||(b.is("a")?(a.data.dialog=!b.getAttribute("name")||b.getAttribute("href")&&b.getChildCount()?"link":"anchor",a.data.link=
  997. b):CKEDITOR.plugins.link.tryRestoreFakeAnchor(c,b)&&(a.data.dialog="anchor"))},null,null,0);c.on("doubleclick",function(a){a.data.dialog in{link:1,anchor:1}&&a.data.link&&c.getSelection().selectElement(a.data.link)},null,null,20);c.addMenuItems&&c.addMenuItems({anchor:{label:c.lang.link.anchor.menu,command:"anchor",group:"anchor",order:1},removeAnchor:{label:c.lang.link.anchor.remove,command:"removeAnchor",group:"anchor",order:5},link:{label:c.lang.link.menu,command:"link",group:"link",order:1},unlink:{label:c.lang.link.unlink,
  998. command:"unlink",group:"link",order:5}});c.contextMenu&&c.contextMenu.addListener(function(a){if(!a||a.isReadOnly())return null;a=CKEDITOR.plugins.link.tryRestoreFakeAnchor(c,a);if(!a&&!(a=CKEDITOR.plugins.link.getSelectedLink(c)))return null;var b={};a.getAttribute("href")&&a.getChildCount()&&(b={link:CKEDITOR.TRISTATE_OFF,unlink:CKEDITOR.TRISTATE_OFF});a&&a.hasAttribute("name")&&(b.anchor=b.removeAnchor=CKEDITOR.TRISTATE_OFF);return b});this.compiledProtectionFunction=n(c)},afterInit:function(c){c.dataProcessor.dataFilter.addRules({elements:{a:function(a){return a.attributes.name?
  999. a.children.length?null:c.createFakeParserElement(a,"cke_anchor","anchor"):null}}});var b=c._.elementsPath&&c._.elementsPath.filters;b&&b.push(function(a,b){if("a"==b&&(CKEDITOR.plugins.link.tryRestoreFakeAnchor(c,a)||a.getAttribute("name")&&(!a.getAttribute("href")||!a.getChildCount())))return"anchor"})}});var t=/^javascript:/,u=/^mailto:([^?]+)(?:\?(.+))?$/,v=/subject=([^;?:@&=$,\/]*)/i,w=/body=([^;?:@&=$,\/]*)/i,x=/^#(.*)$/,y=/^((?:http|https|ftp|news):\/\/)?(.*)$/,z=/^(_(?:self|top|parent|blank))$/,
  1000. A=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,B=/^javascript:([^(]+)\(([^)]+)\)$/,C=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,D=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,m={id:"advId",dir:"advLangDir",accessKey:"advAccessKey",name:"advName",lang:"advLangCode",tabindex:"advTabIndex",title:"advTitle",type:"advContentType","class":"advCSSClasses",charset:"advCharset",style:"advStyles",rel:"advRel"};
  1001. CKEDITOR.plugins.link={getSelectedLink:function(c){var b=c.getSelection(),a=b.getSelectedElement();return a&&a.is("a")?a:(b=b.getRanges()[0])?(b.shrink(CKEDITOR.SHRINK_TEXT),c.elementPath(b.getCommonAncestor()).contains("a",1)):null},getEditorAnchors:function(c){for(var b=c.editable(),a=b.isInline()&&!c.plugins.divarea?c.document:b,b=a.getElementsByTag("a"),a=a.getElementsByTag("img"),f=[],e=0,d;d=b.getItem(e++);)(d.data("cke-saved-name")||d.hasAttribute("name"))&&f.push({name:d.data("cke-saved-name")||
  1002. d.getAttribute("name"),id:d.getAttribute("id")});for(e=0;d=a.getItem(e++);)(d=this.tryRestoreFakeAnchor(c,d))&&f.push({name:d.getAttribute("name"),id:d.getAttribute("id")});return f},fakeAnchor:!0,tryRestoreFakeAnchor:function(c,b){if(b&&b.data("cke-real-element-type")&&"anchor"==b.data("cke-real-element-type")){var a=c.restoreRealElement(b);if(a.data("cke-saved-name"))return a}},parseLinkAttributes:function(c,b){var a=b&&(b.data("cke-saved-href")||b.getAttribute("href"))||"",f=c.plugins.link.compiledProtectionFunction,
  1003. e=c.config.emailProtection,d,g={};a.match(t)&&("encode"==e?a=a.replace(A,function(a,b,c){c=c||"";return"mailto:"+String.fromCharCode.apply(String,b.split(","))+c.replace(/\\'/g,"'")}):e&&a.replace(B,function(a,b,c){if(b==f.name){g.type="email";a=g.email={};b=/(^')|('$)/g;c=c.match(/[^,\s]+/g);for(var d=c.length,e,h,k=0;k<d;k++)e=decodeURIComponent,h=c[k].replace(b,"").replace(/\\'/g,"'"),h=e(h),e=f.params[k].toLowerCase(),a[e]=h;a.address=[a.name,a.domain].join("@")}}));if(!g.type)if(e=a.match(x))g.type=
  1004. "anchor",g.anchor={},g.anchor.name=g.anchor.id=e[1];else if(e=a.match(u)){d=a.match(v);a=a.match(w);g.type="email";var k=g.email={};k.address=e[1];d&&(k.subject=decodeURIComponent(d[1]));a&&(k.body=decodeURIComponent(a[1]))}else a&&(d=a.match(y))&&(g.type="url",g.url={},g.url.protocol=d[1],g.url.url=d[2]);if(b){if(a=b.getAttribute("target"))g.target={type:a.match(z)?a:"frame",name:a};else if(a=(a=b.data("cke-pa-onclick")||b.getAttribute("onclick"))&&a.match(C))for(g.target={type:"popup",name:a[1]};e=
  1005. D.exec(a[2]);)"yes"!=e[2]&&"1"!=e[2]||e[1]in{height:1,width:1,top:1,left:1}?isFinite(e[2])&&(g.target[e[1]]=e[2]):g.target[e[1]]=!0;var a={},h;for(h in m)(e=b.getAttribute(h))&&(a[m[h]]=e);if(h=b.data("cke-saved-name")||a.advName)a.advName=h;CKEDITOR.tools.isEmpty(a)||(g.advanced=a)}return g},getLinkAttributes:function(c,b){var a=c.config.emailProtection||"",f={};switch(b.type){case "url":var a=b.url&&void 0!==b.url.protocol?b.url.protocol:"http://",e=b.url&&CKEDITOR.tools.trim(b.url.url)||"";f["data-cke-saved-href"]=
  1006. 0===e.indexOf("/")?e:a+e;break;case "anchor":a=b.anchor&&b.anchor.id;f["data-cke-saved-href"]="#"+(b.anchor&&b.anchor.name||a||"");break;case "email":var d=b.email,e=d.address;switch(a){case "":case "encode":var g=encodeURIComponent(d.subject||""),k=encodeURIComponent(d.body||""),d=[];g&&d.push("subject\x3d"+g);k&&d.push("body\x3d"+k);d=d.length?"?"+d.join("\x26"):"";"encode"==a?(a=["javascript:void(location.href\x3d'mailto:'+",q(e)],d&&a.push("+'",p(d),"'"),a.push(")")):a=["mailto:",e,d];break;default:a=
  1007. e.split("@",2),d.name=a[0],d.domain=a[1],a=["javascript:",r(c,d)]}f["data-cke-saved-href"]=a.join("")}if(b.target)if("popup"==b.target.type){for(var a=["window.open(this.href, '",b.target.name||"","', '"],h="resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "),e=h.length,g=function(a){b.target[a]&&h.push(a+"\x3d"+b.target[a])},d=0;d<e;d++)h[d]+=b.target[h[d]]?"\x3dyes":"\x3dno";g("width");g("left");g("height");g("top");a.push(h.join(","),"'); return false;");f["data-cke-pa-onclick"]=
  1008. a.join("")}else"notSet"!=b.target.type&&b.target.name&&(f.target=b.target.name);if(b.advanced){for(var l in m)(a=b.advanced[m[l]])&&(f[l]=a);f.name&&(f["data-cke-saved-name"]=f.name)}f["data-cke-saved-href"]&&(f.href=f["data-cke-saved-href"]);l={target:1,onclick:1,"data-cke-pa-onclick":1,"data-cke-saved-name":1};b.advanced&&CKEDITOR.tools.extend(l,m);for(var n in f)delete l[n];return{set:f,removed:CKEDITOR.tools.objectKeys(l)}}};CKEDITOR.unlinkCommand=function(){};CKEDITOR.unlinkCommand.prototype=
  1009. {exec:function(c){var b=new CKEDITOR.style({element:"a",type:CKEDITOR.STYLE_INLINE,alwaysRemoveElement:1});c.removeStyle(b)},refresh:function(c,b){var a=b.lastElement&&b.lastElement.getAscendant("a",!0);a&&"a"==a.getName()&&a.getAttribute("href")&&a.getChildCount()?this.setState(CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)},contextSensitive:1,startDisabled:1,requiredContent:"a[href]"};CKEDITOR.removeAnchorCommand=function(){};CKEDITOR.removeAnchorCommand.prototype={exec:function(c){var b=
  1010. c.getSelection(),a=b.createBookmarks(),f;if(b&&(f=b.getSelectedElement())&&(f.getChildCount()?f.is("a"):CKEDITOR.plugins.link.tryRestoreFakeAnchor(c,f)))f.remove(1);else if(f=CKEDITOR.plugins.link.getSelectedLink(c))f.hasAttribute("href")?(f.removeAttributes({name:1,"data-cke-saved-name":1}),f.removeClass("cke_anchor")):f.remove(1);b.selectBookmarks(a)},requiredContent:"a[name]"};CKEDITOR.tools.extend(CKEDITOR.config,{linkShowAdvancedTab:!0,linkShowTargetTab:!0})})();(function(){function I(b,m,e){function c(c){if(!(!(a=d[c?"getFirst":"getLast"]())||a.is&&a.isBlockBoundary()||!(p=m.root[c?"getPrevious":"getNext"](CKEDITOR.dom.walker.invisible(!0)))||p.is&&p.isBlockBoundary({br:1})))b.document.createElement("br")[c?"insertBefore":"insertAfter"](a)}for(var f=CKEDITOR.plugins.list.listToArray(m.root,e),g=[],k=0;k<m.contents.length;k++){var h=m.contents[k];(h=h.getAscendant("li",!0))&&!h.getCustomData("list_item_processed")&&(g.push(h),CKEDITOR.dom.element.setMarker(e,
  1011. h,"list_item_processed",!0))}h=null;for(k=0;k<g.length;k++)h=g[k].getCustomData("listarray_index"),f[h].indent=-1;for(k=h+1;k<f.length;k++)if(f[k].indent>f[k-1].indent+1){g=f[k-1].indent+1-f[k].indent;for(h=f[k].indent;f[k]&&f[k].indent>=h;)f[k].indent+=g,k++;k--}var d=CKEDITOR.plugins.list.arrayToList(f,e,null,b.config.enterMode,m.root.getAttribute("dir")).listNode,a,p;c(!0);c();d.replace(m.root);b.fire("contentDomInvalidated")}function B(b,m){this.name=b;this.context=this.type=m;this.allowedContent=
  1012. m+" li";this.requiredContent=m}function E(b,m,e,c){for(var f,g;f=b[c?"getLast":"getFirst"](J);)(g=f.getDirection(1))!==m.getDirection(1)&&f.setAttribute("dir",g),f.remove(),e?f[c?"insertBefore":"insertAfter"](e):m.append(f,c)}function F(b){function m(e){var c=b[e?"getPrevious":"getNext"](u);c&&c.type==CKEDITOR.NODE_ELEMENT&&c.is(b.getName())&&(E(b,c,null,!e),b.remove(),b=c)}m();m(1)}function G(b){return b.type==CKEDITOR.NODE_ELEMENT&&(b.getName()in CKEDITOR.dtd.$block||b.getName()in CKEDITOR.dtd.$listItem)&&
  1013. CKEDITOR.dtd[b.getName()]["#"]}function C(b,m,e){b.fire("saveSnapshot");e.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);var c=e.extractContents();m.trim(!1,!0);var f=m.createBookmark(),g=new CKEDITOR.dom.elementPath(m.startContainer),k=g.block,g=g.lastElement.getAscendant("li",1)||k,h=new CKEDITOR.dom.elementPath(e.startContainer),d=h.contains(CKEDITOR.dtd.$listItem),h=h.contains(CKEDITOR.dtd.$list);k?(k=k.getBogus())&&k.remove():h&&(k=h.getPrevious(u))&&z(k)&&k.remove();(k=c.getLast())&&k.type==CKEDITOR.NODE_ELEMENT&&
  1014. k.is("br")&&k.remove();(k=m.startContainer.getChild(m.startOffset))?c.insertBefore(k):m.startContainer.append(c);d&&(c=A(d))&&(g.contains(d)?(E(c,d.getParent(),d),c.remove()):g.append(c));for(;e.checkStartOfBlock()&&e.checkEndOfBlock();){h=e.startPath();c=h.block;if(!c)break;c.is("li")&&(g=c.getParent(),c.equals(g.getLast(u))&&c.equals(g.getFirst(u))&&(c=g));e.moveToPosition(c,CKEDITOR.POSITION_BEFORE_START);c.remove()}e=e.clone();c=b.editable();e.setEndAt(c,CKEDITOR.POSITION_BEFORE_END);e=new CKEDITOR.dom.walker(e);
  1015. e.evaluator=function(a){return u(a)&&!z(a)};(e=e.next())&&e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in CKEDITOR.dtd.$list&&F(e);m.moveToBookmark(f);m.select();b.fire("saveSnapshot")}function A(b){return(b=b.getLast(u))&&b.type==CKEDITOR.NODE_ELEMENT&&b.getName()in v?b:null}var v={ol:1,ul:1},K=CKEDITOR.dom.walker.whitespaces(),H=CKEDITOR.dom.walker.bookmark(),u=function(b){return!(K(b)||H(b))},z=CKEDITOR.dom.walker.bogus();CKEDITOR.plugins.list={listToArray:function(b,m,e,c,f){if(!v[b.getName()])return[];
  1016. c||(c=0);e||(e=[]);for(var g=0,k=b.getChildCount();g<k;g++){var h=b.getChild(g);h.type==CKEDITOR.NODE_ELEMENT&&h.getName()in CKEDITOR.dtd.$list&&CKEDITOR.plugins.list.listToArray(h,m,e,c+1);if("li"==h.$.nodeName.toLowerCase()){var d={parent:b,indent:c,element:h,contents:[]};f?d.grandparent=f:(d.grandparent=b.getParent(),d.grandparent&&"li"==d.grandparent.$.nodeName.toLowerCase()&&(d.grandparent=d.grandparent.getParent()));m&&CKEDITOR.dom.element.setMarker(m,h,"listarray_index",e.length);e.push(d);
  1017. for(var a=0,p=h.getChildCount(),l;a<p;a++)l=h.getChild(a),l.type==CKEDITOR.NODE_ELEMENT&&v[l.getName()]?CKEDITOR.plugins.list.listToArray(l,m,e,c+1,d.grandparent):d.contents.push(l)}}return e},arrayToList:function(b,m,e,c,f){e||(e=0);if(!b||b.length<e+1)return null;for(var g,k=b[e].parent.getDocument(),h=new CKEDITOR.dom.documentFragment(k),d=null,a=e,p=Math.max(b[e].indent,0),l=null,q,n,t=c==CKEDITOR.ENTER_P?"p":"div";;){var r=b[a];g=r.grandparent;q=r.element.getDirection(1);if(r.indent==p){d&&b[a].parent.getName()==
  1018. d.getName()||(d=b[a].parent.clone(!1,1),f&&d.setAttribute("dir",f),h.append(d));l=d.append(r.element.clone(0,1));q!=d.getDirection(1)&&l.setAttribute("dir",q);for(g=0;g<r.contents.length;g++)l.append(r.contents[g].clone(1,1));a++}else if(r.indent==Math.max(p,0)+1)r=b[a-1].element.getDirection(1),a=CKEDITOR.plugins.list.arrayToList(b,null,a,c,r!=q?q:null),!l.getChildCount()&&CKEDITOR.env.needsNbspFiller&&7>=k.$.documentMode&&l.append(k.createText(" ")),l.append(a.listNode),a=a.nextIndex;else if(-1==
  1019. r.indent&&!e&&g){v[g.getName()]?(l=r.element.clone(!1,!0),q!=g.getDirection(1)&&l.setAttribute("dir",q)):l=new CKEDITOR.dom.documentFragment(k);var d=g.getDirection(1)!=q,y=r.element,D=y.getAttribute("class"),z=y.getAttribute("style"),A=l.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(c!=CKEDITOR.ENTER_BR||d||z||D),w,B=r.contents.length,x;for(g=0;g<B;g++)if(w=r.contents[g],H(w)&&1<B)A?x=w.clone(1,1):l.append(w.clone(1,1));else if(w.type==CKEDITOR.NODE_ELEMENT&&w.isBlockBoundary()){d&&!w.getDirection()&&
  1020. w.setAttribute("dir",q);n=w;var C=y.getAttribute("style");C&&n.setAttribute("style",C.replace(/([^;])$/,"$1;")+(n.getAttribute("style")||""));D&&w.addClass(D);n=null;x&&(l.append(x),x=null);l.append(w.clone(1,1))}else A?(n||(n=k.createElement(t),l.append(n),d&&n.setAttribute("dir",q)),z&&n.setAttribute("style",z),D&&n.setAttribute("class",D),x&&(n.append(x),x=null),n.append(w.clone(1,1))):l.append(w.clone(1,1));x&&((n||l).append(x),x=null);l.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&a!=b.length-1&&(CKEDITOR.env.needsBrFiller&&
  1021. (q=l.getLast())&&q.type==CKEDITOR.NODE_ELEMENT&&q.is("br")&&q.remove(),(q=l.getLast(u))&&q.type==CKEDITOR.NODE_ELEMENT&&q.is(CKEDITOR.dtd.$block)||l.append(k.createElement("br")));q=l.$.nodeName.toLowerCase();"div"!=q&&"p"!=q||l.appendBogus();h.append(l);d=null;a++}else return null;n=null;if(b.length<=a||Math.max(b[a].indent,0)<p)break}if(m)for(b=h.getFirst();b;){if(b.type==CKEDITOR.NODE_ELEMENT&&(CKEDITOR.dom.element.clearMarkers(m,b),b.getName()in CKEDITOR.dtd.$listItem&&(e=b,k=f=c=void 0,c=e.getDirection()))){for(f=
  1022. e.getParent();f&&!(k=f.getDirection());)f=f.getParent();c==k&&e.removeAttribute("dir")}b=b.getNextSourceNode()}return{listNode:h,nextIndex:a}}};var L=/^h[1-6]$/,J=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);B.prototype={exec:function(b){this.refresh(b,b.elementPath());var m=b.config,e=b.getSelection(),c=e&&e.getRanges();if(this.state==CKEDITOR.TRISTATE_OFF){var f=b.editable();if(f.getFirst(u)){var g=1==c.length&&c[0];(m=g&&g.getEnclosedNode())&&m.is&&this.type==m.getName()&&this.setState(CKEDITOR.TRISTATE_ON)}else m.enterMode==
  1023. CKEDITOR.ENTER_BR?f.appendBogus():c[0].fixBlock(1,m.enterMode==CKEDITOR.ENTER_P?"p":"div"),e.selectRanges(c)}for(var m=e.createBookmarks(!0),f=[],k={},c=c.createIterator(),h=0;(g=c.getNextRange())&&++h;){var d=g.getBoundaryNodes(),a=d.startNode,p=d.endNode;a.type==CKEDITOR.NODE_ELEMENT&&"td"==a.getName()&&g.setStartAt(d.startNode,CKEDITOR.POSITION_AFTER_START);p.type==CKEDITOR.NODE_ELEMENT&&"td"==p.getName()&&g.setEndAt(d.endNode,CKEDITOR.POSITION_BEFORE_END);g=g.createIterator();for(g.forceBrBreak=
  1024. this.state==CKEDITOR.TRISTATE_OFF;d=g.getNextParagraph();)if(!d.getCustomData("list_block")){CKEDITOR.dom.element.setMarker(k,d,"list_block",1);for(var l=b.elementPath(d),a=l.elements,p=0,l=l.blockLimit,q,n=a.length-1;0<=n&&(q=a[n]);n--)if(v[q.getName()]&&l.contains(q)){l.removeCustomData("list_group_object_"+h);(a=q.getCustomData("list_group_object"))?a.contents.push(d):(a={root:q,contents:[d]},f.push(a),CKEDITOR.dom.element.setMarker(k,q,"list_group_object",a));p=1;break}p||(p=l,p.getCustomData("list_group_object_"+
  1025. h)?p.getCustomData("list_group_object_"+h).contents.push(d):(a={root:p,contents:[d]},CKEDITOR.dom.element.setMarker(k,p,"list_group_object_"+h,a),f.push(a)))}}for(q=[];0<f.length;)if(a=f.shift(),this.state==CKEDITOR.TRISTATE_OFF)if(v[a.root.getName()]){c=b;h=a;a=k;g=q;p=CKEDITOR.plugins.list.listToArray(h.root,a);l=[];for(d=0;d<h.contents.length;d++)n=h.contents[d],(n=n.getAscendant("li",!0))&&!n.getCustomData("list_item_processed")&&(l.push(n),CKEDITOR.dom.element.setMarker(a,n,"list_item_processed",
  1026. !0));for(var n=h.root.getDocument(),t=void 0,r=void 0,d=0;d<l.length;d++){var y=l[d].getCustomData("listarray_index"),t=p[y].parent;t.is(this.type)||(r=n.createElement(this.type),t.copyAttributes(r,{start:1,type:1}),r.removeStyle("list-style-type"),p[y].parent=r)}a=CKEDITOR.plugins.list.arrayToList(p,a,null,c.config.enterMode);p=void 0;l=a.listNode.getChildCount();for(d=0;d<l&&(p=a.listNode.getChild(d));d++)p.getName()==this.type&&g.push(p);a.listNode.replace(h.root);c.fire("contentDomInvalidated")}else{p=
  1027. b;g=a;d=q;l=g.contents;c=g.root.getDocument();h=[];1==l.length&&l[0].equals(g.root)&&(a=c.createElement("div"),l[0].moveChildren&&l[0].moveChildren(a),l[0].append(a),l[0]=a);g=g.contents[0].getParent();for(n=0;n<l.length;n++)g=g.getCommonAncestor(l[n].getParent());t=p.config.useComputedState;p=a=void 0;t=void 0===t||t;for(n=0;n<l.length;n++)for(r=l[n];y=r.getParent();){if(y.equals(g)){h.push(r);!p&&r.getDirection()&&(p=1);r=r.getDirection(t);null!==a&&(a=a&&a!=r?null:r);break}r=y}if(!(1>h.length)){l=
  1028. h[h.length-1].getNext();n=c.createElement(this.type);d.push(n);for(t=d=void 0;h.length;)d=h.shift(),t=c.createElement("li"),r=d,r.is("pre")||L.test(r.getName())||"false"==r.getAttribute("contenteditable")?d.appendTo(t):(d.copyAttributes(t),a&&d.getDirection()&&(t.removeStyle("direction"),t.removeAttribute("dir")),d.moveChildren(t),d.remove()),t.appendTo(n);a&&p&&n.setAttribute("dir",a);l?n.insertBefore(l):n.appendTo(g)}}else this.state==CKEDITOR.TRISTATE_ON&&v[a.root.getName()]&&I.call(this,b,a,k);
  1029. for(n=0;n<q.length;n++)F(q[n]);CKEDITOR.dom.element.clearAllMarkers(k);e.selectBookmarks(m);b.focus()},refresh:function(b,m){var e=m.contains(v,1),c=m.blockLimit||m.root;e&&c.contains(e)?this.setState(e.is(this.type)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.plugins.add("list",{requires:"indentlist",init:function(b){b.blockless||(b.addCommand("numberedlist",new B("numberedlist","ol")),b.addCommand("bulletedlist",new B("bulletedlist","ul")),b.ui.addButton&&
  1030. (b.ui.addButton("NumberedList",{label:b.lang.list.numberedlist,command:"numberedlist",directional:!0,toolbar:"list,10"}),b.ui.addButton("BulletedList",{label:b.lang.list.bulletedlist,command:"bulletedlist",directional:!0,toolbar:"list,20"})),b.on("key",function(m){var e=m.data.domEvent.getKey(),c;if("wysiwyg"==b.mode&&e in{8:1,46:1}){var f=b.getSelection().getRanges()[0],g=f&&f.startPath();if(f&&f.collapsed){var k=8==e,h=b.editable(),d=new CKEDITOR.dom.walker(f.clone());d.evaluator=function(a){return u(a)&&
  1031. !z(a)};d.guard=function(a,b){return!(b&&a.type==CKEDITOR.NODE_ELEMENT&&a.is("table"))};e=f.clone();if(k){var a;(a=g.contains(v))&&f.checkBoundaryOfElement(a,CKEDITOR.START)&&(a=a.getParent())&&a.is("li")&&(a=A(a))?(c=a,a=a.getPrevious(u),e.moveToPosition(a&&z(a)?a:c,CKEDITOR.POSITION_BEFORE_START)):(d.range.setStartAt(h,CKEDITOR.POSITION_AFTER_START),d.range.setEnd(f.startContainer,f.startOffset),(a=d.previous())&&a.type==CKEDITOR.NODE_ELEMENT&&(a.getName()in v||a.is("li"))&&(a.is("li")||(d.range.selectNodeContents(a),
  1032. d.reset(),d.evaluator=G,a=d.previous()),c=a,e.moveToElementEditEnd(c),e.moveToPosition(e.endPath().block,CKEDITOR.POSITION_BEFORE_END)));if(c)C(b,e,f),m.cancel();else{var p=g.contains(v);p&&f.checkBoundaryOfElement(p,CKEDITOR.START)&&(c=p.getFirst(u),f.checkBoundaryOfElement(c,CKEDITOR.START)&&(a=p.getPrevious(u),A(c)?a&&(f.moveToElementEditEnd(a),f.select()):b.execCommand("outdent"),m.cancel()))}}else if(c=g.contains("li")){if(d.range.setEndAt(h,CKEDITOR.POSITION_BEFORE_END),k=(h=c.getLast(u))&&
  1033. G(h)?h:c,g=0,(a=d.next())&&a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in v&&a.equals(h)?(g=1,a=d.next()):f.checkBoundaryOfElement(k,CKEDITOR.END)&&(g=2),g&&a){f=f.clone();f.moveToElementEditStart(a);if(1==g&&(e.optimize(),!e.startContainer.equals(c))){for(c=e.startContainer;c.is(CKEDITOR.dtd.$inline);)p=c,c=c.getParent();p&&e.moveToPosition(p,CKEDITOR.POSITION_AFTER_END)}2==g&&(e.moveToPosition(e.endPath().block,CKEDITOR.POSITION_BEFORE_END),f.endPath().block&&f.moveToPosition(f.endPath().block,CKEDITOR.POSITION_AFTER_START));
  1034. C(b,e,f);m.cancel()}}else d.range.setEndAt(h,CKEDITOR.POSITION_BEFORE_END),(a=d.next())&&a.type==CKEDITOR.NODE_ELEMENT&&a.is(v)&&(a=a.getFirst(u),g.block&&f.checkStartOfBlock()&&f.checkEndOfBlock()?(g.block.remove(),f.moveToElementEditStart(a),f.select()):A(a)?(f.moveToElementEditStart(a),f.select()):(f=f.clone(),f.moveToElementEditStart(a),C(b,e,f)),m.cancel());setTimeout(function(){b.selectionChange(1)})}}}))}})})();(function(){CKEDITOR.plugins.liststyle={requires:"dialog,contextmenu",init:function(a){if(!a.blockless){var b;b=new CKEDITOR.dialogCommand("numberedListStyle",{requiredContent:"ol",allowedContent:"ol{list-style-type}[start]"});b=a.addCommand("numberedListStyle",b);a.addFeature(b);CKEDITOR.dialog.add("numberedListStyle",this.path+"dialogs/liststyle.js");b=new CKEDITOR.dialogCommand("bulletedListStyle",{requiredContent:"ul",allowedContent:"ul{list-style-type}"});b=a.addCommand("bulletedListStyle",b);
  1035. a.addFeature(b);CKEDITOR.dialog.add("bulletedListStyle",this.path+"dialogs/liststyle.js");a.addMenuGroup("list",108);a.addMenuItems({numberedlist:{label:a.lang.liststyle.numberedTitle,group:"list",command:"numberedListStyle"},bulletedlist:{label:a.lang.liststyle.bulletedTitle,group:"list",command:"bulletedListStyle"}});a.contextMenu.addListener(function(a){if(!a||a.isReadOnly())return null;for(;a;){var b=a.getName();if("ol"==b)return{numberedlist:CKEDITOR.TRISTATE_OFF};if("ul"==b)return{bulletedlist:CKEDITOR.TRISTATE_OFF};
  1036. a=a.getParent()}return null})}}};CKEDITOR.plugins.add("liststyle",CKEDITOR.plugins.liststyle)})();(function(){function V(a,c,d){return n(c)&&n(d)&&d.equals(c.getNext(function(a){return!(E(a)||F(a)||u(a))}))}function z(a){this.upper=a[0];this.lower=a[1];this.set.apply(this,a.slice(2))}function O(a){var c=a.element;if(c&&n(c)&&(c=c.getAscendant(a.triggers,!0))&&a.editable.contains(c)){var d=P(c);if("true"==d.getAttribute("contenteditable"))return c;if(d.is(a.triggers))return d}return null}function ka(a,c,d){r(a,c);r(a,d);a=c.size.bottom;d=d.size.top;return a&&d?0|(a+d)/2:a||d}function w(a,c,d){return c=
  1037. c[d?"getPrevious":"getNext"](function(b){return b&&b.type==CKEDITOR.NODE_TEXT&&!E(b)||n(b)&&!u(b)&&!A(a,b)})}function q(a,c,d){return a>c&&a<d}function P(a,c){if(a.data("cke-editable"))return null;for(c||(a=a.getParent());a&&!a.data("cke-editable");){if(a.hasAttribute("contenteditable"))return a;a=a.getParent()}return null}function la(a){var c=a.doc,d=G('\x3cspan contenteditable\x3d"false" style\x3d"'+Q+"position:absolute;border-top:1px dashed "+a.boxColor+'"\x3e\x3c/span\x3e',c),b=CKEDITOR.getUrl(this.path+
  1038. "images/"+(t.hidpi?"hidpi/":"")+"icon"+(a.rtl?"-rtl":"")+".png");v(d,{attach:function(){this.wrap.getParent()||this.wrap.appendTo(a.editable,!0);return this},lineChildren:[v(G('\x3cspan title\x3d"'+a.editor.lang.magicline.title+'" contenteditable\x3d"false"\x3e\x26#8629;\x3c/span\x3e',c),{base:Q+"height:17px;width:17px;"+(a.rtl?"left":"right")+":17px;background:url("+b+") center no-repeat "+a.boxColor+";cursor:pointer;"+(t.hc?"font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;":
  1039. "")+(t.hidpi?"background-size: 9px 10px;":""),looks:["top:-8px; border-radius: 2px;","top:-17px; border-radius: 2px 2px 0px 0px;","top:-1px; border-radius: 0px 0px 2px 2px;"]}),v(G(W,c),{base:X+"left:0px;border-left-color:"+a.boxColor+";",looks:["border-width:8px 0 8px 8px;top:-8px","border-width:8px 0 0 8px;top:-8px","border-width:0 0 8px 8px;top:0px"]}),v(G(W,c),{base:X+"right:0px;border-right-color:"+a.boxColor+";",looks:["border-width:8px 8px 8px 0;top:-8px","border-width:8px 8px 0 0;top:-8px",
  1040. "border-width:0 8px 8px 0;top:0px"]})],detach:function(){this.wrap.getParent()&&this.wrap.remove();return this},mouseNear:function(){r(a,this);var b=a.holdDistance,c=this.size;return c&&q(a.mouse.y,c.top-b,c.bottom+b)&&q(a.mouse.x,c.left-b,c.right+b)?!0:!1},place:function(){var b=a.view,c=a.editable,d=a.trigger,h=d.upper,g=d.lower,l=h||g,p=l.getParent(),m={};this.trigger=d;h&&r(a,h,!0);g&&r(a,g,!0);r(a,p,!0);a.inInlineMode&&H(a,!0);p.equals(c)?(m.left=b.scroll.x,m.right=-b.scroll.x,m.width=""):(m.left=
  1041. l.size.left-l.size.margin.left+b.scroll.x-(a.inInlineMode?b.editable.left+b.editable.border.left:0),m.width=l.size.outerWidth+l.size.margin.left+l.size.margin.right+b.scroll.x,m.right="");h&&g?m.top=h.size.margin.bottom===g.size.margin.top?0|h.size.bottom+h.size.margin.bottom/2:h.size.margin.bottom<g.size.margin.top?h.size.bottom+h.size.margin.bottom:h.size.bottom+h.size.margin.bottom-g.size.margin.top:h?g||(m.top=h.size.bottom+h.size.margin.bottom):m.top=g.size.top-g.size.margin.top;d.is(C)||q(m.top,
  1042. b.scroll.y-15,b.scroll.y+5)?(m.top=a.inInlineMode?0:b.scroll.y,this.look(C)):d.is(D)||q(m.top,b.pane.bottom-5,b.pane.bottom+15)?(m.top=a.inInlineMode?b.editable.height+b.editable.padding.top+b.editable.padding.bottom:b.pane.bottom-1,this.look(D)):(a.inInlineMode&&(m.top-=b.editable.top+b.editable.border.top),this.look(x));a.inInlineMode&&(m.top--,m.top+=b.editable.scroll.top,m.left+=b.editable.scroll.left);for(var n in m)m[n]=CKEDITOR.tools.cssLength(m[n]);this.setStyles(m)},look:function(a){if(this.oldLook!=
  1043. a){for(var b=this.lineChildren.length,c;b--;)(c=this.lineChildren[b]).setAttribute("style",c.base+c.looks[0|a/2]);this.oldLook=a}},wrap:new R("span",a.doc)});for(c=d.lineChildren.length;c--;)d.lineChildren[c].appendTo(d);d.look(x);d.appendTo(d.wrap);d.unselectable();d.lineChildren[0].on("mouseup",function(b){d.detach();S(a,function(b){var c=a.line.trigger;b[c.is(I)?"insertBefore":"insertAfter"](c.is(I)?c.lower:c.upper)},!0);a.editor.focus();t.ie||a.enterMode==CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView();
  1044. b.data.preventDefault(!0)});d.on("mousedown",function(a){a.data.preventDefault(!0)});a.line=d}function S(a,c,d){var b=new CKEDITOR.dom.range(a.doc),e=a.editor,f;t.ie&&a.enterMode==CKEDITOR.ENTER_BR?f=a.doc.createText(J):(f=(f=P(a.element,!0))&&f.data("cke-enter-mode")||a.enterMode,f=new R(K[f],a.doc),f.is("br")||a.doc.createText(J).appendTo(f));d&&e.fire("saveSnapshot");c(f);b.moveToPosition(f,CKEDITOR.POSITION_AFTER_START);e.getSelection().selectRanges([b]);a.hotNode=f;d&&e.fire("saveSnapshot")}
  1045. function Y(a,c){return{canUndo:!0,modes:{wysiwyg:1},exec:function(){function d(b){var d=t.ie&&9>t.version?" ":J,f=a.hotNode&&a.hotNode.getText()==d&&a.element.equals(a.hotNode)&&a.lastCmdDirection===!!c;S(a,function(d){f&&a.hotNode&&a.hotNode.remove();d[c?"insertAfter":"insertBefore"](b);d.setAttributes({"data-cke-magicline-hot":1,"data-cke-magicline-dir":!!c});a.lastCmdDirection=!!c});t.ie||a.enterMode==CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView();a.line.detach()}return function(b){b=b.getSelection().getStartElement();
  1046. var e;b=b.getAscendant(Z,1);if(!aa(a,b)&&b&&!b.equals(a.editable)&&!b.contains(a.editable)){(e=P(b))&&"false"==e.getAttribute("contenteditable")&&(b=e);a.element=b;e=w(a,b,!c);var f;n(e)&&e.is(a.triggers)&&e.is(ma)&&(!w(a,e,!c)||(f=w(a,e,!c))&&n(f)&&f.is(a.triggers))?d(e):(f=O(a,b),n(f)&&(w(a,f,!c)?(b=w(a,f,!c))&&n(b)&&b.is(a.triggers)&&d(f):d(f)))}}}()}}function A(a,c){if(!c||c.type!=CKEDITOR.NODE_ELEMENT||!c.$)return!1;var d=a.line;return d.wrap.equals(c)||d.wrap.contains(c)}function n(a){return a&&
  1047. a.type==CKEDITOR.NODE_ELEMENT&&a.$}function u(a){if(!n(a))return!1;var c;(c=ba(a))||(n(a)?(c={left:1,right:1,center:1},c=!(!c[a.getComputedStyle("float")]&&!c[a.getAttribute("align")])):c=!1);return c}function ba(a){return!!{absolute:1,fixed:1}[a.getComputedStyle("position")]}function L(a,c){return n(c)?c.is(a.triggers):null}function aa(a,c){if(!c)return!1;for(var d=c.getParents(1),b=d.length;b--;)for(var e=a.tabuList.length;e--;)if(d[b].hasAttribute(a.tabuList[e]))return!0;return!1}function na(a,
  1048. c,d){c=c[d?"getLast":"getFirst"](function(b){return a.isRelevant(b)&&!b.is(oa)});if(!c)return!1;r(a,c);return d?c.size.top>a.mouse.y:c.size.bottom<a.mouse.y}function ca(a){var c=a.editable,d=a.mouse,b=a.view,e=a.triggerOffset;H(a);var f=d.y>(a.inInlineMode?b.editable.top+b.editable.height/2:Math.min(b.editable.height,b.pane.height)/2),c=c[f?"getLast":"getFirst"](function(a){return!(E(a)||F(a))});if(!c)return null;A(a,c)&&(c=a.line.wrap[f?"getPrevious":"getNext"](function(a){return!(E(a)||F(a))}));
  1049. if(!n(c)||u(c)||!L(a,c))return null;r(a,c);return!f&&0<=c.size.top&&q(d.y,0,c.size.top+e)?(a=a.inInlineMode||0===b.scroll.y?C:x,new z([null,c,I,M,a])):f&&c.size.bottom<=b.pane.height&&q(d.y,c.size.bottom-e,b.pane.height)?(a=a.inInlineMode||q(c.size.bottom,b.pane.height-e,b.pane.height)?D:x,new z([c,null,da,M,a])):null}function ea(a){var c=a.mouse,d=a.view,b=a.triggerOffset,e=O(a);if(!e)return null;r(a,e);var b=Math.min(b,0|e.size.outerHeight/2),f=[],k,h;if(q(c.y,e.size.top-1,e.size.top+b))h=!1;else if(q(c.y,
  1050. e.size.bottom-b,e.size.bottom+1))h=!0;else return null;if(u(e)||na(a,e,h)||e.getParent().is(fa))return null;var g=w(a,e,!h);if(g){if(g&&g.type==CKEDITOR.NODE_TEXT)return null;if(n(g)){if(u(g)||!L(a,g)||g.getParent().is(fa))return null;f=[g,e][h?"reverse":"concat"]().concat([T,M])}}else e.equals(a.editable[h?"getLast":"getFirst"](a.isRelevant))?(H(a),h&&q(c.y,e.size.bottom-b,d.pane.height)&&q(e.size.bottom,d.pane.height-b,d.pane.height)?k=D:q(c.y,0,e.size.top+b)&&(k=C)):k=x,f=[null,e][h?"reverse":
  1051. "concat"]().concat([h?da:I,M,k,e.equals(a.editable[h?"getLast":"getFirst"](a.isRelevant))?h?D:C:x]);return 0 in f?new z(f):null}function U(a,c,d,b){for(var e=c.getDocumentPosition(),f={},k={},h={},g={},l=y.length;l--;)f[y[l]]=parseInt(c.getComputedStyle.call(c,"border-"+y[l]+"-width"),10)||0,h[y[l]]=parseInt(c.getComputedStyle.call(c,"padding-"+y[l]),10)||0,k[y[l]]=parseInt(c.getComputedStyle.call(c,"margin-"+y[l]),10)||0;d&&!b||N(a,b);g.top=e.y-(d?0:a.view.scroll.y);g.left=e.x-(d?0:a.view.scroll.x);
  1052. g.outerWidth=c.$.offsetWidth;g.outerHeight=c.$.offsetHeight;g.height=g.outerHeight-(h.top+h.bottom+f.top+f.bottom);g.width=g.outerWidth-(h.left+h.right+f.left+f.right);g.bottom=g.top+g.outerHeight;g.right=g.left+g.outerWidth;a.inInlineMode&&(g.scroll={top:c.$.scrollTop,left:c.$.scrollLeft});return v({border:f,padding:h,margin:k,ignoreScroll:d},g,!0)}function r(a,c,d){if(!n(c))return c.size=null;if(!c.size)c.size={};else if(c.size.ignoreScroll==d&&c.size.date>new Date-ga)return null;return v(c.size,
  1053. U(a,c,d),{date:+new Date},!0)}function H(a,c){a.view.editable=U(a,a.editable,c,!0)}function N(a,c){a.view||(a.view={});var d=a.view;if(!(!c&&d&&d.date>new Date-ga)){var b=a.win,d=b.getScrollPosition(),b=b.getViewPaneSize();v(a.view,{scroll:{x:d.x,y:d.y,width:a.doc.$.documentElement.scrollWidth-b.width,height:a.doc.$.documentElement.scrollHeight-b.height},pane:{width:b.width,height:b.height,bottom:b.height+d.y},date:+new Date},!0)}}function pa(a,c,d,b){for(var e=b,f=b,k=0,h=!1,g=!1,l=a.view.pane.height,
  1054. p=a.mouse;p.y+k<l&&0<p.y-k;){h||(h=c(e,b));g||(g=c(f,b));!h&&0<p.y-k&&(e=d(a,{x:p.x,y:p.y-k}));!g&&p.y+k<l&&(f=d(a,{x:p.x,y:p.y+k}));if(h&&g)break;k+=2}return new z([e,f,null,null])}CKEDITOR.plugins.add("magicline",{init:function(a){var c=a.config,d=c.magicline_triggerOffset||30,b={editor:a,enterMode:c.enterMode,triggerOffset:d,holdDistance:0|d*(c.magicline_holdDistance||.5),boxColor:c.magicline_color||"#ff0000",rtl:"rtl"==c.contentsLangDirection,tabuList:["data-cke-hidden-sel"].concat(c.magicline_tabuList||
  1055. []),triggers:c.magicline_everywhere?Z:{table:1,hr:1,div:1,ul:1,ol:1,dl:1,form:1,blockquote:1}},e,f,k;b.isRelevant=function(a){return n(a)&&!A(b,a)&&!u(a)};a.on("contentDom",function(){var d=a.editable(),g=a.document,l=a.window;v(b,{editable:d,inInlineMode:d.isInline(),doc:g,win:l,hotNode:null},!0);b.boundary=b.inInlineMode?b.editable:b.doc.getDocumentElement();d.is(B.$inline)||(b.inInlineMode&&!ba(d)&&d.setStyles({position:"relative",top:null,left:null}),la.call(this,b),N(b),d.attachListener(a,"beforeUndoImage",
  1056. function(){b.line.detach()}),d.attachListener(a,"beforeGetData",function(){b.line.wrap.getParent()&&(b.line.detach(),a.once("getData",function(){b.line.attach()},null,null,1E3))},null,null,0),d.attachListener(b.inInlineMode?g:g.getWindow().getFrame(),"mouseout",function(c){if("wysiwyg"==a.mode)if(b.inInlineMode){var d=c.data.$.clientX;c=c.data.$.clientY;N(b);H(b,!0);var e=b.view.editable,f=b.view.scroll;d>e.left-f.x&&d<e.right-f.x&&c>e.top-f.y&&c<e.bottom-f.y||(clearTimeout(k),k=null,b.line.detach())}else clearTimeout(k),
  1057. k=null,b.line.detach()}),d.attachListener(d,"keyup",function(){b.hiddenMode=0}),d.attachListener(d,"keydown",function(c){if("wysiwyg"==a.mode)switch(c.data.getKeystroke()){case 2228240:case 16:b.hiddenMode=1,b.line.detach()}}),d.attachListener(b.inInlineMode?d:g,"mousemove",function(c){f=!0;if("wysiwyg"==a.mode&&!a.readOnly&&!k){var d={x:c.data.$.clientX,y:c.data.$.clientY};k=setTimeout(function(){b.mouse=d;k=b.trigger=null;N(b);f&&!b.hiddenMode&&a.focusManager.hasFocus&&!b.line.mouseNear()&&(b.element=
  1058. ha(b,!0))&&((b.trigger=ca(b)||ea(b)||ia(b))&&!aa(b,b.trigger.upper||b.trigger.lower)?b.line.attach().place():(b.trigger=null,b.line.detach()),f=!1)},30)}}),d.attachListener(l,"scroll",function(){"wysiwyg"==a.mode&&(b.line.detach(),t.webkit&&(b.hiddenMode=1,clearTimeout(e),e=setTimeout(function(){b.mouseDown||(b.hiddenMode=0)},50)))}),d.attachListener(ja?g:l,"mousedown",function(){"wysiwyg"==a.mode&&(b.line.detach(),b.hiddenMode=1,b.mouseDown=1)}),d.attachListener(ja?g:l,"mouseup",function(){b.hiddenMode=
  1059. 0;b.mouseDown=0}),a.addCommand("accessPreviousSpace",Y(b)),a.addCommand("accessNextSpace",Y(b,!0)),a.setKeystroke([[c.magicline_keystrokePrevious,"accessPreviousSpace"],[c.magicline_keystrokeNext,"accessNextSpace"]]),a.on("loadSnapshot",function(){var c,d,e,f;for(f in{p:1,br:1,div:1})for(c=a.document.getElementsByTag(f),e=c.count();e--;)if((d=c.getItem(e)).data("cke-magicline-hot")){b.hotNode=d;b.lastCmdDirection="true"===d.data("cke-magicline-dir")?!0:!1;return}}),this.backdoor={accessFocusSpace:S,
  1060. boxTrigger:z,isLine:A,getAscendantTrigger:O,getNonEmptyNeighbour:w,getSize:U,that:b,triggerEdge:ea,triggerEditable:ca,triggerExpand:ia})},this)}});var v=CKEDITOR.tools.extend,R=CKEDITOR.dom.element,G=R.createFromHtml,t=CKEDITOR.env,ja=CKEDITOR.env.ie&&9>CKEDITOR.env.version,B=CKEDITOR.dtd,K={},I=128,da=64,T=32,M=16,C=4,D=2,x=1,J=" ",fa=B.$listItem,oa=B.$tableContent,ma=v({},B.$nonEditable,B.$empty),Z=B.$block,ga=100,Q="width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",
  1061. X=Q+"border-color:transparent;display:block;border-style:solid;",W="\x3cspan\x3e"+J+"\x3c/span\x3e";K[CKEDITOR.ENTER_BR]="br";K[CKEDITOR.ENTER_P]="p";K[CKEDITOR.ENTER_DIV]="div";z.prototype={set:function(a,c,d){this.properties=a+c+(d||x);return this},is:function(a){return(this.properties&a)==a}};var ha=function(){function a(a,d){var b=a.$.elementFromPoint(d.x,d.y);return b&&b.nodeType?new CKEDITOR.dom.element(b):null}return function(c,d,b){if(!c.mouse)return null;var e=c.doc,f=c.line.wrap;b=b||c.mouse;
  1062. var k=a(e,b);d&&A(c,k)&&(f.hide(),k=a(e,b),f.show());return!k||k.type!=CKEDITOR.NODE_ELEMENT||!k.$||t.ie&&9>t.version&&!c.boundary.equals(k)&&!c.boundary.contains(k)?null:k}}(),E=CKEDITOR.dom.walker.whitespaces(),F=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),ia=function(){function a(a){var b=a.element,e,f,k;if(!n(b)||b.contains(a.editable)||b.isReadOnly())return null;k=pa(a,function(a,b){return!b.equals(a)},function(a,b){return ha(a,!0,b)},b);e=k.upper;f=k.lower;if(V(a,e,f))return k.set(T,
  1063. 8);if(e&&b.contains(e))for(;!e.getParent().equals(b);)e=e.getParent();else e=b.getFirst(function(b){return c(a,b)});if(f&&b.contains(f))for(;!f.getParent().equals(b);)f=f.getParent();else f=b.getLast(function(b){return c(a,b)});if(!e||!f)return null;r(a,e);r(a,f);if(!q(a.mouse.y,e.size.top,f.size.bottom))return null;for(var b=Number.MAX_VALUE,h,g,l,p;f&&!f.equals(e)&&(g=e.getNext(a.isRelevant));)h=Math.abs(ka(a,e,g)-a.mouse.y),h<b&&(b=h,l=e,p=g),e=g,r(a,e);if(!l||!p||!q(a.mouse.y,l.size.top,p.size.bottom))return null;
  1064. k.upper=l;k.lower=p;return k.set(T,8)}function c(a,b){return!(b&&b.type==CKEDITOR.NODE_TEXT||F(b)||u(b)||A(a,b)||b.type==CKEDITOR.NODE_ELEMENT&&b.$&&b.is("br"))}return function(c){var b=a(c),e;if(e=b){e=b.upper;var f=b.lower;e=!e||!f||u(f)||u(e)||f.equals(e)||e.equals(f)||f.contains(e)||e.contains(f)?!1:L(c,e)&&L(c,f)&&V(c,e,f)?!0:!1}return e?b:null}}(),y=["top","left","right","bottom"]})();CKEDITOR.config.magicline_keystrokePrevious=CKEDITOR.CTRL+CKEDITOR.SHIFT+51;
  1065. CKEDITOR.config.magicline_keystrokeNext=CKEDITOR.CTRL+CKEDITOR.SHIFT+52;(function(){function n(a){if(!a||a.type!=CKEDITOR.NODE_ELEMENT||"form"!=a.getName())return[];for(var e=[],f=["style","className"],b=0;b<f.length;b++){var c=a.$.elements.namedItem(f[b]);c&&(c=new CKEDITOR.dom.element(c),e.push([c,c.nextSibling]),c.remove())}return e}function t(a,e){if(a&&a.type==CKEDITOR.NODE_ELEMENT&&"form"==a.getName()&&0<e.length)for(var f=e.length-1;0<=f;f--){var b=e[f][0],c=e[f][1];c?b.insertBefore(c):b.appendTo(a)}}function r(a,e){var f=n(a),b={},c=a.$;e||(b["class"]=c.className||
  1066. "",c.className="");b.inline=c.style.cssText||"";e||(c.style.cssText="position: static; overflow: visible");t(f);return b}function u(a,e){var f=n(a),b=a.$;"class"in e&&(b.className=e["class"]);"inline"in e&&(b.style.cssText=e.inline);t(f)}function v(a){if(!a.editable().isInline()){var e=CKEDITOR.instances,f;for(f in e){var b=e[f];"wysiwyg"!=b.mode||b.readOnly||(b=b.document.getBody(),b.setAttribute("contentEditable",!1),b.setAttribute("contentEditable",!0))}a.editable().hasFocus&&(a.toolbox.focus(),
  1067. a.focus())}}CKEDITOR.plugins.add("maximize",{init:function(a){function e(){var b=c.getViewPaneSize();a.resize(b.width,b.height,null,!0)}if(a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var f=a.lang,b=CKEDITOR.document,c=b.getWindow(),l,m,p,n=CKEDITOR.TRISTATE_OFF;a.addCommand("maximize",{modes:{wysiwyg:!CKEDITOR.env.iOS,source:!CKEDITOR.env.iOS},readOnly:1,editorFocus:!1,exec:function(){var h=a.container.getFirst(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasClass("cke_inner")}),g=a.ui.space("contents");
  1068. if("wysiwyg"==a.mode){var d=a.getSelection();l=d&&d.getRanges();m=c.getScrollPosition()}else{var k=a.editable().$;l=!CKEDITOR.env.ie&&[k.selectionStart,k.selectionEnd];m=[k.scrollLeft,k.scrollTop]}if(this.state==CKEDITOR.TRISTATE_OFF){c.on("resize",e);p=c.getScrollPosition();for(d=a.container;d=d.getParent();)d.setCustomData("maximize_saved_styles",r(d)),d.setStyle("z-index",a.config.baseFloatZIndex-5);g.setCustomData("maximize_saved_styles",r(g,!0));h.setCustomData("maximize_saved_styles",r(h,!0));
  1069. g={overflow:CKEDITOR.env.webkit?"":"hidden",width:0,height:0};b.getDocumentElement().setStyles(g);!CKEDITOR.env.gecko&&b.getDocumentElement().setStyle("position","fixed");CKEDITOR.env.gecko&&CKEDITOR.env.quirks||b.getBody().setStyles(g);CKEDITOR.env.ie?setTimeout(function(){c.$.scrollTo(0,0)},0):c.$.scrollTo(0,0);h.setStyle("position",CKEDITOR.env.gecko&&CKEDITOR.env.quirks?"fixed":"absolute");h.$.offsetLeft;h.setStyles({"z-index":a.config.baseFloatZIndex-5,left:"0px",top:"0px"});h.addClass("cke_maximized");
  1070. e();g=h.getDocumentPosition();h.setStyles({left:-1*g.x+"px",top:-1*g.y+"px"});CKEDITOR.env.gecko&&v(a)}else if(this.state==CKEDITOR.TRISTATE_ON){c.removeListener("resize",e);for(var d=[g,h],q=0;q<d.length;q++)u(d[q],d[q].getCustomData("maximize_saved_styles")),d[q].removeCustomData("maximize_saved_styles");for(d=a.container;d=d.getParent();)u(d,d.getCustomData("maximize_saved_styles")),d.removeCustomData("maximize_saved_styles");CKEDITOR.env.ie?setTimeout(function(){c.$.scrollTo(p.x,p.y)},0):c.$.scrollTo(p.x,
  1071. p.y);h.removeClass("cke_maximized");CKEDITOR.env.webkit&&(h.setStyle("display","inline"),setTimeout(function(){h.setStyle("display","block")},0));a.fire("resize",{outerHeight:a.container.$.offsetHeight,contentsHeight:g.$.offsetHeight,outerWidth:a.container.$.offsetWidth})}this.toggleState();if(d=this.uiItems[0])g=this.state==CKEDITOR.TRISTATE_OFF?f.maximize.maximize:f.maximize.minimize,d=CKEDITOR.document.getById(d._.id),d.getChild(1).setHtml(g),d.setAttribute("title",g),d.setAttribute("href",'javascript:void("'+
  1072. g+'");');"wysiwyg"==a.mode?l?(CKEDITOR.env.gecko&&v(a),a.getSelection().selectRanges(l),(k=a.getSelection().getStartElement())&&k.scrollIntoView(!0)):c.$.scrollTo(m.x,m.y):(l&&(k.selectionStart=l[0],k.selectionEnd=l[1]),k.scrollLeft=m[0],k.scrollTop=m[1]);l=m=null;n=this.state;a.fire("maximize",this.state)},canUndo:!1});a.ui.addButton&&a.ui.addButton("Maximize",{label:f.maximize.maximize,command:"maximize",toolbar:"tools,10"});a.on("mode",function(){var b=a.getCommand("maximize");b.setState(b.state==
  1073. CKEDITOR.TRISTATE_DISABLED?CKEDITOR.TRISTATE_DISABLED:n)},null,null,100)}}})})();CKEDITOR.plugins.add("newpage",{init:function(a){a.addCommand("newpage",{modes:{wysiwyg:1,source:1},exec:function(b){var a=this;b.setData(b.config.newpage_html||"",function(){b.focus();setTimeout(function(){b.fire("afterCommandExec",{name:"newpage",command:a});b.selectionChange()},200)})},async:!0});a.ui.addButton&&a.ui.addButton("NewPage",{label:a.lang.newpage.toolbar,command:"newpage",toolbar:"document,20"})}});(function(){function e(a){return{"aria-label":a,"class":"cke_pagebreak",contenteditable:"false","data-cke-display-name":"pagebreak","data-cke-pagebreak":1,style:"page-break-after: always",title:a}}CKEDITOR.plugins.add("pagebreak",{requires:"fakeobjects",onLoad:function(){var a=("background:url("+CKEDITOR.getUrl(this.path+"images/pagebreak.gif")+") no-repeat center center;clear:both;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;padding:0;height:7px;cursor:default;").replace(/;/g,
  1074. " !important;");CKEDITOR.addCss("div.cke_pagebreak{"+a+"}")},init:function(a){a.blockless||(a.addCommand("pagebreak",CKEDITOR.plugins.pagebreakCmd),a.ui.addButton&&a.ui.addButton("PageBreak",{label:a.lang.pagebreak.toolbar,command:"pagebreak",toolbar:"insert,70"}),CKEDITOR.env.webkit&&a.on("contentDom",function(){a.document.on("click",function(b){b=b.data.getTarget();b.is("div")&&b.hasClass("cke_pagebreak")&&a.getSelection().selectElement(b)})}))},afterInit:function(a){function b(f){CKEDITOR.tools.extend(f.attributes,
  1075. e(a.lang.pagebreak.alt),!0);f.children.length=0}var c=a.dataProcessor,g=c&&c.dataFilter,c=c&&c.htmlFilter,h=/page-break-after\s*:\s*always/i,k=/display\s*:\s*none/i;c&&c.addRules({attributes:{"class":function(a,b){var c=a.replace("cke_pagebreak","");if(c!=a){var d=CKEDITOR.htmlParser.fragment.fromHtml('\x3cspan style\x3d"display: none;"\x3e\x26nbsp;\x3c/span\x3e').children[0];b.children.length=0;b.add(d);d=b.attributes;delete d["aria-label"];delete d.contenteditable;delete d.title}return c}}},{applyToAll:!0,
  1076. priority:5});g&&g.addRules({elements:{div:function(a){if(a.attributes["data-cke-pagebreak"])b(a);else if(h.test(a.attributes.style)){var c=a.children[0];c&&"span"==c.name&&k.test(c.attributes.style)&&b(a)}}}})}});CKEDITOR.plugins.pagebreakCmd={exec:function(a){var b=a.document.createElement("div",{attributes:e(a.lang.pagebreak.alt)});a.insertElement(b)},context:"div",allowedContent:{div:{styles:"!page-break-after"},span:{match:function(a){return(a=a.parent)&&"div"==a.name&&a.styles&&a.styles["page-break-after"]},
  1077. styles:"display"}},requiredContent:"div{page-break-after}"}})();(function(){var c={canUndo:!1,async:!0,exec:function(a){a.getClipboardData({title:a.lang.pastetext.title},function(b){b&&a.fire("paste",{type:"text",dataValue:b.dataValue,method:"paste",dataTransfer:CKEDITOR.plugins.clipboard.initPasteDataTransfer()});a.fire("afterCommandExec",{name:"pastetext",command:c,returnValue:!!b})})}};CKEDITOR.plugins.add("pastetext",{requires:"clipboard",init:function(a){a.addCommand("pastetext",c);a.ui.addButton&&a.ui.addButton("PasteText",{label:a.lang.pastetext.button,
  1078. command:"pastetext",toolbar:"clipboard,40"});if(a.config.forcePasteAsPlainText)a.on("beforePaste",function(a){"html"!=a.data.type&&(a.data.type="text")});a.on("pasteState",function(b){a.getCommand("pastetext").setState(b.data)})}})})();(function(){function h(a,d,f){var b=CKEDITOR.cleanWord;b?f():(a=CKEDITOR.getUrl(a.config.pasteFromWordCleanupFile||d+"filter/default.js"),CKEDITOR.scriptLoader.load(a,f,null,!0));return!b}function k(a){a.data.type="html"}CKEDITOR.plugins.add("pastefromword",{requires:"clipboard",init:function(a){var d=0,f=this.path;a.addCommand("pastefromword",{canUndo:!1,async:!0,exec:function(a){var e=this;d=1;a.once("beforePaste",k);a.getClipboardData({title:a.lang.pastefromword.title},function(c){c&&a.fire("paste",
  1079. {type:"html",dataValue:c.dataValue,method:"paste",dataTransfer:CKEDITOR.plugins.clipboard.initPasteDataTransfer()});a.fire("afterCommandExec",{name:"pastefromword",command:e,returnValue:!!c})})}});a.ui.addButton&&a.ui.addButton("PasteFromWord",{label:a.lang.pastefromword.toolbar,command:"pastefromword",toolbar:"clipboard,50"});a.on("pasteState",function(b){a.getCommand("pastefromword").setState(b.data)});a.on("paste",function(b){var e=b.data,c=e.dataValue;if(c&&(d||/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(c))){e.dontFilter=
  1080. !0;var g=h(a,f,function(){if(g)a.fire("paste",e);else if(!a.config.pasteFromWordPromptCleanup||d||confirm(a.lang.pastefromword.confirmCleanup))e.dataValue=CKEDITOR.cleanWord(c,a);d=0});g&&b.cancel()}},null,null,3)}})})();(function(){var h,k={modes:{wysiwyg:1,source:1},canUndo:!1,readOnly:1,exec:function(a){var g,b=a.config,f=b.baseHref?'\x3cbase href\x3d"'+b.baseHref+'"/\x3e':"";if(b.fullPage)g=a.getData().replace(/<head>/,"$\x26"+f).replace(/[^>]*(?=<\/title>)/,"$\x26 \x26mdash; "+a.lang.preview.preview);else{var b="\x3cbody ",d=a.document&&a.document.getBody();d&&(d.getAttribute("id")&&(b+='id\x3d"'+d.getAttribute("id")+'" '),d.getAttribute("class")&&(b+='class\x3d"'+d.getAttribute("class")+'" '));b+="\x3e";g=a.config.docType+
  1081. '\x3chtml dir\x3d"'+a.config.contentsLangDirection+'"\x3e\x3chead\x3e'+f+"\x3ctitle\x3e"+a.lang.preview.preview+"\x3c/title\x3e"+CKEDITOR.tools.buildStyleHtml(a.config.contentsCss)+"\x3c/head\x3e"+b+a.getData()+"\x3c/body\x3e\x3c/html\x3e"}f=640;b=420;d=80;try{var c=window.screen,f=Math.round(.8*c.width),b=Math.round(.7*c.height),d=Math.round(.1*c.width)}catch(k){}if(!1===a.fire("contentPreview",a={dataValue:g}))return!1;var c="",e;CKEDITOR.env.ie&&(window._cke_htmlToLoad=a.dataValue,e="javascript:void( (function(){document.open();"+
  1082. ("("+CKEDITOR.tools.fixDomain+")();").replace(/\/\/.*?\n/g,"").replace(/parent\./g,"window.opener.")+"document.write( window.opener._cke_htmlToLoad );document.close();window.opener._cke_htmlToLoad \x3d null;})() )",c="");CKEDITOR.env.gecko&&(window._cke_htmlToLoad=a.dataValue,c=CKEDITOR.getUrl(h+"preview.html"));c=window.open(c,null,"toolbar\x3dyes,location\x3dno,status\x3dyes,menubar\x3dyes,scrollbars\x3dyes,resizable\x3dyes,width\x3d"+f+",height\x3d"+b+",left\x3d"+d);CKEDITOR.env.ie&&c&&(c.location=
  1083. e);CKEDITOR.env.ie||CKEDITOR.env.gecko||(e=c.document,e.open(),e.write(a.dataValue),e.close());return!0}};CKEDITOR.plugins.add("preview",{init:function(a){a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&(h=this.path,a.addCommand("preview",k),a.ui.addButton&&a.ui.addButton("Preview",{label:a.lang.preview.preview,command:"preview",toolbar:"document,40"}))}})})();CKEDITOR.plugins.add("print",{init:function(a){a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&(a.addCommand("print",CKEDITOR.plugins.print),a.ui.addButton&&a.ui.addButton("Print",{label:a.lang.print.toolbar,command:"print",toolbar:"document,50"}))}});CKEDITOR.plugins.print={exec:function(a){CKEDITOR.env.gecko?a.window.$.print():a.document.$.execCommand("Print")},canUndo:!1,readOnly:1,modes:{wysiwyg:1}};CKEDITOR.plugins.add("removeformat",{init:function(a){a.addCommand("removeFormat",CKEDITOR.plugins.removeformat.commands.removeformat);a.ui.addButton&&a.ui.addButton("RemoveFormat",{label:a.lang.removeformat.toolbar,command:"removeFormat",toolbar:"cleanup,10"})}});
  1084. CKEDITOR.plugins.removeformat={commands:{removeformat:{exec:function(a){for(var h=a._.removeFormatRegex||(a._.removeFormatRegex=new RegExp("^(?:"+a.config.removeFormatTags.replace(/,/g,"|")+")$","i")),e=a._.removeAttributes||(a._.removeAttributes=a.config.removeFormatAttributes.split(",")),f=CKEDITOR.plugins.removeformat.filter,m=a.getSelection().getRanges(),n=m.createIterator(),p=function(a){return a.type==CKEDITOR.NODE_ELEMENT},c;c=n.getNextRange();){c.collapsed||c.enlarge(CKEDITOR.ENLARGE_ELEMENT);
  1085. var l=c.createBookmark(),b=l.startNode,d=l.endNode,k=function(b){for(var c=a.elementPath(b),e=c.elements,d=1,g;(g=e[d])&&!g.equals(c.block)&&!g.equals(c.blockLimit);d++)h.test(g.getName())&&f(a,g)&&b.breakParent(g)};k(b);if(d)for(k(d),b=b.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT);b&&!b.equals(d);)if(b.isReadOnly()){if(b.getPosition(d)&CKEDITOR.POSITION_CONTAINS)break;b=b.getNext(p)}else k=b.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT),"img"==b.getName()&&b.data("cke-realelement")||!f(a,b)||(h.test(b.getName())?
  1086. b.remove(1):(b.removeAttributes(e),a.fire("removeFormatCleanup",b))),b=k;c.moveToBookmark(l)}a.forceNextSelectionCheck();a.getSelection().selectRanges(m)}}},filter:function(a,h){for(var e=a._.removeFormatFilters||[],f=0;f<e.length;f++)if(!1===e[f](h))return!1;return!0}};CKEDITOR.editor.prototype.addRemoveFormatFilter=function(a){this._.removeFormatFilters||(this._.removeFormatFilters=[]);this._.removeFormatFilters.push(a)};CKEDITOR.config.removeFormatTags="b,big,cite,code,del,dfn,em,font,i,ins,kbd,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var";
  1087. CKEDITOR.config.removeFormatAttributes="class,style,lang,width,height,align,hspace,valign";(function(){var b={readOnly:1,exec:function(a){if(a.fire("save")&&(a=a.element.$.form))try{a.submit()}catch(b){a.submit.click&&a.submit.click()}}};CKEDITOR.plugins.add("save",{init:function(a){a.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(a.addCommand("save",b).modes={wysiwyg:!!a.element.$.form},a.ui.addButton&&a.ui.addButton("Save",{label:a.lang.save.toolbar,command:"save",toolbar:"document,10"}))}})})();(function(){CKEDITOR.plugins.add("selectall",{init:function(b){b.addCommand("selectAll",{modes:{wysiwyg:1,source:1},exec:function(a){var b=a.editable();if(b.is("textarea"))a=b.$,CKEDITOR.env.ie?a.createTextRange().execCommand("SelectAll"):(a.selectionStart=0,a.selectionEnd=a.value.length),a.focus();else{if(b.is("body"))a.document.$.execCommand("SelectAll",!1,null);else{var c=a.createRange();c.selectNodeContents(b);c.select()}a.forceNextSelectionCheck();a.selectionChange()}},canUndo:!1});b.ui.addButton&&
  1088. b.ui.addButton("SelectAll",{label:b.lang.selectall.toolbar,command:"selectAll",toolbar:"selection,10"})}})})();(function(){var k={readOnly:1,preserveState:!0,editorFocus:!1,exec:function(a){this.toggleState();this.refresh(a)},refresh:function(a){if(a.document){var c=this.state!=CKEDITOR.TRISTATE_ON||a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&!a.focusManager.hasFocus?"removeClass":"attachClass";a.editable()[c]("cke_show_blocks")}}};CKEDITOR.plugins.add("showblocks",{onLoad:function(){var a="p div pre address blockquote h1 h2 h3 h4 h5 h6".split(" "),c,b,e,f,k=CKEDITOR.getUrl(this.path),l=!(CKEDITOR.env.ie&&
  1089. 9>CKEDITOR.env.version),g=l?":not([contenteditable\x3dfalse]):not(.cke_show_blocks_off)":"",d,h;for(c=b=e=f="";d=a.pop();)h=a.length?",":"",c+=".cke_show_blocks "+d+g+h,e+=".cke_show_blocks.cke_contents_ltr "+d+g+h,f+=".cke_show_blocks.cke_contents_rtl "+d+g+h,b+=".cke_show_blocks "+d+g+"{background-image:url("+CKEDITOR.getUrl(k+"images/block_"+d+".png")+")}";CKEDITOR.addCss((c+"{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px}").concat(b,e+"{background-position:top left;padding-left:8px}",
  1090. f+"{background-position:top right;padding-right:8px}"));l||CKEDITOR.addCss(".cke_show_blocks [contenteditable\x3dfalse],.cke_show_blocks .cke_show_blocks_off{border:none;padding-top:0;background-image:none}.cke_show_blocks.cke_contents_rtl [contenteditable\x3dfalse],.cke_show_blocks.cke_contents_rtl .cke_show_blocks_off{padding-right:0}.cke_show_blocks.cke_contents_ltr [contenteditable\x3dfalse],.cke_show_blocks.cke_contents_ltr .cke_show_blocks_off{padding-left:0}")},init:function(a){function c(){b.refresh(a)}
  1091. if(!a.blockless){var b=a.addCommand("showblocks",k);b.canUndo=!1;a.config.startupOutlineBlocks&&b.setState(CKEDITOR.TRISTATE_ON);a.ui.addButton&&a.ui.addButton("ShowBlocks",{label:a.lang.showblocks.toolbar,command:"showblocks",toolbar:"tools,20"});a.on("mode",function(){b.state!=CKEDITOR.TRISTATE_DISABLED&&b.refresh(a)});a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&(a.on("focus",c),a.on("blur",c));a.on("contentDom",function(){b.state!=CKEDITOR.TRISTATE_DISABLED&&b.refresh(a)})}}})})();(function(){var f={preserveState:!0,editorFocus:!1,readOnly:1,exec:function(a){this.toggleState();this.refresh(a)},refresh:function(a){if(a.document){var b=this.state==CKEDITOR.TRISTATE_ON?"attachClass":"removeClass";a.editable()[b]("cke_show_borders")}}};CKEDITOR.plugins.add("showborders",{modes:{wysiwyg:1},onLoad:function(){var a;a=(CKEDITOR.env.ie6Compat?[".%1 table.%2,",".%1 table.%2 td, .%1 table.%2 th","{","border : #d3d3d3 1px dotted","}"]:".%1 table.%2,;.%1 table.%2 \x3e tr \x3e td, .%1 table.%2 \x3e tr \x3e th,;.%1 table.%2 \x3e tbody \x3e tr \x3e td, .%1 table.%2 \x3e tbody \x3e tr \x3e th,;.%1 table.%2 \x3e thead \x3e tr \x3e td, .%1 table.%2 \x3e thead \x3e tr \x3e th,;.%1 table.%2 \x3e tfoot \x3e tr \x3e td, .%1 table.%2 \x3e tfoot \x3e tr \x3e th;{;border : #d3d3d3 1px dotted;}".split(";")).join("").replace(/%2/g,
  1092. "cke_show_border").replace(/%1/g,"cke_show_borders ");CKEDITOR.addCss(a)},init:function(a){var b=a.addCommand("showborders",f);b.canUndo=!1;!1!==a.config.startupShowBorders&&b.setState(CKEDITOR.TRISTATE_ON);a.on("mode",function(){b.state!=CKEDITOR.TRISTATE_DISABLED&&b.refresh(a)},null,null,100);a.on("contentDom",function(){b.state!=CKEDITOR.TRISTATE_DISABLED&&b.refresh(a)});a.on("removeFormatCleanup",function(d){d=d.data;a.getCommand("showborders").state==CKEDITOR.TRISTATE_ON&&d.is("table")&&(!d.hasAttribute("border")||
  1093. 0>=parseInt(d.getAttribute("border"),10))&&d.addClass("cke_show_border")})},afterInit:function(a){var b=a.dataProcessor;a=b&&b.dataFilter;b=b&&b.htmlFilter;a&&a.addRules({elements:{table:function(a){a=a.attributes;var b=a["class"],c=parseInt(a.border,10);c&&!(0>=c)||b&&-1!=b.indexOf("cke_show_border")||(a["class"]=(b||"")+" cke_show_border")}}});b&&b.addRules({elements:{table:function(a){a=a.attributes;var b=a["class"];b&&(a["class"]=b.replace("cke_show_border","").replace(/\s{2}/," ").replace(/^\s+|\s+$/,
  1094. ""))}}})}});CKEDITOR.on("dialogDefinition",function(a){var b=a.data.name;if("table"==b||"tableProperties"==b)if(a=a.data.definition,b=a.getContents("info").get("txtBorder"),b.commit=CKEDITOR.tools.override(b.commit,function(a){return function(b,c){a.apply(this,arguments);var e=parseInt(this.getValue(),10);c[!e||0>=e?"addClass":"removeClass"]("cke_show_border")}}),a=(a=a.getContents("advanced"))&&a.get("advCSSClasses"))a.setup=CKEDITOR.tools.override(a.setup,function(a){return function(){a.apply(this,
  1095. arguments);this.setValue(this.getValue().replace(/cke_show_border/,""))}}),a.commit=CKEDITOR.tools.override(a.commit,function(a){return function(b,c){a.apply(this,arguments);parseInt(c.getAttribute("border"),10)||c.addClass("cke_show_border")}})})})();(function(){CKEDITOR.plugins.add("sourcearea",{init:function(a){function d(){var a=e&&this.equals(CKEDITOR.document.getActive());this.hide();this.setStyle("height",this.getParent().$.clientHeight+"px");this.setStyle("width",this.getParent().$.clientWidth+"px");this.show();a&&this.focus()}if(a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var f=CKEDITOR.plugins.sourcearea;a.addMode("source",function(e){var b=a.ui.space("contents").getDocument().createElement("textarea");b.setStyles(CKEDITOR.tools.extend({width:CKEDITOR.env.ie7Compat?
  1096. "99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",a.config.sourceAreaTabSize||4)));b.setAttribute("dir","ltr");b.addClass("cke_source").addClass("cke_reset").addClass("cke_enable_context_menu");a.ui.space("contents").append(b);b=a.editable(new c(a,b));b.setData(a.getData(1));CKEDITOR.env.ie&&(b.attachListener(a,"resize",d,b),b.attachListener(CKEDITOR.document.getWindow(),"resize",d,b),CKEDITOR.tools.setTimeout(d,0,b));a.fire("ariaWidget",
  1097. this);e()});a.addCommand("source",f.commands.source);a.ui.addButton&&a.ui.addButton("Source",{label:a.lang.sourcearea.toolbar,command:"source",toolbar:"mode,10"});a.on("mode",function(){a.getCommand("source").setState("source"==a.mode?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)});var e=CKEDITOR.env.ie&&9==CKEDITOR.env.version}}});var c=CKEDITOR.tools.createClass({base:CKEDITOR.editable,proto:{setData:function(a){this.setValue(a);this.status="ready";this.editor.fire("dataReady")},getData:function(){return this.getValue()},
  1098. insertHtml:function(){},insertElement:function(){},insertText:function(){},setReadOnly:function(a){this[(a?"set":"remove")+"Attribute"]("readOnly","readonly")},detach:function(){c.baseProto.detach.call(this);this.clearCustomData();this.remove()}}})})();
  1099. CKEDITOR.plugins.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:!1,readOnly:1,exec:function(c){"wysiwyg"==c.mode&&c.fire("saveSnapshot");c.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);c.setMode("source"==c.mode?"wysiwyg":"source")},canUndo:!1}}};CKEDITOR.plugins.add("specialchar",{availableLangs:{af:1,ar:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,"de-ch":1,el:1,en:1,"en-gb":1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fr:1,"fr-ca":1,gl:1,he:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,lt:1,lv:1,nb:1,nl:1,no:1,pl:1,pt:1,"pt-br":1,ru:1,si:1,sk:1,sl:1,sq:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},requires:"dialog",init:function(a){var c=this;CKEDITOR.dialog.add("specialchar",this.path+"dialogs/specialchar.js");a.addCommand("specialchar",{exec:function(){var b=
  1100. a.langCode,b=c.availableLangs[b]?b:c.availableLangs[b.replace(/-.*/,"")]?b.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(c.path+"dialogs/lang/"+b+".js"),function(){CKEDITOR.tools.extend(a.lang.specialchar,c.langEntries[b]);a.openDialog("specialchar")})},modes:{wysiwyg:1},canUndo:!1});a.ui.addButton&&a.ui.addButton("SpecialChar",{label:a.lang.specialchar.toolbar,command:"specialchar",toolbar:"insert,50"})}});CKEDITOR.config.specialChars="! \x26quot; # $ % \x26amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; \x26lt; \x3d \x26gt; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x26euro; \x26lsquo; \x26rsquo; \x26ldquo; \x26rdquo; \x26ndash; \x26mdash; \x26iexcl; \x26cent; \x26pound; \x26curren; \x26yen; \x26brvbar; \x26sect; \x26uml; \x26copy; \x26ordf; \x26laquo; \x26not; \x26reg; \x26macr; \x26deg; \x26sup2; \x26sup3; \x26acute; \x26micro; \x26para; \x26middot; \x26cedil; \x26sup1; \x26ordm; \x26raquo; \x26frac14; \x26frac12; \x26frac34; \x26iquest; \x26Agrave; \x26Aacute; \x26Acirc; \x26Atilde; \x26Auml; \x26Aring; \x26AElig; \x26Ccedil; \x26Egrave; \x26Eacute; \x26Ecirc; \x26Euml; \x26Igrave; \x26Iacute; \x26Icirc; \x26Iuml; \x26ETH; \x26Ntilde; \x26Ograve; \x26Oacute; \x26Ocirc; \x26Otilde; \x26Ouml; \x26times; \x26Oslash; \x26Ugrave; \x26Uacute; \x26Ucirc; \x26Uuml; \x26Yacute; \x26THORN; \x26szlig; \x26agrave; \x26aacute; \x26acirc; \x26atilde; \x26auml; \x26aring; \x26aelig; \x26ccedil; \x26egrave; \x26eacute; \x26ecirc; \x26euml; \x26igrave; \x26iacute; \x26icirc; \x26iuml; \x26eth; \x26ntilde; \x26ograve; \x26oacute; \x26ocirc; \x26otilde; \x26ouml; \x26divide; \x26oslash; \x26ugrave; \x26uacute; \x26ucirc; \x26uuml; \x26yacute; \x26thorn; \x26yuml; \x26OElig; \x26oelig; \x26#372; \x26#374 \x26#373 \x26#375; \x26sbquo; \x26#8219; \x26bdquo; \x26hellip; \x26trade; \x26#9658; \x26bull; \x26rarr; \x26rArr; \x26hArr; \x26diams; \x26asymp;".split(" ");CKEDITOR.plugins.add("scayt",{requires:"menubutton,dialog",tabToOpen:null,dialogName:"scaytDialog",init:function(a){var c=this,d=CKEDITOR.plugins.scayt;this.bindEvents(a);this.parseConfig(a);this.addRule(a);CKEDITOR.dialog.add(this.dialogName,CKEDITOR.getUrl(this.path+"dialogs/options.js"));this.addMenuItems(a);var b=a.lang.scayt,e=CKEDITOR.env;a.ui.add("Scayt",CKEDITOR.UI_MENUBUTTON,{label:b.text_title,title:a.plugins.wsc?a.lang.wsc.title:b.text_title,modes:{wysiwyg:!(e.ie&&(8>e.version||e.quirks))},
  1101. toolbar:"spellchecker,20",refresh:function(){var b=a.ui.instances.Scayt.getState();a.scayt&&(b=d.state.scayt[a.name]?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF);a.fire("scaytButtonState",b)},onRender:function(){var b=this;a.on("scaytButtonState",function(a){void 0!==typeof a.data&&b.setState(a.data)})},onMenu:function(){var b=a.scayt;a.getMenuItem("scaytToggle").label=a.lang.scayt[b&&d.state.scayt[a.name]?"btn_disable":"btn_enable"];b={scaytToggle:CKEDITOR.TRISTATE_OFF,scaytOptions:b?CKEDITOR.TRISTATE_OFF:
  1102. CKEDITOR.TRISTATE_DISABLED,scaytLangs:b?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytDict:b?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytAbout:b?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,WSC:a.plugins.wsc?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED};a.config.scayt_uiTabs[0]||delete b.scaytOptions;a.config.scayt_uiTabs[1]||delete b.scaytLangs;a.config.scayt_uiTabs[2]||delete b.scaytDict;return b}});a.contextMenu&&a.addMenuItems&&(a.contextMenu.addListener(function(b,d){var e=
  1103. a.scayt,k,l;e&&(l=e.getSelectionNode())&&(k=c.menuGenerator(a,l),e.showBanner("."+a.contextMenu._.definition.panel.className.split(" ").join(" .")));return k}),a.contextMenu._.onHide=CKEDITOR.tools.override(a.contextMenu._.onHide,function(b){return function(){var d=a.scayt;d&&d.hideBanner();return b.apply(this)}}))},addMenuItems:function(a){var c=this,d=CKEDITOR.plugins.scayt;a.addMenuGroup("scaytButton");for(var b=a.config.scayt_contextMenuItemsOrder.split("|"),e=0;e<b.length;e++)b[e]="scayt_"+b[e];
  1104. if((b=["grayt_description","grayt_suggest","grayt_control"].concat(b))&&b.length)for(e=0;e<b.length;e++)a.addMenuGroup(b[e],e-10);a.addCommand("scaytToggle",{exec:function(a){var b=a.scayt;d.state.scayt[a.name]=!d.state.scayt[a.name];!0===d.state.scayt[a.name]?b||d.createScayt(a):b&&d.destroy(a)}});a.addCommand("scaytAbout",{exec:function(a){a.scayt.tabToOpen="about";a.lockSelection();a.openDialog(c.dialogName)}});a.addCommand("scaytOptions",{exec:function(a){a.scayt.tabToOpen="options";a.lockSelection();
  1105. a.openDialog(c.dialogName)}});a.addCommand("scaytLangs",{exec:function(a){a.scayt.tabToOpen="langs";a.lockSelection();a.openDialog(c.dialogName)}});a.addCommand("scaytDict",{exec:function(a){a.scayt.tabToOpen="dictionaries";a.lockSelection();a.openDialog(c.dialogName)}});b={scaytToggle:{label:a.lang.scayt.btn_enable,group:"scaytButton",command:"scaytToggle"},scaytAbout:{label:a.lang.scayt.btn_about,group:"scaytButton",command:"scaytAbout"},scaytOptions:{label:a.lang.scayt.btn_options,group:"scaytButton",
  1106. command:"scaytOptions"},scaytLangs:{label:a.lang.scayt.btn_langs,group:"scaytButton",command:"scaytLangs"},scaytDict:{label:a.lang.scayt.btn_dictionaries,group:"scaytButton",command:"scaytDict"}};a.plugins.wsc&&(b.WSC={label:a.lang.wsc.toolbar,group:"scaytButton",onClick:function(){var b=CKEDITOR.plugins.scayt,d=a.scayt,c=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.container.getText():a.document.getBody().getText();(c=c.replace(/\s/g,""))?(d&&b.state.scayt[a.name]&&d.setMarkupPaused&&d.setMarkupPaused(!0),
  1107. a.lockSelection(),a.execCommand("checkspell")):alert("Nothing to check!")}});a.addMenuItems(b)},bindEvents:function(a){var c=CKEDITOR.plugins.scayt,d=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE,b=function(){c.destroy(a)},e=function(){!c.state.scayt[a.name]||a.readOnly||a.scayt||c.createScayt(a)},f=function(){var b=a.editable();b.attachListener(b,"focus",function(b){CKEDITOR.plugins.scayt&&!a.scayt&&setTimeout(e,0);b=CKEDITOR.plugins.scayt&&CKEDITOR.plugins.scayt.state.scayt[a.name]&&a.scayt;var c,
  1108. h;if((d||b)&&a._.savedSelection){b=a._.savedSelection.getSelectedElement();b=!b&&a._.savedSelection.getRanges();for(var f=0;f<b.length;f++)h=b[f],"string"===typeof h.startContainer.$.nodeValue&&(c=h.startContainer.getText().length,(c<h.startOffset||c<h.endOffset)&&a.unlockSelection(!1))}},this,null,-10)},g=function(){d?a.config.scayt_inlineModeImmediateMarkup?e():(a.on("blur",function(){setTimeout(b,0)}),a.on("focus",e),a.focusManager.hasFocus&&e()):e();f();var c=a.editable();c.attachListener(c,"mousedown",
  1109. function(b){b=b.data.getTarget();var d=a.widgets&&a.widgets.getByElement(b);d&&(d.wrapper=b.getAscendant(function(a){return a.hasAttribute("data-cke-widget-wrapper")},!0))},this,null,-10)};a.on("contentDom",g);a.on("beforeCommandExec",function(b){var d=a.scayt,e=null,f=!1,g=!0;b.data.name in c.options.disablingCommandExec&&"wysiwyg"==a.mode?d&&(c.destroy(a),a.fire("scaytButtonState",CKEDITOR.TRISTATE_DISABLED)):"bold"!==b.data.name&&"italic"!==b.data.name&&"underline"!==b.data.name&&"strike"!==b.data.name&&
  1110. "subscript"!==b.data.name&&"superscript"!==b.data.name&&"enter"!==b.data.name&&"cut"!==b.data.name&&"language"!==b.data.name||!d||("cut"===b.data.name&&(g=!1,f=!0),"language"===b.data.name&&(e=(e=a.plugins.language.getCurrentLangElement(a))&&e.$,f=!0),a.fire("reloadMarkupScayt",{removeOptions:{removeInside:g,forceBookmark:f,selectionNode:e},timeout:0}))});a.on("beforeSetMode",function(b){if("source"==b.data){if(b=a.scayt)c.destroy(a),a.fire("scaytButtonState",CKEDITOR.TRISTATE_DISABLED);a.document&&
  1111. a.document.getBody().removeAttribute("_jquid")}});a.on("afterCommandExec",function(b){"wysiwyg"!=a.mode||"undo"!=b.data.name&&"redo"!=b.data.name||setTimeout(function(){var b=a.scayt,d=b&&b.getScaytLangList();d&&d.ltr&&d.rtl&&b.fire("startSpellCheck, startGrammarCheck")},250)});a.on("readOnly",function(b){var d;b&&(d=a.scayt,!0===b.editor.readOnly?d&&d.fire("removeMarkupInDocument",{}):d?d.fire("startSpellCheck, startGrammarCheck"):"wysiwyg"==b.editor.mode&&!0===c.state.scayt[b.editor.name]&&(c.createScayt(a),
  1112. b.editor.fire("scaytButtonState",CKEDITOR.TRISTATE_ON)))});a.on("beforeDestroy",b);a.on("setData",function(){b();(a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE||a.plugins.divarea)&&g()},this,null,50);a.on("reloadMarkupScayt",function(b){var d=b.data&&b.data.removeOptions;setTimeout(function(){var b=a.scayt,c=b&&b.getScaytLangList();c&&c.ltr&&c.rtl&&(a.document.fire("keydown",new CKEDITOR.dom.event({keyCode:37})),b.removeMarkupInSelectionNode(d),b.fire("startSpellCheck, startGrammarCheck"))},b.data&&
  1113. b.data.timeout||0)});a.on("insertElement",function(){a.fire("reloadMarkupScayt",{removeOptions:{forceBookmark:!0}})},this,null,50);a.on("insertHtml",function(){a.fire("reloadMarkupScayt")},this,null,50);a.on("insertText",function(){a.fire("reloadMarkupScayt")},this,null,50);a.on("scaytDialogShown",function(b){b.data.selectPage(a.scayt.tabToOpen)})},parseConfig:function(a){var c=CKEDITOR.plugins.scayt;c.replaceOldOptionsNames(a.config);"boolean"!==typeof a.config.scayt_autoStartup&&(a.config.scayt_autoStartup=
  1114. !1);c.state.scayt[a.name]=a.config.scayt_autoStartup;"boolean"!==typeof a.config.grayt_autoStartup&&(a.config.grayt_autoStartup=!1);"boolean"!==typeof a.config.scayt_inlineModeImmediateMarkup&&(a.config.scayt_inlineModeImmediateMarkup=!1);c.state.grayt[a.name]=a.config.grayt_autoStartup;a.config.scayt_contextCommands||(a.config.scayt_contextCommands="ignore|ignoreall|add");a.config.scayt_contextMenuItemsOrder||(a.config.scayt_contextMenuItemsOrder="suggest|moresuggest|control");a.config.scayt_sLang||
  1115. (a.config.scayt_sLang="en_US");if(void 0===a.config.scayt_maxSuggestions||"number"!=typeof a.config.scayt_maxSuggestions||0>a.config.scayt_maxSuggestions)a.config.scayt_maxSuggestions=5;if(void 0===a.config.scayt_minWordLength||"number"!=typeof a.config.scayt_minWordLength||1>a.config.scayt_minWordLength)a.config.scayt_minWordLength=4;if(void 0===a.config.scayt_customDictionaryIds||"string"!==typeof a.config.scayt_customDictionaryIds)a.config.scayt_customDictionaryIds="";if(void 0===a.config.scayt_userDictionaryName||
  1116. "string"!==typeof a.config.scayt_userDictionaryName)a.config.scayt_userDictionaryName=null;if("string"===typeof a.config.scayt_uiTabs&&3===a.config.scayt_uiTabs.split(",").length){var d=[],b=[];a.config.scayt_uiTabs=a.config.scayt_uiTabs.split(",");CKEDITOR.tools.search(a.config.scayt_uiTabs,function(a){1===Number(a)||0===Number(a)?(b.push(!0),d.push(Number(a))):b.push(!1)});null===CKEDITOR.tools.search(b,!1)?a.config.scayt_uiTabs=d:a.config.scayt_uiTabs=[1,1,1]}else a.config.scayt_uiTabs=[1,1,1];
  1117. "string"!=typeof a.config.scayt_serviceProtocol&&(a.config.scayt_serviceProtocol=null);"string"!=typeof a.config.scayt_serviceHost&&(a.config.scayt_serviceHost=null);"string"!=typeof a.config.scayt_servicePort&&(a.config.scayt_servicePort=null);"string"!=typeof a.config.scayt_servicePath&&(a.config.scayt_servicePath=null);a.config.scayt_moreSuggestions||(a.config.scayt_moreSuggestions="on");"string"!==typeof a.config.scayt_customerId&&(a.config.scayt_customerId="1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2");
  1118. "string"!==typeof a.config.scayt_srcUrl&&(c=document.location.protocol,c=-1!=c.search(/https?:/)?c:"http:",a.config.scayt_srcUrl=c+"//svc.webspellchecker.net/spellcheck31/lf/scayt3/ckscayt/ckscayt.js");"boolean"!==typeof CKEDITOR.config.scayt_handleCheckDirty&&(CKEDITOR.config.scayt_handleCheckDirty=!0);"boolean"!==typeof CKEDITOR.config.scayt_handleUndoRedo&&(CKEDITOR.config.scayt_handleUndoRedo=!0);CKEDITOR.config.scayt_handleUndoRedo=CKEDITOR.plugins.undo?CKEDITOR.config.scayt_handleUndoRedo:!1;
  1119. "boolean"!==typeof a.config.scayt_multiLanguageMode&&(a.config.scayt_multiLanguageMode=!1);"object"!==typeof a.config.scayt_multiLanguageStyles&&(a.config.scayt_multiLanguageStyles={});a.config.scayt_ignoreAllCapsWords&&"boolean"!==typeof a.config.scayt_ignoreAllCapsWords&&(a.config.scayt_ignoreAllCapsWords=!1);a.config.scayt_ignoreDomainNames&&"boolean"!==typeof a.config.scayt_ignoreDomainNames&&(a.config.scayt_ignoreDomainNames=!1);a.config.scayt_ignoreWordsWithMixedCases&&"boolean"!==typeof a.config.scayt_ignoreWordsWithMixedCases&&
  1120. (a.config.scayt_ignoreWordsWithMixedCases=!1);a.config.scayt_ignoreWordsWithNumbers&&"boolean"!==typeof a.config.scayt_ignoreWordsWithNumbers&&(a.config.scayt_ignoreWordsWithNumbers=!1);if(a.config.scayt_disableOptionsStorage){var c=CKEDITOR.tools.isArray(a.config.scayt_disableOptionsStorage)?a.config.scayt_disableOptionsStorage:"string"===typeof a.config.scayt_disableOptionsStorage?[a.config.scayt_disableOptionsStorage]:void 0,e="all options lang ignore-all-caps-words ignore-domain-names ignore-words-with-mixed-cases ignore-words-with-numbers".split(" "),
  1121. f=["lang","ignore-all-caps-words","ignore-domain-names","ignore-words-with-mixed-cases","ignore-words-with-numbers"],g=CKEDITOR.tools.search,h=CKEDITOR.tools.indexOf;a.config.scayt_disableOptionsStorage=function(a){for(var b=[],d=0;d<a.length;d++){var c=a[d],m=!!g(a,"options");if(!g(e,c)||m&&g(f,function(a){if("lang"===a)return!1}))return;g(f,c)&&f.splice(h(f,c),1);if("all"===c||m&&g(a,"lang"))return[];"options"===c&&(f=["lang"])}return b=b.concat(f)}(c)}},addRule:function(a){var c=CKEDITOR.plugins.scayt,
  1122. d=a.dataProcessor,b=d&&d.htmlFilter,e=a._.elementsPath&&a._.elementsPath.filters,d=d&&d.dataFilter,f=a.addRemoveFormatFilter,g=function(b){if(a.scayt&&(b.hasAttribute(c.options.data_attribute_name)||b.hasAttribute(c.options.problem_grammar_data_attribute)))return!1},h=function(b){var d=!0;a.scayt&&(b.hasAttribute(c.options.data_attribute_name)||b.hasAttribute(c.options.problem_grammar_data_attribute))&&(d=!1);return d};e&&e.push(g);d&&d.addRules({elements:{span:function(a){var b=a.hasClass(c.options.misspelled_word_class)&&
  1123. a.attributes[c.options.data_attribute_name],d=a.hasClass(c.options.problem_grammar_class)&&a.attributes[c.options.problem_grammar_data_attribute];c&&(b||d)&&delete a.name;return a}}});b&&b.addRules({elements:{span:function(a){var b=a.hasClass(c.options.misspelled_word_class)&&a.attributes[c.options.data_attribute_name],d=a.hasClass(c.options.problem_grammar_class)&&a.attributes[c.options.problem_grammar_data_attribute];c&&(b||d)&&delete a.name;return a}}});f&&f.call(a,h)},scaytMenuDefinition:function(a){var c=
  1124. this;a=a.scayt;return{scayt:{scayt_ignore:{label:a.getLocal("btn_ignore"),group:"scayt_control",order:1,exec:function(a){a.scayt.ignoreWord()}},scayt_ignoreall:{label:a.getLocal("btn_ignoreAll"),group:"scayt_control",order:2,exec:function(a){a.scayt.ignoreAllWords()}},scayt_add:{label:a.getLocal("btn_addWord"),group:"scayt_control",order:3,exec:function(a){var b=a.scayt;setTimeout(function(){b.addWordToUserDictionary()},10)}},scayt_option:{label:a.getLocal("btn_options"),group:"scayt_control",order:4,
  1125. exec:function(a){a.scayt.tabToOpen="options";a.lockSelection();a.openDialog(c.dialogName)},verification:function(a){return 1==a.config.scayt_uiTabs[0]?!0:!1}},scayt_language:{label:a.getLocal("btn_langs"),group:"scayt_control",order:5,exec:function(a){a.scayt.tabToOpen="langs";a.lockSelection();a.openDialog(c.dialogName)},verification:function(a){return 1==a.config.scayt_uiTabs[1]?!0:!1}},scayt_dictionary:{label:a.getLocal("btn_dictionaries"),group:"scayt_control",order:6,exec:function(a){a.scayt.tabToOpen=
  1126. "dictionaries";a.lockSelection();a.openDialog(c.dialogName)},verification:function(a){return 1==a.config.scayt_uiTabs[2]?!0:!1}},scayt_about:{label:a.getLocal("btn_about"),group:"scayt_control",order:7,exec:function(a){a.scayt.tabToOpen="about";a.lockSelection();a.openDialog(c.dialogName)}}},grayt:{grayt_problemdescription:{label:"Grammar problem description",group:"grayt_description",order:1,state:CKEDITOR.TRISTATE_DISABLED,exec:function(a){}},grayt_ignore:{label:a.getLocal("btn_ignore"),group:"grayt_control",
  1127. order:2,exec:function(a){a.scayt.ignorePhrase()}}}}},buildSuggestionMenuItems:function(a,c,d){var b={},e={},f=d?"word":"phrase",g=d?"startGrammarCheck":"startSpellCheck",h=a.scayt;if(0<c.length&&"no_any_suggestions"!==c[0])if(d)for(d=0;d<c.length;d++){var k="scayt_suggest_"+CKEDITOR.plugins.scayt.suggestions[d].replace(" ","_");a.addCommand(k,this.createCommand(CKEDITOR.plugins.scayt.suggestions[d],f,g));d<a.config.scayt_maxSuggestions?(a.addMenuItem(k,{label:c[d],command:k,group:"scayt_suggest",
  1128. order:d+1}),b[k]=CKEDITOR.TRISTATE_OFF):(a.addMenuItem(k,{label:c[d],command:k,group:"scayt_moresuggest",order:d+1}),e[k]=CKEDITOR.TRISTATE_OFF,"on"===a.config.scayt_moreSuggestions&&(a.addMenuItem("scayt_moresuggest",{label:h.getLocal("btn_moreSuggestions"),group:"scayt_moresuggest",order:10,getItems:function(){return e}}),b.scayt_moresuggest=CKEDITOR.TRISTATE_OFF))}else for(d=0;d<c.length;d++)k="grayt_suggest_"+CKEDITOR.plugins.scayt.suggestions[d].replace(" ","_"),a.addCommand(k,this.createCommand(CKEDITOR.plugins.scayt.suggestions[d],
  1129. f,g)),a.addMenuItem(k,{label:c[d],command:k,group:"grayt_suggest",order:d+1}),b[k]=CKEDITOR.TRISTATE_OFF;else b.no_scayt_suggest=CKEDITOR.TRISTATE_DISABLED,a.addCommand("no_scayt_suggest",{exec:function(){}}),a.addMenuItem("no_scayt_suggest",{label:h.getLocal("btn_noSuggestions")||"no_scayt_suggest",command:"no_scayt_suggest",group:"scayt_suggest",order:0});return b},menuGenerator:function(a,c){var d=a.scayt,b=this.scaytMenuDefinition(a),e={},f=a.config.scayt_contextCommands.split("|"),g=c.getAttribute(d.getLangAttribute())||
  1130. d.getLang(),h,k;h=d.isScaytNode(c);k=d.isGraytNode(c);h?(b=b.scayt,e=c.getAttribute(d.getScaytNodeAttributeName()),d.fire("getSuggestionsList",{lang:g,word:e}),e=this.buildSuggestionMenuItems(a,CKEDITOR.plugins.scayt.suggestions,h)):k&&(b=b.grayt,e=c.getAttribute(d.getGraytNodeAttributeName()),k=d.getProblemDescriptionText(e,g),b.grayt_problemdescription&&k&&(b.grayt_problemdescription.label=k),d.fire("getGrammarSuggestionsList",{lang:g,phrase:e}),e=this.buildSuggestionMenuItems(a,CKEDITOR.plugins.scayt.suggestions,
  1131. h));if(h&&"off"==a.config.scayt_contextCommands)return e;for(var l in b)h&&-1==CKEDITOR.tools.indexOf(f,l.replace("scayt_",""))&&"all"!=a.config.scayt_contextCommands||(e[l]="undefined"!=typeof b[l].state?b[l].state:CKEDITOR.TRISTATE_OFF,"function"!==typeof b[l].verification||b[l].verification(a)||delete e[l],a.addCommand(l,{exec:b[l].exec}),a.addMenuItem(l,{label:a.lang.scayt[b[l].label]||b[l].label,command:l,group:b[l].group,order:b[l].order}));return e},createCommand:function(a,c,d){return{exec:function(b){b=
  1132. b.scayt;var e={};e[c]=a;b.replaceSelectionNode(e);"startGrammarCheck"===d&&b.removeMarkupInSelectionNode({grammarOnly:!0});b.fire(d)}}}});
  1133. CKEDITOR.plugins.scayt={state:{scayt:{},grayt:{}},suggestions:[],loadingHelper:{loadOrder:[]},isLoading:!1,options:{disablingCommandExec:{source:!0,newpage:!0,templates:!0},data_attribute_name:"data-scayt-word",misspelled_word_class:"scayt-misspell-word",problem_grammar_data_attribute:"data-grayt-phrase",problem_grammar_class:"gramm-problem"},backCompatibilityMap:{scayt_service_protocol:"scayt_serviceProtocol",scayt_service_host:"scayt_serviceHost",scayt_service_port:"scayt_servicePort",scayt_service_path:"scayt_servicePath",
  1134. scayt_customerid:"scayt_customerId"},replaceOldOptionsNames:function(a){for(var c in a)c in this.backCompatibilityMap&&(a[this.backCompatibilityMap[c]]=a[c],delete a[c])},createScayt:function(a){var c=this,d=CKEDITOR.plugins.scayt;this.loadScaytLibrary(a,function(a){var e=a.window&&a.window.getFrame()||a.editable();e?(e={lang:a.config.scayt_sLang,container:e.$,customDictionary:a.config.scayt_customDictionaryIds,userDictionaryName:a.config.scayt_userDictionaryName,localization:a.langCode,customer_id:a.config.scayt_customerId,
  1135. debug:a.config.scayt_debug,data_attribute_name:c.options.data_attribute_name,misspelled_word_class:c.options.misspelled_word_class,problem_grammar_data_attribute:c.options.problem_grammar_data_attribute,problem_grammar_class:c.options.problem_grammar_class,"options-to-restore":a.config.scayt_disableOptionsStorage,focused:a.editable().hasFocus,ignoreElementsRegex:a.config.scayt_elementsToIgnore,minWordLength:a.config.scayt_minWordLength,multiLanguageMode:a.config.scayt_multiLanguageMode,multiLanguageStyles:a.config.scayt_multiLanguageStyles,
  1136. graytAutoStartup:d.state.grayt[a.name]},a.config.scayt_serviceProtocol&&(e.service_protocol=a.config.scayt_serviceProtocol),a.config.scayt_serviceHost&&(e.service_host=a.config.scayt_serviceHost),a.config.scayt_servicePort&&(e.service_port=a.config.scayt_servicePort),a.config.scayt_servicePath&&(e.service_path=a.config.scayt_servicePath),"boolean"===typeof a.config.scayt_ignoreAllCapsWords&&(e["ignore-all-caps-words"]=a.config.scayt_ignoreAllCapsWords),"boolean"===typeof a.config.scayt_ignoreDomainNames&&
  1137. (e["ignore-domain-names"]=a.config.scayt_ignoreDomainNames),"boolean"===typeof a.config.scayt_ignoreWordsWithMixedCases&&(e["ignore-words-with-mixed-cases"]=a.config.scayt_ignoreWordsWithMixedCases),"boolean"===typeof a.config.scayt_ignoreWordsWithNumbers&&(e["ignore-words-with-numbers"]=a.config.scayt_ignoreWordsWithNumbers),e=new SCAYT.CKSCAYT(e,function(){},function(){}),e.subscribe("suggestionListSend",function(a){for(var b={},d=[],c=0;c<a.suggestionList.length;c++)b["word_"+a.suggestionList[c]]||
  1138. (b["word_"+a.suggestionList[c]]=a.suggestionList[c],d.push(a.suggestionList[c]));CKEDITOR.plugins.scayt.suggestions=d}),e.subscribe("selectionIsChanged",function(d){a.getSelection().isLocked&&a.lockSelection()}),e.subscribe("graytStateChanged",function(c){d.state.grayt[a.name]=c.state}),a.scayt=e,a.fire("scaytButtonState",a.readOnly?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_ON)):d.state.scayt[a.name]=!1})},destroy:function(a){a.scayt&&a.scayt.destroy();delete a.scayt;a.fire("scaytButtonState",
  1139. CKEDITOR.TRISTATE_OFF)},loadScaytLibrary:function(a,c){var d=this,b,e;this.loadingHelper[a.name]||("undefined"===typeof window.SCAYT||"function"!==typeof window.SCAYT.CKSCAYT?(this.loadingHelper[a.name]=c,this.loadingHelper.loadOrder.push(a.name),b=new Date,b=b.getTime(),e=a.config.scayt_srcUrl,e+=0<=e.indexOf("?")?"":"?"+b,this.loadingHelper.ckscaytLoading||(CKEDITOR.scriptLoader.load(e,function(a){if(a){CKEDITOR.fireOnce("scaytReady");for(var b=0;b<d.loadingHelper.loadOrder.length;b++){a=d.loadingHelper.loadOrder[b];
  1140. if("function"===typeof d.loadingHelper[a])d.loadingHelper[a](CKEDITOR.instances[a]);delete d.loadingHelper[a]}d.loadingHelper.loadOrder=[]}}),this.loadingHelper.ckscaytLoading=!0)):window.SCAYT&&"function"===typeof window.SCAYT.CKSCAYT&&(CKEDITOR.fireOnce("scaytReady"),a.scayt||"function"===typeof c&&c(a)))}};
  1141. CKEDITOR.on("dialogDefinition",function(a){var c=a.data.name;a=a.data.definition.dialog;if("scaytDialog"===c)a.on("cancel",function(a){return!1},this,null,-1);if("checkspell"===c)a.on("cancel",function(a){a=a.sender&&a.sender.getParentEditor();var b=CKEDITOR.plugins.scayt,c=a.scayt;c&&b.state.scayt[a.name]&&c.setMarkupPaused&&c.setMarkupPaused(!1);a.unlockSelection()},this,null,-2);if("link"===c)a.on("ok",function(a){var b=a.sender&&a.sender.getParentEditor();b&&setTimeout(function(){b.fire("reloadMarkupScayt",
  1142. {removeOptions:{removeInside:!0,forceBookmark:!0},timeout:0})},0)})});
  1143. CKEDITOR.on("scaytReady",function(){if(!0===CKEDITOR.config.scayt_handleCheckDirty){var a=CKEDITOR.editor.prototype;a.checkDirty=CKEDITOR.tools.override(a.checkDirty,function(a){return function(){var b=null,c=this.scayt;if(CKEDITOR.plugins.scayt&&CKEDITOR.plugins.scayt.state.scayt[this.name]&&this.scayt){if(b="ready"==this.status)var f=c.removeMarkupFromString(this.getSnapshot()),c=c.removeMarkupFromString(this._.previousValue),b=b&&c!==f}else b=a.call(this);return b}});a.resetDirty=CKEDITOR.tools.override(a.resetDirty,
  1144. function(a){return function(){var b=this.scayt;CKEDITOR.plugins.scayt&&CKEDITOR.plugins.scayt.state.scayt[this.name]&&this.scayt?this._.previousValue=b.removeMarkupFromString(this.getSnapshot()):a.call(this)}})}if(!0===CKEDITOR.config.scayt_handleUndoRedo){var a=CKEDITOR.plugins.undo.Image.prototype,c="function"==typeof a.equalsContent?"equalsContent":"equals";a[c]=CKEDITOR.tools.override(a[c],function(a){return function(b){var c=b.editor.scayt,f=this.contents,g=b.contents,h=null;CKEDITOR.plugins.scayt&&
  1145. CKEDITOR.plugins.scayt.state.scayt[b.editor.name]&&b.editor.scayt&&(this.contents=c.removeMarkupFromString(f)||"",b.contents=c.removeMarkupFromString(g)||"");h=a.apply(this,arguments);this.contents=f;b.contents=g;return h}})}});(function(){CKEDITOR.plugins.add("stylescombo",{requires:"richcombo",init:function(c){var l=c.config,g=c.lang.stylescombo,f={},k=[],m=[];c.on("stylesSet",function(b){if(b=b.data.styles){for(var a,h,d,e=0,n=b.length;e<n;e++)(a=b[e],c.blockless&&a.element in CKEDITOR.dtd.$block||(h=a.name,a=new CKEDITOR.style(a),c.filter.customConfig&&!c.filter.check(a)))||(a._name=h,a._.enterMode=l.enterMode,a._.type=d=a.assignedTo||a.type,a._.weight=e+1E3*(d==CKEDITOR.STYLE_OBJECT?1:d==CKEDITOR.STYLE_BLOCK?2:3),f[h]=
  1146. a,k.push(a),m.push(a));k.sort(function(a,b){return a._.weight-b._.weight})}});c.ui.addRichCombo("Styles",{label:g.label,title:g.panelTitle,toolbar:"styles,10",allowedContent:m,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(l.contentsCss),multiSelect:!0,attributes:{"aria-label":g.panelTitle}},init:function(){var b,a,c,d,e,f;e=0;for(f=k.length;e<f;e++)b=k[e],a=b._name,d=b._.type,d!=c&&(this.startGroup(g["panelTitle"+String(d)]),c=d),this.add(a,b.type==CKEDITOR.STYLE_OBJECT?a:b.buildPreview(),a);
  1147. this.commit()},onClick:function(b){c.focus();c.fire("saveSnapshot");b=f[b];var a=c.elementPath();c[b.checkActive(a,c)?"removeStyle":"applyStyle"](b);c.fire("saveSnapshot")},onRender:function(){c.on("selectionChange",function(b){var a=this.getValue();b=b.data.path.elements;for(var h=0,d=b.length,e;h<d;h++){e=b[h];for(var g in f)if(f[g].checkElementRemovable(e,!0,c)){g!=a&&this.setValue(g);return}}this.setValue("")},this)},onOpen:function(){var b=c.getSelection().getSelectedElement(),b=c.elementPath(b),
  1148. a=[0,0,0,0];this.showAll();this.unmarkAll();for(var h in f){var d=f[h],e=d._.type;d.checkApplicable(b,c,c.activeFilter)?a[e]++:this.hideItem(h);d.checkActive(b,c)&&this.mark(h)}a[CKEDITOR.STYLE_BLOCK]||this.hideGroup(g["panelTitle"+String(CKEDITOR.STYLE_BLOCK)]);a[CKEDITOR.STYLE_INLINE]||this.hideGroup(g["panelTitle"+String(CKEDITOR.STYLE_INLINE)]);a[CKEDITOR.STYLE_OBJECT]||this.hideGroup(g["panelTitle"+String(CKEDITOR.STYLE_OBJECT)])},refresh:function(){var b=c.elementPath();if(b){for(var a in f)if(f[a].checkApplicable(b,
  1149. c,c.activeFilter))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}},reset:function(){f={};k=[]}})}})})();(function(){function k(c){return{editorFocus:!1,canUndo:!1,modes:{wysiwyg:1},exec:function(d){if(d.editable().hasFocus){var e=d.getSelection(),b;if(b=(new CKEDITOR.dom.elementPath(e.getCommonAncestor(),e.root)).contains({td:1,th:1},1)){var e=d.createRange(),a=CKEDITOR.tools.tryThese(function(){var a=b.getParent().$.cells[b.$.cellIndex+(c?-1:1)];a.parentNode.parentNode;return a},function(){var a=b.getParent(),a=a.getAscendant("table").$.rows[a.$.rowIndex+(c?-1:1)];return a.cells[c?a.cells.length-1:
  1150. 0]});if(a||c)if(a)a=new CKEDITOR.dom.element(a),e.moveToElementEditStart(a),e.checkStartOfBlock()&&e.checkEndOfBlock()||e.selectNodeContents(a);else return!0;else{for(var f=b.getAscendant("table").$,a=b.getParent().$.cells,f=new CKEDITOR.dom.element(f.insertRow(-1),d.document),g=0,h=a.length;g<h;g++)f.append((new CKEDITOR.dom.element(a[g],d.document)).clone(!1,!1)).appendBogus();e.moveToElementEditStart(f)}e.select(!0);return!0}}return!1}}}var h={editorFocus:!1,modes:{wysiwyg:1,source:1}},g={exec:function(c){c.container.focusNext(!0,
  1151. c.tabIndex)}},f={exec:function(c){c.container.focusPrevious(!0,c.tabIndex)}};CKEDITOR.plugins.add("tab",{init:function(c){for(var d=!1!==c.config.enableTabKeyTools,e=c.config.tabSpaces||0,b="";e--;)b+=" ";if(b)c.on("key",function(a){9==a.data.keyCode&&(c.insertText(b),a.cancel())});if(d)c.on("key",function(a){(9==a.data.keyCode&&c.execCommand("selectNextCell")||a.data.keyCode==CKEDITOR.SHIFT+9&&c.execCommand("selectPreviousCell"))&&a.cancel()});c.addCommand("blur",CKEDITOR.tools.extend(g,h));c.addCommand("blurBack",
  1152. CKEDITOR.tools.extend(f,h));c.addCommand("selectNextCell",k());c.addCommand("selectPreviousCell",k(!0))}})})();
  1153. CKEDITOR.dom.element.prototype.focusNext=function(k,h){var g=void 0===h?this.getTabIndex():h,f,c,d,e,b,a;if(0>=g)for(b=this.getNextSourceNode(k,CKEDITOR.NODE_ELEMENT);b;){if(b.isVisible()&&0===b.getTabIndex()){d=b;break}b=b.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT)}else for(b=this.getDocument().getBody().getFirst();b=b.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!f)if(!c&&b.equals(this)){if(c=!0,k){if(!(b=b.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;f=1}}else c&&!this.contains(b)&&
  1154. (f=1);if(b.isVisible()&&!(0>(a=b.getTabIndex()))){if(f&&a==g){d=b;break}a>g&&(!d||!e||a<e)?(d=b,e=a):d||0!==a||(d=b,e=a)}}d&&d.focus()};
  1155. CKEDITOR.dom.element.prototype.focusPrevious=function(k,h){for(var g=void 0===h?this.getTabIndex():h,f,c,d,e=0,b,a=this.getDocument().getBody().getLast();a=a.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!f)if(!c&&a.equals(this)){if(c=!0,k){if(!(a=a.getPreviousSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;f=1}}else c&&!this.contains(a)&&(f=1);if(a.isVisible()&&!(0>(b=a.getTabIndex())))if(0>=g){if(f&&0===b){d=a;break}b>e&&(d=a,e=b)}else{if(f&&b==g){d=a;break}b<g&&(!d||b>e)&&(d=a,e=b)}}d&&d.focus()};CKEDITOR.plugins.add("table",{requires:"dialog",init:function(a){function e(a){return CKEDITOR.tools.extend(a||{},{contextSensitive:1,refresh:function(a,f){this.setState(f.contains("table",1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}if(!a.blockless){var c=a.lang.table;a.addCommand("table",new CKEDITOR.dialogCommand("table",{context:"table",allowedContent:"table{width,height}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];"+(a.plugins.dialogadvtab?
  1156. "table"+a.plugins.dialogadvtab.allowedContent():""),requiredContent:"table",contentTransformations:[["table{width}: sizeToStyle","table[width]: sizeToAttribute"]]}));a.addCommand("tableProperties",new CKEDITOR.dialogCommand("tableProperties",e()));a.addCommand("tableDelete",e({exec:function(a){var b=a.elementPath().contains("table",1);if(b){var d=b.getParent(),c=a.editable();1!=d.getChildCount()||d.is("td","th")||d.equals(c)||(b=d);a=a.createRange();a.moveToPosition(b,CKEDITOR.POSITION_BEFORE_START);
  1157. b.remove();a.select()}}}));a.ui.addButton&&a.ui.addButton("Table",{label:c.toolbar,command:"table",toolbar:"insert,30"});CKEDITOR.dialog.add("table",this.path+"dialogs/table.js");CKEDITOR.dialog.add("tableProperties",this.path+"dialogs/table.js");a.addMenuItems&&a.addMenuItems({table:{label:c.menu,command:"tableProperties",group:"table",order:5},tabledelete:{label:c.deleteTable,command:"tableDelete",group:"table",order:1}});a.on("doubleclick",function(a){a.data.element.is("table")&&(a.data.dialog=
  1158. "tableProperties")});a.contextMenu&&a.contextMenu.addListener(function(){return{tabledelete:CKEDITOR.TRISTATE_OFF,table:CKEDITOR.TRISTATE_OFF}})}}});(function(){function t(e){function d(a){0<b.length||a.type!=CKEDITOR.NODE_ELEMENT||!C.test(a.getName())||a.getCustomData("selected_cell")||(CKEDITOR.dom.element.setMarker(c,a,"selected_cell",!0),b.push(a))}e=e.getRanges();for(var b=[],c={},a=0;a<e.length;a++){var f=e[a];if(f.collapsed)f=f.getCommonAncestor(),(f=f.getAscendant("td",!0)||f.getAscendant("th",!0))&&b.push(f);else{var f=new CKEDITOR.dom.walker(f),g;for(f.guard=d;g=f.next();)g.type==CKEDITOR.NODE_ELEMENT&&g.is(CKEDITOR.dtd.table)||(g=g.getAscendant("td",
  1159. !0)||g.getAscendant("th",!0))&&!g.getCustomData("selected_cell")&&(CKEDITOR.dom.element.setMarker(c,g,"selected_cell",!0),b.push(g))}}CKEDITOR.dom.element.clearAllMarkers(c);return b}function p(e,d){for(var b=t(e),c=b[0],a=c.getAscendant("table"),c=c.getDocument(),f=b[0].getParent(),g=f.$.rowIndex,b=b[b.length-1],h=b.getParent().$.rowIndex+b.$.rowSpan-1,b=new CKEDITOR.dom.element(a.$.rows[h]),g=d?g:h,f=d?f:b,b=CKEDITOR.tools.buildTableMap(a),a=b[g],g=d?b[g-1]:b[g+1],b=b[0].length,c=c.createElement("tr"),
  1160. h=0;a[h]&&h<b;h++){var k;1<a[h].rowSpan&&g&&a[h]==g[h]?(k=a[h],k.rowSpan+=1):(k=(new CKEDITOR.dom.element(a[h])).clone(),k.removeAttribute("rowSpan"),k.appendBogus(),c.append(k),k=k.$);h+=k.colSpan-1}d?c.insertBefore(f):c.insertAfter(f)}function u(e){if(e instanceof CKEDITOR.dom.selection){var d=t(e),b=d[0].getAscendant("table"),c=CKEDITOR.tools.buildTableMap(b);e=d[0].getParent().$.rowIndex;for(var d=d[d.length-1],a=d.getParent().$.rowIndex+d.$.rowSpan-1,d=[],f=e;f<=a;f++){for(var g=c[f],h=new CKEDITOR.dom.element(b.$.rows[f]),
  1161. k=0;k<g.length;k++){var l=new CKEDITOR.dom.element(g[k]),n=l.getParent().$.rowIndex;1==l.$.rowSpan?l.remove():(--l.$.rowSpan,n==f&&(n=c[f+1],n[k-1]?l.insertAfter(new CKEDITOR.dom.element(n[k-1])):(new CKEDITOR.dom.element(b.$.rows[f+1])).append(l,1)));k+=l.$.colSpan-1}d.push(h)}c=b.$.rows;b=new CKEDITOR.dom.element(c[a+1]||(0<e?c[e-1]:null)||b.$.parentNode);for(f=d.length;0<=f;f--)u(d[f]);return b}e instanceof CKEDITOR.dom.element&&(b=e.getAscendant("table"),1==b.$.rows.length?b.remove():e.remove());
  1162. return null}function v(e,d){for(var b=d?Infinity:0,c=0;c<e.length;c++){var a;a=e[c];for(var f=d,g=a.getParent().$.cells,h=0,k=0;k<g.length;k++){var l=g[k],h=h+(f?1:l.colSpan);if(l==a.$)break}a=h-1;if(d?a<b:a>b)b=a}return b}function m(e,d){for(var b=t(e),c=b[0].getAscendant("table"),a=v(b,1),b=v(b),a=d?a:b,f=CKEDITOR.tools.buildTableMap(c),c=[],b=[],g=f.length,h=0;h<g;h++)c.push(f[h][a]),b.push(d?f[h][a-1]:f[h][a+1]);for(h=0;h<g;h++)c[h]&&(1<c[h].colSpan&&b[h]==c[h]?(a=c[h],a.colSpan+=1):(a=(new CKEDITOR.dom.element(c[h])).clone(),
  1163. a.removeAttribute("colSpan"),a.appendBogus(),a[d?"insertBefore":"insertAfter"].call(a,new CKEDITOR.dom.element(c[h])),a=a.$),h+=a.rowSpan-1)}function y(e,d){var b=e.getStartElement();if(b=b.getAscendant("td",1)||b.getAscendant("th",1)){var c=b.clone();c.appendBogus();d?c.insertBefore(b):c.insertAfter(b)}}function x(e){if(e instanceof CKEDITOR.dom.selection){e=t(e);var d=e[0]&&e[0].getAscendant("table"),b;a:{var c=0;b=e.length-1;for(var a={},f,g;f=e[c++];)CKEDITOR.dom.element.setMarker(a,f,"delete_cell",
  1164. !0);for(c=0;f=e[c++];)if((g=f.getPrevious())&&!g.getCustomData("delete_cell")||(g=f.getNext())&&!g.getCustomData("delete_cell")){CKEDITOR.dom.element.clearAllMarkers(a);b=g;break a}CKEDITOR.dom.element.clearAllMarkers(a);g=e[0].getParent();(g=g.getPrevious())?b=g.getLast():(g=e[b].getParent(),b=(g=g.getNext())?g.getChild(0):null)}for(g=e.length-1;0<=g;g--)x(e[g]);b?q(b,!0):d&&d.remove()}else e instanceof CKEDITOR.dom.element&&(d=e.getParent(),1==d.getChildCount()?d.remove():e.remove())}function q(e,
  1165. d){var b=e.getDocument(),c=CKEDITOR.document;CKEDITOR.env.ie&&10==CKEDITOR.env.version&&(c.focus(),b.focus());b=new CKEDITOR.dom.range(b);b["moveToElementEdit"+(d?"End":"Start")](e)||(b.selectNodeContents(e),b.collapse(d?!1:!0));b.select(!0)}function z(e,d,b){e=e[d];if("undefined"==typeof b)return e;for(d=0;e&&d<e.length;d++){if(b.is&&e[d]==b.$)return d;if(d==b)return new CKEDITOR.dom.element(e[d])}return b.is?-1:null}function w(e,d,b){var c=t(e),a;if((d?1!=c.length:2>c.length)||(a=e.getCommonAncestor())&&
  1166. a.type==CKEDITOR.NODE_ELEMENT&&a.is("table"))return!1;var f;e=c[0];a=e.getAscendant("table");var g=CKEDITOR.tools.buildTableMap(a),h=g.length,k=g[0].length,l=e.getParent().$.rowIndex,n=z(g,l,e);if(d){var r;try{var q=parseInt(e.getAttribute("rowspan"),10)||1;f=parseInt(e.getAttribute("colspan"),10)||1;r=g["up"==d?l-q:"down"==d?l+q:l]["left"==d?n-f:"right"==d?n+f:n]}catch(D){return!1}if(!r||e.$==r)return!1;c["up"==d||"left"==d?"unshift":"push"](new CKEDITOR.dom.element(r))}d=e.getDocument();var p=l,
  1167. q=r=0,u=!b&&new CKEDITOR.dom.documentFragment(d),w=0;for(d=0;d<c.length;d++){f=c[d];var m=f.getParent(),x=f.getFirst(),v=f.$.colSpan,y=f.$.rowSpan,m=m.$.rowIndex,A=z(g,m,f),w=w+v*y,q=Math.max(q,A-n+v);r=Math.max(r,m-l+y);b||(v=f,(y=v.getBogus())&&y.remove(),v.trim(),f.getChildren().count()&&(m==p||!x||x.isBlockBoundary&&x.isBlockBoundary({br:1})||(p=u.getLast(CKEDITOR.dom.walker.whitespaces(!0)),!p||p.is&&p.is("br")||u.append("br")),f.moveChildren(u)),d?f.remove():f.setHtml(""));p=m}if(b)return r*
  1168. q==w;u.moveChildren(e);e.appendBogus();q>=k?e.removeAttribute("rowSpan"):e.$.rowSpan=r;r>=h?e.removeAttribute("colSpan"):e.$.colSpan=q;b=new CKEDITOR.dom.nodeList(a.$.rows);c=b.count();for(d=c-1;0<=d;d--)a=b.getItem(d),a.$.cells.length||(a.remove(),c++);return e}function A(e,d){var b=t(e);if(1<b.length)return!1;if(d)return!0;var b=b[0],c=b.getParent(),a=c.getAscendant("table"),f=CKEDITOR.tools.buildTableMap(a),g=c.$.rowIndex,h=z(f,g,b),k=b.$.rowSpan,l;if(1<k){l=Math.ceil(k/2);for(var k=Math.floor(k/
  1169. 2),c=g+l,a=new CKEDITOR.dom.element(a.$.rows[c]),f=z(f,c),n,c=b.clone(),g=0;g<f.length;g++)if(n=f[g],n.parentNode==a.$&&g>h){c.insertBefore(new CKEDITOR.dom.element(n));break}else n=null;n||a.append(c)}else for(k=l=1,a=c.clone(),a.insertAfter(c),a.append(c=b.clone()),n=z(f,g),h=0;h<n.length;h++)n[h].rowSpan++;c.appendBogus();b.$.rowSpan=l;c.$.rowSpan=k;1==l&&b.removeAttribute("rowSpan");1==k&&c.removeAttribute("rowSpan");return c}function B(e,d){var b=t(e);if(1<b.length)return!1;if(d)return!0;var b=
  1170. b[0],c=b.getParent(),a=c.getAscendant("table"),a=CKEDITOR.tools.buildTableMap(a),f=z(a,c.$.rowIndex,b),g=b.$.colSpan;if(1<g)c=Math.ceil(g/2),g=Math.floor(g/2);else{for(var g=c=1,h=[],k=0;k<a.length;k++){var l=a[k];h.push(l[f]);1<l[f].rowSpan&&(k+=l[f].rowSpan-1)}for(a=0;a<h.length;a++)h[a].colSpan++}a=b.clone();a.insertAfter(b);a.appendBogus();b.$.colSpan=c;a.$.colSpan=g;1==c&&b.removeAttribute("colSpan");1==g&&a.removeAttribute("colSpan");return a}var C=/^(?:td|th)$/;CKEDITOR.plugins.tabletools=
  1171. {requires:"table,dialog,contextmenu",init:function(e){function d(a){return CKEDITOR.tools.extend(a||{},{contextSensitive:1,refresh:function(a,b){this.setState(b.contains({td:1,th:1},1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}function b(a,b){var c=e.addCommand(a,b);e.addFeature(c)}var c=e.lang.table;b("cellProperties",new CKEDITOR.dialogCommand("cellProperties",d({allowedContent:"td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]",
  1172. requiredContent:"table"})));CKEDITOR.dialog.add("cellProperties",this.path+"dialogs/tableCell.js");b("rowDelete",d({requiredContent:"table",exec:function(a){a=a.getSelection();q(u(a))}}));b("rowInsertBefore",d({requiredContent:"table",exec:function(a){a=a.getSelection();p(a,!0)}}));b("rowInsertAfter",d({requiredContent:"table",exec:function(a){a=a.getSelection();p(a)}}));b("columnDelete",d({requiredContent:"table",exec:function(a){a=a.getSelection();a=t(a);var b=a[0],c=a[a.length-1];a=b.getAscendant("table");
  1173. for(var d=CKEDITOR.tools.buildTableMap(a),e,l,n=[],r=0,p=d.length;r<p;r++)for(var m=0,u=d[r].length;m<u;m++)d[r][m]==b.$&&(e=m),d[r][m]==c.$&&(l=m);for(r=e;r<=l;r++)for(m=0;m<d.length;m++)c=d[m],b=new CKEDITOR.dom.element(a.$.rows[m]),c=new CKEDITOR.dom.element(c[r]),c.$&&(1==c.$.colSpan?c.remove():--c.$.colSpan,m+=c.$.rowSpan-1,b.$.cells.length||n.push(b));l=a.$.rows[0]&&a.$.rows[0].cells;e=new CKEDITOR.dom.element(l[e]||(e?l[e-1]:a.$.parentNode));n.length==p&&a.remove();e&&q(e,!0)}}));b("columnInsertBefore",
  1174. d({requiredContent:"table",exec:function(a){a=a.getSelection();m(a,!0)}}));b("columnInsertAfter",d({requiredContent:"table",exec:function(a){a=a.getSelection();m(a)}}));b("cellDelete",d({requiredContent:"table",exec:function(a){a=a.getSelection();x(a)}}));b("cellMerge",d({allowedContent:"td[colspan,rowspan]",requiredContent:"td[colspan,rowspan]",exec:function(a){q(w(a.getSelection()),!0)}}));b("cellMergeRight",d({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(a){q(w(a.getSelection(),
  1175. "right"),!0)}}));b("cellMergeDown",d({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",exec:function(a){q(w(a.getSelection(),"down"),!0)}}));b("cellVerticalSplit",d({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",exec:function(a){q(B(a.getSelection()))}}));b("cellHorizontalSplit",d({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(a){q(A(a.getSelection()))}}));b("cellInsertBefore",d({requiredContent:"table",exec:function(a){a=a.getSelection();y(a,!0)}}));
  1176. b("cellInsertAfter",d({requiredContent:"table",exec:function(a){a=a.getSelection();y(a)}}));e.addMenuItems&&e.addMenuItems({tablecell:{label:c.cell.menu,group:"tablecell",order:1,getItems:function(){var a=e.getSelection(),b=t(a);return{tablecell_insertBefore:CKEDITOR.TRISTATE_OFF,tablecell_insertAfter:CKEDITOR.TRISTATE_OFF,tablecell_delete:CKEDITOR.TRISTATE_OFF,tablecell_merge:w(a,null,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_right:w(a,"right",!0)?CKEDITOR.TRISTATE_OFF:
  1177. CKEDITOR.TRISTATE_DISABLED,tablecell_merge_down:w(a,"down",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_vertical:B(a,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_horizontal:A(a,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_properties:0<b.length?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED}}},tablecell_insertBefore:{label:c.cell.insertBefore,group:"tablecell",command:"cellInsertBefore",order:5},tablecell_insertAfter:{label:c.cell.insertAfter,
  1178. group:"tablecell",command:"cellInsertAfter",order:10},tablecell_delete:{label:c.cell.deleteCell,group:"tablecell",command:"cellDelete",order:15},tablecell_merge:{label:c.cell.merge,group:"tablecell",command:"cellMerge",order:16},tablecell_merge_right:{label:c.cell.mergeRight,group:"tablecell",command:"cellMergeRight",order:17},tablecell_merge_down:{label:c.cell.mergeDown,group:"tablecell",command:"cellMergeDown",order:18},tablecell_split_horizontal:{label:c.cell.splitHorizontal,group:"tablecell",
  1179. command:"cellHorizontalSplit",order:19},tablecell_split_vertical:{label:c.cell.splitVertical,group:"tablecell",command:"cellVerticalSplit",order:20},tablecell_properties:{label:c.cell.title,group:"tablecellproperties",command:"cellProperties",order:21},tablerow:{label:c.row.menu,group:"tablerow",order:1,getItems:function(){return{tablerow_insertBefore:CKEDITOR.TRISTATE_OFF,tablerow_insertAfter:CKEDITOR.TRISTATE_OFF,tablerow_delete:CKEDITOR.TRISTATE_OFF}}},tablerow_insertBefore:{label:c.row.insertBefore,
  1180. group:"tablerow",command:"rowInsertBefore",order:5},tablerow_insertAfter:{label:c.row.insertAfter,group:"tablerow",command:"rowInsertAfter",order:10},tablerow_delete:{label:c.row.deleteRow,group:"tablerow",command:"rowDelete",order:15},tablecolumn:{label:c.column.menu,group:"tablecolumn",order:1,getItems:function(){return{tablecolumn_insertBefore:CKEDITOR.TRISTATE_OFF,tablecolumn_insertAfter:CKEDITOR.TRISTATE_OFF,tablecolumn_delete:CKEDITOR.TRISTATE_OFF}}},tablecolumn_insertBefore:{label:c.column.insertBefore,
  1181. group:"tablecolumn",command:"columnInsertBefore",order:5},tablecolumn_insertAfter:{label:c.column.insertAfter,group:"tablecolumn",command:"columnInsertAfter",order:10},tablecolumn_delete:{label:c.column.deleteColumn,group:"tablecolumn",command:"columnDelete",order:15}});e.contextMenu&&e.contextMenu.addListener(function(a,b,c){return(a=c.contains({td:1,th:1},1))&&!a.isReadOnly()?{tablecell:CKEDITOR.TRISTATE_OFF,tablerow:CKEDITOR.TRISTATE_OFF,tablecolumn:CKEDITOR.TRISTATE_OFF}:null})},getSelectedCells:t};
  1182. CKEDITOR.plugins.add("tabletools",CKEDITOR.plugins.tabletools)})();CKEDITOR.tools.buildTableMap=function(t){t=t.$.rows;for(var p=-1,u=[],v=0;v<t.length;v++){p++;!u[p]&&(u[p]=[]);for(var m=-1,y=0;y<t[v].cells.length;y++){var x=t[v].cells[y];for(m++;u[p][m];)m++;for(var q=isNaN(x.colSpan)?1:x.colSpan,x=isNaN(x.rowSpan)?1:x.rowSpan,z=0;z<x;z++){u[p+z]||(u[p+z]=[]);for(var w=0;w<q;w++)u[p+z][m+w]=t[v].cells[y]}m+=q-1}}return u};(function(){var g=[CKEDITOR.CTRL+90,CKEDITOR.CTRL+89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90],n={8:1,46:1};CKEDITOR.plugins.add("undo",{init:function(a){function b(a){d.enabled&&!1!==a.data.command.canUndo&&d.save()}function c(){d.enabled=a.readOnly?!1:"wysiwyg"==a.mode;d.onChange()}var d=a.undoManager=new e(a),l=d.editingHandler=new k(d),f=a.addCommand("undo",{exec:function(){d.undo()&&(a.selectionChange(),this.fire("afterUndo"))},startDisabled:!0,canUndo:!1}),h=a.addCommand("redo",{exec:function(){d.redo()&&
  1183. (a.selectionChange(),this.fire("afterRedo"))},startDisabled:!0,canUndo:!1});a.setKeystroke([[g[0],"undo"],[g[1],"redo"],[g[2],"redo"]]);d.onChange=function(){f.setState(d.undoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);h.setState(d.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)};a.on("beforeCommandExec",b);a.on("afterCommandExec",b);a.on("saveSnapshot",function(a){d.save(a.data&&a.data.contentOnly)});a.on("contentDom",l.attachListeners,l);a.on("instanceReady",function(){a.fire("saveSnapshot")});
  1184. a.on("beforeModeUnload",function(){"wysiwyg"==a.mode&&d.save(!0)});a.on("mode",c);a.on("readOnly",c);a.ui.addButton&&(a.ui.addButton("Undo",{label:a.lang.undo.undo,command:"undo",toolbar:"undo,10"}),a.ui.addButton("Redo",{label:a.lang.undo.redo,command:"redo",toolbar:"undo,20"}));a.resetUndo=function(){d.reset();a.fire("saveSnapshot")};a.on("updateSnapshot",function(){d.currentImage&&d.update()});a.on("lockSnapshot",function(a){a=a.data;d.lock(a&&a.dontUpdate,a&&a.forceUpdate)});a.on("unlockSnapshot",
  1185. d.unlock,d)}});CKEDITOR.plugins.undo={};var e=CKEDITOR.plugins.undo.UndoManager=function(a){this.strokesRecorded=[0,0];this.locked=null;this.previousKeyGroup=-1;this.limit=a.config.undoStackSize||20;this.strokesLimit=25;this.editor=a;this.reset()};e.prototype={type:function(a,b){var c=e.getKeyGroup(a),d=this.strokesRecorded[c]+1;b=b||d>=this.strokesLimit;this.typing||(this.hasUndo=this.typing=!0,this.hasRedo=!1,this.onChange());b?(d=0,this.editor.fire("saveSnapshot")):this.editor.fire("change");this.strokesRecorded[c]=
  1186. d;this.previousKeyGroup=c},keyGroupChanged:function(a){return e.getKeyGroup(a)!=this.previousKeyGroup},reset:function(){this.snapshots=[];this.index=-1;this.currentImage=null;this.hasRedo=this.hasUndo=!1;this.locked=null;this.resetType()},resetType:function(){this.strokesRecorded=[0,0];this.typing=!1;this.previousKeyGroup=-1},refreshState:function(){this.hasUndo=!!this.getNextImage(!0);this.hasRedo=!!this.getNextImage(!1);this.resetType();this.onChange()},save:function(a,b,c){var d=this.editor;if(this.locked||
  1187. "ready"!=d.status||"wysiwyg"!=d.mode)return!1;var e=d.editable();if(!e||"ready"!=e.status)return!1;e=this.snapshots;b||(b=new f(d));if(!1===b.contents)return!1;if(this.currentImage)if(b.equalsContent(this.currentImage)){if(a||b.equalsSelection(this.currentImage))return!1}else!1!==c&&d.fire("change");e.splice(this.index+1,e.length-this.index-1);e.length==this.limit&&e.shift();this.index=e.push(b)-1;this.currentImage=b;!1!==c&&this.refreshState();return!0},restoreImage:function(a){var b=this.editor,
  1188. c;a.bookmarks&&(b.focus(),c=b.getSelection());this.locked={level:999};this.editor.loadSnapshot(a.contents);a.bookmarks?c.selectBookmarks(a.bookmarks):CKEDITOR.env.ie&&(c=this.editor.document.getBody().$.createTextRange(),c.collapse(!0),c.select());this.locked=null;this.index=a.index;this.currentImage=this.snapshots[this.index];this.update();this.refreshState();b.fire("change")},getNextImage:function(a){var b=this.snapshots,c=this.currentImage,d;if(c)if(a)for(d=this.index-1;0<=d;d--){if(a=b[d],!c.equalsContent(a))return a.index=
  1189. d,a}else for(d=this.index+1;d<b.length;d++)if(a=b[d],!c.equalsContent(a))return a.index=d,a;return null},redoable:function(){return this.enabled&&this.hasRedo},undoable:function(){return this.enabled&&this.hasUndo},undo:function(){if(this.undoable()){this.save(!0);var a=this.getNextImage(!0);if(a)return this.restoreImage(a),!0}return!1},redo:function(){if(this.redoable()&&(this.save(!0),this.redoable())){var a=this.getNextImage(!1);if(a)return this.restoreImage(a),!0}return!1},update:function(a){if(!this.locked){a||
  1190. (a=new f(this.editor));for(var b=this.index,c=this.snapshots;0<b&&this.currentImage.equalsContent(c[b-1]);)--b;c.splice(b,this.index-b+1,a);this.index=b;this.currentImage=a}},updateSelection:function(a){if(!this.snapshots.length)return!1;var b=this.snapshots,c=b[b.length-1];return c.equalsContent(a)&&!c.equalsSelection(a)?(this.currentImage=b[b.length-1]=a,!0):!1},lock:function(a,b){if(this.locked)this.locked.level++;else if(a)this.locked={level:1};else{var c=null;if(b)c=!0;else{var d=new f(this.editor,
  1191. !0);this.currentImage&&this.currentImage.equalsContent(d)&&(c=d)}this.locked={update:c,level:1}}},unlock:function(){if(this.locked&&!--this.locked.level){var a=this.locked.update;this.locked=null;if(!0===a)this.update();else if(a){var b=new f(this.editor,!0);a.equalsContent(b)||this.update()}}}};e.navigationKeyCodes={37:1,38:1,39:1,40:1,36:1,35:1,33:1,34:1};e.keyGroups={PRINTABLE:0,FUNCTIONAL:1};e.isNavigationKey=function(a){return!!e.navigationKeyCodes[a]};e.getKeyGroup=function(a){var b=e.keyGroups;
  1192. return n[a]?b.FUNCTIONAL:b.PRINTABLE};e.getOppositeKeyGroup=function(a){var b=e.keyGroups;return a==b.FUNCTIONAL?b.PRINTABLE:b.FUNCTIONAL};e.ieFunctionalKeysBug=function(a){return CKEDITOR.env.ie&&e.getKeyGroup(a)==e.keyGroups.FUNCTIONAL};var f=CKEDITOR.plugins.undo.Image=function(a,b){this.editor=a;a.fire("beforeUndoImage");var c=a.getSnapshot();CKEDITOR.env.ie&&c&&(c=c.replace(/\s+data-cke-expando=".*?"/g,""));this.contents=c;b||(this.bookmarks=(c=c&&a.getSelection())&&c.createBookmarks2(!0));a.fire("afterUndoImage")},
  1193. h=/\b(?:href|src|name)="[^"]*?"/gi;f.prototype={equalsContent:function(a){var b=this.contents;a=a.contents;CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)&&(b=b.replace(h,""),a=a.replace(h,""));return b!=a?!1:!0},equalsSelection:function(a){var b=this.bookmarks;a=a.bookmarks;if(b||a){if(!b||!a||b.length!=a.length)return!1;for(var c=0;c<b.length;c++){var d=b[c],e=a[c];if(d.startOffset!=e.startOffset||d.endOffset!=e.endOffset||!CKEDITOR.tools.arrayCompare(d.start,e.start)||!CKEDITOR.tools.arrayCompare(d.end,
  1194. e.end))return!1}}return!0}};var k=CKEDITOR.plugins.undo.NativeEditingHandler=function(a){this.undoManager=a;this.ignoreInputEvent=!1;this.keyEventsStack=new m;this.lastKeydownImage=null};k.prototype={onKeydown:function(a){var b=a.data.getKey();if(229!==b)if(-1<CKEDITOR.tools.indexOf(g,a.data.getKeystroke()))a.data.preventDefault();else if(this.keyEventsStack.cleanUp(a),a=this.undoManager,this.keyEventsStack.getLast(b)||this.keyEventsStack.push(b),this.lastKeydownImage=new f(a.editor),e.isNavigationKey(b)||
  1195. this.undoManager.keyGroupChanged(b))if(a.strokesRecorded[0]||a.strokesRecorded[1])a.save(!1,this.lastKeydownImage,!1),a.resetType()},onInput:function(){if(this.ignoreInputEvent)this.ignoreInputEvent=!1;else{var a=this.keyEventsStack.getLast();a||(a=this.keyEventsStack.push(0));this.keyEventsStack.increment(a.keyCode);this.keyEventsStack.getTotalInputs()>=this.undoManager.strokesLimit&&(this.undoManager.type(a.keyCode,!0),this.keyEventsStack.resetInputs())}},onKeyup:function(a){var b=this.undoManager;
  1196. a=a.data.getKey();var c=this.keyEventsStack.getTotalInputs();this.keyEventsStack.remove(a);if(!(e.ieFunctionalKeysBug(a)&&this.lastKeydownImage&&this.lastKeydownImage.equalsContent(new f(b.editor,!0))))if(0<c)b.type(a);else if(e.isNavigationKey(a))this.onNavigationKey(!0)},onNavigationKey:function(a){var b=this.undoManager;!a&&b.save(!0,null,!1)||b.updateSelection(new f(b.editor));b.resetType()},ignoreInputEventListener:function(){this.ignoreInputEvent=!0},attachListeners:function(){var a=this.undoManager.editor,
  1197. b=a.editable(),c=this;b.attachListener(b,"keydown",function(a){c.onKeydown(a);if(e.ieFunctionalKeysBug(a.data.getKey()))c.onInput()},null,null,999);b.attachListener(b,CKEDITOR.env.ie?"keypress":"input",c.onInput,c,null,999);b.attachListener(b,"keyup",c.onKeyup,c,null,999);b.attachListener(b,"paste",c.ignoreInputEventListener,c,null,999);b.attachListener(b,"drop",c.ignoreInputEventListener,c,null,999);b.attachListener(b.isInline()?b:a.document.getDocumentElement(),"click",function(){c.onNavigationKey()},
  1198. null,null,999);b.attachListener(this.undoManager.editor,"blur",function(){c.keyEventsStack.remove(9)},null,null,999)}};var m=CKEDITOR.plugins.undo.KeyEventsStack=function(){this.stack=[]};m.prototype={push:function(a){a=this.stack.push({keyCode:a,inputs:0});return this.stack[a-1]},getLastIndex:function(a){if("number"!=typeof a)return this.stack.length-1;for(var b=this.stack.length;b--;)if(this.stack[b].keyCode==a)return b;return-1},getLast:function(a){a=this.getLastIndex(a);return-1!=a?this.stack[a]:
  1199. null},increment:function(a){this.getLast(a).inputs++},remove:function(a){a=this.getLastIndex(a);-1!=a&&this.stack.splice(a,1)},resetInputs:function(a){if("number"==typeof a)this.getLast(a).inputs=0;else for(a=this.stack.length;a--;)this.stack[a].inputs=0},getTotalInputs:function(){for(var a=this.stack.length,b=0;a--;)b+=this.stack[a].inputs;return b},cleanUp:function(a){a=a.data.$;a.ctrlKey||a.metaKey||this.remove(17);a.shiftKey||this.remove(16);a.altKey||this.remove(18)}}})();CKEDITOR.plugins.add("wsc",{requires:"dialog",parseApi:function(a){a.config.wsc_onFinish="function"===typeof a.config.wsc_onFinish?a.config.wsc_onFinish:function(){};a.config.wsc_onClose="function"===typeof a.config.wsc_onClose?a.config.wsc_onClose:function(){}},parseConfig:function(a){a.config.wsc_customerId=a.config.wsc_customerId||CKEDITOR.config.wsc_customerId||"1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk";a.config.wsc_customDictionaryIds=a.config.wsc_customDictionaryIds||
  1200. CKEDITOR.config.wsc_customDictionaryIds||"";a.config.wsc_userDictionaryName=a.config.wsc_userDictionaryName||CKEDITOR.config.wsc_userDictionaryName||"";a.config.wsc_customLoaderScript=a.config.wsc_customLoaderScript||CKEDITOR.config.wsc_customLoaderScript;CKEDITOR.config.wsc_cmd=a.config.wsc_cmd||CKEDITOR.config.wsc_cmd||"spell";CKEDITOR.config.wsc_version="v4.3.0-master-d769233";CKEDITOR.config.wsc_removeGlobalVariable=!0},init:function(a){var b=CKEDITOR.env;this.parseConfig(a);this.parseApi(a);
  1201. a.addCommand("checkspell",new CKEDITOR.dialogCommand("checkspell")).modes={wysiwyg:!CKEDITOR.env.opera&&!CKEDITOR.env.air&&document.domain==window.location.hostname&&!(b.ie&&(8>b.version||b.quirks))};"undefined"==typeof a.plugins.scayt&&a.ui.addButton&&a.ui.addButton("SpellChecker",{label:a.lang.wsc.toolbar,click:function(a){var b=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.container.getText():a.document.getBody().getText();(b=b.replace(/\s/g,""))?a.execCommand("checkspell"):alert("Nothing to check!")},
  1202. toolbar:"spellchecker,10"});CKEDITOR.dialog.add("checkspell",this.path+(CKEDITOR.env.ie&&7>=CKEDITOR.env.version?"dialogs/wsc_ie.js":window.postMessage?"dialogs/wsc.js":"dialogs/wsc_ie.js"))}});CKEDITOR.config.plugins='dialogui,dialog,about,a11yhelp,dialogadvtab,basicstyles,bidi,blockquote,clipboard,button,panelbutton,panel,floatpanel,colorbutton,colordialog,templates,menu,contextmenu,div,resize,toolbar,elementspath,enterkey,entities,popup,filebrowser,find,fakeobjects,flash,floatingspace,listblock,richcombo,font,forms,format,horizontalrule,htmlwriter,iframe,wysiwygarea,image,indent,indentblock,indentlist,smiley,justify,menubutton,language,link,list,liststyle,magicline,maximize,newpage,pagebreak,pastetext,pastefromword,preview,print,removeformat,save,selectall,showblocks,showborders,sourcearea,specialchar,scayt,stylescombo,tab,table,tabletools,undo,wsc';CKEDITOR.config.skin='moono';(function() {var setIcons = function(icons, strip) {var path = CKEDITOR.getUrl( 'plugins/' + strip );icons = icons.split( ',' );for ( var i = 0; i < icons.length; i++ )CKEDITOR.skin.icons[ icons[ i ] ] = { path: path, offset: -icons[ ++i ], bgsize : icons[ ++i ] };};if (CKEDITOR.env.hidpi) setIcons('about,0,,bold,24,,italic,48,,strike,72,,subscript,96,,superscript,120,,underline,144,,bidiltr,168,,bidirtl,192,,blockquote,216,,copy-rtl,240,,copy,264,,cut-rtl,288,,cut,312,,paste-rtl,336,,paste,360,,bgcolor,384,,textcolor,408,,templates-rtl,432,,templates,456,,creatediv,480,,find-rtl,504,,find,528,,replace,552,,flash,576,,button,600,,checkbox,624,,form,648,,hiddenfield,672,,imagebutton,696,,radio,720,,select-rtl,744,,select,768,,textarea-rtl,792,,textarea,816,,textfield-rtl,840,,textfield,864,,horizontalrule,888,,iframe,912,,image,936,,indent-rtl,960,,indent,984,,outdent-rtl,1008,,outdent,1032,,smiley,1056,,justifyblock,1080,,justifycenter,1104,,justifyleft,1128,,justifyright,1152,,language,1176,,anchor-rtl,1200,,anchor,1224,,link,1248,,unlink,1272,,bulletedlist-rtl,1296,,bulletedlist,1320,,numberedlist-rtl,1344,,numberedlist,1368,,maximize,1392,,newpage-rtl,1416,,newpage,1440,,pagebreak-rtl,1464,,pagebreak,1488,,pastetext-rtl,1512,,pastetext,1536,,pastefromword-rtl,1560,,pastefromword,1584,,preview-rtl,1608,,preview,1632,,print,1656,,removeformat,1680,,save,1704,,selectall,1728,,showblocks-rtl,1752,,showblocks,1776,,source-rtl,1800,,source,1824,,specialchar,1848,,scayt,1872,,table,1896,,redo-rtl,1920,,redo,1944,,undo-rtl,1968,,undo,1992,,spellchecker,2016,','icons_hidpi.png');else setIcons('about,0,auto,bold,24,auto,italic,48,auto,strike,72,auto,subscript,96,auto,superscript,120,auto,underline,144,auto,bidiltr,168,auto,bidirtl,192,auto,blockquote,216,auto,copy-rtl,240,auto,copy,264,auto,cut-rtl,288,auto,cut,312,auto,paste-rtl,336,auto,paste,360,auto,bgcolor,384,auto,textcolor,408,auto,templates-rtl,432,auto,templates,456,auto,creatediv,480,auto,find-rtl,504,auto,find,528,auto,replace,552,auto,flash,576,auto,button,600,auto,checkbox,624,auto,form,648,auto,hiddenfield,672,auto,imagebutton,696,auto,radio,720,auto,select-rtl,744,auto,select,768,auto,textarea-rtl,792,auto,textarea,816,auto,textfield-rtl,840,auto,textfield,864,auto,horizontalrule,888,auto,iframe,912,auto,image,936,auto,indent-rtl,960,auto,indent,984,auto,outdent-rtl,1008,auto,outdent,1032,auto,smiley,1056,auto,justifyblock,1080,auto,justifycenter,1104,auto,justifyleft,1128,auto,justifyright,1152,auto,language,1176,auto,anchor-rtl,1200,auto,anchor,1224,auto,link,1248,auto,unlink,1272,auto,bulletedlist-rtl,1296,auto,bulletedlist,1320,auto,numberedlist-rtl,1344,auto,numberedlist,1368,auto,maximize,1392,auto,newpage-rtl,1416,auto,newpage,1440,auto,pagebreak-rtl,1464,auto,pagebreak,1488,auto,pastetext-rtl,1512,auto,pastetext,1536,auto,pastefromword-rtl,1560,auto,pastefromword,1584,auto,preview-rtl,1608,auto,preview,1632,auto,print,1656,auto,removeformat,1680,auto,save,1704,auto,selectall,1728,auto,showblocks-rtl,1752,auto,showblocks,1776,auto,source-rtl,1800,auto,source,1824,auto,specialchar,1848,auto,scayt,1872,auto,table,1896,auto,redo-rtl,1920,auto,redo,1944,auto,undo-rtl,1968,auto,undo,1992,auto,spellchecker,2016,auto','icons.png');})();CKEDITOR.lang.languages={"af":1,"sq":1,"ar":1,"eu":1,"bn":1,"bs":1,"bg":1,"ca":1,"zh-cn":1,"zh":1,"hr":1,"cs":1,"da":1,"nl":1,"en":1,"en-au":1,"en-ca":1,"en-gb":1,"eo":1,"et":1,"fo":1,"fi":1,"fr":1,"fr-ca":1,"gl":1,"ka":1,"de":1,"de-ch":1,"el":1,"gu":1,"he":1,"hi":1,"hu":1,"is":1,"id":1,"it":1,"ja":1,"km":1,"ko":1,"ku":1,"lv":1,"lt":1,"mk":1,"ms":1,"mn":1,"no":1,"nb":1,"fa":1,"pl":1,"pt-br":1,"pt":1,"ro":1,"ru":1,"sr":1,"sr-latn":1,"si":1,"sk":1,"sl":1,"es":1,"sv":1,"tt":1,"th":1,"tr":1,"ug":1,"uk":1,"vi":1,"cy":1};}());
  1203. /*!
  1204. * jQuery JavaScript Library v1.12.4
  1205. * http://jquery.com/
  1206. *
  1207. * Includes Sizzle.js
  1208. * http://sizzlejs.com/
  1209. *
  1210. * Copyright jQuery Foundation and other contributors
  1211. * Released under the MIT license
  1212. * http://jquery.org/license
  1213. *
  1214. * Date: 2016-05-20T17:17Z
  1215. */
  1216. (function( global, factory ) {
  1217. if ( typeof module === "object" && typeof module.exports === "object" ) {
  1218. // For CommonJS and CommonJS-like environments where a proper `window`
  1219. // is present, execute the factory and get jQuery.
  1220. // For environments that do not have a `window` with a `document`
  1221. // (such as Node.js), expose a factory as module.exports.
  1222. // This accentuates the need for the creation of a real `window`.
  1223. // e.g. var jQuery = require("jquery")(window);
  1224. // See ticket #14549 for more info.
  1225. module.exports = global.document ?
  1226. factory( global, true ) :
  1227. function( w ) {
  1228. if ( !w.document ) {
  1229. throw new Error( "jQuery requires a window with a document" );
  1230. }
  1231. return factory( w );
  1232. };
  1233. } else {
  1234. factory( global );
  1235. }
  1236. // Pass this if window is not defined yet
  1237. }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  1238. // Support: Firefox 18+
  1239. // Can't be in strict mode, several libs including ASP.NET trace
  1240. // the stack via arguments.caller.callee and Firefox dies if
  1241. // you try to trace through "use strict" call chains. (#13335)
  1242. //"use strict";
  1243. var deletedIds = [];
  1244. var document = window.document;
  1245. var slice = deletedIds.slice;
  1246. var concat = deletedIds.concat;
  1247. var push = deletedIds.push;
  1248. var indexOf = deletedIds.indexOf;
  1249. var class2type = {};
  1250. var toString = class2type.toString;
  1251. var hasOwn = class2type.hasOwnProperty;
  1252. var support = {};
  1253. var
  1254. version = "1.12.4",
  1255. // Define a local copy of jQuery
  1256. jQuery = function( selector, context ) {
  1257. // The jQuery object is actually just the init constructor 'enhanced'
  1258. // Need init if jQuery is called (just allow error to be thrown if not included)
  1259. return new jQuery.fn.init( selector, context );
  1260. },
  1261. // Support: Android<4.1, IE<9
  1262. // Make sure we trim BOM and NBSP
  1263. rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  1264. // Matches dashed string for camelizing
  1265. rmsPrefix = /^-ms-/,
  1266. rdashAlpha = /-([\da-z])/gi,
  1267. // Used by jQuery.camelCase as callback to replace()
  1268. fcamelCase = function( all, letter ) {
  1269. return letter.toUpperCase();
  1270. };
  1271. jQuery.fn = jQuery.prototype = {
  1272. // The current version of jQuery being used
  1273. jquery: version,
  1274. constructor: jQuery,
  1275. // Start with an empty selector
  1276. selector: "",
  1277. // The default length of a jQuery object is 0
  1278. length: 0,
  1279. toArray: function() {
  1280. return slice.call( this );
  1281. },
  1282. // Get the Nth element in the matched element set OR
  1283. // Get the whole matched element set as a clean array
  1284. get: function( num ) {
  1285. return num != null ?
  1286. // Return just the one element from the set
  1287. ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
  1288. // Return all the elements in a clean array
  1289. slice.call( this );
  1290. },
  1291. // Take an array of elements and push it onto the stack
  1292. // (returning the new matched element set)
  1293. pushStack: function( elems ) {
  1294. // Build a new jQuery matched element set
  1295. var ret = jQuery.merge( this.constructor(), elems );
  1296. // Add the old object onto the stack (as a reference)
  1297. ret.prevObject = this;
  1298. ret.context = this.context;
  1299. // Return the newly-formed element set
  1300. return ret;
  1301. },
  1302. // Execute a callback for every element in the matched set.
  1303. each: function( callback ) {
  1304. return jQuery.each( this, callback );
  1305. },
  1306. map: function( callback ) {
  1307. return this.pushStack( jQuery.map( this, function( elem, i ) {
  1308. return callback.call( elem, i, elem );
  1309. } ) );
  1310. },
  1311. slice: function() {
  1312. return this.pushStack( slice.apply( this, arguments ) );
  1313. },
  1314. first: function() {
  1315. return this.eq( 0 );
  1316. },
  1317. last: function() {
  1318. return this.eq( -1 );
  1319. },
  1320. eq: function( i ) {
  1321. var len = this.length,
  1322. j = +i + ( i < 0 ? len : 0 );
  1323. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  1324. },
  1325. end: function() {
  1326. return this.prevObject || this.constructor();
  1327. },
  1328. // For internal use only.
  1329. // Behaves like an Array's method, not like a jQuery method.
  1330. push: push,
  1331. sort: deletedIds.sort,
  1332. splice: deletedIds.splice
  1333. };
  1334. jQuery.extend = jQuery.fn.extend = function() {
  1335. var src, copyIsArray, copy, name, options, clone,
  1336. target = arguments[ 0 ] || {},
  1337. i = 1,
  1338. length = arguments.length,
  1339. deep = false;
  1340. // Handle a deep copy situation
  1341. if ( typeof target === "boolean" ) {
  1342. deep = target;
  1343. // skip the boolean and the target
  1344. target = arguments[ i ] || {};
  1345. i++;
  1346. }
  1347. // Handle case when target is a string or something (possible in deep copy)
  1348. if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
  1349. target = {};
  1350. }
  1351. // extend jQuery itself if only one argument is passed
  1352. if ( i === length ) {
  1353. target = this;
  1354. i--;
  1355. }
  1356. for ( ; i < length; i++ ) {
  1357. // Only deal with non-null/undefined values
  1358. if ( ( options = arguments[ i ] ) != null ) {
  1359. // Extend the base object
  1360. for ( name in options ) {
  1361. src = target[ name ];
  1362. copy = options[ name ];
  1363. // Prevent never-ending loop
  1364. if ( target === copy ) {
  1365. continue;
  1366. }
  1367. // Recurse if we're merging plain objects or arrays
  1368. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  1369. ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
  1370. if ( copyIsArray ) {
  1371. copyIsArray = false;
  1372. clone = src && jQuery.isArray( src ) ? src : [];
  1373. } else {
  1374. clone = src && jQuery.isPlainObject( src ) ? src : {};
  1375. }
  1376. // Never move original objects, clone them
  1377. target[ name ] = jQuery.extend( deep, clone, copy );
  1378. // Don't bring in undefined values
  1379. } else if ( copy !== undefined ) {
  1380. target[ name ] = copy;
  1381. }
  1382. }
  1383. }
  1384. }
  1385. // Return the modified object
  1386. return target;
  1387. };
  1388. jQuery.extend( {
  1389. // Unique for each copy of jQuery on the page
  1390. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  1391. // Assume jQuery is ready without the ready module
  1392. isReady: true,
  1393. error: function( msg ) {
  1394. throw new Error( msg );
  1395. },
  1396. noop: function() {},
  1397. // See test/unit/core.js for details concerning isFunction.
  1398. // Since version 1.3, DOM methods and functions like alert
  1399. // aren't supported. They return false on IE (#2968).
  1400. isFunction: function( obj ) {
  1401. return jQuery.type( obj ) === "function";
  1402. },
  1403. isArray: Array.isArray || function( obj ) {
  1404. return jQuery.type( obj ) === "array";
  1405. },
  1406. isWindow: function( obj ) {
  1407. /* jshint eqeqeq: false */
  1408. return obj != null && obj == obj.window;
  1409. },
  1410. isNumeric: function( obj ) {
  1411. // parseFloat NaNs numeric-cast false positives (null|true|false|"")
  1412. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  1413. // subtraction forces infinities to NaN
  1414. // adding 1 corrects loss of precision from parseFloat (#15100)
  1415. var realStringObj = obj && obj.toString();
  1416. return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
  1417. },
  1418. isEmptyObject: function( obj ) {
  1419. var name;
  1420. for ( name in obj ) {
  1421. return false;
  1422. }
  1423. return true;
  1424. },
  1425. isPlainObject: function( obj ) {
  1426. var key;
  1427. // Must be an Object.
  1428. // Because of IE, we also have to check the presence of the constructor property.
  1429. // Make sure that DOM nodes and window objects don't pass through, as well
  1430. if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
  1431. return false;
  1432. }
  1433. try {
  1434. // Not own constructor property must be Object
  1435. if ( obj.constructor &&
  1436. !hasOwn.call( obj, "constructor" ) &&
  1437. !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
  1438. return false;
  1439. }
  1440. } catch ( e ) {
  1441. // IE8,9 Will throw exceptions on certain host objects #9897
  1442. return false;
  1443. }
  1444. // Support: IE<9
  1445. // Handle iteration over inherited properties before own properties.
  1446. if ( !support.ownFirst ) {
  1447. for ( key in obj ) {
  1448. return hasOwn.call( obj, key );
  1449. }
  1450. }
  1451. // Own properties are enumerated firstly, so to speed up,
  1452. // if last one is own, then all properties are own.
  1453. for ( key in obj ) {}
  1454. return key === undefined || hasOwn.call( obj, key );
  1455. },
  1456. type: function( obj ) {
  1457. if ( obj == null ) {
  1458. return obj + "";
  1459. }
  1460. return typeof obj === "object" || typeof obj === "function" ?
  1461. class2type[ toString.call( obj ) ] || "object" :
  1462. typeof obj;
  1463. },
  1464. // Workarounds based on findings by Jim Driscoll
  1465. // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
  1466. globalEval: function( data ) {
  1467. if ( data && jQuery.trim( data ) ) {
  1468. // We use execScript on Internet Explorer
  1469. // We use an anonymous function so that context is window
  1470. // rather than jQuery in Firefox
  1471. ( window.execScript || function( data ) {
  1472. window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation
  1473. } )( data );
  1474. }
  1475. },
  1476. // Convert dashed to camelCase; used by the css and data modules
  1477. // Microsoft forgot to hump their vendor prefix (#9572)
  1478. camelCase: function( string ) {
  1479. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  1480. },
  1481. nodeName: function( elem, name ) {
  1482. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  1483. },
  1484. each: function( obj, callback ) {
  1485. var length, i = 0;
  1486. if ( isArrayLike( obj ) ) {
  1487. length = obj.length;
  1488. for ( ; i < length; i++ ) {
  1489. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  1490. break;
  1491. }
  1492. }
  1493. } else {
  1494. for ( i in obj ) {
  1495. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  1496. break;
  1497. }
  1498. }
  1499. }
  1500. return obj;
  1501. },
  1502. // Support: Android<4.1, IE<9
  1503. trim: function( text ) {
  1504. return text == null ?
  1505. "" :
  1506. ( text + "" ).replace( rtrim, "" );
  1507. },
  1508. // results is for internal usage only
  1509. makeArray: function( arr, results ) {
  1510. var ret = results || [];
  1511. if ( arr != null ) {
  1512. if ( isArrayLike( Object( arr ) ) ) {
  1513. jQuery.merge( ret,
  1514. typeof arr === "string" ?
  1515. [ arr ] : arr
  1516. );
  1517. } else {
  1518. push.call( ret, arr );
  1519. }
  1520. }
  1521. return ret;
  1522. },
  1523. inArray: function( elem, arr, i ) {
  1524. var len;
  1525. if ( arr ) {
  1526. if ( indexOf ) {
  1527. return indexOf.call( arr, elem, i );
  1528. }
  1529. len = arr.length;
  1530. i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
  1531. for ( ; i < len; i++ ) {
  1532. // Skip accessing in sparse arrays
  1533. if ( i in arr && arr[ i ] === elem ) {
  1534. return i;
  1535. }
  1536. }
  1537. }
  1538. return -1;
  1539. },
  1540. merge: function( first, second ) {
  1541. var len = +second.length,
  1542. j = 0,
  1543. i = first.length;
  1544. while ( j < len ) {
  1545. first[ i++ ] = second[ j++ ];
  1546. }
  1547. // Support: IE<9
  1548. // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
  1549. if ( len !== len ) {
  1550. while ( second[ j ] !== undefined ) {
  1551. first[ i++ ] = second[ j++ ];
  1552. }
  1553. }
  1554. first.length = i;
  1555. return first;
  1556. },
  1557. grep: function( elems, callback, invert ) {
  1558. var callbackInverse,
  1559. matches = [],
  1560. i = 0,
  1561. length = elems.length,
  1562. callbackExpect = !invert;
  1563. // Go through the array, only saving the items
  1564. // that pass the validator function
  1565. for ( ; i < length; i++ ) {
  1566. callbackInverse = !callback( elems[ i ], i );
  1567. if ( callbackInverse !== callbackExpect ) {
  1568. matches.push( elems[ i ] );
  1569. }
  1570. }
  1571. return matches;
  1572. },
  1573. // arg is for internal usage only
  1574. map: function( elems, callback, arg ) {
  1575. var length, value,
  1576. i = 0,
  1577. ret = [];
  1578. // Go through the array, translating each of the items to their new values
  1579. if ( isArrayLike( elems ) ) {
  1580. length = elems.length;
  1581. for ( ; i < length; i++ ) {
  1582. value = callback( elems[ i ], i, arg );
  1583. if ( value != null ) {
  1584. ret.push( value );
  1585. }
  1586. }
  1587. // Go through every key on the object,
  1588. } else {
  1589. for ( i in elems ) {
  1590. value = callback( elems[ i ], i, arg );
  1591. if ( value != null ) {
  1592. ret.push( value );
  1593. }
  1594. }
  1595. }
  1596. // Flatten any nested arrays
  1597. return concat.apply( [], ret );
  1598. },
  1599. // A global GUID counter for objects
  1600. guid: 1,
  1601. // Bind a function to a context, optionally partially applying any
  1602. // arguments.
  1603. proxy: function( fn, context ) {
  1604. var args, proxy, tmp;
  1605. if ( typeof context === "string" ) {
  1606. tmp = fn[ context ];
  1607. context = fn;
  1608. fn = tmp;
  1609. }
  1610. // Quick check to determine if target is callable, in the spec
  1611. // this throws a TypeError, but we will just return undefined.
  1612. if ( !jQuery.isFunction( fn ) ) {
  1613. return undefined;
  1614. }
  1615. // Simulated bind
  1616. args = slice.call( arguments, 2 );
  1617. proxy = function() {
  1618. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  1619. };
  1620. // Set the guid of unique handler to the same of original handler, so it can be removed
  1621. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  1622. return proxy;
  1623. },
  1624. now: function() {
  1625. return +( new Date() );
  1626. },
  1627. // jQuery.support is not used in Core but other projects attach their
  1628. // properties to it so it needs to exist.
  1629. support: support
  1630. } );
  1631. // JSHint would error on this code due to the Symbol not being defined in ES5.
  1632. // Defining this global in .jshintrc would create a danger of using the global
  1633. // unguarded in another place, it seems safer to just disable JSHint for these
  1634. // three lines.
  1635. /* jshint ignore: start */
  1636. if ( typeof Symbol === "function" ) {
  1637. jQuery.fn[ Symbol.iterator ] = deletedIds[ Symbol.iterator ];
  1638. }
  1639. /* jshint ignore: end */
  1640. // Populate the class2type map
  1641. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  1642. function( i, name ) {
  1643. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  1644. } );
  1645. function isArrayLike( obj ) {
  1646. // Support: iOS 8.2 (not reproducible in simulator)
  1647. // `in` check used to prevent JIT error (gh-2145)
  1648. // hasOwn isn't used here due to false negatives
  1649. // regarding Nodelist length in IE
  1650. var length = !!obj && "length" in obj && obj.length,
  1651. type = jQuery.type( obj );
  1652. if ( type === "function" || jQuery.isWindow( obj ) ) {
  1653. return false;
  1654. }
  1655. return type === "array" || length === 0 ||
  1656. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  1657. }
  1658. var Sizzle =
  1659. /*!
  1660. * Sizzle CSS Selector Engine v2.2.1
  1661. * http://sizzlejs.com/
  1662. *
  1663. * Copyright jQuery Foundation and other contributors
  1664. * Released under the MIT license
  1665. * http://jquery.org/license
  1666. *
  1667. * Date: 2015-10-17
  1668. */
  1669. (function( window ) {
  1670. var i,
  1671. support,
  1672. Expr,
  1673. getText,
  1674. isXML,
  1675. tokenize,
  1676. compile,
  1677. select,
  1678. outermostContext,
  1679. sortInput,
  1680. hasDuplicate,
  1681. // Local document vars
  1682. setDocument,
  1683. document,
  1684. docElem,
  1685. documentIsHTML,
  1686. rbuggyQSA,
  1687. rbuggyMatches,
  1688. matches,
  1689. contains,
  1690. // Instance-specific data
  1691. expando = "sizzle" + 1 * new Date(),
  1692. preferredDoc = window.document,
  1693. dirruns = 0,
  1694. done = 0,
  1695. classCache = createCache(),
  1696. tokenCache = createCache(),
  1697. compilerCache = createCache(),
  1698. sortOrder = function( a, b ) {
  1699. if ( a === b ) {
  1700. hasDuplicate = true;
  1701. }
  1702. return 0;
  1703. },
  1704. // General-purpose constants
  1705. MAX_NEGATIVE = 1 << 31,
  1706. // Instance methods
  1707. hasOwn = ({}).hasOwnProperty,
  1708. arr = [],
  1709. pop = arr.pop,
  1710. push_native = arr.push,
  1711. push = arr.push,
  1712. slice = arr.slice,
  1713. // Use a stripped-down indexOf as it's faster than native
  1714. // http://jsperf.com/thor-indexof-vs-for/5
  1715. indexOf = function( list, elem ) {
  1716. var i = 0,
  1717. len = list.length;
  1718. for ( ; i < len; i++ ) {
  1719. if ( list[i] === elem ) {
  1720. return i;
  1721. }
  1722. }
  1723. return -1;
  1724. },
  1725. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  1726. // Regular expressions
  1727. // http://www.w3.org/TR/css3-selectors/#whitespace
  1728. whitespace = "[\\x20\\t\\r\\n\\f]",
  1729. // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  1730. identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
  1731. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  1732. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  1733. // Operator (capture 2)
  1734. "*([*^$|!~]?=)" + whitespace +
  1735. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  1736. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
  1737. "*\\]",
  1738. pseudos = ":(" + identifier + ")(?:\\((" +
  1739. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  1740. // 1. quoted (capture 3; capture 4 or capture 5)
  1741. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  1742. // 2. simple (capture 6)
  1743. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  1744. // 3. anything else (capture 2)
  1745. ".*" +
  1746. ")\\)|)",
  1747. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  1748. rwhitespace = new RegExp( whitespace + "+", "g" ),
  1749. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
  1750. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  1751. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
  1752. rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
  1753. rpseudo = new RegExp( pseudos ),
  1754. ridentifier = new RegExp( "^" + identifier + "$" ),
  1755. matchExpr = {
  1756. "ID": new RegExp( "^#(" + identifier + ")" ),
  1757. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  1758. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  1759. "ATTR": new RegExp( "^" + attributes ),
  1760. "PSEUDO": new RegExp( "^" + pseudos ),
  1761. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
  1762. "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
  1763. "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  1764. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  1765. // For use in libraries implementing .is()
  1766. // We use this for POS matching in `select`
  1767. "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
  1768. whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  1769. },
  1770. rinputs = /^(?:input|select|textarea|button)$/i,
  1771. rheader = /^h\d$/i,
  1772. rnative = /^[^{]+\{\s*\[native \w/,
  1773. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  1774. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  1775. rsibling = /[+~]/,
  1776. rescape = /'|\\/g,
  1777. // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  1778. runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
  1779. funescape = function( _, escaped, escapedWhitespace ) {
  1780. var high = "0x" + escaped - 0x10000;
  1781. // NaN means non-codepoint
  1782. // Support: Firefox<24
  1783. // Workaround erroneous numeric interpretation of +"0x"
  1784. return high !== high || escapedWhitespace ?
  1785. escaped :
  1786. high < 0 ?
  1787. // BMP codepoint
  1788. String.fromCharCode( high + 0x10000 ) :
  1789. // Supplemental Plane codepoint (surrogate pair)
  1790. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  1791. },
  1792. // Used for iframes
  1793. // See setDocument()
  1794. // Removing the function wrapper causes a "Permission Denied"
  1795. // error in IE
  1796. unloadHandler = function() {
  1797. setDocument();
  1798. };
  1799. // Optimize for push.apply( _, NodeList )
  1800. try {
  1801. push.apply(
  1802. (arr = slice.call( preferredDoc.childNodes )),
  1803. preferredDoc.childNodes
  1804. );
  1805. // Support: Android<4.0
  1806. // Detect silently failing push.apply
  1807. arr[ preferredDoc.childNodes.length ].nodeType;
  1808. } catch ( e ) {
  1809. push = { apply: arr.length ?
  1810. // Leverage slice if possible
  1811. function( target, els ) {
  1812. push_native.apply( target, slice.call(els) );
  1813. } :
  1814. // Support: IE<9
  1815. // Otherwise append directly
  1816. function( target, els ) {
  1817. var j = target.length,
  1818. i = 0;
  1819. // Can't trust NodeList.length
  1820. while ( (target[j++] = els[i++]) ) {}
  1821. target.length = j - 1;
  1822. }
  1823. };
  1824. }
  1825. function Sizzle( selector, context, results, seed ) {
  1826. var m, i, elem, nid, nidselect, match, groups, newSelector,
  1827. newContext = context && context.ownerDocument,
  1828. // nodeType defaults to 9, since context defaults to document
  1829. nodeType = context ? context.nodeType : 9;
  1830. results = results || [];
  1831. // Return early from calls with invalid selector or context
  1832. if ( typeof selector !== "string" || !selector ||
  1833. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  1834. return results;
  1835. }
  1836. // Try to shortcut find operations (as opposed to filters) in HTML documents
  1837. if ( !seed ) {
  1838. if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
  1839. setDocument( context );
  1840. }
  1841. context = context || document;
  1842. if ( documentIsHTML ) {
  1843. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  1844. // (excepting DocumentFragment context, where the methods don't exist)
  1845. if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
  1846. // ID selector
  1847. if ( (m = match[1]) ) {
  1848. // Document context
  1849. if ( nodeType === 9 ) {
  1850. if ( (elem = context.getElementById( m )) ) {
  1851. // Support: IE, Opera, Webkit
  1852. // TODO: identify versions
  1853. // getElementById can match elements by name instead of ID
  1854. if ( elem.id === m ) {
  1855. results.push( elem );
  1856. return results;
  1857. }
  1858. } else {
  1859. return results;
  1860. }
  1861. // Element context
  1862. } else {
  1863. // Support: IE, Opera, Webkit
  1864. // TODO: identify versions
  1865. // getElementById can match elements by name instead of ID
  1866. if ( newContext && (elem = newContext.getElementById( m )) &&
  1867. contains( context, elem ) &&
  1868. elem.id === m ) {
  1869. results.push( elem );
  1870. return results;
  1871. }
  1872. }
  1873. // Type selector
  1874. } else if ( match[2] ) {
  1875. push.apply( results, context.getElementsByTagName( selector ) );
  1876. return results;
  1877. // Class selector
  1878. } else if ( (m = match[3]) && support.getElementsByClassName &&
  1879. context.getElementsByClassName ) {
  1880. push.apply( results, context.getElementsByClassName( m ) );
  1881. return results;
  1882. }
  1883. }
  1884. // Take advantage of querySelectorAll
  1885. if ( support.qsa &&
  1886. !compilerCache[ selector + " " ] &&
  1887. (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
  1888. if ( nodeType !== 1 ) {
  1889. newContext = context;
  1890. newSelector = selector;
  1891. // qSA looks outside Element context, which is not what we want
  1892. // Thanks to Andrew Dupont for this workaround technique
  1893. // Support: IE <=8
  1894. // Exclude object elements
  1895. } else if ( context.nodeName.toLowerCase() !== "object" ) {
  1896. // Capture the context ID, setting it first if necessary
  1897. if ( (nid = context.getAttribute( "id" )) ) {
  1898. nid = nid.replace( rescape, "\\$&" );
  1899. } else {
  1900. context.setAttribute( "id", (nid = expando) );
  1901. }
  1902. // Prefix every selector in the list
  1903. groups = tokenize( selector );
  1904. i = groups.length;
  1905. nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']";
  1906. while ( i-- ) {
  1907. groups[i] = nidselect + " " + toSelector( groups[i] );
  1908. }
  1909. newSelector = groups.join( "," );
  1910. // Expand context for sibling selectors
  1911. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  1912. context;
  1913. }
  1914. if ( newSelector ) {
  1915. try {
  1916. push.apply( results,
  1917. newContext.querySelectorAll( newSelector )
  1918. );
  1919. return results;
  1920. } catch ( qsaError ) {
  1921. } finally {
  1922. if ( nid === expando ) {
  1923. context.removeAttribute( "id" );
  1924. }
  1925. }
  1926. }
  1927. }
  1928. }
  1929. }
  1930. // All others
  1931. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  1932. }
  1933. /**
  1934. * Create key-value caches of limited size
  1935. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  1936. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  1937. * deleting the oldest entry
  1938. */
  1939. function createCache() {
  1940. var keys = [];
  1941. function cache( key, value ) {
  1942. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  1943. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  1944. // Only keep the most recent entries
  1945. delete cache[ keys.shift() ];
  1946. }
  1947. return (cache[ key + " " ] = value);
  1948. }
  1949. return cache;
  1950. }
  1951. /**
  1952. * Mark a function for special use by Sizzle
  1953. * @param {Function} fn The function to mark
  1954. */
  1955. function markFunction( fn ) {
  1956. fn[ expando ] = true;
  1957. return fn;
  1958. }
  1959. /**
  1960. * Support testing using an element
  1961. * @param {Function} fn Passed the created div and expects a boolean result
  1962. */
  1963. function assert( fn ) {
  1964. var div = document.createElement("div");
  1965. try {
  1966. return !!fn( div );
  1967. } catch (e) {
  1968. return false;
  1969. } finally {
  1970. // Remove from its parent by default
  1971. if ( div.parentNode ) {
  1972. div.parentNode.removeChild( div );
  1973. }
  1974. // release memory in IE
  1975. div = null;
  1976. }
  1977. }
  1978. /**
  1979. * Adds the same handler for all of the specified attrs
  1980. * @param {String} attrs Pipe-separated list of attributes
  1981. * @param {Function} handler The method that will be applied
  1982. */
  1983. function addHandle( attrs, handler ) {
  1984. var arr = attrs.split("|"),
  1985. i = arr.length;
  1986. while ( i-- ) {
  1987. Expr.attrHandle[ arr[i] ] = handler;
  1988. }
  1989. }
  1990. /**
  1991. * Checks document order of two siblings
  1992. * @param {Element} a
  1993. * @param {Element} b
  1994. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  1995. */
  1996. function siblingCheck( a, b ) {
  1997. var cur = b && a,
  1998. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  1999. ( ~b.sourceIndex || MAX_NEGATIVE ) -
  2000. ( ~a.sourceIndex || MAX_NEGATIVE );
  2001. // Use IE sourceIndex if available on both nodes
  2002. if ( diff ) {
  2003. return diff;
  2004. }
  2005. // Check if b follows a
  2006. if ( cur ) {
  2007. while ( (cur = cur.nextSibling) ) {
  2008. if ( cur === b ) {
  2009. return -1;
  2010. }
  2011. }
  2012. }
  2013. return a ? 1 : -1;
  2014. }
  2015. /**
  2016. * Returns a function to use in pseudos for input types
  2017. * @param {String} type
  2018. */
  2019. function createInputPseudo( type ) {
  2020. return function( elem ) {
  2021. var name = elem.nodeName.toLowerCase();
  2022. return name === "input" && elem.type === type;
  2023. };
  2024. }
  2025. /**
  2026. * Returns a function to use in pseudos for buttons
  2027. * @param {String} type
  2028. */
  2029. function createButtonPseudo( type ) {
  2030. return function( elem ) {
  2031. var name = elem.nodeName.toLowerCase();
  2032. return (name === "input" || name === "button") && elem.type === type;
  2033. };
  2034. }
  2035. /**
  2036. * Returns a function to use in pseudos for positionals
  2037. * @param {Function} fn
  2038. */
  2039. function createPositionalPseudo( fn ) {
  2040. return markFunction(function( argument ) {
  2041. argument = +argument;
  2042. return markFunction(function( seed, matches ) {
  2043. var j,
  2044. matchIndexes = fn( [], seed.length, argument ),
  2045. i = matchIndexes.length;
  2046. // Match elements found at the specified indexes
  2047. while ( i-- ) {
  2048. if ( seed[ (j = matchIndexes[i]) ] ) {
  2049. seed[j] = !(matches[j] = seed[j]);
  2050. }
  2051. }
  2052. });
  2053. });
  2054. }
  2055. /**
  2056. * Checks a node for validity as a Sizzle context
  2057. * @param {Element|Object=} context
  2058. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  2059. */
  2060. function testContext( context ) {
  2061. return context && typeof context.getElementsByTagName !== "undefined" && context;
  2062. }
  2063. // Expose support vars for convenience
  2064. support = Sizzle.support = {};
  2065. /**
  2066. * Detects XML nodes
  2067. * @param {Element|Object} elem An element or a document
  2068. * @returns {Boolean} True iff elem is a non-HTML XML node
  2069. */
  2070. isXML = Sizzle.isXML = function( elem ) {
  2071. // documentElement is verified for cases where it doesn't yet exist
  2072. // (such as loading iframes in IE - #4833)
  2073. var documentElement = elem && (elem.ownerDocument || elem).documentElement;
  2074. return documentElement ? documentElement.nodeName !== "HTML" : false;
  2075. };
  2076. /**
  2077. * Sets document-related variables once based on the current document
  2078. * @param {Element|Object} [doc] An element or document object to use to set the document
  2079. * @returns {Object} Returns the current document
  2080. */
  2081. setDocument = Sizzle.setDocument = function( node ) {
  2082. var hasCompare, parent,
  2083. doc = node ? node.ownerDocument || node : preferredDoc;
  2084. // Return early if doc is invalid or already selected
  2085. if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
  2086. return document;
  2087. }
  2088. // Update global variables
  2089. document = doc;
  2090. docElem = document.documentElement;
  2091. documentIsHTML = !isXML( document );
  2092. // Support: IE 9-11, Edge
  2093. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  2094. if ( (parent = document.defaultView) && parent.top !== parent ) {
  2095. // Support: IE 11
  2096. if ( parent.addEventListener ) {
  2097. parent.addEventListener( "unload", unloadHandler, false );
  2098. // Support: IE 9 - 10 only
  2099. } else if ( parent.attachEvent ) {
  2100. parent.attachEvent( "onunload", unloadHandler );
  2101. }
  2102. }
  2103. /* Attributes
  2104. ---------------------------------------------------------------------- */
  2105. // Support: IE<8
  2106. // Verify that getAttribute really returns attributes and not properties
  2107. // (excepting IE8 booleans)
  2108. support.attributes = assert(function( div ) {
  2109. div.className = "i";
  2110. return !div.getAttribute("className");
  2111. });
  2112. /* getElement(s)By*
  2113. ---------------------------------------------------------------------- */
  2114. // Check if getElementsByTagName("*") returns only elements
  2115. support.getElementsByTagName = assert(function( div ) {
  2116. div.appendChild( document.createComment("") );
  2117. return !div.getElementsByTagName("*").length;
  2118. });
  2119. // Support: IE<9
  2120. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  2121. // Support: IE<10
  2122. // Check if getElementById returns elements by name
  2123. // The broken getElementById methods don't pick up programatically-set names,
  2124. // so use a roundabout getElementsByName test
  2125. support.getById = assert(function( div ) {
  2126. docElem.appendChild( div ).id = expando;
  2127. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  2128. });
  2129. // ID find and filter
  2130. if ( support.getById ) {
  2131. Expr.find["ID"] = function( id, context ) {
  2132. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  2133. var m = context.getElementById( id );
  2134. return m ? [ m ] : [];
  2135. }
  2136. };
  2137. Expr.filter["ID"] = function( id ) {
  2138. var attrId = id.replace( runescape, funescape );
  2139. return function( elem ) {
  2140. return elem.getAttribute("id") === attrId;
  2141. };
  2142. };
  2143. } else {
  2144. // Support: IE6/7
  2145. // getElementById is not reliable as a find shortcut
  2146. delete Expr.find["ID"];
  2147. Expr.filter["ID"] = function( id ) {
  2148. var attrId = id.replace( runescape, funescape );
  2149. return function( elem ) {
  2150. var node = typeof elem.getAttributeNode !== "undefined" &&
  2151. elem.getAttributeNode("id");
  2152. return node && node.value === attrId;
  2153. };
  2154. };
  2155. }
  2156. // Tag
  2157. Expr.find["TAG"] = support.getElementsByTagName ?
  2158. function( tag, context ) {
  2159. if ( typeof context.getElementsByTagName !== "undefined" ) {
  2160. return context.getElementsByTagName( tag );
  2161. // DocumentFragment nodes don't have gEBTN
  2162. } else if ( support.qsa ) {
  2163. return context.querySelectorAll( tag );
  2164. }
  2165. } :
  2166. function( tag, context ) {
  2167. var elem,
  2168. tmp = [],
  2169. i = 0,
  2170. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  2171. results = context.getElementsByTagName( tag );
  2172. // Filter out possible comments
  2173. if ( tag === "*" ) {
  2174. while ( (elem = results[i++]) ) {
  2175. if ( elem.nodeType === 1 ) {
  2176. tmp.push( elem );
  2177. }
  2178. }
  2179. return tmp;
  2180. }
  2181. return results;
  2182. };
  2183. // Class
  2184. Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
  2185. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  2186. return context.getElementsByClassName( className );
  2187. }
  2188. };
  2189. /* QSA/matchesSelector
  2190. ---------------------------------------------------------------------- */
  2191. // QSA and matchesSelector support
  2192. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  2193. rbuggyMatches = [];
  2194. // qSa(:focus) reports false when true (Chrome 21)
  2195. // We allow this because of a bug in IE8/9 that throws an error
  2196. // whenever `document.activeElement` is accessed on an iframe
  2197. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  2198. // See http://bugs.jquery.com/ticket/13378
  2199. rbuggyQSA = [];
  2200. if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
  2201. // Build QSA regex
  2202. // Regex strategy adopted from Diego Perini
  2203. assert(function( div ) {
  2204. // Select is set to empty string on purpose
  2205. // This is to test IE's treatment of not explicitly
  2206. // setting a boolean content attribute,
  2207. // since its presence should be enough
  2208. // http://bugs.jquery.com/ticket/12359
  2209. docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
  2210. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  2211. "<option selected=''></option></select>";
  2212. // Support: IE8, Opera 11-12.16
  2213. // Nothing should be selected when empty strings follow ^= or $= or *=
  2214. // The test attribute must be unknown in Opera but "safe" for WinRT
  2215. // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  2216. if ( div.querySelectorAll("[msallowcapture^='']").length ) {
  2217. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  2218. }
  2219. // Support: IE8
  2220. // Boolean attributes and "value" are not treated correctly
  2221. if ( !div.querySelectorAll("[selected]").length ) {
  2222. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  2223. }
  2224. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  2225. if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  2226. rbuggyQSA.push("~=");
  2227. }
  2228. // Webkit/Opera - :checked should return selected option elements
  2229. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  2230. // IE8 throws error here and will not see later tests
  2231. if ( !div.querySelectorAll(":checked").length ) {
  2232. rbuggyQSA.push(":checked");
  2233. }
  2234. // Support: Safari 8+, iOS 8+
  2235. // https://bugs.webkit.org/show_bug.cgi?id=136851
  2236. // In-page `selector#id sibing-combinator selector` fails
  2237. if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
  2238. rbuggyQSA.push(".#.+[+~]");
  2239. }
  2240. });
  2241. assert(function( div ) {
  2242. // Support: Windows 8 Native Apps
  2243. // The type and name attributes are restricted during .innerHTML assignment
  2244. var input = document.createElement("input");
  2245. input.setAttribute( "type", "hidden" );
  2246. div.appendChild( input ).setAttribute( "name", "D" );
  2247. // Support: IE8
  2248. // Enforce case-sensitivity of name attribute
  2249. if ( div.querySelectorAll("[name=d]").length ) {
  2250. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  2251. }
  2252. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  2253. // IE8 throws error here and will not see later tests
  2254. if ( !div.querySelectorAll(":enabled").length ) {
  2255. rbuggyQSA.push( ":enabled", ":disabled" );
  2256. }
  2257. // Opera 10-11 does not throw on post-comma invalid pseudos
  2258. div.querySelectorAll("*,:x");
  2259. rbuggyQSA.push(",.*:");
  2260. });
  2261. }
  2262. if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
  2263. docElem.webkitMatchesSelector ||
  2264. docElem.mozMatchesSelector ||
  2265. docElem.oMatchesSelector ||
  2266. docElem.msMatchesSelector) )) ) {
  2267. assert(function( div ) {
  2268. // Check to see if it's possible to do matchesSelector
  2269. // on a disconnected node (IE 9)
  2270. support.disconnectedMatch = matches.call( div, "div" );
  2271. // This should fail with an exception
  2272. // Gecko does not error, returns false instead
  2273. matches.call( div, "[s!='']:x" );
  2274. rbuggyMatches.push( "!=", pseudos );
  2275. });
  2276. }
  2277. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
  2278. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
  2279. /* Contains
  2280. ---------------------------------------------------------------------- */
  2281. hasCompare = rnative.test( docElem.compareDocumentPosition );
  2282. // Element contains another
  2283. // Purposefully self-exclusive
  2284. // As in, an element does not contain itself
  2285. contains = hasCompare || rnative.test( docElem.contains ) ?
  2286. function( a, b ) {
  2287. var adown = a.nodeType === 9 ? a.documentElement : a,
  2288. bup = b && b.parentNode;
  2289. return a === bup || !!( bup && bup.nodeType === 1 && (
  2290. adown.contains ?
  2291. adown.contains( bup ) :
  2292. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  2293. ));
  2294. } :
  2295. function( a, b ) {
  2296. if ( b ) {
  2297. while ( (b = b.parentNode) ) {
  2298. if ( b === a ) {
  2299. return true;
  2300. }
  2301. }
  2302. }
  2303. return false;
  2304. };
  2305. /* Sorting
  2306. ---------------------------------------------------------------------- */
  2307. // Document order sorting
  2308. sortOrder = hasCompare ?
  2309. function( a, b ) {
  2310. // Flag for duplicate removal
  2311. if ( a === b ) {
  2312. hasDuplicate = true;
  2313. return 0;
  2314. }
  2315. // Sort on method existence if only one input has compareDocumentPosition
  2316. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  2317. if ( compare ) {
  2318. return compare;
  2319. }
  2320. // Calculate position if both inputs belong to the same document
  2321. compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
  2322. a.compareDocumentPosition( b ) :
  2323. // Otherwise we know they are disconnected
  2324. 1;
  2325. // Disconnected nodes
  2326. if ( compare & 1 ||
  2327. (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
  2328. // Choose the first element that is related to our preferred document
  2329. if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
  2330. return -1;
  2331. }
  2332. if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
  2333. return 1;
  2334. }
  2335. // Maintain original order
  2336. return sortInput ?
  2337. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  2338. 0;
  2339. }
  2340. return compare & 4 ? -1 : 1;
  2341. } :
  2342. function( a, b ) {
  2343. // Exit early if the nodes are identical
  2344. if ( a === b ) {
  2345. hasDuplicate = true;
  2346. return 0;
  2347. }
  2348. var cur,
  2349. i = 0,
  2350. aup = a.parentNode,
  2351. bup = b.parentNode,
  2352. ap = [ a ],
  2353. bp = [ b ];
  2354. // Parentless nodes are either documents or disconnected
  2355. if ( !aup || !bup ) {
  2356. return a === document ? -1 :
  2357. b === document ? 1 :
  2358. aup ? -1 :
  2359. bup ? 1 :
  2360. sortInput ?
  2361. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  2362. 0;
  2363. // If the nodes are siblings, we can do a quick check
  2364. } else if ( aup === bup ) {
  2365. return siblingCheck( a, b );
  2366. }
  2367. // Otherwise we need full lists of their ancestors for comparison
  2368. cur = a;
  2369. while ( (cur = cur.parentNode) ) {
  2370. ap.unshift( cur );
  2371. }
  2372. cur = b;
  2373. while ( (cur = cur.parentNode) ) {
  2374. bp.unshift( cur );
  2375. }
  2376. // Walk down the tree looking for a discrepancy
  2377. while ( ap[i] === bp[i] ) {
  2378. i++;
  2379. }
  2380. return i ?
  2381. // Do a sibling check if the nodes have a common ancestor
  2382. siblingCheck( ap[i], bp[i] ) :
  2383. // Otherwise nodes in our document sort first
  2384. ap[i] === preferredDoc ? -1 :
  2385. bp[i] === preferredDoc ? 1 :
  2386. 0;
  2387. };
  2388. return document;
  2389. };
  2390. Sizzle.matches = function( expr, elements ) {
  2391. return Sizzle( expr, null, null, elements );
  2392. };
  2393. Sizzle.matchesSelector = function( elem, expr ) {
  2394. // Set document vars if needed
  2395. if ( ( elem.ownerDocument || elem ) !== document ) {
  2396. setDocument( elem );
  2397. }
  2398. // Make sure that attribute selectors are quoted
  2399. expr = expr.replace( rattributeQuotes, "='$1']" );
  2400. if ( support.matchesSelector && documentIsHTML &&
  2401. !compilerCache[ expr + " " ] &&
  2402. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  2403. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  2404. try {
  2405. var ret = matches.call( elem, expr );
  2406. // IE 9's matchesSelector returns false on disconnected nodes
  2407. if ( ret || support.disconnectedMatch ||
  2408. // As well, disconnected nodes are said to be in a document
  2409. // fragment in IE 9
  2410. elem.document && elem.document.nodeType !== 11 ) {
  2411. return ret;
  2412. }
  2413. } catch (e) {}
  2414. }
  2415. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  2416. };
  2417. Sizzle.contains = function( context, elem ) {
  2418. // Set document vars if needed
  2419. if ( ( context.ownerDocument || context ) !== document ) {
  2420. setDocument( context );
  2421. }
  2422. return contains( context, elem );
  2423. };
  2424. Sizzle.attr = function( elem, name ) {
  2425. // Set document vars if needed
  2426. if ( ( elem.ownerDocument || elem ) !== document ) {
  2427. setDocument( elem );
  2428. }
  2429. var fn = Expr.attrHandle[ name.toLowerCase() ],
  2430. // Don't get fooled by Object.prototype properties (jQuery #13807)
  2431. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  2432. fn( elem, name, !documentIsHTML ) :
  2433. undefined;
  2434. return val !== undefined ?
  2435. val :
  2436. support.attributes || !documentIsHTML ?
  2437. elem.getAttribute( name ) :
  2438. (val = elem.getAttributeNode(name)) && val.specified ?
  2439. val.value :
  2440. null;
  2441. };
  2442. Sizzle.error = function( msg ) {
  2443. throw new Error( "Syntax error, unrecognized expression: " + msg );
  2444. };
  2445. /**
  2446. * Document sorting and removing duplicates
  2447. * @param {ArrayLike} results
  2448. */
  2449. Sizzle.uniqueSort = function( results ) {
  2450. var elem,
  2451. duplicates = [],
  2452. j = 0,
  2453. i = 0;
  2454. // Unless we *know* we can detect duplicates, assume their presence
  2455. hasDuplicate = !support.detectDuplicates;
  2456. sortInput = !support.sortStable && results.slice( 0 );
  2457. results.sort( sortOrder );
  2458. if ( hasDuplicate ) {
  2459. while ( (elem = results[i++]) ) {
  2460. if ( elem === results[ i ] ) {
  2461. j = duplicates.push( i );
  2462. }
  2463. }
  2464. while ( j-- ) {
  2465. results.splice( duplicates[ j ], 1 );
  2466. }
  2467. }
  2468. // Clear input after sorting to release objects
  2469. // See https://github.com/jquery/sizzle/pull/225
  2470. sortInput = null;
  2471. return results;
  2472. };
  2473. /**
  2474. * Utility function for retrieving the text value of an array of DOM nodes
  2475. * @param {Array|Element} elem
  2476. */
  2477. getText = Sizzle.getText = function( elem ) {
  2478. var node,
  2479. ret = "",
  2480. i = 0,
  2481. nodeType = elem.nodeType;
  2482. if ( !nodeType ) {
  2483. // If no nodeType, this is expected to be an array
  2484. while ( (node = elem[i++]) ) {
  2485. // Do not traverse comment nodes
  2486. ret += getText( node );
  2487. }
  2488. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  2489. // Use textContent for elements
  2490. // innerText usage removed for consistency of new lines (jQuery #11153)
  2491. if ( typeof elem.textContent === "string" ) {
  2492. return elem.textContent;
  2493. } else {
  2494. // Traverse its children
  2495. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  2496. ret += getText( elem );
  2497. }
  2498. }
  2499. } else if ( nodeType === 3 || nodeType === 4 ) {
  2500. return elem.nodeValue;
  2501. }
  2502. // Do not include comment or processing instruction nodes
  2503. return ret;
  2504. };
  2505. Expr = Sizzle.selectors = {
  2506. // Can be adjusted by the user
  2507. cacheLength: 50,
  2508. createPseudo: markFunction,
  2509. match: matchExpr,
  2510. attrHandle: {},
  2511. find: {},
  2512. relative: {
  2513. ">": { dir: "parentNode", first: true },
  2514. " ": { dir: "parentNode" },
  2515. "+": { dir: "previousSibling", first: true },
  2516. "~": { dir: "previousSibling" }
  2517. },
  2518. preFilter: {
  2519. "ATTR": function( match ) {
  2520. match[1] = match[1].replace( runescape, funescape );
  2521. // Move the given value to match[3] whether quoted or unquoted
  2522. match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
  2523. if ( match[2] === "~=" ) {
  2524. match[3] = " " + match[3] + " ";
  2525. }
  2526. return match.slice( 0, 4 );
  2527. },
  2528. "CHILD": function( match ) {
  2529. /* matches from matchExpr["CHILD"]
  2530. 1 type (only|nth|...)
  2531. 2 what (child|of-type)
  2532. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  2533. 4 xn-component of xn+y argument ([+-]?\d*n|)
  2534. 5 sign of xn-component
  2535. 6 x of xn-component
  2536. 7 sign of y-component
  2537. 8 y of y-component
  2538. */
  2539. match[1] = match[1].toLowerCase();
  2540. if ( match[1].slice( 0, 3 ) === "nth" ) {
  2541. // nth-* requires argument
  2542. if ( !match[3] ) {
  2543. Sizzle.error( match[0] );
  2544. }
  2545. // numeric x and y parameters for Expr.filter.CHILD
  2546. // remember that false/true cast respectively to 0/1
  2547. match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
  2548. match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
  2549. // other types prohibit arguments
  2550. } else if ( match[3] ) {
  2551. Sizzle.error( match[0] );
  2552. }
  2553. return match;
  2554. },
  2555. "PSEUDO": function( match ) {
  2556. var excess,
  2557. unquoted = !match[6] && match[2];
  2558. if ( matchExpr["CHILD"].test( match[0] ) ) {
  2559. return null;
  2560. }
  2561. // Accept quoted arguments as-is
  2562. if ( match[3] ) {
  2563. match[2] = match[4] || match[5] || "";
  2564. // Strip excess characters from unquoted arguments
  2565. } else if ( unquoted && rpseudo.test( unquoted ) &&
  2566. // Get excess from tokenize (recursively)
  2567. (excess = tokenize( unquoted, true )) &&
  2568. // advance to the next closing parenthesis
  2569. (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
  2570. // excess is a negative index
  2571. match[0] = match[0].slice( 0, excess );
  2572. match[2] = unquoted.slice( 0, excess );
  2573. }
  2574. // Return only captures needed by the pseudo filter method (type and argument)
  2575. return match.slice( 0, 3 );
  2576. }
  2577. },
  2578. filter: {
  2579. "TAG": function( nodeNameSelector ) {
  2580. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  2581. return nodeNameSelector === "*" ?
  2582. function() { return true; } :
  2583. function( elem ) {
  2584. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  2585. };
  2586. },
  2587. "CLASS": function( className ) {
  2588. var pattern = classCache[ className + " " ];
  2589. return pattern ||
  2590. (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
  2591. classCache( className, function( elem ) {
  2592. return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
  2593. });
  2594. },
  2595. "ATTR": function( name, operator, check ) {
  2596. return function( elem ) {
  2597. var result = Sizzle.attr( elem, name );
  2598. if ( result == null ) {
  2599. return operator === "!=";
  2600. }
  2601. if ( !operator ) {
  2602. return true;
  2603. }
  2604. result += "";
  2605. return operator === "=" ? result === check :
  2606. operator === "!=" ? result !== check :
  2607. operator === "^=" ? check && result.indexOf( check ) === 0 :
  2608. operator === "*=" ? check && result.indexOf( check ) > -1 :
  2609. operator === "$=" ? check && result.slice( -check.length ) === check :
  2610. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  2611. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  2612. false;
  2613. };
  2614. },
  2615. "CHILD": function( type, what, argument, first, last ) {
  2616. var simple = type.slice( 0, 3 ) !== "nth",
  2617. forward = type.slice( -4 ) !== "last",
  2618. ofType = what === "of-type";
  2619. return first === 1 && last === 0 ?
  2620. // Shortcut for :nth-*(n)
  2621. function( elem ) {
  2622. return !!elem.parentNode;
  2623. } :
  2624. function( elem, context, xml ) {
  2625. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  2626. dir = simple !== forward ? "nextSibling" : "previousSibling",
  2627. parent = elem.parentNode,
  2628. name = ofType && elem.nodeName.toLowerCase(),
  2629. useCache = !xml && !ofType,
  2630. diff = false;
  2631. if ( parent ) {
  2632. // :(first|last|only)-(child|of-type)
  2633. if ( simple ) {
  2634. while ( dir ) {
  2635. node = elem;
  2636. while ( (node = node[ dir ]) ) {
  2637. if ( ofType ?
  2638. node.nodeName.toLowerCase() === name :
  2639. node.nodeType === 1 ) {
  2640. return false;
  2641. }
  2642. }
  2643. // Reverse direction for :only-* (if we haven't yet done so)
  2644. start = dir = type === "only" && !start && "nextSibling";
  2645. }
  2646. return true;
  2647. }
  2648. start = [ forward ? parent.firstChild : parent.lastChild ];
  2649. // non-xml :nth-child(...) stores cache data on `parent`
  2650. if ( forward && useCache ) {
  2651. // Seek `elem` from a previously-cached index
  2652. // ...in a gzip-friendly way
  2653. node = parent;
  2654. outerCache = node[ expando ] || (node[ expando ] = {});
  2655. // Support: IE <9 only
  2656. // Defend against cloned attroperties (jQuery gh-1709)
  2657. uniqueCache = outerCache[ node.uniqueID ] ||
  2658. (outerCache[ node.uniqueID ] = {});
  2659. cache = uniqueCache[ type ] || [];
  2660. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  2661. diff = nodeIndex && cache[ 2 ];
  2662. node = nodeIndex && parent.childNodes[ nodeIndex ];
  2663. while ( (node = ++nodeIndex && node && node[ dir ] ||
  2664. // Fallback to seeking `elem` from the start
  2665. (diff = nodeIndex = 0) || start.pop()) ) {
  2666. // When found, cache indexes on `parent` and break
  2667. if ( node.nodeType === 1 && ++diff && node === elem ) {
  2668. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  2669. break;
  2670. }
  2671. }
  2672. } else {
  2673. // Use previously-cached element index if available
  2674. if ( useCache ) {
  2675. // ...in a gzip-friendly way
  2676. node = elem;
  2677. outerCache = node[ expando ] || (node[ expando ] = {});
  2678. // Support: IE <9 only
  2679. // Defend against cloned attroperties (jQuery gh-1709)
  2680. uniqueCache = outerCache[ node.uniqueID ] ||
  2681. (outerCache[ node.uniqueID ] = {});
  2682. cache = uniqueCache[ type ] || [];
  2683. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  2684. diff = nodeIndex;
  2685. }
  2686. // xml :nth-child(...)
  2687. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  2688. if ( diff === false ) {
  2689. // Use the same loop as above to seek `elem` from the start
  2690. while ( (node = ++nodeIndex && node && node[ dir ] ||
  2691. (diff = nodeIndex = 0) || start.pop()) ) {
  2692. if ( ( ofType ?
  2693. node.nodeName.toLowerCase() === name :
  2694. node.nodeType === 1 ) &&
  2695. ++diff ) {
  2696. // Cache the index of each encountered element
  2697. if ( useCache ) {
  2698. outerCache = node[ expando ] || (node[ expando ] = {});
  2699. // Support: IE <9 only
  2700. // Defend against cloned attroperties (jQuery gh-1709)
  2701. uniqueCache = outerCache[ node.uniqueID ] ||
  2702. (outerCache[ node.uniqueID ] = {});
  2703. uniqueCache[ type ] = [ dirruns, diff ];
  2704. }
  2705. if ( node === elem ) {
  2706. break;
  2707. }
  2708. }
  2709. }
  2710. }
  2711. }
  2712. // Incorporate the offset, then check against cycle size
  2713. diff -= last;
  2714. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  2715. }
  2716. };
  2717. },
  2718. "PSEUDO": function( pseudo, argument ) {
  2719. // pseudo-class names are case-insensitive
  2720. // http://www.w3.org/TR/selectors/#pseudo-classes
  2721. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  2722. // Remember that setFilters inherits from pseudos
  2723. var args,
  2724. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  2725. Sizzle.error( "unsupported pseudo: " + pseudo );
  2726. // The user may use createPseudo to indicate that
  2727. // arguments are needed to create the filter function
  2728. // just as Sizzle does
  2729. if ( fn[ expando ] ) {
  2730. return fn( argument );
  2731. }
  2732. // But maintain support for old signatures
  2733. if ( fn.length > 1 ) {
  2734. args = [ pseudo, pseudo, "", argument ];
  2735. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  2736. markFunction(function( seed, matches ) {
  2737. var idx,
  2738. matched = fn( seed, argument ),
  2739. i = matched.length;
  2740. while ( i-- ) {
  2741. idx = indexOf( seed, matched[i] );
  2742. seed[ idx ] = !( matches[ idx ] = matched[i] );
  2743. }
  2744. }) :
  2745. function( elem ) {
  2746. return fn( elem, 0, args );
  2747. };
  2748. }
  2749. return fn;
  2750. }
  2751. },
  2752. pseudos: {
  2753. // Potentially complex pseudos
  2754. "not": markFunction(function( selector ) {
  2755. // Trim the selector passed to compile
  2756. // to avoid treating leading and trailing
  2757. // spaces as combinators
  2758. var input = [],
  2759. results = [],
  2760. matcher = compile( selector.replace( rtrim, "$1" ) );
  2761. return matcher[ expando ] ?
  2762. markFunction(function( seed, matches, context, xml ) {
  2763. var elem,
  2764. unmatched = matcher( seed, null, xml, [] ),
  2765. i = seed.length;
  2766. // Match elements unmatched by `matcher`
  2767. while ( i-- ) {
  2768. if ( (elem = unmatched[i]) ) {
  2769. seed[i] = !(matches[i] = elem);
  2770. }
  2771. }
  2772. }) :
  2773. function( elem, context, xml ) {
  2774. input[0] = elem;
  2775. matcher( input, null, xml, results );
  2776. // Don't keep the element (issue #299)
  2777. input[0] = null;
  2778. return !results.pop();
  2779. };
  2780. }),
  2781. "has": markFunction(function( selector ) {
  2782. return function( elem ) {
  2783. return Sizzle( selector, elem ).length > 0;
  2784. };
  2785. }),
  2786. "contains": markFunction(function( text ) {
  2787. text = text.replace( runescape, funescape );
  2788. return function( elem ) {
  2789. return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
  2790. };
  2791. }),
  2792. // "Whether an element is represented by a :lang() selector
  2793. // is based solely on the element's language value
  2794. // being equal to the identifier C,
  2795. // or beginning with the identifier C immediately followed by "-".
  2796. // The matching of C against the element's language value is performed case-insensitively.
  2797. // The identifier C does not have to be a valid language name."
  2798. // http://www.w3.org/TR/selectors/#lang-pseudo
  2799. "lang": markFunction( function( lang ) {
  2800. // lang value must be a valid identifier
  2801. if ( !ridentifier.test(lang || "") ) {
  2802. Sizzle.error( "unsupported lang: " + lang );
  2803. }
  2804. lang = lang.replace( runescape, funescape ).toLowerCase();
  2805. return function( elem ) {
  2806. var elemLang;
  2807. do {
  2808. if ( (elemLang = documentIsHTML ?
  2809. elem.lang :
  2810. elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
  2811. elemLang = elemLang.toLowerCase();
  2812. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  2813. }
  2814. } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
  2815. return false;
  2816. };
  2817. }),
  2818. // Miscellaneous
  2819. "target": function( elem ) {
  2820. var hash = window.location && window.location.hash;
  2821. return hash && hash.slice( 1 ) === elem.id;
  2822. },
  2823. "root": function( elem ) {
  2824. return elem === docElem;
  2825. },
  2826. "focus": function( elem ) {
  2827. return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
  2828. },
  2829. // Boolean properties
  2830. "enabled": function( elem ) {
  2831. return elem.disabled === false;
  2832. },
  2833. "disabled": function( elem ) {
  2834. return elem.disabled === true;
  2835. },
  2836. "checked": function( elem ) {
  2837. // In CSS3, :checked should return both checked and selected elements
  2838. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  2839. var nodeName = elem.nodeName.toLowerCase();
  2840. return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
  2841. },
  2842. "selected": function( elem ) {
  2843. // Accessing this property makes selected-by-default
  2844. // options in Safari work properly
  2845. if ( elem.parentNode ) {
  2846. elem.parentNode.selectedIndex;
  2847. }
  2848. return elem.selected === true;
  2849. },
  2850. // Contents
  2851. "empty": function( elem ) {
  2852. // http://www.w3.org/TR/selectors/#empty-pseudo
  2853. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  2854. // but not by others (comment: 8; processing instruction: 7; etc.)
  2855. // nodeType < 6 works because attributes (2) do not appear as children
  2856. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  2857. if ( elem.nodeType < 6 ) {
  2858. return false;
  2859. }
  2860. }
  2861. return true;
  2862. },
  2863. "parent": function( elem ) {
  2864. return !Expr.pseudos["empty"]( elem );
  2865. },
  2866. // Element/input types
  2867. "header": function( elem ) {
  2868. return rheader.test( elem.nodeName );
  2869. },
  2870. "input": function( elem ) {
  2871. return rinputs.test( elem.nodeName );
  2872. },
  2873. "button": function( elem ) {
  2874. var name = elem.nodeName.toLowerCase();
  2875. return name === "input" && elem.type === "button" || name === "button";
  2876. },
  2877. "text": function( elem ) {
  2878. var attr;
  2879. return elem.nodeName.toLowerCase() === "input" &&
  2880. elem.type === "text" &&
  2881. // Support: IE<8
  2882. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  2883. ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
  2884. },
  2885. // Position-in-collection
  2886. "first": createPositionalPseudo(function() {
  2887. return [ 0 ];
  2888. }),
  2889. "last": createPositionalPseudo(function( matchIndexes, length ) {
  2890. return [ length - 1 ];
  2891. }),
  2892. "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
  2893. return [ argument < 0 ? argument + length : argument ];
  2894. }),
  2895. "even": createPositionalPseudo(function( matchIndexes, length ) {
  2896. var i = 0;
  2897. for ( ; i < length; i += 2 ) {
  2898. matchIndexes.push( i );
  2899. }
  2900. return matchIndexes;
  2901. }),
  2902. "odd": createPositionalPseudo(function( matchIndexes, length ) {
  2903. var i = 1;
  2904. for ( ; i < length; i += 2 ) {
  2905. matchIndexes.push( i );
  2906. }
  2907. return matchIndexes;
  2908. }),
  2909. "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  2910. var i = argument < 0 ? argument + length : argument;
  2911. for ( ; --i >= 0; ) {
  2912. matchIndexes.push( i );
  2913. }
  2914. return matchIndexes;
  2915. }),
  2916. "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  2917. var i = argument < 0 ? argument + length : argument;
  2918. for ( ; ++i < length; ) {
  2919. matchIndexes.push( i );
  2920. }
  2921. return matchIndexes;
  2922. })
  2923. }
  2924. };
  2925. Expr.pseudos["nth"] = Expr.pseudos["eq"];
  2926. // Add button/input type pseudos
  2927. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  2928. Expr.pseudos[ i ] = createInputPseudo( i );
  2929. }
  2930. for ( i in { submit: true, reset: true } ) {
  2931. Expr.pseudos[ i ] = createButtonPseudo( i );
  2932. }
  2933. // Easy API for creating new setFilters
  2934. function setFilters() {}
  2935. setFilters.prototype = Expr.filters = Expr.pseudos;
  2936. Expr.setFilters = new setFilters();
  2937. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  2938. var matched, match, tokens, type,
  2939. soFar, groups, preFilters,
  2940. cached = tokenCache[ selector + " " ];
  2941. if ( cached ) {
  2942. return parseOnly ? 0 : cached.slice( 0 );
  2943. }
  2944. soFar = selector;
  2945. groups = [];
  2946. preFilters = Expr.preFilter;
  2947. while ( soFar ) {
  2948. // Comma and first run
  2949. if ( !matched || (match = rcomma.exec( soFar )) ) {
  2950. if ( match ) {
  2951. // Don't consume trailing commas as valid
  2952. soFar = soFar.slice( match[0].length ) || soFar;
  2953. }
  2954. groups.push( (tokens = []) );
  2955. }
  2956. matched = false;
  2957. // Combinators
  2958. if ( (match = rcombinators.exec( soFar )) ) {
  2959. matched = match.shift();
  2960. tokens.push({
  2961. value: matched,
  2962. // Cast descendant combinators to space
  2963. type: match[0].replace( rtrim, " " )
  2964. });
  2965. soFar = soFar.slice( matched.length );
  2966. }
  2967. // Filters
  2968. for ( type in Expr.filter ) {
  2969. if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
  2970. (match = preFilters[ type ]( match ))) ) {
  2971. matched = match.shift();
  2972. tokens.push({
  2973. value: matched,
  2974. type: type,
  2975. matches: match
  2976. });
  2977. soFar = soFar.slice( matched.length );
  2978. }
  2979. }
  2980. if ( !matched ) {
  2981. break;
  2982. }
  2983. }
  2984. // Return the length of the invalid excess
  2985. // if we're just parsing
  2986. // Otherwise, throw an error or return tokens
  2987. return parseOnly ?
  2988. soFar.length :
  2989. soFar ?
  2990. Sizzle.error( selector ) :
  2991. // Cache the tokens
  2992. tokenCache( selector, groups ).slice( 0 );
  2993. };
  2994. function toSelector( tokens ) {
  2995. var i = 0,
  2996. len = tokens.length,
  2997. selector = "";
  2998. for ( ; i < len; i++ ) {
  2999. selector += tokens[i].value;
  3000. }
  3001. return selector;
  3002. }
  3003. function addCombinator( matcher, combinator, base ) {
  3004. var dir = combinator.dir,
  3005. checkNonElements = base && dir === "parentNode",
  3006. doneName = done++;
  3007. return combinator.first ?
  3008. // Check against closest ancestor/preceding element
  3009. function( elem, context, xml ) {
  3010. while ( (elem = elem[ dir ]) ) {
  3011. if ( elem.nodeType === 1 || checkNonElements ) {
  3012. return matcher( elem, context, xml );
  3013. }
  3014. }
  3015. } :
  3016. // Check against all ancestor/preceding elements
  3017. function( elem, context, xml ) {
  3018. var oldCache, uniqueCache, outerCache,
  3019. newCache = [ dirruns, doneName ];
  3020. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  3021. if ( xml ) {
  3022. while ( (elem = elem[ dir ]) ) {
  3023. if ( elem.nodeType === 1 || checkNonElements ) {
  3024. if ( matcher( elem, context, xml ) ) {
  3025. return true;
  3026. }
  3027. }
  3028. }
  3029. } else {
  3030. while ( (elem = elem[ dir ]) ) {
  3031. if ( elem.nodeType === 1 || checkNonElements ) {
  3032. outerCache = elem[ expando ] || (elem[ expando ] = {});
  3033. // Support: IE <9 only
  3034. // Defend against cloned attroperties (jQuery gh-1709)
  3035. uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
  3036. if ( (oldCache = uniqueCache[ dir ]) &&
  3037. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  3038. // Assign to newCache so results back-propagate to previous elements
  3039. return (newCache[ 2 ] = oldCache[ 2 ]);
  3040. } else {
  3041. // Reuse newcache so results back-propagate to previous elements
  3042. uniqueCache[ dir ] = newCache;
  3043. // A match means we're done; a fail means we have to keep checking
  3044. if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
  3045. return true;
  3046. }
  3047. }
  3048. }
  3049. }
  3050. }
  3051. };
  3052. }
  3053. function elementMatcher( matchers ) {
  3054. return matchers.length > 1 ?
  3055. function( elem, context, xml ) {
  3056. var i = matchers.length;
  3057. while ( i-- ) {
  3058. if ( !matchers[i]( elem, context, xml ) ) {
  3059. return false;
  3060. }
  3061. }
  3062. return true;
  3063. } :
  3064. matchers[0];
  3065. }
  3066. function multipleContexts( selector, contexts, results ) {
  3067. var i = 0,
  3068. len = contexts.length;
  3069. for ( ; i < len; i++ ) {
  3070. Sizzle( selector, contexts[i], results );
  3071. }
  3072. return results;
  3073. }
  3074. function condense( unmatched, map, filter, context, xml ) {
  3075. var elem,
  3076. newUnmatched = [],
  3077. i = 0,
  3078. len = unmatched.length,
  3079. mapped = map != null;
  3080. for ( ; i < len; i++ ) {
  3081. if ( (elem = unmatched[i]) ) {
  3082. if ( !filter || filter( elem, context, xml ) ) {
  3083. newUnmatched.push( elem );
  3084. if ( mapped ) {
  3085. map.push( i );
  3086. }
  3087. }
  3088. }
  3089. }
  3090. return newUnmatched;
  3091. }
  3092. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  3093. if ( postFilter && !postFilter[ expando ] ) {
  3094. postFilter = setMatcher( postFilter );
  3095. }
  3096. if ( postFinder && !postFinder[ expando ] ) {
  3097. postFinder = setMatcher( postFinder, postSelector );
  3098. }
  3099. return markFunction(function( seed, results, context, xml ) {
  3100. var temp, i, elem,
  3101. preMap = [],
  3102. postMap = [],
  3103. preexisting = results.length,
  3104. // Get initial elements from seed or context
  3105. elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
  3106. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  3107. matcherIn = preFilter && ( seed || !selector ) ?
  3108. condense( elems, preMap, preFilter, context, xml ) :
  3109. elems,
  3110. matcherOut = matcher ?
  3111. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  3112. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  3113. // ...intermediate processing is necessary
  3114. [] :
  3115. // ...otherwise use results directly
  3116. results :
  3117. matcherIn;
  3118. // Find primary matches
  3119. if ( matcher ) {
  3120. matcher( matcherIn, matcherOut, context, xml );
  3121. }
  3122. // Apply postFilter
  3123. if ( postFilter ) {
  3124. temp = condense( matcherOut, postMap );
  3125. postFilter( temp, [], context, xml );
  3126. // Un-match failing elements by moving them back to matcherIn
  3127. i = temp.length;
  3128. while ( i-- ) {
  3129. if ( (elem = temp[i]) ) {
  3130. matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
  3131. }
  3132. }
  3133. }
  3134. if ( seed ) {
  3135. if ( postFinder || preFilter ) {
  3136. if ( postFinder ) {
  3137. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  3138. temp = [];
  3139. i = matcherOut.length;
  3140. while ( i-- ) {
  3141. if ( (elem = matcherOut[i]) ) {
  3142. // Restore matcherIn since elem is not yet a final match
  3143. temp.push( (matcherIn[i] = elem) );
  3144. }
  3145. }
  3146. postFinder( null, (matcherOut = []), temp, xml );
  3147. }
  3148. // Move matched elements from seed to results to keep them synchronized
  3149. i = matcherOut.length;
  3150. while ( i-- ) {
  3151. if ( (elem = matcherOut[i]) &&
  3152. (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
  3153. seed[temp] = !(results[temp] = elem);
  3154. }
  3155. }
  3156. }
  3157. // Add elements to results, through postFinder if defined
  3158. } else {
  3159. matcherOut = condense(
  3160. matcherOut === results ?
  3161. matcherOut.splice( preexisting, matcherOut.length ) :
  3162. matcherOut
  3163. );
  3164. if ( postFinder ) {
  3165. postFinder( null, results, matcherOut, xml );
  3166. } else {
  3167. push.apply( results, matcherOut );
  3168. }
  3169. }
  3170. });
  3171. }
  3172. function matcherFromTokens( tokens ) {
  3173. var checkContext, matcher, j,
  3174. len = tokens.length,
  3175. leadingRelative = Expr.relative[ tokens[0].type ],
  3176. implicitRelative = leadingRelative || Expr.relative[" "],
  3177. i = leadingRelative ? 1 : 0,
  3178. // The foundational matcher ensures that elements are reachable from top-level context(s)
  3179. matchContext = addCombinator( function( elem ) {
  3180. return elem === checkContext;
  3181. }, implicitRelative, true ),
  3182. matchAnyContext = addCombinator( function( elem ) {
  3183. return indexOf( checkContext, elem ) > -1;
  3184. }, implicitRelative, true ),
  3185. matchers = [ function( elem, context, xml ) {
  3186. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  3187. (checkContext = context).nodeType ?
  3188. matchContext( elem, context, xml ) :
  3189. matchAnyContext( elem, context, xml ) );
  3190. // Avoid hanging onto element (issue #299)
  3191. checkContext = null;
  3192. return ret;
  3193. } ];
  3194. for ( ; i < len; i++ ) {
  3195. if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
  3196. matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
  3197. } else {
  3198. matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
  3199. // Return special upon seeing a positional matcher
  3200. if ( matcher[ expando ] ) {
  3201. // Find the next relative operator (if any) for proper handling
  3202. j = ++i;
  3203. for ( ; j < len; j++ ) {
  3204. if ( Expr.relative[ tokens[j].type ] ) {
  3205. break;
  3206. }
  3207. }
  3208. return setMatcher(
  3209. i > 1 && elementMatcher( matchers ),
  3210. i > 1 && toSelector(
  3211. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  3212. tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
  3213. ).replace( rtrim, "$1" ),
  3214. matcher,
  3215. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  3216. j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
  3217. j < len && toSelector( tokens )
  3218. );
  3219. }
  3220. matchers.push( matcher );
  3221. }
  3222. }
  3223. return elementMatcher( matchers );
  3224. }
  3225. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  3226. var bySet = setMatchers.length > 0,
  3227. byElement = elementMatchers.length > 0,
  3228. superMatcher = function( seed, context, xml, results, outermost ) {
  3229. var elem, j, matcher,
  3230. matchedCount = 0,
  3231. i = "0",
  3232. unmatched = seed && [],
  3233. setMatched = [],
  3234. contextBackup = outermostContext,
  3235. // We must always have either seed elements or outermost context
  3236. elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
  3237. // Use integer dirruns iff this is the outermost matcher
  3238. dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
  3239. len = elems.length;
  3240. if ( outermost ) {
  3241. outermostContext = context === document || context || outermost;
  3242. }
  3243. // Add elements passing elementMatchers directly to results
  3244. // Support: IE<9, Safari
  3245. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  3246. for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
  3247. if ( byElement && elem ) {
  3248. j = 0;
  3249. if ( !context && elem.ownerDocument !== document ) {
  3250. setDocument( elem );
  3251. xml = !documentIsHTML;
  3252. }
  3253. while ( (matcher = elementMatchers[j++]) ) {
  3254. if ( matcher( elem, context || document, xml) ) {
  3255. results.push( elem );
  3256. break;
  3257. }
  3258. }
  3259. if ( outermost ) {
  3260. dirruns = dirrunsUnique;
  3261. }
  3262. }
  3263. // Track unmatched elements for set filters
  3264. if ( bySet ) {
  3265. // They will have gone through all possible matchers
  3266. if ( (elem = !matcher && elem) ) {
  3267. matchedCount--;
  3268. }
  3269. // Lengthen the array for every element, matched or not
  3270. if ( seed ) {
  3271. unmatched.push( elem );
  3272. }
  3273. }
  3274. }
  3275. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  3276. // makes the latter nonnegative.
  3277. matchedCount += i;
  3278. // Apply set filters to unmatched elements
  3279. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  3280. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  3281. // no element matchers and no seed.
  3282. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  3283. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  3284. // numerically zero.
  3285. if ( bySet && i !== matchedCount ) {
  3286. j = 0;
  3287. while ( (matcher = setMatchers[j++]) ) {
  3288. matcher( unmatched, setMatched, context, xml );
  3289. }
  3290. if ( seed ) {
  3291. // Reintegrate element matches to eliminate the need for sorting
  3292. if ( matchedCount > 0 ) {
  3293. while ( i-- ) {
  3294. if ( !(unmatched[i] || setMatched[i]) ) {
  3295. setMatched[i] = pop.call( results );
  3296. }
  3297. }
  3298. }
  3299. // Discard index placeholder values to get only actual matches
  3300. setMatched = condense( setMatched );
  3301. }
  3302. // Add matches to results
  3303. push.apply( results, setMatched );
  3304. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  3305. if ( outermost && !seed && setMatched.length > 0 &&
  3306. ( matchedCount + setMatchers.length ) > 1 ) {
  3307. Sizzle.uniqueSort( results );
  3308. }
  3309. }
  3310. // Override manipulation of globals by nested matchers
  3311. if ( outermost ) {
  3312. dirruns = dirrunsUnique;
  3313. outermostContext = contextBackup;
  3314. }
  3315. return unmatched;
  3316. };
  3317. return bySet ?
  3318. markFunction( superMatcher ) :
  3319. superMatcher;
  3320. }
  3321. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  3322. var i,
  3323. setMatchers = [],
  3324. elementMatchers = [],
  3325. cached = compilerCache[ selector + " " ];
  3326. if ( !cached ) {
  3327. // Generate a function of recursive functions that can be used to check each element
  3328. if ( !match ) {
  3329. match = tokenize( selector );
  3330. }
  3331. i = match.length;
  3332. while ( i-- ) {
  3333. cached = matcherFromTokens( match[i] );
  3334. if ( cached[ expando ] ) {
  3335. setMatchers.push( cached );
  3336. } else {
  3337. elementMatchers.push( cached );
  3338. }
  3339. }
  3340. // Cache the compiled function
  3341. cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  3342. // Save selector and tokenization
  3343. cached.selector = selector;
  3344. }
  3345. return cached;
  3346. };
  3347. /**
  3348. * A low-level selection function that works with Sizzle's compiled
  3349. * selector functions
  3350. * @param {String|Function} selector A selector or a pre-compiled
  3351. * selector function built with Sizzle.compile
  3352. * @param {Element} context
  3353. * @param {Array} [results]
  3354. * @param {Array} [seed] A set of elements to match against
  3355. */
  3356. select = Sizzle.select = function( selector, context, results, seed ) {
  3357. var i, tokens, token, type, find,
  3358. compiled = typeof selector === "function" && selector,
  3359. match = !seed && tokenize( (selector = compiled.selector || selector) );
  3360. results = results || [];
  3361. // Try to minimize operations if there is only one selector in the list and no seed
  3362. // (the latter of which guarantees us context)
  3363. if ( match.length === 1 ) {
  3364. // Reduce context if the leading compound selector is an ID
  3365. tokens = match[0] = match[0].slice( 0 );
  3366. if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
  3367. support.getById && context.nodeType === 9 && documentIsHTML &&
  3368. Expr.relative[ tokens[1].type ] ) {
  3369. context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
  3370. if ( !context ) {
  3371. return results;
  3372. // Precompiled matchers will still verify ancestry, so step up a level
  3373. } else if ( compiled ) {
  3374. context = context.parentNode;
  3375. }
  3376. selector = selector.slice( tokens.shift().value.length );
  3377. }
  3378. // Fetch a seed set for right-to-left matching
  3379. i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
  3380. while ( i-- ) {
  3381. token = tokens[i];
  3382. // Abort if we hit a combinator
  3383. if ( Expr.relative[ (type = token.type) ] ) {
  3384. break;
  3385. }
  3386. if ( (find = Expr.find[ type ]) ) {
  3387. // Search, expanding context for leading sibling combinators
  3388. if ( (seed = find(
  3389. token.matches[0].replace( runescape, funescape ),
  3390. rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
  3391. )) ) {
  3392. // If seed is empty or no tokens remain, we can return early
  3393. tokens.splice( i, 1 );
  3394. selector = seed.length && toSelector( tokens );
  3395. if ( !selector ) {
  3396. push.apply( results, seed );
  3397. return results;
  3398. }
  3399. break;
  3400. }
  3401. }
  3402. }
  3403. }
  3404. // Compile and execute a filtering function if one is not provided
  3405. // Provide `match` to avoid retokenization if we modified the selector above
  3406. ( compiled || compile( selector, match ) )(
  3407. seed,
  3408. context,
  3409. !documentIsHTML,
  3410. results,
  3411. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  3412. );
  3413. return results;
  3414. };
  3415. // One-time assignments
  3416. // Sort stability
  3417. support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
  3418. // Support: Chrome 14-35+
  3419. // Always assume duplicates if they aren't passed to the comparison function
  3420. support.detectDuplicates = !!hasDuplicate;
  3421. // Initialize against the default document
  3422. setDocument();
  3423. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  3424. // Detached nodes confoundingly follow *each other*
  3425. support.sortDetached = assert(function( div1 ) {
  3426. // Should return 1, but returns 4 (following)
  3427. return div1.compareDocumentPosition( document.createElement("div") ) & 1;
  3428. });
  3429. // Support: IE<8
  3430. // Prevent attribute/property "interpolation"
  3431. // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  3432. if ( !assert(function( div ) {
  3433. div.innerHTML = "<a href='#'></a>";
  3434. return div.firstChild.getAttribute("href") === "#" ;
  3435. }) ) {
  3436. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  3437. if ( !isXML ) {
  3438. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  3439. }
  3440. });
  3441. }
  3442. // Support: IE<9
  3443. // Use defaultValue in place of getAttribute("value")
  3444. if ( !support.attributes || !assert(function( div ) {
  3445. div.innerHTML = "<input/>";
  3446. div.firstChild.setAttribute( "value", "" );
  3447. return div.firstChild.getAttribute( "value" ) === "";
  3448. }) ) {
  3449. addHandle( "value", function( elem, name, isXML ) {
  3450. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  3451. return elem.defaultValue;
  3452. }
  3453. });
  3454. }
  3455. // Support: IE<9
  3456. // Use getAttributeNode to fetch booleans when getAttribute lies
  3457. if ( !assert(function( div ) {
  3458. return div.getAttribute("disabled") == null;
  3459. }) ) {
  3460. addHandle( booleans, function( elem, name, isXML ) {
  3461. var val;
  3462. if ( !isXML ) {
  3463. return elem[ name ] === true ? name.toLowerCase() :
  3464. (val = elem.getAttributeNode( name )) && val.specified ?
  3465. val.value :
  3466. null;
  3467. }
  3468. });
  3469. }
  3470. return Sizzle;
  3471. })( window );
  3472. jQuery.find = Sizzle;
  3473. jQuery.expr = Sizzle.selectors;
  3474. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  3475. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  3476. jQuery.text = Sizzle.getText;
  3477. jQuery.isXMLDoc = Sizzle.isXML;
  3478. jQuery.contains = Sizzle.contains;
  3479. var dir = function( elem, dir, until ) {
  3480. var matched = [],
  3481. truncate = until !== undefined;
  3482. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  3483. if ( elem.nodeType === 1 ) {
  3484. if ( truncate && jQuery( elem ).is( until ) ) {
  3485. break;
  3486. }
  3487. matched.push( elem );
  3488. }
  3489. }
  3490. return matched;
  3491. };
  3492. var siblings = function( n, elem ) {
  3493. var matched = [];
  3494. for ( ; n; n = n.nextSibling ) {
  3495. if ( n.nodeType === 1 && n !== elem ) {
  3496. matched.push( n );
  3497. }
  3498. }
  3499. return matched;
  3500. };
  3501. var rneedsContext = jQuery.expr.match.needsContext;
  3502. var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ );
  3503. var risSimple = /^.[^:#\[\.,]*$/;
  3504. // Implement the identical functionality for filter and not
  3505. function winnow( elements, qualifier, not ) {
  3506. if ( jQuery.isFunction( qualifier ) ) {
  3507. return jQuery.grep( elements, function( elem, i ) {
  3508. /* jshint -W018 */
  3509. return !!qualifier.call( elem, i, elem ) !== not;
  3510. } );
  3511. }
  3512. if ( qualifier.nodeType ) {
  3513. return jQuery.grep( elements, function( elem ) {
  3514. return ( elem === qualifier ) !== not;
  3515. } );
  3516. }
  3517. if ( typeof qualifier === "string" ) {
  3518. if ( risSimple.test( qualifier ) ) {
  3519. return jQuery.filter( qualifier, elements, not );
  3520. }
  3521. qualifier = jQuery.filter( qualifier, elements );
  3522. }
  3523. return jQuery.grep( elements, function( elem ) {
  3524. return ( jQuery.inArray( elem, qualifier ) > -1 ) !== not;
  3525. } );
  3526. }
  3527. jQuery.filter = function( expr, elems, not ) {
  3528. var elem = elems[ 0 ];
  3529. if ( not ) {
  3530. expr = ":not(" + expr + ")";
  3531. }
  3532. return elems.length === 1 && elem.nodeType === 1 ?
  3533. jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
  3534. jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  3535. return elem.nodeType === 1;
  3536. } ) );
  3537. };
  3538. jQuery.fn.extend( {
  3539. find: function( selector ) {
  3540. var i,
  3541. ret = [],
  3542. self = this,
  3543. len = self.length;
  3544. if ( typeof selector !== "string" ) {
  3545. return this.pushStack( jQuery( selector ).filter( function() {
  3546. for ( i = 0; i < len; i++ ) {
  3547. if ( jQuery.contains( self[ i ], this ) ) {
  3548. return true;
  3549. }
  3550. }
  3551. } ) );
  3552. }
  3553. for ( i = 0; i < len; i++ ) {
  3554. jQuery.find( selector, self[ i ], ret );
  3555. }
  3556. // Needed because $( selector, context ) becomes $( context ).find( selector )
  3557. ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
  3558. ret.selector = this.selector ? this.selector + " " + selector : selector;
  3559. return ret;
  3560. },
  3561. filter: function( selector ) {
  3562. return this.pushStack( winnow( this, selector || [], false ) );
  3563. },
  3564. not: function( selector ) {
  3565. return this.pushStack( winnow( this, selector || [], true ) );
  3566. },
  3567. is: function( selector ) {
  3568. return !!winnow(
  3569. this,
  3570. // If this is a positional/relative selector, check membership in the returned set
  3571. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  3572. typeof selector === "string" && rneedsContext.test( selector ) ?
  3573. jQuery( selector ) :
  3574. selector || [],
  3575. false
  3576. ).length;
  3577. }
  3578. } );
  3579. // Initialize a jQuery object
  3580. // A central reference to the root jQuery(document)
  3581. var rootjQuery,
  3582. // A simple way to check for HTML strings
  3583. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  3584. // Strict HTML recognition (#11290: must start with <)
  3585. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
  3586. init = jQuery.fn.init = function( selector, context, root ) {
  3587. var match, elem;
  3588. // HANDLE: $(""), $(null), $(undefined), $(false)
  3589. if ( !selector ) {
  3590. return this;
  3591. }
  3592. // init accepts an alternate rootjQuery
  3593. // so migrate can support jQuery.sub (gh-2101)
  3594. root = root || rootjQuery;
  3595. // Handle HTML strings
  3596. if ( typeof selector === "string" ) {
  3597. if ( selector.charAt( 0 ) === "<" &&
  3598. selector.charAt( selector.length - 1 ) === ">" &&
  3599. selector.length >= 3 ) {
  3600. // Assume that strings that start and end with <> are HTML and skip the regex check
  3601. match = [ null, selector, null ];
  3602. } else {
  3603. match = rquickExpr.exec( selector );
  3604. }
  3605. // Match html or make sure no context is specified for #id
  3606. if ( match && ( match[ 1 ] || !context ) ) {
  3607. // HANDLE: $(html) -> $(array)
  3608. if ( match[ 1 ] ) {
  3609. context = context instanceof jQuery ? context[ 0 ] : context;
  3610. // scripts is true for back-compat
  3611. // Intentionally let the error be thrown if parseHTML is not present
  3612. jQuery.merge( this, jQuery.parseHTML(
  3613. match[ 1 ],
  3614. context && context.nodeType ? context.ownerDocument || context : document,
  3615. true
  3616. ) );
  3617. // HANDLE: $(html, props)
  3618. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  3619. for ( match in context ) {
  3620. // Properties of context are called as methods if possible
  3621. if ( jQuery.isFunction( this[ match ] ) ) {
  3622. this[ match ]( context[ match ] );
  3623. // ...and otherwise set as attributes
  3624. } else {
  3625. this.attr( match, context[ match ] );
  3626. }
  3627. }
  3628. }
  3629. return this;
  3630. // HANDLE: $(#id)
  3631. } else {
  3632. elem = document.getElementById( match[ 2 ] );
  3633. // Check parentNode to catch when Blackberry 4.6 returns
  3634. // nodes that are no longer in the document #6963
  3635. if ( elem && elem.parentNode ) {
  3636. // Handle the case where IE and Opera return items
  3637. // by name instead of ID
  3638. if ( elem.id !== match[ 2 ] ) {
  3639. return rootjQuery.find( selector );
  3640. }
  3641. // Otherwise, we inject the element directly into the jQuery object
  3642. this.length = 1;
  3643. this[ 0 ] = elem;
  3644. }
  3645. this.context = document;
  3646. this.selector = selector;
  3647. return this;
  3648. }
  3649. // HANDLE: $(expr, $(...))
  3650. } else if ( !context || context.jquery ) {
  3651. return ( context || root ).find( selector );
  3652. // HANDLE: $(expr, context)
  3653. // (which is just equivalent to: $(context).find(expr)
  3654. } else {
  3655. return this.constructor( context ).find( selector );
  3656. }
  3657. // HANDLE: $(DOMElement)
  3658. } else if ( selector.nodeType ) {
  3659. this.context = this[ 0 ] = selector;
  3660. this.length = 1;
  3661. return this;
  3662. // HANDLE: $(function)
  3663. // Shortcut for document ready
  3664. } else if ( jQuery.isFunction( selector ) ) {
  3665. return typeof root.ready !== "undefined" ?
  3666. root.ready( selector ) :
  3667. // Execute immediately if ready is not present
  3668. selector( jQuery );
  3669. }
  3670. if ( selector.selector !== undefined ) {
  3671. this.selector = selector.selector;
  3672. this.context = selector.context;
  3673. }
  3674. return jQuery.makeArray( selector, this );
  3675. };
  3676. // Give the init function the jQuery prototype for later instantiation
  3677. init.prototype = jQuery.fn;
  3678. // Initialize central reference
  3679. rootjQuery = jQuery( document );
  3680. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  3681. // methods guaranteed to produce a unique set when starting from a unique set
  3682. guaranteedUnique = {
  3683. children: true,
  3684. contents: true,
  3685. next: true,
  3686. prev: true
  3687. };
  3688. jQuery.fn.extend( {
  3689. has: function( target ) {
  3690. var i,
  3691. targets = jQuery( target, this ),
  3692. len = targets.length;
  3693. return this.filter( function() {
  3694. for ( i = 0; i < len; i++ ) {
  3695. if ( jQuery.contains( this, targets[ i ] ) ) {
  3696. return true;
  3697. }
  3698. }
  3699. } );
  3700. },
  3701. closest: function( selectors, context ) {
  3702. var cur,
  3703. i = 0,
  3704. l = this.length,
  3705. matched = [],
  3706. pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
  3707. jQuery( selectors, context || this.context ) :
  3708. 0;
  3709. for ( ; i < l; i++ ) {
  3710. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  3711. // Always skip document fragments
  3712. if ( cur.nodeType < 11 && ( pos ?
  3713. pos.index( cur ) > -1 :
  3714. // Don't pass non-elements to Sizzle
  3715. cur.nodeType === 1 &&
  3716. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  3717. matched.push( cur );
  3718. break;
  3719. }
  3720. }
  3721. }
  3722. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  3723. },
  3724. // Determine the position of an element within
  3725. // the matched set of elements
  3726. index: function( elem ) {
  3727. // No argument, return index in parent
  3728. if ( !elem ) {
  3729. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  3730. }
  3731. // index in selector
  3732. if ( typeof elem === "string" ) {
  3733. return jQuery.inArray( this[ 0 ], jQuery( elem ) );
  3734. }
  3735. // Locate the position of the desired element
  3736. return jQuery.inArray(
  3737. // If it receives a jQuery object, the first element is used
  3738. elem.jquery ? elem[ 0 ] : elem, this );
  3739. },
  3740. add: function( selector, context ) {
  3741. return this.pushStack(
  3742. jQuery.uniqueSort(
  3743. jQuery.merge( this.get(), jQuery( selector, context ) )
  3744. )
  3745. );
  3746. },
  3747. addBack: function( selector ) {
  3748. return this.add( selector == null ?
  3749. this.prevObject : this.prevObject.filter( selector )
  3750. );
  3751. }
  3752. } );
  3753. function sibling( cur, dir ) {
  3754. do {
  3755. cur = cur[ dir ];
  3756. } while ( cur && cur.nodeType !== 1 );
  3757. return cur;
  3758. }
  3759. jQuery.each( {
  3760. parent: function( elem ) {
  3761. var parent = elem.parentNode;
  3762. return parent && parent.nodeType !== 11 ? parent : null;
  3763. },
  3764. parents: function( elem ) {
  3765. return dir( elem, "parentNode" );
  3766. },
  3767. parentsUntil: function( elem, i, until ) {
  3768. return dir( elem, "parentNode", until );
  3769. },
  3770. next: function( elem ) {
  3771. return sibling( elem, "nextSibling" );
  3772. },
  3773. prev: function( elem ) {
  3774. return sibling( elem, "previousSibling" );
  3775. },
  3776. nextAll: function( elem ) {
  3777. return dir( elem, "nextSibling" );
  3778. },
  3779. prevAll: function( elem ) {
  3780. return dir( elem, "previousSibling" );
  3781. },
  3782. nextUntil: function( elem, i, until ) {
  3783. return dir( elem, "nextSibling", until );
  3784. },
  3785. prevUntil: function( elem, i, until ) {
  3786. return dir( elem, "previousSibling", until );
  3787. },
  3788. siblings: function( elem ) {
  3789. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  3790. },
  3791. children: function( elem ) {
  3792. return siblings( elem.firstChild );
  3793. },
  3794. contents: function( elem ) {
  3795. return jQuery.nodeName( elem, "iframe" ) ?
  3796. elem.contentDocument || elem.contentWindow.document :
  3797. jQuery.merge( [], elem.childNodes );
  3798. }
  3799. }, function( name, fn ) {
  3800. jQuery.fn[ name ] = function( until, selector ) {
  3801. var ret = jQuery.map( this, fn, until );
  3802. if ( name.slice( -5 ) !== "Until" ) {
  3803. selector = until;
  3804. }
  3805. if ( selector && typeof selector === "string" ) {
  3806. ret = jQuery.filter( selector, ret );
  3807. }
  3808. if ( this.length > 1 ) {
  3809. // Remove duplicates
  3810. if ( !guaranteedUnique[ name ] ) {
  3811. ret = jQuery.uniqueSort( ret );
  3812. }
  3813. // Reverse order for parents* and prev-derivatives
  3814. if ( rparentsprev.test( name ) ) {
  3815. ret = ret.reverse();
  3816. }
  3817. }
  3818. return this.pushStack( ret );
  3819. };
  3820. } );
  3821. var rnotwhite = ( /\S+/g );
  3822. // Convert String-formatted options into Object-formatted ones
  3823. function createOptions( options ) {
  3824. var object = {};
  3825. jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
  3826. object[ flag ] = true;
  3827. } );
  3828. return object;
  3829. }
  3830. /*
  3831. * Create a callback list using the following parameters:
  3832. *
  3833. * options: an optional list of space-separated options that will change how
  3834. * the callback list behaves or a more traditional option object
  3835. *
  3836. * By default a callback list will act like an event callback list and can be
  3837. * "fired" multiple times.
  3838. *
  3839. * Possible options:
  3840. *
  3841. * once: will ensure the callback list can only be fired once (like a Deferred)
  3842. *
  3843. * memory: will keep track of previous values and will call any callback added
  3844. * after the list has been fired right away with the latest "memorized"
  3845. * values (like a Deferred)
  3846. *
  3847. * unique: will ensure a callback can only be added once (no duplicate in the list)
  3848. *
  3849. * stopOnFalse: interrupt callings when a callback returns false
  3850. *
  3851. */
  3852. jQuery.Callbacks = function( options ) {
  3853. // Convert options from String-formatted to Object-formatted if needed
  3854. // (we check in cache first)
  3855. options = typeof options === "string" ?
  3856. createOptions( options ) :
  3857. jQuery.extend( {}, options );
  3858. var // Flag to know if list is currently firing
  3859. firing,
  3860. // Last fire value for non-forgettable lists
  3861. memory,
  3862. // Flag to know if list was already fired
  3863. fired,
  3864. // Flag to prevent firing
  3865. locked,
  3866. // Actual callback list
  3867. list = [],
  3868. // Queue of execution data for repeatable lists
  3869. queue = [],
  3870. // Index of currently firing callback (modified by add/remove as needed)
  3871. firingIndex = -1,
  3872. // Fire callbacks
  3873. fire = function() {
  3874. // Enforce single-firing
  3875. locked = options.once;
  3876. // Execute callbacks for all pending executions,
  3877. // respecting firingIndex overrides and runtime changes
  3878. fired = firing = true;
  3879. for ( ; queue.length; firingIndex = -1 ) {
  3880. memory = queue.shift();
  3881. while ( ++firingIndex < list.length ) {
  3882. // Run callback and check for early termination
  3883. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  3884. options.stopOnFalse ) {
  3885. // Jump to end and forget the data so .add doesn't re-fire
  3886. firingIndex = list.length;
  3887. memory = false;
  3888. }
  3889. }
  3890. }
  3891. // Forget the data if we're done with it
  3892. if ( !options.memory ) {
  3893. memory = false;
  3894. }
  3895. firing = false;
  3896. // Clean up if we're done firing for good
  3897. if ( locked ) {
  3898. // Keep an empty list if we have data for future add calls
  3899. if ( memory ) {
  3900. list = [];
  3901. // Otherwise, this object is spent
  3902. } else {
  3903. list = "";
  3904. }
  3905. }
  3906. },
  3907. // Actual Callbacks object
  3908. self = {
  3909. // Add a callback or a collection of callbacks to the list
  3910. add: function() {
  3911. if ( list ) {
  3912. // If we have memory from a past run, we should fire after adding
  3913. if ( memory && !firing ) {
  3914. firingIndex = list.length - 1;
  3915. queue.push( memory );
  3916. }
  3917. ( function add( args ) {
  3918. jQuery.each( args, function( _, arg ) {
  3919. if ( jQuery.isFunction( arg ) ) {
  3920. if ( !options.unique || !self.has( arg ) ) {
  3921. list.push( arg );
  3922. }
  3923. } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
  3924. // Inspect recursively
  3925. add( arg );
  3926. }
  3927. } );
  3928. } )( arguments );
  3929. if ( memory && !firing ) {
  3930. fire();
  3931. }
  3932. }
  3933. return this;
  3934. },
  3935. // Remove a callback from the list
  3936. remove: function() {
  3937. jQuery.each( arguments, function( _, arg ) {
  3938. var index;
  3939. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  3940. list.splice( index, 1 );
  3941. // Handle firing indexes
  3942. if ( index <= firingIndex ) {
  3943. firingIndex--;
  3944. }
  3945. }
  3946. } );
  3947. return this;
  3948. },
  3949. // Check if a given callback is in the list.
  3950. // If no argument is given, return whether or not list has callbacks attached.
  3951. has: function( fn ) {
  3952. return fn ?
  3953. jQuery.inArray( fn, list ) > -1 :
  3954. list.length > 0;
  3955. },
  3956. // Remove all callbacks from the list
  3957. empty: function() {
  3958. if ( list ) {
  3959. list = [];
  3960. }
  3961. return this;
  3962. },
  3963. // Disable .fire and .add
  3964. // Abort any current/pending executions
  3965. // Clear all callbacks and values
  3966. disable: function() {
  3967. locked = queue = [];
  3968. list = memory = "";
  3969. return this;
  3970. },
  3971. disabled: function() {
  3972. return !list;
  3973. },
  3974. // Disable .fire
  3975. // Also disable .add unless we have memory (since it would have no effect)
  3976. // Abort any pending executions
  3977. lock: function() {
  3978. locked = true;
  3979. if ( !memory ) {
  3980. self.disable();
  3981. }
  3982. return this;
  3983. },
  3984. locked: function() {
  3985. return !!locked;
  3986. },
  3987. // Call all callbacks with the given context and arguments
  3988. fireWith: function( context, args ) {
  3989. if ( !locked ) {
  3990. args = args || [];
  3991. args = [ context, args.slice ? args.slice() : args ];
  3992. queue.push( args );
  3993. if ( !firing ) {
  3994. fire();
  3995. }
  3996. }
  3997. return this;
  3998. },
  3999. // Call all the callbacks with the given arguments
  4000. fire: function() {
  4001. self.fireWith( this, arguments );
  4002. return this;
  4003. },
  4004. // To know if the callbacks have already been called at least once
  4005. fired: function() {
  4006. return !!fired;
  4007. }
  4008. };
  4009. return self;
  4010. };
  4011. jQuery.extend( {
  4012. Deferred: function( func ) {
  4013. var tuples = [
  4014. // action, add listener, listener list, final state
  4015. [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ],
  4016. [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ],
  4017. [ "notify", "progress", jQuery.Callbacks( "memory" ) ]
  4018. ],
  4019. state = "pending",
  4020. promise = {
  4021. state: function() {
  4022. return state;
  4023. },
  4024. always: function() {
  4025. deferred.done( arguments ).fail( arguments );
  4026. return this;
  4027. },
  4028. then: function( /* fnDone, fnFail, fnProgress */ ) {
  4029. var fns = arguments;
  4030. return jQuery.Deferred( function( newDefer ) {
  4031. jQuery.each( tuples, function( i, tuple ) {
  4032. var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
  4033. // deferred[ done | fail | progress ] for forwarding actions to newDefer
  4034. deferred[ tuple[ 1 ] ]( function() {
  4035. var returned = fn && fn.apply( this, arguments );
  4036. if ( returned && jQuery.isFunction( returned.promise ) ) {
  4037. returned.promise()
  4038. .progress( newDefer.notify )
  4039. .done( newDefer.resolve )
  4040. .fail( newDefer.reject );
  4041. } else {
  4042. newDefer[ tuple[ 0 ] + "With" ](
  4043. this === promise ? newDefer.promise() : this,
  4044. fn ? [ returned ] : arguments
  4045. );
  4046. }
  4047. } );
  4048. } );
  4049. fns = null;
  4050. } ).promise();
  4051. },
  4052. // Get a promise for this deferred
  4053. // If obj is provided, the promise aspect is added to the object
  4054. promise: function( obj ) {
  4055. return obj != null ? jQuery.extend( obj, promise ) : promise;
  4056. }
  4057. },
  4058. deferred = {};
  4059. // Keep pipe for back-compat
  4060. promise.pipe = promise.then;
  4061. // Add list-specific methods
  4062. jQuery.each( tuples, function( i, tuple ) {
  4063. var list = tuple[ 2 ],
  4064. stateString = tuple[ 3 ];
  4065. // promise[ done | fail | progress ] = list.add
  4066. promise[ tuple[ 1 ] ] = list.add;
  4067. // Handle state
  4068. if ( stateString ) {
  4069. list.add( function() {
  4070. // state = [ resolved | rejected ]
  4071. state = stateString;
  4072. // [ reject_list | resolve_list ].disable; progress_list.lock
  4073. }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
  4074. }
  4075. // deferred[ resolve | reject | notify ]
  4076. deferred[ tuple[ 0 ] ] = function() {
  4077. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments );
  4078. return this;
  4079. };
  4080. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  4081. } );
  4082. // Make the deferred a promise
  4083. promise.promise( deferred );
  4084. // Call given func if any
  4085. if ( func ) {
  4086. func.call( deferred, deferred );
  4087. }
  4088. // All done!
  4089. return deferred;
  4090. },
  4091. // Deferred helper
  4092. when: function( subordinate /* , ..., subordinateN */ ) {
  4093. var i = 0,
  4094. resolveValues = slice.call( arguments ),
  4095. length = resolveValues.length,
  4096. // the count of uncompleted subordinates
  4097. remaining = length !== 1 ||
  4098. ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
  4099. // the master Deferred.
  4100. // If resolveValues consist of only a single Deferred, just use that.
  4101. deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
  4102. // Update function for both resolve and progress values
  4103. updateFunc = function( i, contexts, values ) {
  4104. return function( value ) {
  4105. contexts[ i ] = this;
  4106. values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  4107. if ( values === progressValues ) {
  4108. deferred.notifyWith( contexts, values );
  4109. } else if ( !( --remaining ) ) {
  4110. deferred.resolveWith( contexts, values );
  4111. }
  4112. };
  4113. },
  4114. progressValues, progressContexts, resolveContexts;
  4115. // add listeners to Deferred subordinates; treat others as resolved
  4116. if ( length > 1 ) {
  4117. progressValues = new Array( length );
  4118. progressContexts = new Array( length );
  4119. resolveContexts = new Array( length );
  4120. for ( ; i < length; i++ ) {
  4121. if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
  4122. resolveValues[ i ].promise()
  4123. .progress( updateFunc( i, progressContexts, progressValues ) )
  4124. .done( updateFunc( i, resolveContexts, resolveValues ) )
  4125. .fail( deferred.reject );
  4126. } else {
  4127. --remaining;
  4128. }
  4129. }
  4130. }
  4131. // if we're not waiting on anything, resolve the master
  4132. if ( !remaining ) {
  4133. deferred.resolveWith( resolveContexts, resolveValues );
  4134. }
  4135. return deferred.promise();
  4136. }
  4137. } );
  4138. // The deferred used on DOM ready
  4139. var readyList;
  4140. jQuery.fn.ready = function( fn ) {
  4141. // Add the callback
  4142. jQuery.ready.promise().done( fn );
  4143. return this;
  4144. };
  4145. jQuery.extend( {
  4146. // Is the DOM ready to be used? Set to true once it occurs.
  4147. isReady: false,
  4148. // A counter to track how many items to wait for before
  4149. // the ready event fires. See #6781
  4150. readyWait: 1,
  4151. // Hold (or release) the ready event
  4152. holdReady: function( hold ) {
  4153. if ( hold ) {
  4154. jQuery.readyWait++;
  4155. } else {
  4156. jQuery.ready( true );
  4157. }
  4158. },
  4159. // Handle when the DOM is ready
  4160. ready: function( wait ) {
  4161. // Abort if there are pending holds or we're already ready
  4162. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  4163. return;
  4164. }
  4165. // Remember that the DOM is ready
  4166. jQuery.isReady = true;
  4167. // If a normal DOM Ready event fired, decrement, and wait if need be
  4168. if ( wait !== true && --jQuery.readyWait > 0 ) {
  4169. return;
  4170. }
  4171. // If there are functions bound, to execute
  4172. readyList.resolveWith( document, [ jQuery ] );
  4173. // Trigger any bound ready events
  4174. if ( jQuery.fn.triggerHandler ) {
  4175. jQuery( document ).triggerHandler( "ready" );
  4176. jQuery( document ).off( "ready" );
  4177. }
  4178. }
  4179. } );
  4180. /**
  4181. * Clean-up method for dom ready events
  4182. */
  4183. function detach() {
  4184. if ( document.addEventListener ) {
  4185. document.removeEventListener( "DOMContentLoaded", completed );
  4186. window.removeEventListener( "load", completed );
  4187. } else {
  4188. document.detachEvent( "onreadystatechange", completed );
  4189. window.detachEvent( "onload", completed );
  4190. }
  4191. }
  4192. /**
  4193. * The ready event handler and self cleanup method
  4194. */
  4195. function completed() {
  4196. // readyState === "complete" is good enough for us to call the dom ready in oldIE
  4197. if ( document.addEventListener ||
  4198. window.event.type === "load" ||
  4199. document.readyState === "complete" ) {
  4200. detach();
  4201. jQuery.ready();
  4202. }
  4203. }
  4204. jQuery.ready.promise = function( obj ) {
  4205. if ( !readyList ) {
  4206. readyList = jQuery.Deferred();
  4207. // Catch cases where $(document).ready() is called
  4208. // after the browser event has already occurred.
  4209. // Support: IE6-10
  4210. // Older IE sometimes signals "interactive" too soon
  4211. if ( document.readyState === "complete" ||
  4212. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  4213. // Handle it asynchronously to allow scripts the opportunity to delay ready
  4214. window.setTimeout( jQuery.ready );
  4215. // Standards-based browsers support DOMContentLoaded
  4216. } else if ( document.addEventListener ) {
  4217. // Use the handy event callback
  4218. document.addEventListener( "DOMContentLoaded", completed );
  4219. // A fallback to window.onload, that will always work
  4220. window.addEventListener( "load", completed );
  4221. // If IE event model is used
  4222. } else {
  4223. // Ensure firing before onload, maybe late but safe also for iframes
  4224. document.attachEvent( "onreadystatechange", completed );
  4225. // A fallback to window.onload, that will always work
  4226. window.attachEvent( "onload", completed );
  4227. // If IE and not a frame
  4228. // continually check to see if the document is ready
  4229. var top = false;
  4230. try {
  4231. top = window.frameElement == null && document.documentElement;
  4232. } catch ( e ) {}
  4233. if ( top && top.doScroll ) {
  4234. ( function doScrollCheck() {
  4235. if ( !jQuery.isReady ) {
  4236. try {
  4237. // Use the trick by Diego Perini
  4238. // http://javascript.nwbox.com/IEContentLoaded/
  4239. top.doScroll( "left" );
  4240. } catch ( e ) {
  4241. return window.setTimeout( doScrollCheck, 50 );
  4242. }
  4243. // detach all dom ready events
  4244. detach();
  4245. // and execute any waiting functions
  4246. jQuery.ready();
  4247. }
  4248. } )();
  4249. }
  4250. }
  4251. }
  4252. return readyList.promise( obj );
  4253. };
  4254. // Kick off the DOM ready check even if the user does not
  4255. jQuery.ready.promise();
  4256. // Support: IE<9
  4257. // Iteration over object's inherited properties before its own
  4258. var i;
  4259. for ( i in jQuery( support ) ) {
  4260. break;
  4261. }
  4262. support.ownFirst = i === "0";
  4263. // Note: most support tests are defined in their respective modules.
  4264. // false until the test is run
  4265. support.inlineBlockNeedsLayout = false;
  4266. // Execute ASAP in case we need to set body.style.zoom
  4267. jQuery( function() {
  4268. // Minified: var a,b,c,d
  4269. var val, div, body, container;
  4270. body = document.getElementsByTagName( "body" )[ 0 ];
  4271. if ( !body || !body.style ) {
  4272. // Return for frameset docs that don't have a body
  4273. return;
  4274. }
  4275. // Setup
  4276. div = document.createElement( "div" );
  4277. container = document.createElement( "div" );
  4278. container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
  4279. body.appendChild( container ).appendChild( div );
  4280. if ( typeof div.style.zoom !== "undefined" ) {
  4281. // Support: IE<8
  4282. // Check if natively block-level elements act like inline-block
  4283. // elements when setting their display to 'inline' and giving
  4284. // them layout
  4285. div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
  4286. support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
  4287. if ( val ) {
  4288. // Prevent IE 6 from affecting layout for positioned elements #11048
  4289. // Prevent IE from shrinking the body in IE 7 mode #12869
  4290. // Support: IE<8
  4291. body.style.zoom = 1;
  4292. }
  4293. }
  4294. body.removeChild( container );
  4295. } );
  4296. ( function() {
  4297. var div = document.createElement( "div" );
  4298. // Support: IE<9
  4299. support.deleteExpando = true;
  4300. try {
  4301. delete div.test;
  4302. } catch ( e ) {
  4303. support.deleteExpando = false;
  4304. }
  4305. // Null elements to avoid leaks in IE.
  4306. div = null;
  4307. } )();
  4308. var acceptData = function( elem ) {
  4309. var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ],
  4310. nodeType = +elem.nodeType || 1;
  4311. // Do not set data on non-element DOM nodes because it will not be cleared (#8335).
  4312. return nodeType !== 1 && nodeType !== 9 ?
  4313. false :
  4314. // Nodes accept data unless otherwise specified; rejection can be conditional
  4315. !noData || noData !== true && elem.getAttribute( "classid" ) === noData;
  4316. };
  4317. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  4318. rmultiDash = /([A-Z])/g;
  4319. function dataAttr( elem, key, data ) {
  4320. // If nothing was found internally, try to fetch any
  4321. // data from the HTML5 data-* attribute
  4322. if ( data === undefined && elem.nodeType === 1 ) {
  4323. var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
  4324. data = elem.getAttribute( name );
  4325. if ( typeof data === "string" ) {
  4326. try {
  4327. data = data === "true" ? true :
  4328. data === "false" ? false :
  4329. data === "null" ? null :
  4330. // Only convert to a number if it doesn't change the string
  4331. +data + "" === data ? +data :
  4332. rbrace.test( data ) ? jQuery.parseJSON( data ) :
  4333. data;
  4334. } catch ( e ) {}
  4335. // Make sure we set the data so it isn't changed later
  4336. jQuery.data( elem, key, data );
  4337. } else {
  4338. data = undefined;
  4339. }
  4340. }
  4341. return data;
  4342. }
  4343. // checks a cache object for emptiness
  4344. function isEmptyDataObject( obj ) {
  4345. var name;
  4346. for ( name in obj ) {
  4347. // if the public data object is empty, the private is still empty
  4348. if ( name === "data" && jQuery.isEmptyObject( obj[ name ] ) ) {
  4349. continue;
  4350. }
  4351. if ( name !== "toJSON" ) {
  4352. return false;
  4353. }
  4354. }
  4355. return true;
  4356. }
  4357. function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
  4358. if ( !acceptData( elem ) ) {
  4359. return;
  4360. }
  4361. var ret, thisCache,
  4362. internalKey = jQuery.expando,
  4363. // We have to handle DOM nodes and JS objects differently because IE6-7
  4364. // can't GC object references properly across the DOM-JS boundary
  4365. isNode = elem.nodeType,
  4366. // Only DOM nodes need the global jQuery cache; JS object data is
  4367. // attached directly to the object so GC can occur automatically
  4368. cache = isNode ? jQuery.cache : elem,
  4369. // Only defining an ID for JS objects if its cache already exists allows
  4370. // the code to shortcut on the same path as a DOM node with no cache
  4371. id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
  4372. // Avoid doing any more work than we need to when trying to get data on an
  4373. // object that has no data at all
  4374. if ( ( !id || !cache[ id ] || ( !pvt && !cache[ id ].data ) ) &&
  4375. data === undefined && typeof name === "string" ) {
  4376. return;
  4377. }
  4378. if ( !id ) {
  4379. // Only DOM nodes need a new unique ID for each element since their data
  4380. // ends up in the global cache
  4381. if ( isNode ) {
  4382. id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
  4383. } else {
  4384. id = internalKey;
  4385. }
  4386. }
  4387. if ( !cache[ id ] ) {
  4388. // Avoid exposing jQuery metadata on plain JS objects when the object
  4389. // is serialized using JSON.stringify
  4390. cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
  4391. }
  4392. // An object can be passed to jQuery.data instead of a key/value pair; this gets
  4393. // shallow copied over onto the existing cache
  4394. if ( typeof name === "object" || typeof name === "function" ) {
  4395. if ( pvt ) {
  4396. cache[ id ] = jQuery.extend( cache[ id ], name );
  4397. } else {
  4398. cache[ id ].data = jQuery.extend( cache[ id ].data, name );
  4399. }
  4400. }
  4401. thisCache = cache[ id ];
  4402. // jQuery data() is stored in a separate object inside the object's internal data
  4403. // cache in order to avoid key collisions between internal data and user-defined
  4404. // data.
  4405. if ( !pvt ) {
  4406. if ( !thisCache.data ) {
  4407. thisCache.data = {};
  4408. }
  4409. thisCache = thisCache.data;
  4410. }
  4411. if ( data !== undefined ) {
  4412. thisCache[ jQuery.camelCase( name ) ] = data;
  4413. }
  4414. // Check for both converted-to-camel and non-converted data property names
  4415. // If a data property was specified
  4416. if ( typeof name === "string" ) {
  4417. // First Try to find as-is property data
  4418. ret = thisCache[ name ];
  4419. // Test for null|undefined property data
  4420. if ( ret == null ) {
  4421. // Try to find the camelCased property
  4422. ret = thisCache[ jQuery.camelCase( name ) ];
  4423. }
  4424. } else {
  4425. ret = thisCache;
  4426. }
  4427. return ret;
  4428. }
  4429. function internalRemoveData( elem, name, pvt ) {
  4430. if ( !acceptData( elem ) ) {
  4431. return;
  4432. }
  4433. var thisCache, i,
  4434. isNode = elem.nodeType,
  4435. // See jQuery.data for more information
  4436. cache = isNode ? jQuery.cache : elem,
  4437. id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
  4438. // If there is already no cache entry for this object, there is no
  4439. // purpose in continuing
  4440. if ( !cache[ id ] ) {
  4441. return;
  4442. }
  4443. if ( name ) {
  4444. thisCache = pvt ? cache[ id ] : cache[ id ].data;
  4445. if ( thisCache ) {
  4446. // Support array or space separated string names for data keys
  4447. if ( !jQuery.isArray( name ) ) {
  4448. // try the string as a key before any manipulation
  4449. if ( name in thisCache ) {
  4450. name = [ name ];
  4451. } else {
  4452. // split the camel cased version by spaces unless a key with the spaces exists
  4453. name = jQuery.camelCase( name );
  4454. if ( name in thisCache ) {
  4455. name = [ name ];
  4456. } else {
  4457. name = name.split( " " );
  4458. }
  4459. }
  4460. } else {
  4461. // If "name" is an array of keys...
  4462. // When data is initially created, via ("key", "val") signature,
  4463. // keys will be converted to camelCase.
  4464. // Since there is no way to tell _how_ a key was added, remove
  4465. // both plain key and camelCase key. #12786
  4466. // This will only penalize the array argument path.
  4467. name = name.concat( jQuery.map( name, jQuery.camelCase ) );
  4468. }
  4469. i = name.length;
  4470. while ( i-- ) {
  4471. delete thisCache[ name[ i ] ];
  4472. }
  4473. // If there is no data left in the cache, we want to continue
  4474. // and let the cache object itself get destroyed
  4475. if ( pvt ? !isEmptyDataObject( thisCache ) : !jQuery.isEmptyObject( thisCache ) ) {
  4476. return;
  4477. }
  4478. }
  4479. }
  4480. // See jQuery.data for more information
  4481. if ( !pvt ) {
  4482. delete cache[ id ].data;
  4483. // Don't destroy the parent cache unless the internal data object
  4484. // had been the only thing left in it
  4485. if ( !isEmptyDataObject( cache[ id ] ) ) {
  4486. return;
  4487. }
  4488. }
  4489. // Destroy the cache
  4490. if ( isNode ) {
  4491. jQuery.cleanData( [ elem ], true );
  4492. // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
  4493. /* jshint eqeqeq: false */
  4494. } else if ( support.deleteExpando || cache != cache.window ) {
  4495. /* jshint eqeqeq: true */
  4496. delete cache[ id ];
  4497. // When all else fails, undefined
  4498. } else {
  4499. cache[ id ] = undefined;
  4500. }
  4501. }
  4502. jQuery.extend( {
  4503. cache: {},
  4504. // The following elements (space-suffixed to avoid Object.prototype collisions)
  4505. // throw uncatchable exceptions if you attempt to set expando properties
  4506. noData: {
  4507. "applet ": true,
  4508. "embed ": true,
  4509. // ...but Flash objects (which have this classid) *can* handle expandos
  4510. "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  4511. },
  4512. hasData: function( elem ) {
  4513. elem = elem.nodeType ? jQuery.cache[ elem[ jQuery.expando ] ] : elem[ jQuery.expando ];
  4514. return !!elem && !isEmptyDataObject( elem );
  4515. },
  4516. data: function( elem, name, data ) {
  4517. return internalData( elem, name, data );
  4518. },
  4519. removeData: function( elem, name ) {
  4520. return internalRemoveData( elem, name );
  4521. },
  4522. // For internal use only.
  4523. _data: function( elem, name, data ) {
  4524. return internalData( elem, name, data, true );
  4525. },
  4526. _removeData: function( elem, name ) {
  4527. return internalRemoveData( elem, name, true );
  4528. }
  4529. } );
  4530. jQuery.fn.extend( {
  4531. data: function( key, value ) {
  4532. var i, name, data,
  4533. elem = this[ 0 ],
  4534. attrs = elem && elem.attributes;
  4535. // Special expections of .data basically thwart jQuery.access,
  4536. // so implement the relevant behavior ourselves
  4537. // Gets all values
  4538. if ( key === undefined ) {
  4539. if ( this.length ) {
  4540. data = jQuery.data( elem );
  4541. if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
  4542. i = attrs.length;
  4543. while ( i-- ) {
  4544. // Support: IE11+
  4545. // The attrs elements can be null (#14894)
  4546. if ( attrs[ i ] ) {
  4547. name = attrs[ i ].name;
  4548. if ( name.indexOf( "data-" ) === 0 ) {
  4549. name = jQuery.camelCase( name.slice( 5 ) );
  4550. dataAttr( elem, name, data[ name ] );
  4551. }
  4552. }
  4553. }
  4554. jQuery._data( elem, "parsedAttrs", true );
  4555. }
  4556. }
  4557. return data;
  4558. }
  4559. // Sets multiple values
  4560. if ( typeof key === "object" ) {
  4561. return this.each( function() {
  4562. jQuery.data( this, key );
  4563. } );
  4564. }
  4565. return arguments.length > 1 ?
  4566. // Sets one value
  4567. this.each( function() {
  4568. jQuery.data( this, key, value );
  4569. } ) :
  4570. // Gets one value
  4571. // Try to fetch any internally stored data first
  4572. elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
  4573. },
  4574. removeData: function( key ) {
  4575. return this.each( function() {
  4576. jQuery.removeData( this, key );
  4577. } );
  4578. }
  4579. } );
  4580. jQuery.extend( {
  4581. queue: function( elem, type, data ) {
  4582. var queue;
  4583. if ( elem ) {
  4584. type = ( type || "fx" ) + "queue";
  4585. queue = jQuery._data( elem, type );
  4586. // Speed up dequeue by getting out quickly if this is just a lookup
  4587. if ( data ) {
  4588. if ( !queue || jQuery.isArray( data ) ) {
  4589. queue = jQuery._data( elem, type, jQuery.makeArray( data ) );
  4590. } else {
  4591. queue.push( data );
  4592. }
  4593. }
  4594. return queue || [];
  4595. }
  4596. },
  4597. dequeue: function( elem, type ) {
  4598. type = type || "fx";
  4599. var queue = jQuery.queue( elem, type ),
  4600. startLength = queue.length,
  4601. fn = queue.shift(),
  4602. hooks = jQuery._queueHooks( elem, type ),
  4603. next = function() {
  4604. jQuery.dequeue( elem, type );
  4605. };
  4606. // If the fx queue is dequeued, always remove the progress sentinel
  4607. if ( fn === "inprogress" ) {
  4608. fn = queue.shift();
  4609. startLength--;
  4610. }
  4611. if ( fn ) {
  4612. // Add a progress sentinel to prevent the fx queue from being
  4613. // automatically dequeued
  4614. if ( type === "fx" ) {
  4615. queue.unshift( "inprogress" );
  4616. }
  4617. // clear up the last queue stop function
  4618. delete hooks.stop;
  4619. fn.call( elem, next, hooks );
  4620. }
  4621. if ( !startLength && hooks ) {
  4622. hooks.empty.fire();
  4623. }
  4624. },
  4625. // not intended for public consumption - generates a queueHooks object,
  4626. // or returns the current one
  4627. _queueHooks: function( elem, type ) {
  4628. var key = type + "queueHooks";
  4629. return jQuery._data( elem, key ) || jQuery._data( elem, key, {
  4630. empty: jQuery.Callbacks( "once memory" ).add( function() {
  4631. jQuery._removeData( elem, type + "queue" );
  4632. jQuery._removeData( elem, key );
  4633. } )
  4634. } );
  4635. }
  4636. } );
  4637. jQuery.fn.extend( {
  4638. queue: function( type, data ) {
  4639. var setter = 2;
  4640. if ( typeof type !== "string" ) {
  4641. data = type;
  4642. type = "fx";
  4643. setter--;
  4644. }
  4645. if ( arguments.length < setter ) {
  4646. return jQuery.queue( this[ 0 ], type );
  4647. }
  4648. return data === undefined ?
  4649. this :
  4650. this.each( function() {
  4651. var queue = jQuery.queue( this, type, data );
  4652. // ensure a hooks for this queue
  4653. jQuery._queueHooks( this, type );
  4654. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  4655. jQuery.dequeue( this, type );
  4656. }
  4657. } );
  4658. },
  4659. dequeue: function( type ) {
  4660. return this.each( function() {
  4661. jQuery.dequeue( this, type );
  4662. } );
  4663. },
  4664. clearQueue: function( type ) {
  4665. return this.queue( type || "fx", [] );
  4666. },
  4667. // Get a promise resolved when queues of a certain type
  4668. // are emptied (fx is the type by default)
  4669. promise: function( type, obj ) {
  4670. var tmp,
  4671. count = 1,
  4672. defer = jQuery.Deferred(),
  4673. elements = this,
  4674. i = this.length,
  4675. resolve = function() {
  4676. if ( !( --count ) ) {
  4677. defer.resolveWith( elements, [ elements ] );
  4678. }
  4679. };
  4680. if ( typeof type !== "string" ) {
  4681. obj = type;
  4682. type = undefined;
  4683. }
  4684. type = type || "fx";
  4685. while ( i-- ) {
  4686. tmp = jQuery._data( elements[ i ], type + "queueHooks" );
  4687. if ( tmp && tmp.empty ) {
  4688. count++;
  4689. tmp.empty.add( resolve );
  4690. }
  4691. }
  4692. resolve();
  4693. return defer.promise( obj );
  4694. }
  4695. } );
  4696. ( function() {
  4697. var shrinkWrapBlocksVal;
  4698. support.shrinkWrapBlocks = function() {
  4699. if ( shrinkWrapBlocksVal != null ) {
  4700. return shrinkWrapBlocksVal;
  4701. }
  4702. // Will be changed later if needed.
  4703. shrinkWrapBlocksVal = false;
  4704. // Minified: var b,c,d
  4705. var div, body, container;
  4706. body = document.getElementsByTagName( "body" )[ 0 ];
  4707. if ( !body || !body.style ) {
  4708. // Test fired too early or in an unsupported environment, exit.
  4709. return;
  4710. }
  4711. // Setup
  4712. div = document.createElement( "div" );
  4713. container = document.createElement( "div" );
  4714. container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
  4715. body.appendChild( container ).appendChild( div );
  4716. // Support: IE6
  4717. // Check if elements with layout shrink-wrap their children
  4718. if ( typeof div.style.zoom !== "undefined" ) {
  4719. // Reset CSS: box-sizing; display; margin; border
  4720. div.style.cssText =
  4721. // Support: Firefox<29, Android 2.3
  4722. // Vendor-prefix box-sizing
  4723. "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
  4724. "box-sizing:content-box;display:block;margin:0;border:0;" +
  4725. "padding:1px;width:1px;zoom:1";
  4726. div.appendChild( document.createElement( "div" ) ).style.width = "5px";
  4727. shrinkWrapBlocksVal = div.offsetWidth !== 3;
  4728. }
  4729. body.removeChild( container );
  4730. return shrinkWrapBlocksVal;
  4731. };
  4732. } )();
  4733. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  4734. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  4735. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  4736. var isHidden = function( elem, el ) {
  4737. // isHidden might be called from jQuery#filter function;
  4738. // in that case, element will be second argument
  4739. elem = el || elem;
  4740. return jQuery.css( elem, "display" ) === "none" ||
  4741. !jQuery.contains( elem.ownerDocument, elem );
  4742. };
  4743. function adjustCSS( elem, prop, valueParts, tween ) {
  4744. var adjusted,
  4745. scale = 1,
  4746. maxIterations = 20,
  4747. currentValue = tween ?
  4748. function() { return tween.cur(); } :
  4749. function() { return jQuery.css( elem, prop, "" ); },
  4750. initial = currentValue(),
  4751. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  4752. // Starting value computation is required for potential unit mismatches
  4753. initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  4754. rcssNum.exec( jQuery.css( elem, prop ) );
  4755. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  4756. // Trust units reported by jQuery.css
  4757. unit = unit || initialInUnit[ 3 ];
  4758. // Make sure we update the tween properties later on
  4759. valueParts = valueParts || [];
  4760. // Iteratively approximate from a nonzero starting point
  4761. initialInUnit = +initial || 1;
  4762. do {
  4763. // If previous iteration zeroed out, double until we get *something*.
  4764. // Use string for doubling so we don't accidentally see scale as unchanged below
  4765. scale = scale || ".5";
  4766. // Adjust and apply
  4767. initialInUnit = initialInUnit / scale;
  4768. jQuery.style( elem, prop, initialInUnit + unit );
  4769. // Update scale, tolerating zero or NaN from tween.cur()
  4770. // Break the loop if scale is unchanged or perfect, or if we've just had enough.
  4771. } while (
  4772. scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
  4773. );
  4774. }
  4775. if ( valueParts ) {
  4776. initialInUnit = +initialInUnit || +initial || 0;
  4777. // Apply relative offset (+=/-=) if specified
  4778. adjusted = valueParts[ 1 ] ?
  4779. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  4780. +valueParts[ 2 ];
  4781. if ( tween ) {
  4782. tween.unit = unit;
  4783. tween.start = initialInUnit;
  4784. tween.end = adjusted;
  4785. }
  4786. }
  4787. return adjusted;
  4788. }
  4789. // Multifunctional method to get and set values of a collection
  4790. // The value/s can optionally be executed if it's a function
  4791. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  4792. var i = 0,
  4793. length = elems.length,
  4794. bulk = key == null;
  4795. // Sets many values
  4796. if ( jQuery.type( key ) === "object" ) {
  4797. chainable = true;
  4798. for ( i in key ) {
  4799. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  4800. }
  4801. // Sets one value
  4802. } else if ( value !== undefined ) {
  4803. chainable = true;
  4804. if ( !jQuery.isFunction( value ) ) {
  4805. raw = true;
  4806. }
  4807. if ( bulk ) {
  4808. // Bulk operations run against the entire set
  4809. if ( raw ) {
  4810. fn.call( elems, value );
  4811. fn = null;
  4812. // ...except when executing function values
  4813. } else {
  4814. bulk = fn;
  4815. fn = function( elem, key, value ) {
  4816. return bulk.call( jQuery( elem ), value );
  4817. };
  4818. }
  4819. }
  4820. if ( fn ) {
  4821. for ( ; i < length; i++ ) {
  4822. fn(
  4823. elems[ i ],
  4824. key,
  4825. raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) )
  4826. );
  4827. }
  4828. }
  4829. }
  4830. return chainable ?
  4831. elems :
  4832. // Gets
  4833. bulk ?
  4834. fn.call( elems ) :
  4835. length ? fn( elems[ 0 ], key ) : emptyGet;
  4836. };
  4837. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  4838. var rtagName = ( /<([\w:-]+)/ );
  4839. var rscriptType = ( /^$|\/(?:java|ecma)script/i );
  4840. var rleadingWhitespace = ( /^\s+/ );
  4841. var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" +
  4842. "details|dialog|figcaption|figure|footer|header|hgroup|main|" +
  4843. "mark|meter|nav|output|picture|progress|section|summary|template|time|video";
  4844. function createSafeFragment( document ) {
  4845. var list = nodeNames.split( "|" ),
  4846. safeFrag = document.createDocumentFragment();
  4847. if ( safeFrag.createElement ) {
  4848. while ( list.length ) {
  4849. safeFrag.createElement(
  4850. list.pop()
  4851. );
  4852. }
  4853. }
  4854. return safeFrag;
  4855. }
  4856. ( function() {
  4857. var div = document.createElement( "div" ),
  4858. fragment = document.createDocumentFragment(),
  4859. input = document.createElement( "input" );
  4860. // Setup
  4861. div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
  4862. // IE strips leading whitespace when .innerHTML is used
  4863. support.leadingWhitespace = div.firstChild.nodeType === 3;
  4864. // Make sure that tbody elements aren't automatically inserted
  4865. // IE will insert them into empty tables
  4866. support.tbody = !div.getElementsByTagName( "tbody" ).length;
  4867. // Make sure that link elements get serialized correctly by innerHTML
  4868. // This requires a wrapper element in IE
  4869. support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
  4870. // Makes sure cloning an html5 element does not cause problems
  4871. // Where outerHTML is undefined, this still works
  4872. support.html5Clone =
  4873. document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
  4874. // Check if a disconnected checkbox will retain its checked
  4875. // value of true after appended to the DOM (IE6/7)
  4876. input.type = "checkbox";
  4877. input.checked = true;
  4878. fragment.appendChild( input );
  4879. support.appendChecked = input.checked;
  4880. // Make sure textarea (and checkbox) defaultValue is properly cloned
  4881. // Support: IE6-IE11+
  4882. div.innerHTML = "<textarea>x</textarea>";
  4883. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  4884. // #11217 - WebKit loses check when the name is after the checked attribute
  4885. fragment.appendChild( div );
  4886. // Support: Windows Web Apps (WWA)
  4887. // `name` and `type` must use .setAttribute for WWA (#14901)
  4888. input = document.createElement( "input" );
  4889. input.setAttribute( "type", "radio" );
  4890. input.setAttribute( "checked", "checked" );
  4891. input.setAttribute( "name", "t" );
  4892. div.appendChild( input );
  4893. // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
  4894. // old WebKit doesn't clone checked state correctly in fragments
  4895. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  4896. // Support: IE<9
  4897. // Cloned elements keep attachEvent handlers, we use addEventListener on IE9+
  4898. support.noCloneEvent = !!div.addEventListener;
  4899. // Support: IE<9
  4900. // Since attributes and properties are the same in IE,
  4901. // cleanData must set properties to undefined rather than use removeAttribute
  4902. div[ jQuery.expando ] = 1;
  4903. support.attributes = !div.getAttribute( jQuery.expando );
  4904. } )();
  4905. // We have to close these tags to support XHTML (#13200)
  4906. var wrapMap = {
  4907. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  4908. legend: [ 1, "<fieldset>", "</fieldset>" ],
  4909. area: [ 1, "<map>", "</map>" ],
  4910. // Support: IE8
  4911. param: [ 1, "<object>", "</object>" ],
  4912. thead: [ 1, "<table>", "</table>" ],
  4913. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  4914. col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
  4915. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  4916. // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
  4917. // unless wrapped in a div with non-breaking characters in front of it.
  4918. _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
  4919. };
  4920. // Support: IE8-IE9
  4921. wrapMap.optgroup = wrapMap.option;
  4922. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  4923. wrapMap.th = wrapMap.td;
  4924. function getAll( context, tag ) {
  4925. var elems, elem,
  4926. i = 0,
  4927. found = typeof context.getElementsByTagName !== "undefined" ?
  4928. context.getElementsByTagName( tag || "*" ) :
  4929. typeof context.querySelectorAll !== "undefined" ?
  4930. context.querySelectorAll( tag || "*" ) :
  4931. undefined;
  4932. if ( !found ) {
  4933. for ( found = [], elems = context.childNodes || context;
  4934. ( elem = elems[ i ] ) != null;
  4935. i++
  4936. ) {
  4937. if ( !tag || jQuery.nodeName( elem, tag ) ) {
  4938. found.push( elem );
  4939. } else {
  4940. jQuery.merge( found, getAll( elem, tag ) );
  4941. }
  4942. }
  4943. }
  4944. return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
  4945. jQuery.merge( [ context ], found ) :
  4946. found;
  4947. }
  4948. // Mark scripts as having already been evaluated
  4949. function setGlobalEval( elems, refElements ) {
  4950. var elem,
  4951. i = 0;
  4952. for ( ; ( elem = elems[ i ] ) != null; i++ ) {
  4953. jQuery._data(
  4954. elem,
  4955. "globalEval",
  4956. !refElements || jQuery._data( refElements[ i ], "globalEval" )
  4957. );
  4958. }
  4959. }
  4960. var rhtml = /<|&#?\w+;/,
  4961. rtbody = /<tbody/i;
  4962. function fixDefaultChecked( elem ) {
  4963. if ( rcheckableType.test( elem.type ) ) {
  4964. elem.defaultChecked = elem.checked;
  4965. }
  4966. }
  4967. function buildFragment( elems, context, scripts, selection, ignored ) {
  4968. var j, elem, contains,
  4969. tmp, tag, tbody, wrap,
  4970. l = elems.length,
  4971. // Ensure a safe fragment
  4972. safe = createSafeFragment( context ),
  4973. nodes = [],
  4974. i = 0;
  4975. for ( ; i < l; i++ ) {
  4976. elem = elems[ i ];
  4977. if ( elem || elem === 0 ) {
  4978. // Add nodes directly
  4979. if ( jQuery.type( elem ) === "object" ) {
  4980. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  4981. // Convert non-html into a text node
  4982. } else if ( !rhtml.test( elem ) ) {
  4983. nodes.push( context.createTextNode( elem ) );
  4984. // Convert html into DOM nodes
  4985. } else {
  4986. tmp = tmp || safe.appendChild( context.createElement( "div" ) );
  4987. // Deserialize a standard representation
  4988. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  4989. wrap = wrapMap[ tag ] || wrapMap._default;
  4990. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  4991. // Descend through wrappers to the right content
  4992. j = wrap[ 0 ];
  4993. while ( j-- ) {
  4994. tmp = tmp.lastChild;
  4995. }
  4996. // Manually add leading whitespace removed by IE
  4997. if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
  4998. nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[ 0 ] ) );
  4999. }
  5000. // Remove IE's autoinserted <tbody> from table fragments
  5001. if ( !support.tbody ) {
  5002. // String was a <table>, *may* have spurious <tbody>
  5003. elem = tag === "table" && !rtbody.test( elem ) ?
  5004. tmp.firstChild :
  5005. // String was a bare <thead> or <tfoot>
  5006. wrap[ 1 ] === "<table>" && !rtbody.test( elem ) ?
  5007. tmp :
  5008. 0;
  5009. j = elem && elem.childNodes.length;
  5010. while ( j-- ) {
  5011. if ( jQuery.nodeName( ( tbody = elem.childNodes[ j ] ), "tbody" ) &&
  5012. !tbody.childNodes.length ) {
  5013. elem.removeChild( tbody );
  5014. }
  5015. }
  5016. }
  5017. jQuery.merge( nodes, tmp.childNodes );
  5018. // Fix #12392 for WebKit and IE > 9
  5019. tmp.textContent = "";
  5020. // Fix #12392 for oldIE
  5021. while ( tmp.firstChild ) {
  5022. tmp.removeChild( tmp.firstChild );
  5023. }
  5024. // Remember the top-level container for proper cleanup
  5025. tmp = safe.lastChild;
  5026. }
  5027. }
  5028. }
  5029. // Fix #11356: Clear elements from fragment
  5030. if ( tmp ) {
  5031. safe.removeChild( tmp );
  5032. }
  5033. // Reset defaultChecked for any radios and checkboxes
  5034. // about to be appended to the DOM in IE 6/7 (#8060)
  5035. if ( !support.appendChecked ) {
  5036. jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
  5037. }
  5038. i = 0;
  5039. while ( ( elem = nodes[ i++ ] ) ) {
  5040. // Skip elements already in the context collection (trac-4087)
  5041. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  5042. if ( ignored ) {
  5043. ignored.push( elem );
  5044. }
  5045. continue;
  5046. }
  5047. contains = jQuery.contains( elem.ownerDocument, elem );
  5048. // Append to fragment
  5049. tmp = getAll( safe.appendChild( elem ), "script" );
  5050. // Preserve script evaluation history
  5051. if ( contains ) {
  5052. setGlobalEval( tmp );
  5053. }
  5054. // Capture executables
  5055. if ( scripts ) {
  5056. j = 0;
  5057. while ( ( elem = tmp[ j++ ] ) ) {
  5058. if ( rscriptType.test( elem.type || "" ) ) {
  5059. scripts.push( elem );
  5060. }
  5061. }
  5062. }
  5063. }
  5064. tmp = null;
  5065. return safe;
  5066. }
  5067. ( function() {
  5068. var i, eventName,
  5069. div = document.createElement( "div" );
  5070. // Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events)
  5071. for ( i in { submit: true, change: true, focusin: true } ) {
  5072. eventName = "on" + i;
  5073. if ( !( support[ i ] = eventName in window ) ) {
  5074. // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
  5075. div.setAttribute( eventName, "t" );
  5076. support[ i ] = div.attributes[ eventName ].expando === false;
  5077. }
  5078. }
  5079. // Null elements to avoid leaks in IE.
  5080. div = null;
  5081. } )();
  5082. var rformElems = /^(?:input|select|textarea)$/i,
  5083. rkeyEvent = /^key/,
  5084. rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  5085. rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  5086. rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  5087. function returnTrue() {
  5088. return true;
  5089. }
  5090. function returnFalse() {
  5091. return false;
  5092. }
  5093. // Support: IE9
  5094. // See #13393 for more info
  5095. function safeActiveElement() {
  5096. try {
  5097. return document.activeElement;
  5098. } catch ( err ) { }
  5099. }
  5100. function on( elem, types, selector, data, fn, one ) {
  5101. var origFn, type;
  5102. // Types can be a map of types/handlers
  5103. if ( typeof types === "object" ) {
  5104. // ( types-Object, selector, data )
  5105. if ( typeof selector !== "string" ) {
  5106. // ( types-Object, data )
  5107. data = data || selector;
  5108. selector = undefined;
  5109. }
  5110. for ( type in types ) {
  5111. on( elem, type, selector, data, types[ type ], one );
  5112. }
  5113. return elem;
  5114. }
  5115. if ( data == null && fn == null ) {
  5116. // ( types, fn )
  5117. fn = selector;
  5118. data = selector = undefined;
  5119. } else if ( fn == null ) {
  5120. if ( typeof selector === "string" ) {
  5121. // ( types, selector, fn )
  5122. fn = data;
  5123. data = undefined;
  5124. } else {
  5125. // ( types, data, fn )
  5126. fn = data;
  5127. data = selector;
  5128. selector = undefined;
  5129. }
  5130. }
  5131. if ( fn === false ) {
  5132. fn = returnFalse;
  5133. } else if ( !fn ) {
  5134. return elem;
  5135. }
  5136. if ( one === 1 ) {
  5137. origFn = fn;
  5138. fn = function( event ) {
  5139. // Can use an empty set, since event contains the info
  5140. jQuery().off( event );
  5141. return origFn.apply( this, arguments );
  5142. };
  5143. // Use same guid so caller can remove using origFn
  5144. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  5145. }
  5146. return elem.each( function() {
  5147. jQuery.event.add( this, types, fn, data, selector );
  5148. } );
  5149. }
  5150. /*
  5151. * Helper functions for managing events -- not part of the public interface.
  5152. * Props to Dean Edwards' addEvent library for many of the ideas.
  5153. */
  5154. jQuery.event = {
  5155. global: {},
  5156. add: function( elem, types, handler, data, selector ) {
  5157. var tmp, events, t, handleObjIn,
  5158. special, eventHandle, handleObj,
  5159. handlers, type, namespaces, origType,
  5160. elemData = jQuery._data( elem );
  5161. // Don't attach events to noData or text/comment nodes (but allow plain objects)
  5162. if ( !elemData ) {
  5163. return;
  5164. }
  5165. // Caller can pass in an object of custom data in lieu of the handler
  5166. if ( handler.handler ) {
  5167. handleObjIn = handler;
  5168. handler = handleObjIn.handler;
  5169. selector = handleObjIn.selector;
  5170. }
  5171. // Make sure that the handler has a unique ID, used to find/remove it later
  5172. if ( !handler.guid ) {
  5173. handler.guid = jQuery.guid++;
  5174. }
  5175. // Init the element's event structure and main handler, if this is the first
  5176. if ( !( events = elemData.events ) ) {
  5177. events = elemData.events = {};
  5178. }
  5179. if ( !( eventHandle = elemData.handle ) ) {
  5180. eventHandle = elemData.handle = function( e ) {
  5181. // Discard the second event of a jQuery.event.trigger() and
  5182. // when an event is called after a page has unloaded
  5183. return typeof jQuery !== "undefined" &&
  5184. ( !e || jQuery.event.triggered !== e.type ) ?
  5185. jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
  5186. undefined;
  5187. };
  5188. // Add elem as a property of the handle fn to prevent a memory leak
  5189. // with IE non-native events
  5190. eventHandle.elem = elem;
  5191. }
  5192. // Handle multiple events separated by a space
  5193. types = ( types || "" ).match( rnotwhite ) || [ "" ];
  5194. t = types.length;
  5195. while ( t-- ) {
  5196. tmp = rtypenamespace.exec( types[ t ] ) || [];
  5197. type = origType = tmp[ 1 ];
  5198. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  5199. // There *must* be a type, no attaching namespace-only handlers
  5200. if ( !type ) {
  5201. continue;
  5202. }
  5203. // If event changes its type, use the special event handlers for the changed type
  5204. special = jQuery.event.special[ type ] || {};
  5205. // If selector defined, determine special event api type, otherwise given type
  5206. type = ( selector ? special.delegateType : special.bindType ) || type;
  5207. // Update special based on newly reset type
  5208. special = jQuery.event.special[ type ] || {};
  5209. // handleObj is passed to all event handlers
  5210. handleObj = jQuery.extend( {
  5211. type: type,
  5212. origType: origType,
  5213. data: data,
  5214. handler: handler,
  5215. guid: handler.guid,
  5216. selector: selector,
  5217. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  5218. namespace: namespaces.join( "." )
  5219. }, handleObjIn );
  5220. // Init the event handler queue if we're the first
  5221. if ( !( handlers = events[ type ] ) ) {
  5222. handlers = events[ type ] = [];
  5223. handlers.delegateCount = 0;
  5224. // Only use addEventListener/attachEvent if the special events handler returns false
  5225. if ( !special.setup ||
  5226. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  5227. // Bind the global event handler to the element
  5228. if ( elem.addEventListener ) {
  5229. elem.addEventListener( type, eventHandle, false );
  5230. } else if ( elem.attachEvent ) {
  5231. elem.attachEvent( "on" + type, eventHandle );
  5232. }
  5233. }
  5234. }
  5235. if ( special.add ) {
  5236. special.add.call( elem, handleObj );
  5237. if ( !handleObj.handler.guid ) {
  5238. handleObj.handler.guid = handler.guid;
  5239. }
  5240. }
  5241. // Add to the element's handler list, delegates in front
  5242. if ( selector ) {
  5243. handlers.splice( handlers.delegateCount++, 0, handleObj );
  5244. } else {
  5245. handlers.push( handleObj );
  5246. }
  5247. // Keep track of which events have ever been used, for event optimization
  5248. jQuery.event.global[ type ] = true;
  5249. }
  5250. // Nullify elem to prevent memory leaks in IE
  5251. elem = null;
  5252. },
  5253. // Detach an event or set of events from an element
  5254. remove: function( elem, types, handler, selector, mappedTypes ) {
  5255. var j, handleObj, tmp,
  5256. origCount, t, events,
  5257. special, handlers, type,
  5258. namespaces, origType,
  5259. elemData = jQuery.hasData( elem ) && jQuery._data( elem );
  5260. if ( !elemData || !( events = elemData.events ) ) {
  5261. return;
  5262. }
  5263. // Once for each type.namespace in types; type may be omitted
  5264. types = ( types || "" ).match( rnotwhite ) || [ "" ];
  5265. t = types.length;
  5266. while ( t-- ) {
  5267. tmp = rtypenamespace.exec( types[ t ] ) || [];
  5268. type = origType = tmp[ 1 ];
  5269. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  5270. // Unbind all events (on this namespace, if provided) for the element
  5271. if ( !type ) {
  5272. for ( type in events ) {
  5273. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  5274. }
  5275. continue;
  5276. }
  5277. special = jQuery.event.special[ type ] || {};
  5278. type = ( selector ? special.delegateType : special.bindType ) || type;
  5279. handlers = events[ type ] || [];
  5280. tmp = tmp[ 2 ] &&
  5281. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  5282. // Remove matching events
  5283. origCount = j = handlers.length;
  5284. while ( j-- ) {
  5285. handleObj = handlers[ j ];
  5286. if ( ( mappedTypes || origType === handleObj.origType ) &&
  5287. ( !handler || handler.guid === handleObj.guid ) &&
  5288. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  5289. ( !selector || selector === handleObj.selector ||
  5290. selector === "**" && handleObj.selector ) ) {
  5291. handlers.splice( j, 1 );
  5292. if ( handleObj.selector ) {
  5293. handlers.delegateCount--;
  5294. }
  5295. if ( special.remove ) {
  5296. special.remove.call( elem, handleObj );
  5297. }
  5298. }
  5299. }
  5300. // Remove generic event handler if we removed something and no more handlers exist
  5301. // (avoids potential for endless recursion during removal of special event handlers)
  5302. if ( origCount && !handlers.length ) {
  5303. if ( !special.teardown ||
  5304. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  5305. jQuery.removeEvent( elem, type, elemData.handle );
  5306. }
  5307. delete events[ type ];
  5308. }
  5309. }
  5310. // Remove the expando if it's no longer used
  5311. if ( jQuery.isEmptyObject( events ) ) {
  5312. delete elemData.handle;
  5313. // removeData also checks for emptiness and clears the expando if empty
  5314. // so use it instead of delete
  5315. jQuery._removeData( elem, "events" );
  5316. }
  5317. },
  5318. trigger: function( event, data, elem, onlyHandlers ) {
  5319. var handle, ontype, cur,
  5320. bubbleType, special, tmp, i,
  5321. eventPath = [ elem || document ],
  5322. type = hasOwn.call( event, "type" ) ? event.type : event,
  5323. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  5324. cur = tmp = elem = elem || document;
  5325. // Don't do events on text and comment nodes
  5326. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  5327. return;
  5328. }
  5329. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  5330. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  5331. return;
  5332. }
  5333. if ( type.indexOf( "." ) > -1 ) {
  5334. // Namespaced trigger; create a regexp to match event type in handle()
  5335. namespaces = type.split( "." );
  5336. type = namespaces.shift();
  5337. namespaces.sort();
  5338. }
  5339. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  5340. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  5341. event = event[ jQuery.expando ] ?
  5342. event :
  5343. new jQuery.Event( type, typeof event === "object" && event );
  5344. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  5345. event.isTrigger = onlyHandlers ? 2 : 3;
  5346. event.namespace = namespaces.join( "." );
  5347. event.rnamespace = event.namespace ?
  5348. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  5349. null;
  5350. // Clean up the event in case it is being reused
  5351. event.result = undefined;
  5352. if ( !event.target ) {
  5353. event.target = elem;
  5354. }
  5355. // Clone any incoming data and prepend the event, creating the handler arg list
  5356. data = data == null ?
  5357. [ event ] :
  5358. jQuery.makeArray( data, [ event ] );
  5359. // Allow special events to draw outside the lines
  5360. special = jQuery.event.special[ type ] || {};
  5361. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  5362. return;
  5363. }
  5364. // Determine event propagation path in advance, per W3C events spec (#9951)
  5365. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  5366. if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
  5367. bubbleType = special.delegateType || type;
  5368. if ( !rfocusMorph.test( bubbleType + type ) ) {
  5369. cur = cur.parentNode;
  5370. }
  5371. for ( ; cur; cur = cur.parentNode ) {
  5372. eventPath.push( cur );
  5373. tmp = cur;
  5374. }
  5375. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  5376. if ( tmp === ( elem.ownerDocument || document ) ) {
  5377. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  5378. }
  5379. }
  5380. // Fire handlers on the event path
  5381. i = 0;
  5382. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  5383. event.type = i > 1 ?
  5384. bubbleType :
  5385. special.bindType || type;
  5386. // jQuery handler
  5387. handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] &&
  5388. jQuery._data( cur, "handle" );
  5389. if ( handle ) {
  5390. handle.apply( cur, data );
  5391. }
  5392. // Native handler
  5393. handle = ontype && cur[ ontype ];
  5394. if ( handle && handle.apply && acceptData( cur ) ) {
  5395. event.result = handle.apply( cur, data );
  5396. if ( event.result === false ) {
  5397. event.preventDefault();
  5398. }
  5399. }
  5400. }
  5401. event.type = type;
  5402. // If nobody prevented the default action, do it now
  5403. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  5404. if (
  5405. ( !special._default ||
  5406. special._default.apply( eventPath.pop(), data ) === false
  5407. ) && acceptData( elem )
  5408. ) {
  5409. // Call a native DOM method on the target with the same name name as the event.
  5410. // Can't use an .isFunction() check here because IE6/7 fails that test.
  5411. // Don't do default actions on window, that's where global variables be (#6170)
  5412. if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
  5413. // Don't re-trigger an onFOO event when we call its FOO() method
  5414. tmp = elem[ ontype ];
  5415. if ( tmp ) {
  5416. elem[ ontype ] = null;
  5417. }
  5418. // Prevent re-triggering of the same event, since we already bubbled it above
  5419. jQuery.event.triggered = type;
  5420. try {
  5421. elem[ type ]();
  5422. } catch ( e ) {
  5423. // IE<9 dies on focus/blur to hidden element (#1486,#12518)
  5424. // only reproducible on winXP IE8 native, not IE9 in IE8 mode
  5425. }
  5426. jQuery.event.triggered = undefined;
  5427. if ( tmp ) {
  5428. elem[ ontype ] = tmp;
  5429. }
  5430. }
  5431. }
  5432. }
  5433. return event.result;
  5434. },
  5435. dispatch: function( event ) {
  5436. // Make a writable jQuery.Event from the native event object
  5437. event = jQuery.event.fix( event );
  5438. var i, j, ret, matched, handleObj,
  5439. handlerQueue = [],
  5440. args = slice.call( arguments ),
  5441. handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
  5442. special = jQuery.event.special[ event.type ] || {};
  5443. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  5444. args[ 0 ] = event;
  5445. event.delegateTarget = this;
  5446. // Call the preDispatch hook for the mapped type, and let it bail if desired
  5447. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  5448. return;
  5449. }
  5450. // Determine handlers
  5451. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  5452. // Run delegates first; they may want to stop propagation beneath us
  5453. i = 0;
  5454. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  5455. event.currentTarget = matched.elem;
  5456. j = 0;
  5457. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  5458. !event.isImmediatePropagationStopped() ) {
  5459. // Triggered event must either 1) have no namespace, or 2) have namespace(s)
  5460. // a subset or equal to those in the bound event (both can have no namespace).
  5461. if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
  5462. event.handleObj = handleObj;
  5463. event.data = handleObj.data;
  5464. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  5465. handleObj.handler ).apply( matched.elem, args );
  5466. if ( ret !== undefined ) {
  5467. if ( ( event.result = ret ) === false ) {
  5468. event.preventDefault();
  5469. event.stopPropagation();
  5470. }
  5471. }
  5472. }
  5473. }
  5474. }
  5475. // Call the postDispatch hook for the mapped type
  5476. if ( special.postDispatch ) {
  5477. special.postDispatch.call( this, event );
  5478. }
  5479. return event.result;
  5480. },
  5481. handlers: function( event, handlers ) {
  5482. var i, matches, sel, handleObj,
  5483. handlerQueue = [],
  5484. delegateCount = handlers.delegateCount,
  5485. cur = event.target;
  5486. // Support (at least): Chrome, IE9
  5487. // Find delegate handlers
  5488. // Black-hole SVG <use> instance trees (#13180)
  5489. //
  5490. // Support: Firefox<=42+
  5491. // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343)
  5492. if ( delegateCount && cur.nodeType &&
  5493. ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) {
  5494. /* jshint eqeqeq: false */
  5495. for ( ; cur != this; cur = cur.parentNode || this ) {
  5496. /* jshint eqeqeq: true */
  5497. // Don't check non-elements (#13208)
  5498. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  5499. if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) {
  5500. matches = [];
  5501. for ( i = 0; i < delegateCount; i++ ) {
  5502. handleObj = handlers[ i ];
  5503. // Don't conflict with Object.prototype properties (#13203)
  5504. sel = handleObj.selector + " ";
  5505. if ( matches[ sel ] === undefined ) {
  5506. matches[ sel ] = handleObj.needsContext ?
  5507. jQuery( sel, this ).index( cur ) > -1 :
  5508. jQuery.find( sel, this, null, [ cur ] ).length;
  5509. }
  5510. if ( matches[ sel ] ) {
  5511. matches.push( handleObj );
  5512. }
  5513. }
  5514. if ( matches.length ) {
  5515. handlerQueue.push( { elem: cur, handlers: matches } );
  5516. }
  5517. }
  5518. }
  5519. }
  5520. // Add the remaining (directly-bound) handlers
  5521. if ( delegateCount < handlers.length ) {
  5522. handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } );
  5523. }
  5524. return handlerQueue;
  5525. },
  5526. fix: function( event ) {
  5527. if ( event[ jQuery.expando ] ) {
  5528. return event;
  5529. }
  5530. // Create a writable copy of the event object and normalize some properties
  5531. var i, prop, copy,
  5532. type = event.type,
  5533. originalEvent = event,
  5534. fixHook = this.fixHooks[ type ];
  5535. if ( !fixHook ) {
  5536. this.fixHooks[ type ] = fixHook =
  5537. rmouseEvent.test( type ) ? this.mouseHooks :
  5538. rkeyEvent.test( type ) ? this.keyHooks :
  5539. {};
  5540. }
  5541. copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
  5542. event = new jQuery.Event( originalEvent );
  5543. i = copy.length;
  5544. while ( i-- ) {
  5545. prop = copy[ i ];
  5546. event[ prop ] = originalEvent[ prop ];
  5547. }
  5548. // Support: IE<9
  5549. // Fix target property (#1925)
  5550. if ( !event.target ) {
  5551. event.target = originalEvent.srcElement || document;
  5552. }
  5553. // Support: Safari 6-8+
  5554. // Target should not be a text node (#504, #13143)
  5555. if ( event.target.nodeType === 3 ) {
  5556. event.target = event.target.parentNode;
  5557. }
  5558. // Support: IE<9
  5559. // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
  5560. event.metaKey = !!event.metaKey;
  5561. return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
  5562. },
  5563. // Includes some event props shared by KeyEvent and MouseEvent
  5564. props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " +
  5565. "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ),
  5566. fixHooks: {},
  5567. keyHooks: {
  5568. props: "char charCode key keyCode".split( " " ),
  5569. filter: function( event, original ) {
  5570. // Add which for key events
  5571. if ( event.which == null ) {
  5572. event.which = original.charCode != null ? original.charCode : original.keyCode;
  5573. }
  5574. return event;
  5575. }
  5576. },
  5577. mouseHooks: {
  5578. props: ( "button buttons clientX clientY fromElement offsetX offsetY " +
  5579. "pageX pageY screenX screenY toElement" ).split( " " ),
  5580. filter: function( event, original ) {
  5581. var body, eventDoc, doc,
  5582. button = original.button,
  5583. fromElement = original.fromElement;
  5584. // Calculate pageX/Y if missing and clientX/Y available
  5585. if ( event.pageX == null && original.clientX != null ) {
  5586. eventDoc = event.target.ownerDocument || document;
  5587. doc = eventDoc.documentElement;
  5588. body = eventDoc.body;
  5589. event.pageX = original.clientX +
  5590. ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) -
  5591. ( doc && doc.clientLeft || body && body.clientLeft || 0 );
  5592. event.pageY = original.clientY +
  5593. ( doc && doc.scrollTop || body && body.scrollTop || 0 ) -
  5594. ( doc && doc.clientTop || body && body.clientTop || 0 );
  5595. }
  5596. // Add relatedTarget, if necessary
  5597. if ( !event.relatedTarget && fromElement ) {
  5598. event.relatedTarget = fromElement === event.target ?
  5599. original.toElement :
  5600. fromElement;
  5601. }
  5602. // Add which for click: 1 === left; 2 === middle; 3 === right
  5603. // Note: button is not normalized, so don't use it
  5604. if ( !event.which && button !== undefined ) {
  5605. event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
  5606. }
  5607. return event;
  5608. }
  5609. },
  5610. special: {
  5611. load: {
  5612. // Prevent triggered image.load events from bubbling to window.load
  5613. noBubble: true
  5614. },
  5615. focus: {
  5616. // Fire native event if possible so blur/focus sequence is correct
  5617. trigger: function() {
  5618. if ( this !== safeActiveElement() && this.focus ) {
  5619. try {
  5620. this.focus();
  5621. return false;
  5622. } catch ( e ) {
  5623. // Support: IE<9
  5624. // If we error on focus to hidden element (#1486, #12518),
  5625. // let .trigger() run the handlers
  5626. }
  5627. }
  5628. },
  5629. delegateType: "focusin"
  5630. },
  5631. blur: {
  5632. trigger: function() {
  5633. if ( this === safeActiveElement() && this.blur ) {
  5634. this.blur();
  5635. return false;
  5636. }
  5637. },
  5638. delegateType: "focusout"
  5639. },
  5640. click: {
  5641. // For checkbox, fire native event so checked state will be right
  5642. trigger: function() {
  5643. if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
  5644. this.click();
  5645. return false;
  5646. }
  5647. },
  5648. // For cross-browser consistency, don't fire native .click() on links
  5649. _default: function( event ) {
  5650. return jQuery.nodeName( event.target, "a" );
  5651. }
  5652. },
  5653. beforeunload: {
  5654. postDispatch: function( event ) {
  5655. // Support: Firefox 20+
  5656. // Firefox doesn't alert if the returnValue field is not set.
  5657. if ( event.result !== undefined && event.originalEvent ) {
  5658. event.originalEvent.returnValue = event.result;
  5659. }
  5660. }
  5661. }
  5662. },
  5663. // Piggyback on a donor event to simulate a different one
  5664. simulate: function( type, elem, event ) {
  5665. var e = jQuery.extend(
  5666. new jQuery.Event(),
  5667. event,
  5668. {
  5669. type: type,
  5670. isSimulated: true
  5671. // Previously, `originalEvent: {}` was set here, so stopPropagation call
  5672. // would not be triggered on donor event, since in our own
  5673. // jQuery.event.stopPropagation function we had a check for existence of
  5674. // originalEvent.stopPropagation method, so, consequently it would be a noop.
  5675. //
  5676. // Guard for simulated events was moved to jQuery.event.stopPropagation function
  5677. // since `originalEvent` should point to the original event for the
  5678. // constancy with other events and for more focused logic
  5679. }
  5680. );
  5681. jQuery.event.trigger( e, null, elem );
  5682. if ( e.isDefaultPrevented() ) {
  5683. event.preventDefault();
  5684. }
  5685. }
  5686. };
  5687. jQuery.removeEvent = document.removeEventListener ?
  5688. function( elem, type, handle ) {
  5689. // This "if" is needed for plain objects
  5690. if ( elem.removeEventListener ) {
  5691. elem.removeEventListener( type, handle );
  5692. }
  5693. } :
  5694. function( elem, type, handle ) {
  5695. var name = "on" + type;
  5696. if ( elem.detachEvent ) {
  5697. // #8545, #7054, preventing memory leaks for custom events in IE6-8
  5698. // detachEvent needed property on element, by name of that event,
  5699. // to properly expose it to GC
  5700. if ( typeof elem[ name ] === "undefined" ) {
  5701. elem[ name ] = null;
  5702. }
  5703. elem.detachEvent( name, handle );
  5704. }
  5705. };
  5706. jQuery.Event = function( src, props ) {
  5707. // Allow instantiation without the 'new' keyword
  5708. if ( !( this instanceof jQuery.Event ) ) {
  5709. return new jQuery.Event( src, props );
  5710. }
  5711. // Event object
  5712. if ( src && src.type ) {
  5713. this.originalEvent = src;
  5714. this.type = src.type;
  5715. // Events bubbling up the document may have been marked as prevented
  5716. // by a handler lower down the tree; reflect the correct value.
  5717. this.isDefaultPrevented = src.defaultPrevented ||
  5718. src.defaultPrevented === undefined &&
  5719. // Support: IE < 9, Android < 4.0
  5720. src.returnValue === false ?
  5721. returnTrue :
  5722. returnFalse;
  5723. // Event type
  5724. } else {
  5725. this.type = src;
  5726. }
  5727. // Put explicitly provided properties onto the event object
  5728. if ( props ) {
  5729. jQuery.extend( this, props );
  5730. }
  5731. // Create a timestamp if incoming event doesn't have one
  5732. this.timeStamp = src && src.timeStamp || jQuery.now();
  5733. // Mark it as fixed
  5734. this[ jQuery.expando ] = true;
  5735. };
  5736. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  5737. // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  5738. jQuery.Event.prototype = {
  5739. constructor: jQuery.Event,
  5740. isDefaultPrevented: returnFalse,
  5741. isPropagationStopped: returnFalse,
  5742. isImmediatePropagationStopped: returnFalse,
  5743. preventDefault: function() {
  5744. var e = this.originalEvent;
  5745. this.isDefaultPrevented = returnTrue;
  5746. if ( !e ) {
  5747. return;
  5748. }
  5749. // If preventDefault exists, run it on the original event
  5750. if ( e.preventDefault ) {
  5751. e.preventDefault();
  5752. // Support: IE
  5753. // Otherwise set the returnValue property of the original event to false
  5754. } else {
  5755. e.returnValue = false;
  5756. }
  5757. },
  5758. stopPropagation: function() {
  5759. var e = this.originalEvent;
  5760. this.isPropagationStopped = returnTrue;
  5761. if ( !e || this.isSimulated ) {
  5762. return;
  5763. }
  5764. // If stopPropagation exists, run it on the original event
  5765. if ( e.stopPropagation ) {
  5766. e.stopPropagation();
  5767. }
  5768. // Support: IE
  5769. // Set the cancelBubble property of the original event to true
  5770. e.cancelBubble = true;
  5771. },
  5772. stopImmediatePropagation: function() {
  5773. var e = this.originalEvent;
  5774. this.isImmediatePropagationStopped = returnTrue;
  5775. if ( e && e.stopImmediatePropagation ) {
  5776. e.stopImmediatePropagation();
  5777. }
  5778. this.stopPropagation();
  5779. }
  5780. };
  5781. // Create mouseenter/leave events using mouseover/out and event-time checks
  5782. // so that event delegation works in jQuery.
  5783. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  5784. //
  5785. // Support: Safari 7 only
  5786. // Safari sends mouseenter too often; see:
  5787. // https://code.google.com/p/chromium/issues/detail?id=470258
  5788. // for the description of the bug (it existed in older Chrome versions as well).
  5789. jQuery.each( {
  5790. mouseenter: "mouseover",
  5791. mouseleave: "mouseout",
  5792. pointerenter: "pointerover",
  5793. pointerleave: "pointerout"
  5794. }, function( orig, fix ) {
  5795. jQuery.event.special[ orig ] = {
  5796. delegateType: fix,
  5797. bindType: fix,
  5798. handle: function( event ) {
  5799. var ret,
  5800. target = this,
  5801. related = event.relatedTarget,
  5802. handleObj = event.handleObj;
  5803. // For mouseenter/leave call the handler if related is outside the target.
  5804. // NB: No relatedTarget if the mouse left/entered the browser window
  5805. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  5806. event.type = handleObj.origType;
  5807. ret = handleObj.handler.apply( this, arguments );
  5808. event.type = fix;
  5809. }
  5810. return ret;
  5811. }
  5812. };
  5813. } );
  5814. // IE submit delegation
  5815. if ( !support.submit ) {
  5816. jQuery.event.special.submit = {
  5817. setup: function() {
  5818. // Only need this for delegated form submit events
  5819. if ( jQuery.nodeName( this, "form" ) ) {
  5820. return false;
  5821. }
  5822. // Lazy-add a submit handler when a descendant form may potentially be submitted
  5823. jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
  5824. // Node name check avoids a VML-related crash in IE (#9807)
  5825. var elem = e.target,
  5826. form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ?
  5827. // Support: IE <=8
  5828. // We use jQuery.prop instead of elem.form
  5829. // to allow fixing the IE8 delegated submit issue (gh-2332)
  5830. // by 3rd party polyfills/workarounds.
  5831. jQuery.prop( elem, "form" ) :
  5832. undefined;
  5833. if ( form && !jQuery._data( form, "submit" ) ) {
  5834. jQuery.event.add( form, "submit._submit", function( event ) {
  5835. event._submitBubble = true;
  5836. } );
  5837. jQuery._data( form, "submit", true );
  5838. }
  5839. } );
  5840. // return undefined since we don't need an event listener
  5841. },
  5842. postDispatch: function( event ) {
  5843. // If form was submitted by the user, bubble the event up the tree
  5844. if ( event._submitBubble ) {
  5845. delete event._submitBubble;
  5846. if ( this.parentNode && !event.isTrigger ) {
  5847. jQuery.event.simulate( "submit", this.parentNode, event );
  5848. }
  5849. }
  5850. },
  5851. teardown: function() {
  5852. // Only need this for delegated form submit events
  5853. if ( jQuery.nodeName( this, "form" ) ) {
  5854. return false;
  5855. }
  5856. // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
  5857. jQuery.event.remove( this, "._submit" );
  5858. }
  5859. };
  5860. }
  5861. // IE change delegation and checkbox/radio fix
  5862. if ( !support.change ) {
  5863. jQuery.event.special.change = {
  5864. setup: function() {
  5865. if ( rformElems.test( this.nodeName ) ) {
  5866. // IE doesn't fire change on a check/radio until blur; trigger it on click
  5867. // after a propertychange. Eat the blur-change in special.change.handle.
  5868. // This still fires onchange a second time for check/radio after blur.
  5869. if ( this.type === "checkbox" || this.type === "radio" ) {
  5870. jQuery.event.add( this, "propertychange._change", function( event ) {
  5871. if ( event.originalEvent.propertyName === "checked" ) {
  5872. this._justChanged = true;
  5873. }
  5874. } );
  5875. jQuery.event.add( this, "click._change", function( event ) {
  5876. if ( this._justChanged && !event.isTrigger ) {
  5877. this._justChanged = false;
  5878. }
  5879. // Allow triggered, simulated change events (#11500)
  5880. jQuery.event.simulate( "change", this, event );
  5881. } );
  5882. }
  5883. return false;
  5884. }
  5885. // Delegated event; lazy-add a change handler on descendant inputs
  5886. jQuery.event.add( this, "beforeactivate._change", function( e ) {
  5887. var elem = e.target;
  5888. if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "change" ) ) {
  5889. jQuery.event.add( elem, "change._change", function( event ) {
  5890. if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
  5891. jQuery.event.simulate( "change", this.parentNode, event );
  5892. }
  5893. } );
  5894. jQuery._data( elem, "change", true );
  5895. }
  5896. } );
  5897. },
  5898. handle: function( event ) {
  5899. var elem = event.target;
  5900. // Swallow native change events from checkbox/radio, we already triggered them above
  5901. if ( this !== elem || event.isSimulated || event.isTrigger ||
  5902. ( elem.type !== "radio" && elem.type !== "checkbox" ) ) {
  5903. return event.handleObj.handler.apply( this, arguments );
  5904. }
  5905. },
  5906. teardown: function() {
  5907. jQuery.event.remove( this, "._change" );
  5908. return !rformElems.test( this.nodeName );
  5909. }
  5910. };
  5911. }
  5912. // Support: Firefox
  5913. // Firefox doesn't have focus(in | out) events
  5914. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  5915. //
  5916. // Support: Chrome, Safari
  5917. // focus(in | out) events fire after focus & blur events,
  5918. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  5919. // Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857
  5920. if ( !support.focusin ) {
  5921. jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  5922. // Attach a single capturing handler on the document while someone wants focusin/focusout
  5923. var handler = function( event ) {
  5924. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
  5925. };
  5926. jQuery.event.special[ fix ] = {
  5927. setup: function() {
  5928. var doc = this.ownerDocument || this,
  5929. attaches = jQuery._data( doc, fix );
  5930. if ( !attaches ) {
  5931. doc.addEventListener( orig, handler, true );
  5932. }
  5933. jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
  5934. },
  5935. teardown: function() {
  5936. var doc = this.ownerDocument || this,
  5937. attaches = jQuery._data( doc, fix ) - 1;
  5938. if ( !attaches ) {
  5939. doc.removeEventListener( orig, handler, true );
  5940. jQuery._removeData( doc, fix );
  5941. } else {
  5942. jQuery._data( doc, fix, attaches );
  5943. }
  5944. }
  5945. };
  5946. } );
  5947. }
  5948. jQuery.fn.extend( {
  5949. on: function( types, selector, data, fn ) {
  5950. return on( this, types, selector, data, fn );
  5951. },
  5952. one: function( types, selector, data, fn ) {
  5953. return on( this, types, selector, data, fn, 1 );
  5954. },
  5955. off: function( types, selector, fn ) {
  5956. var handleObj, type;
  5957. if ( types && types.preventDefault && types.handleObj ) {
  5958. // ( event ) dispatched jQuery.Event
  5959. handleObj = types.handleObj;
  5960. jQuery( types.delegateTarget ).off(
  5961. handleObj.namespace ?
  5962. handleObj.origType + "." + handleObj.namespace :
  5963. handleObj.origType,
  5964. handleObj.selector,
  5965. handleObj.handler
  5966. );
  5967. return this;
  5968. }
  5969. if ( typeof types === "object" ) {
  5970. // ( types-object [, selector] )
  5971. for ( type in types ) {
  5972. this.off( type, selector, types[ type ] );
  5973. }
  5974. return this;
  5975. }
  5976. if ( selector === false || typeof selector === "function" ) {
  5977. // ( types [, fn] )
  5978. fn = selector;
  5979. selector = undefined;
  5980. }
  5981. if ( fn === false ) {
  5982. fn = returnFalse;
  5983. }
  5984. return this.each( function() {
  5985. jQuery.event.remove( this, types, fn, selector );
  5986. } );
  5987. },
  5988. trigger: function( type, data ) {
  5989. return this.each( function() {
  5990. jQuery.event.trigger( type, data, this );
  5991. } );
  5992. },
  5993. triggerHandler: function( type, data ) {
  5994. var elem = this[ 0 ];
  5995. if ( elem ) {
  5996. return jQuery.event.trigger( type, data, elem, true );
  5997. }
  5998. }
  5999. } );
  6000. var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
  6001. rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ),
  6002. rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
  6003. // Support: IE 10-11, Edge 10240+
  6004. // In IE/Edge using regex groups here causes severe slowdowns.
  6005. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  6006. rnoInnerhtml = /<script|<style|<link/i,
  6007. // checked="checked" or checked
  6008. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  6009. rscriptTypeMasked = /^true\/(.*)/,
  6010. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
  6011. safeFragment = createSafeFragment( document ),
  6012. fragmentDiv = safeFragment.appendChild( document.createElement( "div" ) );
  6013. // Support: IE<8
  6014. // Manipulating tables requires a tbody
  6015. function manipulationTarget( elem, content ) {
  6016. return jQuery.nodeName( elem, "table" ) &&
  6017. jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
  6018. elem.getElementsByTagName( "tbody" )[ 0 ] ||
  6019. elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) :
  6020. elem;
  6021. }
  6022. // Replace/restore the type attribute of script elements for safe DOM manipulation
  6023. function disableScript( elem ) {
  6024. elem.type = ( jQuery.find.attr( elem, "type" ) !== null ) + "/" + elem.type;
  6025. return elem;
  6026. }
  6027. function restoreScript( elem ) {
  6028. var match = rscriptTypeMasked.exec( elem.type );
  6029. if ( match ) {
  6030. elem.type = match[ 1 ];
  6031. } else {
  6032. elem.removeAttribute( "type" );
  6033. }
  6034. return elem;
  6035. }
  6036. function cloneCopyEvent( src, dest ) {
  6037. if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
  6038. return;
  6039. }
  6040. var type, i, l,
  6041. oldData = jQuery._data( src ),
  6042. curData = jQuery._data( dest, oldData ),
  6043. events = oldData.events;
  6044. if ( events ) {
  6045. delete curData.handle;
  6046. curData.events = {};
  6047. for ( type in events ) {
  6048. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  6049. jQuery.event.add( dest, type, events[ type ][ i ] );
  6050. }
  6051. }
  6052. }
  6053. // make the cloned public data object a copy from the original
  6054. if ( curData.data ) {
  6055. curData.data = jQuery.extend( {}, curData.data );
  6056. }
  6057. }
  6058. function fixCloneNodeIssues( src, dest ) {
  6059. var nodeName, e, data;
  6060. // We do not need to do anything for non-Elements
  6061. if ( dest.nodeType !== 1 ) {
  6062. return;
  6063. }
  6064. nodeName = dest.nodeName.toLowerCase();
  6065. // IE6-8 copies events bound via attachEvent when using cloneNode.
  6066. if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
  6067. data = jQuery._data( dest );
  6068. for ( e in data.events ) {
  6069. jQuery.removeEvent( dest, e, data.handle );
  6070. }
  6071. // Event data gets referenced instead of copied if the expando gets copied too
  6072. dest.removeAttribute( jQuery.expando );
  6073. }
  6074. // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
  6075. if ( nodeName === "script" && dest.text !== src.text ) {
  6076. disableScript( dest ).text = src.text;
  6077. restoreScript( dest );
  6078. // IE6-10 improperly clones children of object elements using classid.
  6079. // IE10 throws NoModificationAllowedError if parent is null, #12132.
  6080. } else if ( nodeName === "object" ) {
  6081. if ( dest.parentNode ) {
  6082. dest.outerHTML = src.outerHTML;
  6083. }
  6084. // This path appears unavoidable for IE9. When cloning an object
  6085. // element in IE9, the outerHTML strategy above is not sufficient.
  6086. // If the src has innerHTML and the destination does not,
  6087. // copy the src.innerHTML into the dest.innerHTML. #10324
  6088. if ( support.html5Clone && ( src.innerHTML && !jQuery.trim( dest.innerHTML ) ) ) {
  6089. dest.innerHTML = src.innerHTML;
  6090. }
  6091. } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  6092. // IE6-8 fails to persist the checked state of a cloned checkbox
  6093. // or radio button. Worse, IE6-7 fail to give the cloned element
  6094. // a checked appearance if the defaultChecked value isn't also set
  6095. dest.defaultChecked = dest.checked = src.checked;
  6096. // IE6-7 get confused and end up setting the value of a cloned
  6097. // checkbox/radio button to an empty string instead of "on"
  6098. if ( dest.value !== src.value ) {
  6099. dest.value = src.value;
  6100. }
  6101. // IE6-8 fails to return the selected option to the default selected
  6102. // state when cloning options
  6103. } else if ( nodeName === "option" ) {
  6104. dest.defaultSelected = dest.selected = src.defaultSelected;
  6105. // IE6-8 fails to set the defaultValue to the correct value when
  6106. // cloning other types of input fields
  6107. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  6108. dest.defaultValue = src.defaultValue;
  6109. }
  6110. }
  6111. function domManip( collection, args, callback, ignored ) {
  6112. // Flatten any nested arrays
  6113. args = concat.apply( [], args );
  6114. var first, node, hasScripts,
  6115. scripts, doc, fragment,
  6116. i = 0,
  6117. l = collection.length,
  6118. iNoClone = l - 1,
  6119. value = args[ 0 ],
  6120. isFunction = jQuery.isFunction( value );
  6121. // We can't cloneNode fragments that contain checked, in WebKit
  6122. if ( isFunction ||
  6123. ( l > 1 && typeof value === "string" &&
  6124. !support.checkClone && rchecked.test( value ) ) ) {
  6125. return collection.each( function( index ) {
  6126. var self = collection.eq( index );
  6127. if ( isFunction ) {
  6128. args[ 0 ] = value.call( this, index, self.html() );
  6129. }
  6130. domManip( self, args, callback, ignored );
  6131. } );
  6132. }
  6133. if ( l ) {
  6134. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  6135. first = fragment.firstChild;
  6136. if ( fragment.childNodes.length === 1 ) {
  6137. fragment = first;
  6138. }
  6139. // Require either new content or an interest in ignored elements to invoke the callback
  6140. if ( first || ignored ) {
  6141. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  6142. hasScripts = scripts.length;
  6143. // Use the original fragment for the last item
  6144. // instead of the first because it can end up
  6145. // being emptied incorrectly in certain situations (#8070).
  6146. for ( ; i < l; i++ ) {
  6147. node = fragment;
  6148. if ( i !== iNoClone ) {
  6149. node = jQuery.clone( node, true, true );
  6150. // Keep references to cloned scripts for later restoration
  6151. if ( hasScripts ) {
  6152. // Support: Android<4.1, PhantomJS<2
  6153. // push.apply(_, arraylike) throws on ancient WebKit
  6154. jQuery.merge( scripts, getAll( node, "script" ) );
  6155. }
  6156. }
  6157. callback.call( collection[ i ], node, i );
  6158. }
  6159. if ( hasScripts ) {
  6160. doc = scripts[ scripts.length - 1 ].ownerDocument;
  6161. // Reenable scripts
  6162. jQuery.map( scripts, restoreScript );
  6163. // Evaluate executable scripts on first document insertion
  6164. for ( i = 0; i < hasScripts; i++ ) {
  6165. node = scripts[ i ];
  6166. if ( rscriptType.test( node.type || "" ) &&
  6167. !jQuery._data( node, "globalEval" ) &&
  6168. jQuery.contains( doc, node ) ) {
  6169. if ( node.src ) {
  6170. // Optional AJAX dependency, but won't run scripts if not present
  6171. if ( jQuery._evalUrl ) {
  6172. jQuery._evalUrl( node.src );
  6173. }
  6174. } else {
  6175. jQuery.globalEval(
  6176. ( node.text || node.textContent || node.innerHTML || "" )
  6177. .replace( rcleanScript, "" )
  6178. );
  6179. }
  6180. }
  6181. }
  6182. }
  6183. // Fix #11809: Avoid leaking memory
  6184. fragment = first = null;
  6185. }
  6186. }
  6187. return collection;
  6188. }
  6189. function remove( elem, selector, keepData ) {
  6190. var node,
  6191. elems = selector ? jQuery.filter( selector, elem ) : elem,
  6192. i = 0;
  6193. for ( ; ( node = elems[ i ] ) != null; i++ ) {
  6194. if ( !keepData && node.nodeType === 1 ) {
  6195. jQuery.cleanData( getAll( node ) );
  6196. }
  6197. if ( node.parentNode ) {
  6198. if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
  6199. setGlobalEval( getAll( node, "script" ) );
  6200. }
  6201. node.parentNode.removeChild( node );
  6202. }
  6203. }
  6204. return elem;
  6205. }
  6206. jQuery.extend( {
  6207. htmlPrefilter: function( html ) {
  6208. return html.replace( rxhtmlTag, "<$1></$2>" );
  6209. },
  6210. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  6211. var destElements, node, clone, i, srcElements,
  6212. inPage = jQuery.contains( elem.ownerDocument, elem );
  6213. if ( support.html5Clone || jQuery.isXMLDoc( elem ) ||
  6214. !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
  6215. clone = elem.cloneNode( true );
  6216. // IE<=8 does not properly clone detached, unknown element nodes
  6217. } else {
  6218. fragmentDiv.innerHTML = elem.outerHTML;
  6219. fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
  6220. }
  6221. if ( ( !support.noCloneEvent || !support.noCloneChecked ) &&
  6222. ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) {
  6223. // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
  6224. destElements = getAll( clone );
  6225. srcElements = getAll( elem );
  6226. // Fix all IE cloning issues
  6227. for ( i = 0; ( node = srcElements[ i ] ) != null; ++i ) {
  6228. // Ensure that the destination node is not null; Fixes #9587
  6229. if ( destElements[ i ] ) {
  6230. fixCloneNodeIssues( node, destElements[ i ] );
  6231. }
  6232. }
  6233. }
  6234. // Copy the events from the original to the clone
  6235. if ( dataAndEvents ) {
  6236. if ( deepDataAndEvents ) {
  6237. srcElements = srcElements || getAll( elem );
  6238. destElements = destElements || getAll( clone );
  6239. for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) {
  6240. cloneCopyEvent( node, destElements[ i ] );
  6241. }
  6242. } else {
  6243. cloneCopyEvent( elem, clone );
  6244. }
  6245. }
  6246. // Preserve script evaluation history
  6247. destElements = getAll( clone, "script" );
  6248. if ( destElements.length > 0 ) {
  6249. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  6250. }
  6251. destElements = srcElements = node = null;
  6252. // Return the cloned set
  6253. return clone;
  6254. },
  6255. cleanData: function( elems, /* internal */ forceAcceptData ) {
  6256. var elem, type, id, data,
  6257. i = 0,
  6258. internalKey = jQuery.expando,
  6259. cache = jQuery.cache,
  6260. attributes = support.attributes,
  6261. special = jQuery.event.special;
  6262. for ( ; ( elem = elems[ i ] ) != null; i++ ) {
  6263. if ( forceAcceptData || acceptData( elem ) ) {
  6264. id = elem[ internalKey ];
  6265. data = id && cache[ id ];
  6266. if ( data ) {
  6267. if ( data.events ) {
  6268. for ( type in data.events ) {
  6269. if ( special[ type ] ) {
  6270. jQuery.event.remove( elem, type );
  6271. // This is a shortcut to avoid jQuery.event.remove's overhead
  6272. } else {
  6273. jQuery.removeEvent( elem, type, data.handle );
  6274. }
  6275. }
  6276. }
  6277. // Remove cache only if it was not already removed by jQuery.event.remove
  6278. if ( cache[ id ] ) {
  6279. delete cache[ id ];
  6280. // Support: IE<9
  6281. // IE does not allow us to delete expando properties from nodes
  6282. // IE creates expando attributes along with the property
  6283. // IE does not have a removeAttribute function on Document nodes
  6284. if ( !attributes && typeof elem.removeAttribute !== "undefined" ) {
  6285. elem.removeAttribute( internalKey );
  6286. // Webkit & Blink performance suffers when deleting properties
  6287. // from DOM nodes, so set to undefined instead
  6288. // https://code.google.com/p/chromium/issues/detail?id=378607
  6289. } else {
  6290. elem[ internalKey ] = undefined;
  6291. }
  6292. deletedIds.push( id );
  6293. }
  6294. }
  6295. }
  6296. }
  6297. }
  6298. } );
  6299. jQuery.fn.extend( {
  6300. // Keep domManip exposed until 3.0 (gh-2225)
  6301. domManip: domManip,
  6302. detach: function( selector ) {
  6303. return remove( this, selector, true );
  6304. },
  6305. remove: function( selector ) {
  6306. return remove( this, selector );
  6307. },
  6308. text: function( value ) {
  6309. return access( this, function( value ) {
  6310. return value === undefined ?
  6311. jQuery.text( this ) :
  6312. this.empty().append(
  6313. ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value )
  6314. );
  6315. }, null, value, arguments.length );
  6316. },
  6317. append: function() {
  6318. return domManip( this, arguments, function( elem ) {
  6319. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  6320. var target = manipulationTarget( this, elem );
  6321. target.appendChild( elem );
  6322. }
  6323. } );
  6324. },
  6325. prepend: function() {
  6326. return domManip( this, arguments, function( elem ) {
  6327. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  6328. var target = manipulationTarget( this, elem );
  6329. target.insertBefore( elem, target.firstChild );
  6330. }
  6331. } );
  6332. },
  6333. before: function() {
  6334. return domManip( this, arguments, function( elem ) {
  6335. if ( this.parentNode ) {
  6336. this.parentNode.insertBefore( elem, this );
  6337. }
  6338. } );
  6339. },
  6340. after: function() {
  6341. return domManip( this, arguments, function( elem ) {
  6342. if ( this.parentNode ) {
  6343. this.parentNode.insertBefore( elem, this.nextSibling );
  6344. }
  6345. } );
  6346. },
  6347. empty: function() {
  6348. var elem,
  6349. i = 0;
  6350. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  6351. // Remove element nodes and prevent memory leaks
  6352. if ( elem.nodeType === 1 ) {
  6353. jQuery.cleanData( getAll( elem, false ) );
  6354. }
  6355. // Remove any remaining nodes
  6356. while ( elem.firstChild ) {
  6357. elem.removeChild( elem.firstChild );
  6358. }
  6359. // If this is a select, ensure that it displays empty (#12336)
  6360. // Support: IE<9
  6361. if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
  6362. elem.options.length = 0;
  6363. }
  6364. }
  6365. return this;
  6366. },
  6367. clone: function( dataAndEvents, deepDataAndEvents ) {
  6368. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  6369. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  6370. return this.map( function() {
  6371. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  6372. } );
  6373. },
  6374. html: function( value ) {
  6375. return access( this, function( value ) {
  6376. var elem = this[ 0 ] || {},
  6377. i = 0,
  6378. l = this.length;
  6379. if ( value === undefined ) {
  6380. return elem.nodeType === 1 ?
  6381. elem.innerHTML.replace( rinlinejQuery, "" ) :
  6382. undefined;
  6383. }
  6384. // See if we can take a shortcut and just use innerHTML
  6385. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  6386. ( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
  6387. ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
  6388. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  6389. value = jQuery.htmlPrefilter( value );
  6390. try {
  6391. for ( ; i < l; i++ ) {
  6392. // Remove element nodes and prevent memory leaks
  6393. elem = this[ i ] || {};
  6394. if ( elem.nodeType === 1 ) {
  6395. jQuery.cleanData( getAll( elem, false ) );
  6396. elem.innerHTML = value;
  6397. }
  6398. }
  6399. elem = 0;
  6400. // If using innerHTML throws an exception, use the fallback method
  6401. } catch ( e ) {}
  6402. }
  6403. if ( elem ) {
  6404. this.empty().append( value );
  6405. }
  6406. }, null, value, arguments.length );
  6407. },
  6408. replaceWith: function() {
  6409. var ignored = [];
  6410. // Make the changes, replacing each non-ignored context element with the new content
  6411. return domManip( this, arguments, function( elem ) {
  6412. var parent = this.parentNode;
  6413. if ( jQuery.inArray( this, ignored ) < 0 ) {
  6414. jQuery.cleanData( getAll( this ) );
  6415. if ( parent ) {
  6416. parent.replaceChild( elem, this );
  6417. }
  6418. }
  6419. // Force callback invocation
  6420. }, ignored );
  6421. }
  6422. } );
  6423. jQuery.each( {
  6424. appendTo: "append",
  6425. prependTo: "prepend",
  6426. insertBefore: "before",
  6427. insertAfter: "after",
  6428. replaceAll: "replaceWith"
  6429. }, function( name, original ) {
  6430. jQuery.fn[ name ] = function( selector ) {
  6431. var elems,
  6432. i = 0,
  6433. ret = [],
  6434. insert = jQuery( selector ),
  6435. last = insert.length - 1;
  6436. for ( ; i <= last; i++ ) {
  6437. elems = i === last ? this : this.clone( true );
  6438. jQuery( insert[ i ] )[ original ]( elems );
  6439. // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
  6440. push.apply( ret, elems.get() );
  6441. }
  6442. return this.pushStack( ret );
  6443. };
  6444. } );
  6445. var iframe,
  6446. elemdisplay = {
  6447. // Support: Firefox
  6448. // We have to pre-define these values for FF (#10227)
  6449. HTML: "block",
  6450. BODY: "block"
  6451. };
  6452. /**
  6453. * Retrieve the actual display of a element
  6454. * @param {String} name nodeName of the element
  6455. * @param {Object} doc Document object
  6456. */
  6457. // Called only from within defaultDisplay
  6458. function actualDisplay( name, doc ) {
  6459. var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
  6460. display = jQuery.css( elem[ 0 ], "display" );
  6461. // We don't have any data stored on the element,
  6462. // so use "detach" method as fast way to get rid of the element
  6463. elem.detach();
  6464. return display;
  6465. }
  6466. /**
  6467. * Try to determine the default display value of an element
  6468. * @param {String} nodeName
  6469. */
  6470. function defaultDisplay( nodeName ) {
  6471. var doc = document,
  6472. display = elemdisplay[ nodeName ];
  6473. if ( !display ) {
  6474. display = actualDisplay( nodeName, doc );
  6475. // If the simple way fails, read from inside an iframe
  6476. if ( display === "none" || !display ) {
  6477. // Use the already-created iframe if possible
  6478. iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) )
  6479. .appendTo( doc.documentElement );
  6480. // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
  6481. doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
  6482. // Support: IE
  6483. doc.write();
  6484. doc.close();
  6485. display = actualDisplay( nodeName, doc );
  6486. iframe.detach();
  6487. }
  6488. // Store the correct default display
  6489. elemdisplay[ nodeName ] = display;
  6490. }
  6491. return display;
  6492. }
  6493. var rmargin = ( /^margin/ );
  6494. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  6495. var swap = function( elem, options, callback, args ) {
  6496. var ret, name,
  6497. old = {};
  6498. // Remember the old values, and insert the new ones
  6499. for ( name in options ) {
  6500. old[ name ] = elem.style[ name ];
  6501. elem.style[ name ] = options[ name ];
  6502. }
  6503. ret = callback.apply( elem, args || [] );
  6504. // Revert the old values
  6505. for ( name in options ) {
  6506. elem.style[ name ] = old[ name ];
  6507. }
  6508. return ret;
  6509. };
  6510. var documentElement = document.documentElement;
  6511. ( function() {
  6512. var pixelPositionVal, pixelMarginRightVal, boxSizingReliableVal,
  6513. reliableHiddenOffsetsVal, reliableMarginRightVal, reliableMarginLeftVal,
  6514. container = document.createElement( "div" ),
  6515. div = document.createElement( "div" );
  6516. // Finish early in limited (non-browser) environments
  6517. if ( !div.style ) {
  6518. return;
  6519. }
  6520. div.style.cssText = "float:left;opacity:.5";
  6521. // Support: IE<9
  6522. // Make sure that element opacity exists (as opposed to filter)
  6523. support.opacity = div.style.opacity === "0.5";
  6524. // Verify style float existence
  6525. // (IE uses styleFloat instead of cssFloat)
  6526. support.cssFloat = !!div.style.cssFloat;
  6527. div.style.backgroundClip = "content-box";
  6528. div.cloneNode( true ).style.backgroundClip = "";
  6529. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  6530. container = document.createElement( "div" );
  6531. container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
  6532. "padding:0;margin-top:1px;position:absolute";
  6533. div.innerHTML = "";
  6534. container.appendChild( div );
  6535. // Support: Firefox<29, Android 2.3
  6536. // Vendor-prefix box-sizing
  6537. support.boxSizing = div.style.boxSizing === "" || div.style.MozBoxSizing === "" ||
  6538. div.style.WebkitBoxSizing === "";
  6539. jQuery.extend( support, {
  6540. reliableHiddenOffsets: function() {
  6541. if ( pixelPositionVal == null ) {
  6542. computeStyleTests();
  6543. }
  6544. return reliableHiddenOffsetsVal;
  6545. },
  6546. boxSizingReliable: function() {
  6547. // We're checking for pixelPositionVal here instead of boxSizingReliableVal
  6548. // since that compresses better and they're computed together anyway.
  6549. if ( pixelPositionVal == null ) {
  6550. computeStyleTests();
  6551. }
  6552. return boxSizingReliableVal;
  6553. },
  6554. pixelMarginRight: function() {
  6555. // Support: Android 4.0-4.3
  6556. if ( pixelPositionVal == null ) {
  6557. computeStyleTests();
  6558. }
  6559. return pixelMarginRightVal;
  6560. },
  6561. pixelPosition: function() {
  6562. if ( pixelPositionVal == null ) {
  6563. computeStyleTests();
  6564. }
  6565. return pixelPositionVal;
  6566. },
  6567. reliableMarginRight: function() {
  6568. // Support: Android 2.3
  6569. if ( pixelPositionVal == null ) {
  6570. computeStyleTests();
  6571. }
  6572. return reliableMarginRightVal;
  6573. },
  6574. reliableMarginLeft: function() {
  6575. // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37
  6576. if ( pixelPositionVal == null ) {
  6577. computeStyleTests();
  6578. }
  6579. return reliableMarginLeftVal;
  6580. }
  6581. } );
  6582. function computeStyleTests() {
  6583. var contents, divStyle,
  6584. documentElement = document.documentElement;
  6585. // Setup
  6586. documentElement.appendChild( container );
  6587. div.style.cssText =
  6588. // Support: Android 2.3
  6589. // Vendor-prefix box-sizing
  6590. "-webkit-box-sizing:border-box;box-sizing:border-box;" +
  6591. "position:relative;display:block;" +
  6592. "margin:auto;border:1px;padding:1px;" +
  6593. "top:1%;width:50%";
  6594. // Support: IE<9
  6595. // Assume reasonable values in the absence of getComputedStyle
  6596. pixelPositionVal = boxSizingReliableVal = reliableMarginLeftVal = false;
  6597. pixelMarginRightVal = reliableMarginRightVal = true;
  6598. // Check for getComputedStyle so that this code is not run in IE<9.
  6599. if ( window.getComputedStyle ) {
  6600. divStyle = window.getComputedStyle( div );
  6601. pixelPositionVal = ( divStyle || {} ).top !== "1%";
  6602. reliableMarginLeftVal = ( divStyle || {} ).marginLeft === "2px";
  6603. boxSizingReliableVal = ( divStyle || { width: "4px" } ).width === "4px";
  6604. // Support: Android 4.0 - 4.3 only
  6605. // Some styles come back with percentage values, even though they shouldn't
  6606. div.style.marginRight = "50%";
  6607. pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px";
  6608. // Support: Android 2.3 only
  6609. // Div with explicit width and no margin-right incorrectly
  6610. // gets computed margin-right based on width of container (#3333)
  6611. // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  6612. contents = div.appendChild( document.createElement( "div" ) );
  6613. // Reset CSS: box-sizing; display; margin; border; padding
  6614. contents.style.cssText = div.style.cssText =
  6615. // Support: Android 2.3
  6616. // Vendor-prefix box-sizing
  6617. "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
  6618. "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
  6619. contents.style.marginRight = contents.style.width = "0";
  6620. div.style.width = "1px";
  6621. reliableMarginRightVal =
  6622. !parseFloat( ( window.getComputedStyle( contents ) || {} ).marginRight );
  6623. div.removeChild( contents );
  6624. }
  6625. // Support: IE6-8
  6626. // First check that getClientRects works as expected
  6627. // Check if table cells still have offsetWidth/Height when they are set
  6628. // to display:none and there are still other visible table cells in a
  6629. // table row; if so, offsetWidth/Height are not reliable for use when
  6630. // determining if an element has been hidden directly using
  6631. // display:none (it is still safe to use offsets if a parent element is
  6632. // hidden; don safety goggles and see bug #4512 for more information).
  6633. div.style.display = "none";
  6634. reliableHiddenOffsetsVal = div.getClientRects().length === 0;
  6635. if ( reliableHiddenOffsetsVal ) {
  6636. div.style.display = "";
  6637. div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
  6638. div.childNodes[ 0 ].style.borderCollapse = "separate";
  6639. contents = div.getElementsByTagName( "td" );
  6640. contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
  6641. reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
  6642. if ( reliableHiddenOffsetsVal ) {
  6643. contents[ 0 ].style.display = "";
  6644. contents[ 1 ].style.display = "none";
  6645. reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
  6646. }
  6647. }
  6648. // Teardown
  6649. documentElement.removeChild( container );
  6650. }
  6651. } )();
  6652. var getStyles, curCSS,
  6653. rposition = /^(top|right|bottom|left)$/;
  6654. if ( window.getComputedStyle ) {
  6655. getStyles = function( elem ) {
  6656. // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
  6657. // IE throws on elements created in popups
  6658. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  6659. var view = elem.ownerDocument.defaultView;
  6660. if ( !view || !view.opener ) {
  6661. view = window;
  6662. }
  6663. return view.getComputedStyle( elem );
  6664. };
  6665. curCSS = function( elem, name, computed ) {
  6666. var width, minWidth, maxWidth, ret,
  6667. style = elem.style;
  6668. computed = computed || getStyles( elem );
  6669. // getPropertyValue is only needed for .css('filter') in IE9, see #12537
  6670. ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
  6671. // Support: Opera 12.1x only
  6672. // Fall back to style even without computed
  6673. // computed is undefined for elems on document fragments
  6674. if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
  6675. ret = jQuery.style( elem, name );
  6676. }
  6677. if ( computed ) {
  6678. // A tribute to the "awesome hack by Dean Edwards"
  6679. // Chrome < 17 and Safari 5.0 uses "computed value"
  6680. // instead of "used value" for margin-right
  6681. // Safari 5.1.7 (at least) returns percentage for a larger set of values,
  6682. // but width seems to be reliably pixels
  6683. // this is against the CSSOM draft spec:
  6684. // http://dev.w3.org/csswg/cssom/#resolved-values
  6685. if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
  6686. // Remember the original values
  6687. width = style.width;
  6688. minWidth = style.minWidth;
  6689. maxWidth = style.maxWidth;
  6690. // Put in the new values to get a computed value out
  6691. style.minWidth = style.maxWidth = style.width = ret;
  6692. ret = computed.width;
  6693. // Revert the changed values
  6694. style.width = width;
  6695. style.minWidth = minWidth;
  6696. style.maxWidth = maxWidth;
  6697. }
  6698. }
  6699. // Support: IE
  6700. // IE returns zIndex value as an integer.
  6701. return ret === undefined ?
  6702. ret :
  6703. ret + "";
  6704. };
  6705. } else if ( documentElement.currentStyle ) {
  6706. getStyles = function( elem ) {
  6707. return elem.currentStyle;
  6708. };
  6709. curCSS = function( elem, name, computed ) {
  6710. var left, rs, rsLeft, ret,
  6711. style = elem.style;
  6712. computed = computed || getStyles( elem );
  6713. ret = computed ? computed[ name ] : undefined;
  6714. // Avoid setting ret to empty string here
  6715. // so we don't default to auto
  6716. if ( ret == null && style && style[ name ] ) {
  6717. ret = style[ name ];
  6718. }
  6719. // From the awesome hack by Dean Edwards
  6720. // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
  6721. // If we're not dealing with a regular pixel number
  6722. // but a number that has a weird ending, we need to convert it to pixels
  6723. // but not position css attributes, as those are
  6724. // proportional to the parent element instead
  6725. // and we can't measure the parent instead because it
  6726. // might trigger a "stacking dolls" problem
  6727. if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
  6728. // Remember the original values
  6729. left = style.left;
  6730. rs = elem.runtimeStyle;
  6731. rsLeft = rs && rs.left;
  6732. // Put in the new values to get a computed value out
  6733. if ( rsLeft ) {
  6734. rs.left = elem.currentStyle.left;
  6735. }
  6736. style.left = name === "fontSize" ? "1em" : ret;
  6737. ret = style.pixelLeft + "px";
  6738. // Revert the changed values
  6739. style.left = left;
  6740. if ( rsLeft ) {
  6741. rs.left = rsLeft;
  6742. }
  6743. }
  6744. // Support: IE
  6745. // IE returns zIndex value as an integer.
  6746. return ret === undefined ?
  6747. ret :
  6748. ret + "" || "auto";
  6749. };
  6750. }
  6751. function addGetHookIf( conditionFn, hookFn ) {
  6752. // Define the hook, we'll check on the first run if it's really needed.
  6753. return {
  6754. get: function() {
  6755. if ( conditionFn() ) {
  6756. // Hook not needed (or it's not possible to use it due
  6757. // to missing dependency), remove it.
  6758. delete this.get;
  6759. return;
  6760. }
  6761. // Hook needed; redefine it so that the support test is not executed again.
  6762. return ( this.get = hookFn ).apply( this, arguments );
  6763. }
  6764. };
  6765. }
  6766. var
  6767. ralpha = /alpha\([^)]*\)/i,
  6768. ropacity = /opacity\s*=\s*([^)]*)/i,
  6769. // swappable if display is none or starts with table except
  6770. // "table", "table-cell", or "table-caption"
  6771. // see here for display values:
  6772. // https://developer.mozilla.org/en-US/docs/CSS/display
  6773. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  6774. rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
  6775. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  6776. cssNormalTransform = {
  6777. letterSpacing: "0",
  6778. fontWeight: "400"
  6779. },
  6780. cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],
  6781. emptyStyle = document.createElement( "div" ).style;
  6782. // return a css property mapped to a potentially vendor prefixed property
  6783. function vendorPropName( name ) {
  6784. // shortcut for names that are not vendor prefixed
  6785. if ( name in emptyStyle ) {
  6786. return name;
  6787. }
  6788. // check for vendor prefixed names
  6789. var capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),
  6790. i = cssPrefixes.length;
  6791. while ( i-- ) {
  6792. name = cssPrefixes[ i ] + capName;
  6793. if ( name in emptyStyle ) {
  6794. return name;
  6795. }
  6796. }
  6797. }
  6798. function showHide( elements, show ) {
  6799. var display, elem, hidden,
  6800. values = [],
  6801. index = 0,
  6802. length = elements.length;
  6803. for ( ; index < length; index++ ) {
  6804. elem = elements[ index ];
  6805. if ( !elem.style ) {
  6806. continue;
  6807. }
  6808. values[ index ] = jQuery._data( elem, "olddisplay" );
  6809. display = elem.style.display;
  6810. if ( show ) {
  6811. // Reset the inline display of this element to learn if it is
  6812. // being hidden by cascaded rules or not
  6813. if ( !values[ index ] && display === "none" ) {
  6814. elem.style.display = "";
  6815. }
  6816. // Set elements which have been overridden with display: none
  6817. // in a stylesheet to whatever the default browser style is
  6818. // for such an element
  6819. if ( elem.style.display === "" && isHidden( elem ) ) {
  6820. values[ index ] =
  6821. jQuery._data( elem, "olddisplay", defaultDisplay( elem.nodeName ) );
  6822. }
  6823. } else {
  6824. hidden = isHidden( elem );
  6825. if ( display && display !== "none" || !hidden ) {
  6826. jQuery._data(
  6827. elem,
  6828. "olddisplay",
  6829. hidden ? display : jQuery.css( elem, "display" )
  6830. );
  6831. }
  6832. }
  6833. }
  6834. // Set the display of most of the elements in a second loop
  6835. // to avoid the constant reflow
  6836. for ( index = 0; index < length; index++ ) {
  6837. elem = elements[ index ];
  6838. if ( !elem.style ) {
  6839. continue;
  6840. }
  6841. if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
  6842. elem.style.display = show ? values[ index ] || "" : "none";
  6843. }
  6844. }
  6845. return elements;
  6846. }
  6847. function setPositiveNumber( elem, value, subtract ) {
  6848. var matches = rnumsplit.exec( value );
  6849. return matches ?
  6850. // Guard against undefined "subtract", e.g., when used as in cssHooks
  6851. Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
  6852. value;
  6853. }
  6854. function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
  6855. var i = extra === ( isBorderBox ? "border" : "content" ) ?
  6856. // If we already have the right measurement, avoid augmentation
  6857. 4 :
  6858. // Otherwise initialize for horizontal or vertical properties
  6859. name === "width" ? 1 : 0,
  6860. val = 0;
  6861. for ( ; i < 4; i += 2 ) {
  6862. // both box models exclude margin, so add it if we want it
  6863. if ( extra === "margin" ) {
  6864. val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
  6865. }
  6866. if ( isBorderBox ) {
  6867. // border-box includes padding, so remove it if we want content
  6868. if ( extra === "content" ) {
  6869. val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  6870. }
  6871. // at this point, extra isn't border nor margin, so remove border
  6872. if ( extra !== "margin" ) {
  6873. val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  6874. }
  6875. } else {
  6876. // at this point, extra isn't content, so add padding
  6877. val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  6878. // at this point, extra isn't content nor padding, so add border
  6879. if ( extra !== "padding" ) {
  6880. val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  6881. }
  6882. }
  6883. }
  6884. return val;
  6885. }
  6886. function getWidthOrHeight( elem, name, extra ) {
  6887. // Start with offset property, which is equivalent to the border-box value
  6888. var valueIsBorderBox = true,
  6889. val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
  6890. styles = getStyles( elem ),
  6891. isBorderBox = support.boxSizing &&
  6892. jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  6893. // some non-html elements return undefined for offsetWidth, so check for null/undefined
  6894. // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
  6895. // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
  6896. if ( val <= 0 || val == null ) {
  6897. // Fall back to computed then uncomputed css if necessary
  6898. val = curCSS( elem, name, styles );
  6899. if ( val < 0 || val == null ) {
  6900. val = elem.style[ name ];
  6901. }
  6902. // Computed unit is not pixels. Stop here and return.
  6903. if ( rnumnonpx.test( val ) ) {
  6904. return val;
  6905. }
  6906. // we need the check for style in case a browser which returns unreliable values
  6907. // for getComputedStyle silently falls back to the reliable elem.style
  6908. valueIsBorderBox = isBorderBox &&
  6909. ( support.boxSizingReliable() || val === elem.style[ name ] );
  6910. // Normalize "", auto, and prepare for extra
  6911. val = parseFloat( val ) || 0;
  6912. }
  6913. // use the active box-sizing model to add/subtract irrelevant styles
  6914. return ( val +
  6915. augmentWidthOrHeight(
  6916. elem,
  6917. name,
  6918. extra || ( isBorderBox ? "border" : "content" ),
  6919. valueIsBorderBox,
  6920. styles
  6921. )
  6922. ) + "px";
  6923. }
  6924. jQuery.extend( {
  6925. // Add in style property hooks for overriding the default
  6926. // behavior of getting and setting a style property
  6927. cssHooks: {
  6928. opacity: {
  6929. get: function( elem, computed ) {
  6930. if ( computed ) {
  6931. // We should always get a number back from opacity
  6932. var ret = curCSS( elem, "opacity" );
  6933. return ret === "" ? "1" : ret;
  6934. }
  6935. }
  6936. }
  6937. },
  6938. // Don't automatically add "px" to these possibly-unitless properties
  6939. cssNumber: {
  6940. "animationIterationCount": true,
  6941. "columnCount": true,
  6942. "fillOpacity": true,
  6943. "flexGrow": true,
  6944. "flexShrink": true,
  6945. "fontWeight": true,
  6946. "lineHeight": true,
  6947. "opacity": true,
  6948. "order": true,
  6949. "orphans": true,
  6950. "widows": true,
  6951. "zIndex": true,
  6952. "zoom": true
  6953. },
  6954. // Add in properties whose names you wish to fix before
  6955. // setting or getting the value
  6956. cssProps: {
  6957. // normalize float css property
  6958. "float": support.cssFloat ? "cssFloat" : "styleFloat"
  6959. },
  6960. // Get and set the style property on a DOM Node
  6961. style: function( elem, name, value, extra ) {
  6962. // Don't set styles on text and comment nodes
  6963. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  6964. return;
  6965. }
  6966. // Make sure that we're working with the right name
  6967. var ret, type, hooks,
  6968. origName = jQuery.camelCase( name ),
  6969. style = elem.style;
  6970. name = jQuery.cssProps[ origName ] ||
  6971. ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
  6972. // gets hook for the prefixed version
  6973. // followed by the unprefixed version
  6974. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  6975. // Check if we're setting a value
  6976. if ( value !== undefined ) {
  6977. type = typeof value;
  6978. // Convert "+=" or "-=" to relative numbers (#7345)
  6979. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  6980. value = adjustCSS( elem, name, ret );
  6981. // Fixes bug #9237
  6982. type = "number";
  6983. }
  6984. // Make sure that null and NaN values aren't set. See: #7116
  6985. if ( value == null || value !== value ) {
  6986. return;
  6987. }
  6988. // If a number was passed in, add the unit (except for certain CSS properties)
  6989. if ( type === "number" ) {
  6990. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  6991. }
  6992. // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
  6993. // but it would mean to define eight
  6994. // (for every problematic property) identical functions
  6995. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  6996. style[ name ] = "inherit";
  6997. }
  6998. // If a hook was provided, use that value, otherwise just set the specified value
  6999. if ( !hooks || !( "set" in hooks ) ||
  7000. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  7001. // Support: IE
  7002. // Swallow errors from 'invalid' CSS values (#5509)
  7003. try {
  7004. style[ name ] = value;
  7005. } catch ( e ) {}
  7006. }
  7007. } else {
  7008. // If a hook was provided get the non-computed value from there
  7009. if ( hooks && "get" in hooks &&
  7010. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  7011. return ret;
  7012. }
  7013. // Otherwise just get the value from the style object
  7014. return style[ name ];
  7015. }
  7016. },
  7017. css: function( elem, name, extra, styles ) {
  7018. var num, val, hooks,
  7019. origName = jQuery.camelCase( name );
  7020. // Make sure that we're working with the right name
  7021. name = jQuery.cssProps[ origName ] ||
  7022. ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
  7023. // gets hook for the prefixed version
  7024. // followed by the unprefixed version
  7025. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  7026. // If a hook was provided get the computed value from there
  7027. if ( hooks && "get" in hooks ) {
  7028. val = hooks.get( elem, true, extra );
  7029. }
  7030. // Otherwise, if a way to get the computed value exists, use that
  7031. if ( val === undefined ) {
  7032. val = curCSS( elem, name, styles );
  7033. }
  7034. //convert "normal" to computed value
  7035. if ( val === "normal" && name in cssNormalTransform ) {
  7036. val = cssNormalTransform[ name ];
  7037. }
  7038. // Return, converting to number if forced or a qualifier was provided and val looks numeric
  7039. if ( extra === "" || extra ) {
  7040. num = parseFloat( val );
  7041. return extra === true || isFinite( num ) ? num || 0 : val;
  7042. }
  7043. return val;
  7044. }
  7045. } );
  7046. jQuery.each( [ "height", "width" ], function( i, name ) {
  7047. jQuery.cssHooks[ name ] = {
  7048. get: function( elem, computed, extra ) {
  7049. if ( computed ) {
  7050. // certain elements can have dimension info if we invisibly show them
  7051. // however, it must have a current display style that would benefit from this
  7052. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  7053. elem.offsetWidth === 0 ?
  7054. swap( elem, cssShow, function() {
  7055. return getWidthOrHeight( elem, name, extra );
  7056. } ) :
  7057. getWidthOrHeight( elem, name, extra );
  7058. }
  7059. },
  7060. set: function( elem, value, extra ) {
  7061. var styles = extra && getStyles( elem );
  7062. return setPositiveNumber( elem, value, extra ?
  7063. augmentWidthOrHeight(
  7064. elem,
  7065. name,
  7066. extra,
  7067. support.boxSizing &&
  7068. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  7069. styles
  7070. ) : 0
  7071. );
  7072. }
  7073. };
  7074. } );
  7075. if ( !support.opacity ) {
  7076. jQuery.cssHooks.opacity = {
  7077. get: function( elem, computed ) {
  7078. // IE uses filters for opacity
  7079. return ropacity.test( ( computed && elem.currentStyle ?
  7080. elem.currentStyle.filter :
  7081. elem.style.filter ) || "" ) ?
  7082. ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
  7083. computed ? "1" : "";
  7084. },
  7085. set: function( elem, value ) {
  7086. var style = elem.style,
  7087. currentStyle = elem.currentStyle,
  7088. opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
  7089. filter = currentStyle && currentStyle.filter || style.filter || "";
  7090. // IE has trouble with opacity if it does not have layout
  7091. // Force it by setting the zoom level
  7092. style.zoom = 1;
  7093. // if setting opacity to 1, and no other filters exist -
  7094. // attempt to remove filter attribute #6652
  7095. // if value === "", then remove inline opacity #12685
  7096. if ( ( value >= 1 || value === "" ) &&
  7097. jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
  7098. style.removeAttribute ) {
  7099. // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
  7100. // if "filter:" is present at all, clearType is disabled, we want to avoid this
  7101. // style.removeAttribute is IE Only, but so apparently is this code path...
  7102. style.removeAttribute( "filter" );
  7103. // if there is no filter style applied in a css rule
  7104. // or unset inline opacity, we are done
  7105. if ( value === "" || currentStyle && !currentStyle.filter ) {
  7106. return;
  7107. }
  7108. }
  7109. // otherwise, set new filter values
  7110. style.filter = ralpha.test( filter ) ?
  7111. filter.replace( ralpha, opacity ) :
  7112. filter + " " + opacity;
  7113. }
  7114. };
  7115. }
  7116. jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
  7117. function( elem, computed ) {
  7118. if ( computed ) {
  7119. return swap( elem, { "display": "inline-block" },
  7120. curCSS, [ elem, "marginRight" ] );
  7121. }
  7122. }
  7123. );
  7124. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  7125. function( elem, computed ) {
  7126. if ( computed ) {
  7127. return (
  7128. parseFloat( curCSS( elem, "marginLeft" ) ) ||
  7129. // Support: IE<=11+
  7130. // Running getBoundingClientRect on a disconnected node in IE throws an error
  7131. // Support: IE8 only
  7132. // getClientRects() errors on disconnected elems
  7133. ( jQuery.contains( elem.ownerDocument, elem ) ?
  7134. elem.getBoundingClientRect().left -
  7135. swap( elem, { marginLeft: 0 }, function() {
  7136. return elem.getBoundingClientRect().left;
  7137. } ) :
  7138. 0
  7139. )
  7140. ) + "px";
  7141. }
  7142. }
  7143. );
  7144. // These hooks are used by animate to expand properties
  7145. jQuery.each( {
  7146. margin: "",
  7147. padding: "",
  7148. border: "Width"
  7149. }, function( prefix, suffix ) {
  7150. jQuery.cssHooks[ prefix + suffix ] = {
  7151. expand: function( value ) {
  7152. var i = 0,
  7153. expanded = {},
  7154. // assumes a single number if not a string
  7155. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  7156. for ( ; i < 4; i++ ) {
  7157. expanded[ prefix + cssExpand[ i ] + suffix ] =
  7158. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  7159. }
  7160. return expanded;
  7161. }
  7162. };
  7163. if ( !rmargin.test( prefix ) ) {
  7164. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  7165. }
  7166. } );
  7167. jQuery.fn.extend( {
  7168. css: function( name, value ) {
  7169. return access( this, function( elem, name, value ) {
  7170. var styles, len,
  7171. map = {},
  7172. i = 0;
  7173. if ( jQuery.isArray( name ) ) {
  7174. styles = getStyles( elem );
  7175. len = name.length;
  7176. for ( ; i < len; i++ ) {
  7177. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  7178. }
  7179. return map;
  7180. }
  7181. return value !== undefined ?
  7182. jQuery.style( elem, name, value ) :
  7183. jQuery.css( elem, name );
  7184. }, name, value, arguments.length > 1 );
  7185. },
  7186. show: function() {
  7187. return showHide( this, true );
  7188. },
  7189. hide: function() {
  7190. return showHide( this );
  7191. },
  7192. toggle: function( state ) {
  7193. if ( typeof state === "boolean" ) {
  7194. return state ? this.show() : this.hide();
  7195. }
  7196. return this.each( function() {
  7197. if ( isHidden( this ) ) {
  7198. jQuery( this ).show();
  7199. } else {
  7200. jQuery( this ).hide();
  7201. }
  7202. } );
  7203. }
  7204. } );
  7205. function Tween( elem, options, prop, end, easing ) {
  7206. return new Tween.prototype.init( elem, options, prop, end, easing );
  7207. }
  7208. jQuery.Tween = Tween;
  7209. Tween.prototype = {
  7210. constructor: Tween,
  7211. init: function( elem, options, prop, end, easing, unit ) {
  7212. this.elem = elem;
  7213. this.prop = prop;
  7214. this.easing = easing || jQuery.easing._default;
  7215. this.options = options;
  7216. this.start = this.now = this.cur();
  7217. this.end = end;
  7218. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  7219. },
  7220. cur: function() {
  7221. var hooks = Tween.propHooks[ this.prop ];
  7222. return hooks && hooks.get ?
  7223. hooks.get( this ) :
  7224. Tween.propHooks._default.get( this );
  7225. },
  7226. run: function( percent ) {
  7227. var eased,
  7228. hooks = Tween.propHooks[ this.prop ];
  7229. if ( this.options.duration ) {
  7230. this.pos = eased = jQuery.easing[ this.easing ](
  7231. percent, this.options.duration * percent, 0, 1, this.options.duration
  7232. );
  7233. } else {
  7234. this.pos = eased = percent;
  7235. }
  7236. this.now = ( this.end - this.start ) * eased + this.start;
  7237. if ( this.options.step ) {
  7238. this.options.step.call( this.elem, this.now, this );
  7239. }
  7240. if ( hooks && hooks.set ) {
  7241. hooks.set( this );
  7242. } else {
  7243. Tween.propHooks._default.set( this );
  7244. }
  7245. return this;
  7246. }
  7247. };
  7248. Tween.prototype.init.prototype = Tween.prototype;
  7249. Tween.propHooks = {
  7250. _default: {
  7251. get: function( tween ) {
  7252. var result;
  7253. // Use a property on the element directly when it is not a DOM element,
  7254. // or when there is no matching style property that exists.
  7255. if ( tween.elem.nodeType !== 1 ||
  7256. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  7257. return tween.elem[ tween.prop ];
  7258. }
  7259. // passing an empty string as a 3rd parameter to .css will automatically
  7260. // attempt a parseFloat and fallback to a string if the parse fails
  7261. // so, simple values such as "10px" are parsed to Float.
  7262. // complex values such as "rotate(1rad)" are returned as is.
  7263. result = jQuery.css( tween.elem, tween.prop, "" );
  7264. // Empty strings, null, undefined and "auto" are converted to 0.
  7265. return !result || result === "auto" ? 0 : result;
  7266. },
  7267. set: function( tween ) {
  7268. // use step hook for back compat - use cssHook if its there - use .style if its
  7269. // available and use plain properties where available
  7270. if ( jQuery.fx.step[ tween.prop ] ) {
  7271. jQuery.fx.step[ tween.prop ]( tween );
  7272. } else if ( tween.elem.nodeType === 1 &&
  7273. ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
  7274. jQuery.cssHooks[ tween.prop ] ) ) {
  7275. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  7276. } else {
  7277. tween.elem[ tween.prop ] = tween.now;
  7278. }
  7279. }
  7280. }
  7281. };
  7282. // Support: IE <=9
  7283. // Panic based approach to setting things on disconnected nodes
  7284. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  7285. set: function( tween ) {
  7286. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  7287. tween.elem[ tween.prop ] = tween.now;
  7288. }
  7289. }
  7290. };
  7291. jQuery.easing = {
  7292. linear: function( p ) {
  7293. return p;
  7294. },
  7295. swing: function( p ) {
  7296. return 0.5 - Math.cos( p * Math.PI ) / 2;
  7297. },
  7298. _default: "swing"
  7299. };
  7300. jQuery.fx = Tween.prototype.init;
  7301. // Back Compat <1.8 extension point
  7302. jQuery.fx.step = {};
  7303. var
  7304. fxNow, timerId,
  7305. rfxtypes = /^(?:toggle|show|hide)$/,
  7306. rrun = /queueHooks$/;
  7307. // Animations created synchronously will run synchronously
  7308. function createFxNow() {
  7309. window.setTimeout( function() {
  7310. fxNow = undefined;
  7311. } );
  7312. return ( fxNow = jQuery.now() );
  7313. }
  7314. // Generate parameters to create a standard animation
  7315. function genFx( type, includeWidth ) {
  7316. var which,
  7317. attrs = { height: type },
  7318. i = 0;
  7319. // if we include width, step value is 1 to do all cssExpand values,
  7320. // if we don't include width, step value is 2 to skip over Left and Right
  7321. includeWidth = includeWidth ? 1 : 0;
  7322. for ( ; i < 4 ; i += 2 - includeWidth ) {
  7323. which = cssExpand[ i ];
  7324. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  7325. }
  7326. if ( includeWidth ) {
  7327. attrs.opacity = attrs.width = type;
  7328. }
  7329. return attrs;
  7330. }
  7331. function createTween( value, prop, animation ) {
  7332. var tween,
  7333. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  7334. index = 0,
  7335. length = collection.length;
  7336. for ( ; index < length; index++ ) {
  7337. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  7338. // we're done with this property
  7339. return tween;
  7340. }
  7341. }
  7342. }
  7343. function defaultPrefilter( elem, props, opts ) {
  7344. /* jshint validthis: true */
  7345. var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
  7346. anim = this,
  7347. orig = {},
  7348. style = elem.style,
  7349. hidden = elem.nodeType && isHidden( elem ),
  7350. dataShow = jQuery._data( elem, "fxshow" );
  7351. // handle queue: false promises
  7352. if ( !opts.queue ) {
  7353. hooks = jQuery._queueHooks( elem, "fx" );
  7354. if ( hooks.unqueued == null ) {
  7355. hooks.unqueued = 0;
  7356. oldfire = hooks.empty.fire;
  7357. hooks.empty.fire = function() {
  7358. if ( !hooks.unqueued ) {
  7359. oldfire();
  7360. }
  7361. };
  7362. }
  7363. hooks.unqueued++;
  7364. anim.always( function() {
  7365. // doing this makes sure that the complete handler will be called
  7366. // before this completes
  7367. anim.always( function() {
  7368. hooks.unqueued--;
  7369. if ( !jQuery.queue( elem, "fx" ).length ) {
  7370. hooks.empty.fire();
  7371. }
  7372. } );
  7373. } );
  7374. }
  7375. // height/width overflow pass
  7376. if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
  7377. // Make sure that nothing sneaks out
  7378. // Record all 3 overflow attributes because IE does not
  7379. // change the overflow attribute when overflowX and
  7380. // overflowY are set to the same value
  7381. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  7382. // Set display property to inline-block for height/width
  7383. // animations on inline elements that are having width/height animated
  7384. display = jQuery.css( elem, "display" );
  7385. // Test default display if display is currently "none"
  7386. checkDisplay = display === "none" ?
  7387. jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
  7388. if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
  7389. // inline-level elements accept inline-block;
  7390. // block-level elements need to be inline with layout
  7391. if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
  7392. style.display = "inline-block";
  7393. } else {
  7394. style.zoom = 1;
  7395. }
  7396. }
  7397. }
  7398. if ( opts.overflow ) {
  7399. style.overflow = "hidden";
  7400. if ( !support.shrinkWrapBlocks() ) {
  7401. anim.always( function() {
  7402. style.overflow = opts.overflow[ 0 ];
  7403. style.overflowX = opts.overflow[ 1 ];
  7404. style.overflowY = opts.overflow[ 2 ];
  7405. } );
  7406. }
  7407. }
  7408. // show/hide pass
  7409. for ( prop in props ) {
  7410. value = props[ prop ];
  7411. if ( rfxtypes.exec( value ) ) {
  7412. delete props[ prop ];
  7413. toggle = toggle || value === "toggle";
  7414. if ( value === ( hidden ? "hide" : "show" ) ) {
  7415. // If there is dataShow left over from a stopped hide or show
  7416. // and we are going to proceed with show, we should pretend to be hidden
  7417. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  7418. hidden = true;
  7419. } else {
  7420. continue;
  7421. }
  7422. }
  7423. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  7424. // Any non-fx value stops us from restoring the original display value
  7425. } else {
  7426. display = undefined;
  7427. }
  7428. }
  7429. if ( !jQuery.isEmptyObject( orig ) ) {
  7430. if ( dataShow ) {
  7431. if ( "hidden" in dataShow ) {
  7432. hidden = dataShow.hidden;
  7433. }
  7434. } else {
  7435. dataShow = jQuery._data( elem, "fxshow", {} );
  7436. }
  7437. // store state if its toggle - enables .stop().toggle() to "reverse"
  7438. if ( toggle ) {
  7439. dataShow.hidden = !hidden;
  7440. }
  7441. if ( hidden ) {
  7442. jQuery( elem ).show();
  7443. } else {
  7444. anim.done( function() {
  7445. jQuery( elem ).hide();
  7446. } );
  7447. }
  7448. anim.done( function() {
  7449. var prop;
  7450. jQuery._removeData( elem, "fxshow" );
  7451. for ( prop in orig ) {
  7452. jQuery.style( elem, prop, orig[ prop ] );
  7453. }
  7454. } );
  7455. for ( prop in orig ) {
  7456. tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  7457. if ( !( prop in dataShow ) ) {
  7458. dataShow[ prop ] = tween.start;
  7459. if ( hidden ) {
  7460. tween.end = tween.start;
  7461. tween.start = prop === "width" || prop === "height" ? 1 : 0;
  7462. }
  7463. }
  7464. }
  7465. // If this is a noop like .hide().hide(), restore an overwritten display value
  7466. } else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : display ) === "inline" ) {
  7467. style.display = display;
  7468. }
  7469. }
  7470. function propFilter( props, specialEasing ) {
  7471. var index, name, easing, value, hooks;
  7472. // camelCase, specialEasing and expand cssHook pass
  7473. for ( index in props ) {
  7474. name = jQuery.camelCase( index );
  7475. easing = specialEasing[ name ];
  7476. value = props[ index ];
  7477. if ( jQuery.isArray( value ) ) {
  7478. easing = value[ 1 ];
  7479. value = props[ index ] = value[ 0 ];
  7480. }
  7481. if ( index !== name ) {
  7482. props[ name ] = value;
  7483. delete props[ index ];
  7484. }
  7485. hooks = jQuery.cssHooks[ name ];
  7486. if ( hooks && "expand" in hooks ) {
  7487. value = hooks.expand( value );
  7488. delete props[ name ];
  7489. // not quite $.extend, this wont overwrite keys already present.
  7490. // also - reusing 'index' from above because we have the correct "name"
  7491. for ( index in value ) {
  7492. if ( !( index in props ) ) {
  7493. props[ index ] = value[ index ];
  7494. specialEasing[ index ] = easing;
  7495. }
  7496. }
  7497. } else {
  7498. specialEasing[ name ] = easing;
  7499. }
  7500. }
  7501. }
  7502. function Animation( elem, properties, options ) {
  7503. var result,
  7504. stopped,
  7505. index = 0,
  7506. length = Animation.prefilters.length,
  7507. deferred = jQuery.Deferred().always( function() {
  7508. // don't match elem in the :animated selector
  7509. delete tick.elem;
  7510. } ),
  7511. tick = function() {
  7512. if ( stopped ) {
  7513. return false;
  7514. }
  7515. var currentTime = fxNow || createFxNow(),
  7516. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  7517. // Support: Android 2.3
  7518. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  7519. temp = remaining / animation.duration || 0,
  7520. percent = 1 - temp,
  7521. index = 0,
  7522. length = animation.tweens.length;
  7523. for ( ; index < length ; index++ ) {
  7524. animation.tweens[ index ].run( percent );
  7525. }
  7526. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  7527. if ( percent < 1 && length ) {
  7528. return remaining;
  7529. } else {
  7530. deferred.resolveWith( elem, [ animation ] );
  7531. return false;
  7532. }
  7533. },
  7534. animation = deferred.promise( {
  7535. elem: elem,
  7536. props: jQuery.extend( {}, properties ),
  7537. opts: jQuery.extend( true, {
  7538. specialEasing: {},
  7539. easing: jQuery.easing._default
  7540. }, options ),
  7541. originalProperties: properties,
  7542. originalOptions: options,
  7543. startTime: fxNow || createFxNow(),
  7544. duration: options.duration,
  7545. tweens: [],
  7546. createTween: function( prop, end ) {
  7547. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  7548. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  7549. animation.tweens.push( tween );
  7550. return tween;
  7551. },
  7552. stop: function( gotoEnd ) {
  7553. var index = 0,
  7554. // if we are going to the end, we want to run all the tweens
  7555. // otherwise we skip this part
  7556. length = gotoEnd ? animation.tweens.length : 0;
  7557. if ( stopped ) {
  7558. return this;
  7559. }
  7560. stopped = true;
  7561. for ( ; index < length ; index++ ) {
  7562. animation.tweens[ index ].run( 1 );
  7563. }
  7564. // resolve when we played the last frame
  7565. // otherwise, reject
  7566. if ( gotoEnd ) {
  7567. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  7568. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  7569. } else {
  7570. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  7571. }
  7572. return this;
  7573. }
  7574. } ),
  7575. props = animation.props;
  7576. propFilter( props, animation.opts.specialEasing );
  7577. for ( ; index < length ; index++ ) {
  7578. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  7579. if ( result ) {
  7580. if ( jQuery.isFunction( result.stop ) ) {
  7581. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  7582. jQuery.proxy( result.stop, result );
  7583. }
  7584. return result;
  7585. }
  7586. }
  7587. jQuery.map( props, createTween, animation );
  7588. if ( jQuery.isFunction( animation.opts.start ) ) {
  7589. animation.opts.start.call( elem, animation );
  7590. }
  7591. jQuery.fx.timer(
  7592. jQuery.extend( tick, {
  7593. elem: elem,
  7594. anim: animation,
  7595. queue: animation.opts.queue
  7596. } )
  7597. );
  7598. // attach callbacks from options
  7599. return animation.progress( animation.opts.progress )
  7600. .done( animation.opts.done, animation.opts.complete )
  7601. .fail( animation.opts.fail )
  7602. .always( animation.opts.always );
  7603. }
  7604. jQuery.Animation = jQuery.extend( Animation, {
  7605. tweeners: {
  7606. "*": [ function( prop, value ) {
  7607. var tween = this.createTween( prop, value );
  7608. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  7609. return tween;
  7610. } ]
  7611. },
  7612. tweener: function( props, callback ) {
  7613. if ( jQuery.isFunction( props ) ) {
  7614. callback = props;
  7615. props = [ "*" ];
  7616. } else {
  7617. props = props.match( rnotwhite );
  7618. }
  7619. var prop,
  7620. index = 0,
  7621. length = props.length;
  7622. for ( ; index < length ; index++ ) {
  7623. prop = props[ index ];
  7624. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  7625. Animation.tweeners[ prop ].unshift( callback );
  7626. }
  7627. },
  7628. prefilters: [ defaultPrefilter ],
  7629. prefilter: function( callback, prepend ) {
  7630. if ( prepend ) {
  7631. Animation.prefilters.unshift( callback );
  7632. } else {
  7633. Animation.prefilters.push( callback );
  7634. }
  7635. }
  7636. } );
  7637. jQuery.speed = function( speed, easing, fn ) {
  7638. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  7639. complete: fn || !fn && easing ||
  7640. jQuery.isFunction( speed ) && speed,
  7641. duration: speed,
  7642. easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
  7643. };
  7644. opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
  7645. opt.duration in jQuery.fx.speeds ?
  7646. jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
  7647. // normalize opt.queue - true/undefined/null -> "fx"
  7648. if ( opt.queue == null || opt.queue === true ) {
  7649. opt.queue = "fx";
  7650. }
  7651. // Queueing
  7652. opt.old = opt.complete;
  7653. opt.complete = function() {
  7654. if ( jQuery.isFunction( opt.old ) ) {
  7655. opt.old.call( this );
  7656. }
  7657. if ( opt.queue ) {
  7658. jQuery.dequeue( this, opt.queue );
  7659. }
  7660. };
  7661. return opt;
  7662. };
  7663. jQuery.fn.extend( {
  7664. fadeTo: function( speed, to, easing, callback ) {
  7665. // show any hidden elements after setting opacity to 0
  7666. return this.filter( isHidden ).css( "opacity", 0 ).show()
  7667. // animate to the value specified
  7668. .end().animate( { opacity: to }, speed, easing, callback );
  7669. },
  7670. animate: function( prop, speed, easing, callback ) {
  7671. var empty = jQuery.isEmptyObject( prop ),
  7672. optall = jQuery.speed( speed, easing, callback ),
  7673. doAnimation = function() {
  7674. // Operate on a copy of prop so per-property easing won't be lost
  7675. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  7676. // Empty animations, or finishing resolves immediately
  7677. if ( empty || jQuery._data( this, "finish" ) ) {
  7678. anim.stop( true );
  7679. }
  7680. };
  7681. doAnimation.finish = doAnimation;
  7682. return empty || optall.queue === false ?
  7683. this.each( doAnimation ) :
  7684. this.queue( optall.queue, doAnimation );
  7685. },
  7686. stop: function( type, clearQueue, gotoEnd ) {
  7687. var stopQueue = function( hooks ) {
  7688. var stop = hooks.stop;
  7689. delete hooks.stop;
  7690. stop( gotoEnd );
  7691. };
  7692. if ( typeof type !== "string" ) {
  7693. gotoEnd = clearQueue;
  7694. clearQueue = type;
  7695. type = undefined;
  7696. }
  7697. if ( clearQueue && type !== false ) {
  7698. this.queue( type || "fx", [] );
  7699. }
  7700. return this.each( function() {
  7701. var dequeue = true,
  7702. index = type != null && type + "queueHooks",
  7703. timers = jQuery.timers,
  7704. data = jQuery._data( this );
  7705. if ( index ) {
  7706. if ( data[ index ] && data[ index ].stop ) {
  7707. stopQueue( data[ index ] );
  7708. }
  7709. } else {
  7710. for ( index in data ) {
  7711. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  7712. stopQueue( data[ index ] );
  7713. }
  7714. }
  7715. }
  7716. for ( index = timers.length; index--; ) {
  7717. if ( timers[ index ].elem === this &&
  7718. ( type == null || timers[ index ].queue === type ) ) {
  7719. timers[ index ].anim.stop( gotoEnd );
  7720. dequeue = false;
  7721. timers.splice( index, 1 );
  7722. }
  7723. }
  7724. // start the next in the queue if the last step wasn't forced
  7725. // timers currently will call their complete callbacks, which will dequeue
  7726. // but only if they were gotoEnd
  7727. if ( dequeue || !gotoEnd ) {
  7728. jQuery.dequeue( this, type );
  7729. }
  7730. } );
  7731. },
  7732. finish: function( type ) {
  7733. if ( type !== false ) {
  7734. type = type || "fx";
  7735. }
  7736. return this.each( function() {
  7737. var index,
  7738. data = jQuery._data( this ),
  7739. queue = data[ type + "queue" ],
  7740. hooks = data[ type + "queueHooks" ],
  7741. timers = jQuery.timers,
  7742. length = queue ? queue.length : 0;
  7743. // enable finishing flag on private data
  7744. data.finish = true;
  7745. // empty the queue first
  7746. jQuery.queue( this, type, [] );
  7747. if ( hooks && hooks.stop ) {
  7748. hooks.stop.call( this, true );
  7749. }
  7750. // look for any active animations, and finish them
  7751. for ( index = timers.length; index--; ) {
  7752. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  7753. timers[ index ].anim.stop( true );
  7754. timers.splice( index, 1 );
  7755. }
  7756. }
  7757. // look for any animations in the old queue and finish them
  7758. for ( index = 0; index < length; index++ ) {
  7759. if ( queue[ index ] && queue[ index ].finish ) {
  7760. queue[ index ].finish.call( this );
  7761. }
  7762. }
  7763. // turn off finishing flag
  7764. delete data.finish;
  7765. } );
  7766. }
  7767. } );
  7768. jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
  7769. var cssFn = jQuery.fn[ name ];
  7770. jQuery.fn[ name ] = function( speed, easing, callback ) {
  7771. return speed == null || typeof speed === "boolean" ?
  7772. cssFn.apply( this, arguments ) :
  7773. this.animate( genFx( name, true ), speed, easing, callback );
  7774. };
  7775. } );
  7776. // Generate shortcuts for custom animations
  7777. jQuery.each( {
  7778. slideDown: genFx( "show" ),
  7779. slideUp: genFx( "hide" ),
  7780. slideToggle: genFx( "toggle" ),
  7781. fadeIn: { opacity: "show" },
  7782. fadeOut: { opacity: "hide" },
  7783. fadeToggle: { opacity: "toggle" }
  7784. }, function( name, props ) {
  7785. jQuery.fn[ name ] = function( speed, easing, callback ) {
  7786. return this.animate( props, speed, easing, callback );
  7787. };
  7788. } );
  7789. jQuery.timers = [];
  7790. jQuery.fx.tick = function() {
  7791. var timer,
  7792. timers = jQuery.timers,
  7793. i = 0;
  7794. fxNow = jQuery.now();
  7795. for ( ; i < timers.length; i++ ) {
  7796. timer = timers[ i ];
  7797. // Checks the timer has not already been removed
  7798. if ( !timer() && timers[ i ] === timer ) {
  7799. timers.splice( i--, 1 );
  7800. }
  7801. }
  7802. if ( !timers.length ) {
  7803. jQuery.fx.stop();
  7804. }
  7805. fxNow = undefined;
  7806. };
  7807. jQuery.fx.timer = function( timer ) {
  7808. jQuery.timers.push( timer );
  7809. if ( timer() ) {
  7810. jQuery.fx.start();
  7811. } else {
  7812. jQuery.timers.pop();
  7813. }
  7814. };
  7815. jQuery.fx.interval = 13;
  7816. jQuery.fx.start = function() {
  7817. if ( !timerId ) {
  7818. timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
  7819. }
  7820. };
  7821. jQuery.fx.stop = function() {
  7822. window.clearInterval( timerId );
  7823. timerId = null;
  7824. };
  7825. jQuery.fx.speeds = {
  7826. slow: 600,
  7827. fast: 200,
  7828. // Default speed
  7829. _default: 400
  7830. };
  7831. // Based off of the plugin by Clint Helfers, with permission.
  7832. // http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
  7833. jQuery.fn.delay = function( time, type ) {
  7834. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  7835. type = type || "fx";
  7836. return this.queue( type, function( next, hooks ) {
  7837. var timeout = window.setTimeout( next, time );
  7838. hooks.stop = function() {
  7839. window.clearTimeout( timeout );
  7840. };
  7841. } );
  7842. };
  7843. ( function() {
  7844. var a,
  7845. input = document.createElement( "input" ),
  7846. div = document.createElement( "div" ),
  7847. select = document.createElement( "select" ),
  7848. opt = select.appendChild( document.createElement( "option" ) );
  7849. // Setup
  7850. div = document.createElement( "div" );
  7851. div.setAttribute( "className", "t" );
  7852. div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
  7853. a = div.getElementsByTagName( "a" )[ 0 ];
  7854. // Support: Windows Web Apps (WWA)
  7855. // `type` must use .setAttribute for WWA (#14901)
  7856. input.setAttribute( "type", "checkbox" );
  7857. div.appendChild( input );
  7858. a = div.getElementsByTagName( "a" )[ 0 ];
  7859. // First batch of tests.
  7860. a.style.cssText = "top:1px";
  7861. // Test setAttribute on camelCase class.
  7862. // If it works, we need attrFixes when doing get/setAttribute (ie6/7)
  7863. support.getSetAttribute = div.className !== "t";
  7864. // Get the style information from getAttribute
  7865. // (IE uses .cssText instead)
  7866. support.style = /top/.test( a.getAttribute( "style" ) );
  7867. // Make sure that URLs aren't manipulated
  7868. // (IE normalizes it by default)
  7869. support.hrefNormalized = a.getAttribute( "href" ) === "/a";
  7870. // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
  7871. support.checkOn = !!input.value;
  7872. // Make sure that a selected-by-default option has a working selected property.
  7873. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
  7874. support.optSelected = opt.selected;
  7875. // Tests for enctype support on a form (#6743)
  7876. support.enctype = !!document.createElement( "form" ).enctype;
  7877. // Make sure that the options inside disabled selects aren't marked as disabled
  7878. // (WebKit marks them as disabled)
  7879. select.disabled = true;
  7880. support.optDisabled = !opt.disabled;
  7881. // Support: IE8 only
  7882. // Check if we can trust getAttribute("value")
  7883. input = document.createElement( "input" );
  7884. input.setAttribute( "value", "" );
  7885. support.input = input.getAttribute( "value" ) === "";
  7886. // Check if an input maintains its value after becoming a radio
  7887. input.value = "t";
  7888. input.setAttribute( "type", "radio" );
  7889. support.radioValue = input.value === "t";
  7890. } )();
  7891. var rreturn = /\r/g,
  7892. rspaces = /[\x20\t\r\n\f]+/g;
  7893. jQuery.fn.extend( {
  7894. val: function( value ) {
  7895. var hooks, ret, isFunction,
  7896. elem = this[ 0 ];
  7897. if ( !arguments.length ) {
  7898. if ( elem ) {
  7899. hooks = jQuery.valHooks[ elem.type ] ||
  7900. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  7901. if (
  7902. hooks &&
  7903. "get" in hooks &&
  7904. ( ret = hooks.get( elem, "value" ) ) !== undefined
  7905. ) {
  7906. return ret;
  7907. }
  7908. ret = elem.value;
  7909. return typeof ret === "string" ?
  7910. // handle most common string cases
  7911. ret.replace( rreturn, "" ) :
  7912. // handle cases where value is null/undef or number
  7913. ret == null ? "" : ret;
  7914. }
  7915. return;
  7916. }
  7917. isFunction = jQuery.isFunction( value );
  7918. return this.each( function( i ) {
  7919. var val;
  7920. if ( this.nodeType !== 1 ) {
  7921. return;
  7922. }
  7923. if ( isFunction ) {
  7924. val = value.call( this, i, jQuery( this ).val() );
  7925. } else {
  7926. val = value;
  7927. }
  7928. // Treat null/undefined as ""; convert numbers to string
  7929. if ( val == null ) {
  7930. val = "";
  7931. } else if ( typeof val === "number" ) {
  7932. val += "";
  7933. } else if ( jQuery.isArray( val ) ) {
  7934. val = jQuery.map( val, function( value ) {
  7935. return value == null ? "" : value + "";
  7936. } );
  7937. }
  7938. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  7939. // If set returns undefined, fall back to normal setting
  7940. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  7941. this.value = val;
  7942. }
  7943. } );
  7944. }
  7945. } );
  7946. jQuery.extend( {
  7947. valHooks: {
  7948. option: {
  7949. get: function( elem ) {
  7950. var val = jQuery.find.attr( elem, "value" );
  7951. return val != null ?
  7952. val :
  7953. // Support: IE10-11+
  7954. // option.text throws exceptions (#14686, #14858)
  7955. // Strip and collapse whitespace
  7956. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  7957. jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " );
  7958. }
  7959. },
  7960. select: {
  7961. get: function( elem ) {
  7962. var value, option,
  7963. options = elem.options,
  7964. index = elem.selectedIndex,
  7965. one = elem.type === "select-one" || index < 0,
  7966. values = one ? null : [],
  7967. max = one ? index + 1 : options.length,
  7968. i = index < 0 ?
  7969. max :
  7970. one ? index : 0;
  7971. // Loop through all the selected options
  7972. for ( ; i < max; i++ ) {
  7973. option = options[ i ];
  7974. // oldIE doesn't update selected after form reset (#2551)
  7975. if ( ( option.selected || i === index ) &&
  7976. // Don't return options that are disabled or in a disabled optgroup
  7977. ( support.optDisabled ?
  7978. !option.disabled :
  7979. option.getAttribute( "disabled" ) === null ) &&
  7980. ( !option.parentNode.disabled ||
  7981. !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
  7982. // Get the specific value for the option
  7983. value = jQuery( option ).val();
  7984. // We don't need an array for one selects
  7985. if ( one ) {
  7986. return value;
  7987. }
  7988. // Multi-Selects return an array
  7989. values.push( value );
  7990. }
  7991. }
  7992. return values;
  7993. },
  7994. set: function( elem, value ) {
  7995. var optionSet, option,
  7996. options = elem.options,
  7997. values = jQuery.makeArray( value ),
  7998. i = options.length;
  7999. while ( i-- ) {
  8000. option = options[ i ];
  8001. if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 ) {
  8002. // Support: IE6
  8003. // When new option element is added to select box we need to
  8004. // force reflow of newly added node in order to workaround delay
  8005. // of initialization properties
  8006. try {
  8007. option.selected = optionSet = true;
  8008. } catch ( _ ) {
  8009. // Will be executed only in IE6
  8010. option.scrollHeight;
  8011. }
  8012. } else {
  8013. option.selected = false;
  8014. }
  8015. }
  8016. // Force browsers to behave consistently when non-matching value is set
  8017. if ( !optionSet ) {
  8018. elem.selectedIndex = -1;
  8019. }
  8020. return options;
  8021. }
  8022. }
  8023. }
  8024. } );
  8025. // Radios and checkboxes getter/setter
  8026. jQuery.each( [ "radio", "checkbox" ], function() {
  8027. jQuery.valHooks[ this ] = {
  8028. set: function( elem, value ) {
  8029. if ( jQuery.isArray( value ) ) {
  8030. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  8031. }
  8032. }
  8033. };
  8034. if ( !support.checkOn ) {
  8035. jQuery.valHooks[ this ].get = function( elem ) {
  8036. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  8037. };
  8038. }
  8039. } );
  8040. var nodeHook, boolHook,
  8041. attrHandle = jQuery.expr.attrHandle,
  8042. ruseDefault = /^(?:checked|selected)$/i,
  8043. getSetAttribute = support.getSetAttribute,
  8044. getSetInput = support.input;
  8045. jQuery.fn.extend( {
  8046. attr: function( name, value ) {
  8047. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  8048. },
  8049. removeAttr: function( name ) {
  8050. return this.each( function() {
  8051. jQuery.removeAttr( this, name );
  8052. } );
  8053. }
  8054. } );
  8055. jQuery.extend( {
  8056. attr: function( elem, name, value ) {
  8057. var ret, hooks,
  8058. nType = elem.nodeType;
  8059. // Don't get/set attributes on text, comment and attribute nodes
  8060. if ( nType === 3 || nType === 8 || nType === 2 ) {
  8061. return;
  8062. }
  8063. // Fallback to prop when attributes are not supported
  8064. if ( typeof elem.getAttribute === "undefined" ) {
  8065. return jQuery.prop( elem, name, value );
  8066. }
  8067. // All attributes are lowercase
  8068. // Grab necessary hook if one is defined
  8069. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  8070. name = name.toLowerCase();
  8071. hooks = jQuery.attrHooks[ name ] ||
  8072. ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
  8073. }
  8074. if ( value !== undefined ) {
  8075. if ( value === null ) {
  8076. jQuery.removeAttr( elem, name );
  8077. return;
  8078. }
  8079. if ( hooks && "set" in hooks &&
  8080. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  8081. return ret;
  8082. }
  8083. elem.setAttribute( name, value + "" );
  8084. return value;
  8085. }
  8086. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  8087. return ret;
  8088. }
  8089. ret = jQuery.find.attr( elem, name );
  8090. // Non-existent attributes return null, we normalize to undefined
  8091. return ret == null ? undefined : ret;
  8092. },
  8093. attrHooks: {
  8094. type: {
  8095. set: function( elem, value ) {
  8096. if ( !support.radioValue && value === "radio" &&
  8097. jQuery.nodeName( elem, "input" ) ) {
  8098. // Setting the type on a radio button after the value resets the value in IE8-9
  8099. // Reset value to default in case type is set after value during creation
  8100. var val = elem.value;
  8101. elem.setAttribute( "type", value );
  8102. if ( val ) {
  8103. elem.value = val;
  8104. }
  8105. return value;
  8106. }
  8107. }
  8108. }
  8109. },
  8110. removeAttr: function( elem, value ) {
  8111. var name, propName,
  8112. i = 0,
  8113. attrNames = value && value.match( rnotwhite );
  8114. if ( attrNames && elem.nodeType === 1 ) {
  8115. while ( ( name = attrNames[ i++ ] ) ) {
  8116. propName = jQuery.propFix[ name ] || name;
  8117. // Boolean attributes get special treatment (#10870)
  8118. if ( jQuery.expr.match.bool.test( name ) ) {
  8119. // Set corresponding property to false
  8120. if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
  8121. elem[ propName ] = false;
  8122. // Support: IE<9
  8123. // Also clear defaultChecked/defaultSelected (if appropriate)
  8124. } else {
  8125. elem[ jQuery.camelCase( "default-" + name ) ] =
  8126. elem[ propName ] = false;
  8127. }
  8128. // See #9699 for explanation of this approach (setting first, then removal)
  8129. } else {
  8130. jQuery.attr( elem, name, "" );
  8131. }
  8132. elem.removeAttribute( getSetAttribute ? name : propName );
  8133. }
  8134. }
  8135. }
  8136. } );
  8137. // Hooks for boolean attributes
  8138. boolHook = {
  8139. set: function( elem, value, name ) {
  8140. if ( value === false ) {
  8141. // Remove boolean attributes when set to false
  8142. jQuery.removeAttr( elem, name );
  8143. } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
  8144. // IE<8 needs the *property* name
  8145. elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
  8146. } else {
  8147. // Support: IE<9
  8148. // Use defaultChecked and defaultSelected for oldIE
  8149. elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
  8150. }
  8151. return name;
  8152. }
  8153. };
  8154. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
  8155. var getter = attrHandle[ name ] || jQuery.find.attr;
  8156. if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
  8157. attrHandle[ name ] = function( elem, name, isXML ) {
  8158. var ret, handle;
  8159. if ( !isXML ) {
  8160. // Avoid an infinite loop by temporarily removing this function from the getter
  8161. handle = attrHandle[ name ];
  8162. attrHandle[ name ] = ret;
  8163. ret = getter( elem, name, isXML ) != null ?
  8164. name.toLowerCase() :
  8165. null;
  8166. attrHandle[ name ] = handle;
  8167. }
  8168. return ret;
  8169. };
  8170. } else {
  8171. attrHandle[ name ] = function( elem, name, isXML ) {
  8172. if ( !isXML ) {
  8173. return elem[ jQuery.camelCase( "default-" + name ) ] ?
  8174. name.toLowerCase() :
  8175. null;
  8176. }
  8177. };
  8178. }
  8179. } );
  8180. // fix oldIE attroperties
  8181. if ( !getSetInput || !getSetAttribute ) {
  8182. jQuery.attrHooks.value = {
  8183. set: function( elem, value, name ) {
  8184. if ( jQuery.nodeName( elem, "input" ) ) {
  8185. // Does not return so that setAttribute is also used
  8186. elem.defaultValue = value;
  8187. } else {
  8188. // Use nodeHook if defined (#1954); otherwise setAttribute is fine
  8189. return nodeHook && nodeHook.set( elem, value, name );
  8190. }
  8191. }
  8192. };
  8193. }
  8194. // IE6/7 do not support getting/setting some attributes with get/setAttribute
  8195. if ( !getSetAttribute ) {
  8196. // Use this for any attribute in IE6/7
  8197. // This fixes almost every IE6/7 issue
  8198. nodeHook = {
  8199. set: function( elem, value, name ) {
  8200. // Set the existing or create a new attribute node
  8201. var ret = elem.getAttributeNode( name );
  8202. if ( !ret ) {
  8203. elem.setAttributeNode(
  8204. ( ret = elem.ownerDocument.createAttribute( name ) )
  8205. );
  8206. }
  8207. ret.value = value += "";
  8208. // Break association with cloned elements by also using setAttribute (#9646)
  8209. if ( name === "value" || value === elem.getAttribute( name ) ) {
  8210. return value;
  8211. }
  8212. }
  8213. };
  8214. // Some attributes are constructed with empty-string values when not defined
  8215. attrHandle.id = attrHandle.name = attrHandle.coords =
  8216. function( elem, name, isXML ) {
  8217. var ret;
  8218. if ( !isXML ) {
  8219. return ( ret = elem.getAttributeNode( name ) ) && ret.value !== "" ?
  8220. ret.value :
  8221. null;
  8222. }
  8223. };
  8224. // Fixing value retrieval on a button requires this module
  8225. jQuery.valHooks.button = {
  8226. get: function( elem, name ) {
  8227. var ret = elem.getAttributeNode( name );
  8228. if ( ret && ret.specified ) {
  8229. return ret.value;
  8230. }
  8231. },
  8232. set: nodeHook.set
  8233. };
  8234. // Set contenteditable to false on removals(#10429)
  8235. // Setting to empty string throws an error as an invalid value
  8236. jQuery.attrHooks.contenteditable = {
  8237. set: function( elem, value, name ) {
  8238. nodeHook.set( elem, value === "" ? false : value, name );
  8239. }
  8240. };
  8241. // Set width and height to auto instead of 0 on empty string( Bug #8150 )
  8242. // This is for removals
  8243. jQuery.each( [ "width", "height" ], function( i, name ) {
  8244. jQuery.attrHooks[ name ] = {
  8245. set: function( elem, value ) {
  8246. if ( value === "" ) {
  8247. elem.setAttribute( name, "auto" );
  8248. return value;
  8249. }
  8250. }
  8251. };
  8252. } );
  8253. }
  8254. if ( !support.style ) {
  8255. jQuery.attrHooks.style = {
  8256. get: function( elem ) {
  8257. // Return undefined in the case of empty string
  8258. // Note: IE uppercases css property names, but if we were to .toLowerCase()
  8259. // .cssText, that would destroy case sensitivity in URL's, like in "background"
  8260. return elem.style.cssText || undefined;
  8261. },
  8262. set: function( elem, value ) {
  8263. return ( elem.style.cssText = value + "" );
  8264. }
  8265. };
  8266. }
  8267. var rfocusable = /^(?:input|select|textarea|button|object)$/i,
  8268. rclickable = /^(?:a|area)$/i;
  8269. jQuery.fn.extend( {
  8270. prop: function( name, value ) {
  8271. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  8272. },
  8273. removeProp: function( name ) {
  8274. name = jQuery.propFix[ name ] || name;
  8275. return this.each( function() {
  8276. // try/catch handles cases where IE balks (such as removing a property on window)
  8277. try {
  8278. this[ name ] = undefined;
  8279. delete this[ name ];
  8280. } catch ( e ) {}
  8281. } );
  8282. }
  8283. } );
  8284. jQuery.extend( {
  8285. prop: function( elem, name, value ) {
  8286. var ret, hooks,
  8287. nType = elem.nodeType;
  8288. // Don't get/set properties on text, comment and attribute nodes
  8289. if ( nType === 3 || nType === 8 || nType === 2 ) {
  8290. return;
  8291. }
  8292. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  8293. // Fix name and attach hooks
  8294. name = jQuery.propFix[ name ] || name;
  8295. hooks = jQuery.propHooks[ name ];
  8296. }
  8297. if ( value !== undefined ) {
  8298. if ( hooks && "set" in hooks &&
  8299. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  8300. return ret;
  8301. }
  8302. return ( elem[ name ] = value );
  8303. }
  8304. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  8305. return ret;
  8306. }
  8307. return elem[ name ];
  8308. },
  8309. propHooks: {
  8310. tabIndex: {
  8311. get: function( elem ) {
  8312. // elem.tabIndex doesn't always return the
  8313. // correct value when it hasn't been explicitly set
  8314. // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  8315. // Use proper attribute retrieval(#12072)
  8316. var tabindex = jQuery.find.attr( elem, "tabindex" );
  8317. return tabindex ?
  8318. parseInt( tabindex, 10 ) :
  8319. rfocusable.test( elem.nodeName ) ||
  8320. rclickable.test( elem.nodeName ) && elem.href ?
  8321. 0 :
  8322. -1;
  8323. }
  8324. }
  8325. },
  8326. propFix: {
  8327. "for": "htmlFor",
  8328. "class": "className"
  8329. }
  8330. } );
  8331. // Some attributes require a special call on IE
  8332. // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  8333. if ( !support.hrefNormalized ) {
  8334. // href/src property should get the full normalized URL (#10299/#12915)
  8335. jQuery.each( [ "href", "src" ], function( i, name ) {
  8336. jQuery.propHooks[ name ] = {
  8337. get: function( elem ) {
  8338. return elem.getAttribute( name, 4 );
  8339. }
  8340. };
  8341. } );
  8342. }
  8343. // Support: Safari, IE9+
  8344. // Accessing the selectedIndex property
  8345. // forces the browser to respect setting selected
  8346. // on the option
  8347. // The getter ensures a default option is selected
  8348. // when in an optgroup
  8349. if ( !support.optSelected ) {
  8350. jQuery.propHooks.selected = {
  8351. get: function( elem ) {
  8352. var parent = elem.parentNode;
  8353. if ( parent ) {
  8354. parent.selectedIndex;
  8355. // Make sure that it also works with optgroups, see #5701
  8356. if ( parent.parentNode ) {
  8357. parent.parentNode.selectedIndex;
  8358. }
  8359. }
  8360. return null;
  8361. },
  8362. set: function( elem ) {
  8363. var parent = elem.parentNode;
  8364. if ( parent ) {
  8365. parent.selectedIndex;
  8366. if ( parent.parentNode ) {
  8367. parent.parentNode.selectedIndex;
  8368. }
  8369. }
  8370. }
  8371. };
  8372. }
  8373. jQuery.each( [
  8374. "tabIndex",
  8375. "readOnly",
  8376. "maxLength",
  8377. "cellSpacing",
  8378. "cellPadding",
  8379. "rowSpan",
  8380. "colSpan",
  8381. "useMap",
  8382. "frameBorder",
  8383. "contentEditable"
  8384. ], function() {
  8385. jQuery.propFix[ this.toLowerCase() ] = this;
  8386. } );
  8387. // IE6/7 call enctype encoding
  8388. if ( !support.enctype ) {
  8389. jQuery.propFix.enctype = "encoding";
  8390. }
  8391. var rclass = /[\t\r\n\f]/g;
  8392. function getClass( elem ) {
  8393. return jQuery.attr( elem, "class" ) || "";
  8394. }
  8395. jQuery.fn.extend( {
  8396. addClass: function( value ) {
  8397. var classes, elem, cur, curValue, clazz, j, finalValue,
  8398. i = 0;
  8399. if ( jQuery.isFunction( value ) ) {
  8400. return this.each( function( j ) {
  8401. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  8402. } );
  8403. }
  8404. if ( typeof value === "string" && value ) {
  8405. classes = value.match( rnotwhite ) || [];
  8406. while ( ( elem = this[ i++ ] ) ) {
  8407. curValue = getClass( elem );
  8408. cur = elem.nodeType === 1 &&
  8409. ( " " + curValue + " " ).replace( rclass, " " );
  8410. if ( cur ) {
  8411. j = 0;
  8412. while ( ( clazz = classes[ j++ ] ) ) {
  8413. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  8414. cur += clazz + " ";
  8415. }
  8416. }
  8417. // only assign if different to avoid unneeded rendering.
  8418. finalValue = jQuery.trim( cur );
  8419. if ( curValue !== finalValue ) {
  8420. jQuery.attr( elem, "class", finalValue );
  8421. }
  8422. }
  8423. }
  8424. }
  8425. return this;
  8426. },
  8427. removeClass: function( value ) {
  8428. var classes, elem, cur, curValue, clazz, j, finalValue,
  8429. i = 0;
  8430. if ( jQuery.isFunction( value ) ) {
  8431. return this.each( function( j ) {
  8432. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  8433. } );
  8434. }
  8435. if ( !arguments.length ) {
  8436. return this.attr( "class", "" );
  8437. }
  8438. if ( typeof value === "string" && value ) {
  8439. classes = value.match( rnotwhite ) || [];
  8440. while ( ( elem = this[ i++ ] ) ) {
  8441. curValue = getClass( elem );
  8442. // This expression is here for better compressibility (see addClass)
  8443. cur = elem.nodeType === 1 &&
  8444. ( " " + curValue + " " ).replace( rclass, " " );
  8445. if ( cur ) {
  8446. j = 0;
  8447. while ( ( clazz = classes[ j++ ] ) ) {
  8448. // Remove *all* instances
  8449. while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
  8450. cur = cur.replace( " " + clazz + " ", " " );
  8451. }
  8452. }
  8453. // Only assign if different to avoid unneeded rendering.
  8454. finalValue = jQuery.trim( cur );
  8455. if ( curValue !== finalValue ) {
  8456. jQuery.attr( elem, "class", finalValue );
  8457. }
  8458. }
  8459. }
  8460. }
  8461. return this;
  8462. },
  8463. toggleClass: function( value, stateVal ) {
  8464. var type = typeof value;
  8465. if ( typeof stateVal === "boolean" && type === "string" ) {
  8466. return stateVal ? this.addClass( value ) : this.removeClass( value );
  8467. }
  8468. if ( jQuery.isFunction( value ) ) {
  8469. return this.each( function( i ) {
  8470. jQuery( this ).toggleClass(
  8471. value.call( this, i, getClass( this ), stateVal ),
  8472. stateVal
  8473. );
  8474. } );
  8475. }
  8476. return this.each( function() {
  8477. var className, i, self, classNames;
  8478. if ( type === "string" ) {
  8479. // Toggle individual class names
  8480. i = 0;
  8481. self = jQuery( this );
  8482. classNames = value.match( rnotwhite ) || [];
  8483. while ( ( className = classNames[ i++ ] ) ) {
  8484. // Check each className given, space separated list
  8485. if ( self.hasClass( className ) ) {
  8486. self.removeClass( className );
  8487. } else {
  8488. self.addClass( className );
  8489. }
  8490. }
  8491. // Toggle whole class name
  8492. } else if ( value === undefined || type === "boolean" ) {
  8493. className = getClass( this );
  8494. if ( className ) {
  8495. // store className if set
  8496. jQuery._data( this, "__className__", className );
  8497. }
  8498. // If the element has a class name or if we're passed "false",
  8499. // then remove the whole classname (if there was one, the above saved it).
  8500. // Otherwise bring back whatever was previously saved (if anything),
  8501. // falling back to the empty string if nothing was stored.
  8502. jQuery.attr( this, "class",
  8503. className || value === false ?
  8504. "" :
  8505. jQuery._data( this, "__className__" ) || ""
  8506. );
  8507. }
  8508. } );
  8509. },
  8510. hasClass: function( selector ) {
  8511. var className, elem,
  8512. i = 0;
  8513. className = " " + selector + " ";
  8514. while ( ( elem = this[ i++ ] ) ) {
  8515. if ( elem.nodeType === 1 &&
  8516. ( " " + getClass( elem ) + " " ).replace( rclass, " " )
  8517. .indexOf( className ) > -1
  8518. ) {
  8519. return true;
  8520. }
  8521. }
  8522. return false;
  8523. }
  8524. } );
  8525. // Return jQuery for attributes-only inclusion
  8526. jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " +
  8527. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  8528. "change select submit keydown keypress keyup error contextmenu" ).split( " " ),
  8529. function( i, name ) {
  8530. // Handle event binding
  8531. jQuery.fn[ name ] = function( data, fn ) {
  8532. return arguments.length > 0 ?
  8533. this.on( name, null, data, fn ) :
  8534. this.trigger( name );
  8535. };
  8536. } );
  8537. jQuery.fn.extend( {
  8538. hover: function( fnOver, fnOut ) {
  8539. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  8540. }
  8541. } );
  8542. var location = window.location;
  8543. var nonce = jQuery.now();
  8544. var rquery = ( /\?/ );
  8545. var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
  8546. jQuery.parseJSON = function( data ) {
  8547. // Attempt to parse using the native JSON parser first
  8548. if ( window.JSON && window.JSON.parse ) {
  8549. // Support: Android 2.3
  8550. // Workaround failure to string-cast null input
  8551. return window.JSON.parse( data + "" );
  8552. }
  8553. var requireNonComma,
  8554. depth = null,
  8555. str = jQuery.trim( data + "" );
  8556. // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
  8557. // after removing valid tokens
  8558. return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
  8559. // Force termination if we see a misplaced comma
  8560. if ( requireNonComma && comma ) {
  8561. depth = 0;
  8562. }
  8563. // Perform no more replacements after returning to outermost depth
  8564. if ( depth === 0 ) {
  8565. return token;
  8566. }
  8567. // Commas must not follow "[", "{", or ","
  8568. requireNonComma = open || comma;
  8569. // Determine new depth
  8570. // array/object open ("[" or "{"): depth += true - false (increment)
  8571. // array/object close ("]" or "}"): depth += false - true (decrement)
  8572. // other cases ("," or primitive): depth += true - true (numeric cast)
  8573. depth += !close - !open;
  8574. // Remove this token
  8575. return "";
  8576. } ) ) ?
  8577. ( Function( "return " + str ) )() :
  8578. jQuery.error( "Invalid JSON: " + data );
  8579. };
  8580. // Cross-browser xml parsing
  8581. jQuery.parseXML = function( data ) {
  8582. var xml, tmp;
  8583. if ( !data || typeof data !== "string" ) {
  8584. return null;
  8585. }
  8586. try {
  8587. if ( window.DOMParser ) { // Standard
  8588. tmp = new window.DOMParser();
  8589. xml = tmp.parseFromString( data, "text/xml" );
  8590. } else { // IE
  8591. xml = new window.ActiveXObject( "Microsoft.XMLDOM" );
  8592. xml.async = "false";
  8593. xml.loadXML( data );
  8594. }
  8595. } catch ( e ) {
  8596. xml = undefined;
  8597. }
  8598. if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
  8599. jQuery.error( "Invalid XML: " + data );
  8600. }
  8601. return xml;
  8602. };
  8603. var
  8604. rhash = /#.*$/,
  8605. rts = /([?&])_=[^&]*/,
  8606. // IE leaves an \r character at EOL
  8607. rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg,
  8608. // #7653, #8125, #8152: local protocol detection
  8609. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  8610. rnoContent = /^(?:GET|HEAD)$/,
  8611. rprotocol = /^\/\//,
  8612. rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
  8613. /* Prefilters
  8614. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  8615. * 2) These are called:
  8616. * - BEFORE asking for a transport
  8617. * - AFTER param serialization (s.data is a string if s.processData is true)
  8618. * 3) key is the dataType
  8619. * 4) the catchall symbol "*" can be used
  8620. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  8621. */
  8622. prefilters = {},
  8623. /* Transports bindings
  8624. * 1) key is the dataType
  8625. * 2) the catchall symbol "*" can be used
  8626. * 3) selection will start with transport dataType and THEN go to "*" if needed
  8627. */
  8628. transports = {},
  8629. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  8630. allTypes = "*/".concat( "*" ),
  8631. // Document location
  8632. ajaxLocation = location.href,
  8633. // Segment location into parts
  8634. ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
  8635. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  8636. function addToPrefiltersOrTransports( structure ) {
  8637. // dataTypeExpression is optional and defaults to "*"
  8638. return function( dataTypeExpression, func ) {
  8639. if ( typeof dataTypeExpression !== "string" ) {
  8640. func = dataTypeExpression;
  8641. dataTypeExpression = "*";
  8642. }
  8643. var dataType,
  8644. i = 0,
  8645. dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
  8646. if ( jQuery.isFunction( func ) ) {
  8647. // For each dataType in the dataTypeExpression
  8648. while ( ( dataType = dataTypes[ i++ ] ) ) {
  8649. // Prepend if requested
  8650. if ( dataType.charAt( 0 ) === "+" ) {
  8651. dataType = dataType.slice( 1 ) || "*";
  8652. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  8653. // Otherwise append
  8654. } else {
  8655. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  8656. }
  8657. }
  8658. }
  8659. };
  8660. }
  8661. // Base inspection function for prefilters and transports
  8662. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  8663. var inspected = {},
  8664. seekingTransport = ( structure === transports );
  8665. function inspect( dataType ) {
  8666. var selected;
  8667. inspected[ dataType ] = true;
  8668. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  8669. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  8670. if ( typeof dataTypeOrTransport === "string" &&
  8671. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  8672. options.dataTypes.unshift( dataTypeOrTransport );
  8673. inspect( dataTypeOrTransport );
  8674. return false;
  8675. } else if ( seekingTransport ) {
  8676. return !( selected = dataTypeOrTransport );
  8677. }
  8678. } );
  8679. return selected;
  8680. }
  8681. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  8682. }
  8683. // A special extend for ajax options
  8684. // that takes "flat" options (not to be deep extended)
  8685. // Fixes #9887
  8686. function ajaxExtend( target, src ) {
  8687. var deep, key,
  8688. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  8689. for ( key in src ) {
  8690. if ( src[ key ] !== undefined ) {
  8691. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  8692. }
  8693. }
  8694. if ( deep ) {
  8695. jQuery.extend( true, target, deep );
  8696. }
  8697. return target;
  8698. }
  8699. /* Handles responses to an ajax request:
  8700. * - finds the right dataType (mediates between content-type and expected dataType)
  8701. * - returns the corresponding response
  8702. */
  8703. function ajaxHandleResponses( s, jqXHR, responses ) {
  8704. var firstDataType, ct, finalDataType, type,
  8705. contents = s.contents,
  8706. dataTypes = s.dataTypes;
  8707. // Remove auto dataType and get content-type in the process
  8708. while ( dataTypes[ 0 ] === "*" ) {
  8709. dataTypes.shift();
  8710. if ( ct === undefined ) {
  8711. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  8712. }
  8713. }
  8714. // Check if we're dealing with a known content-type
  8715. if ( ct ) {
  8716. for ( type in contents ) {
  8717. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  8718. dataTypes.unshift( type );
  8719. break;
  8720. }
  8721. }
  8722. }
  8723. // Check to see if we have a response for the expected dataType
  8724. if ( dataTypes[ 0 ] in responses ) {
  8725. finalDataType = dataTypes[ 0 ];
  8726. } else {
  8727. // Try convertible dataTypes
  8728. for ( type in responses ) {
  8729. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  8730. finalDataType = type;
  8731. break;
  8732. }
  8733. if ( !firstDataType ) {
  8734. firstDataType = type;
  8735. }
  8736. }
  8737. // Or just use first one
  8738. finalDataType = finalDataType || firstDataType;
  8739. }
  8740. // If we found a dataType
  8741. // We add the dataType to the list if needed
  8742. // and return the corresponding response
  8743. if ( finalDataType ) {
  8744. if ( finalDataType !== dataTypes[ 0 ] ) {
  8745. dataTypes.unshift( finalDataType );
  8746. }
  8747. return responses[ finalDataType ];
  8748. }
  8749. }
  8750. /* Chain conversions given the request and the original response
  8751. * Also sets the responseXXX fields on the jqXHR instance
  8752. */
  8753. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  8754. var conv2, current, conv, tmp, prev,
  8755. converters = {},
  8756. // Work with a copy of dataTypes in case we need to modify it for conversion
  8757. dataTypes = s.dataTypes.slice();
  8758. // Create converters map with lowercased keys
  8759. if ( dataTypes[ 1 ] ) {
  8760. for ( conv in s.converters ) {
  8761. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  8762. }
  8763. }
  8764. current = dataTypes.shift();
  8765. // Convert to each sequential dataType
  8766. while ( current ) {
  8767. if ( s.responseFields[ current ] ) {
  8768. jqXHR[ s.responseFields[ current ] ] = response;
  8769. }
  8770. // Apply the dataFilter if provided
  8771. if ( !prev && isSuccess && s.dataFilter ) {
  8772. response = s.dataFilter( response, s.dataType );
  8773. }
  8774. prev = current;
  8775. current = dataTypes.shift();
  8776. if ( current ) {
  8777. // There's only work to do if current dataType is non-auto
  8778. if ( current === "*" ) {
  8779. current = prev;
  8780. // Convert response if prev dataType is non-auto and differs from current
  8781. } else if ( prev !== "*" && prev !== current ) {
  8782. // Seek a direct converter
  8783. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  8784. // If none found, seek a pair
  8785. if ( !conv ) {
  8786. for ( conv2 in converters ) {
  8787. // If conv2 outputs current
  8788. tmp = conv2.split( " " );
  8789. if ( tmp[ 1 ] === current ) {
  8790. // If prev can be converted to accepted input
  8791. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  8792. converters[ "* " + tmp[ 0 ] ];
  8793. if ( conv ) {
  8794. // Condense equivalence converters
  8795. if ( conv === true ) {
  8796. conv = converters[ conv2 ];
  8797. // Otherwise, insert the intermediate dataType
  8798. } else if ( converters[ conv2 ] !== true ) {
  8799. current = tmp[ 0 ];
  8800. dataTypes.unshift( tmp[ 1 ] );
  8801. }
  8802. break;
  8803. }
  8804. }
  8805. }
  8806. }
  8807. // Apply converter (if not an equivalence)
  8808. if ( conv !== true ) {
  8809. // Unless errors are allowed to bubble, catch and return them
  8810. if ( conv && s[ "throws" ] ) { // jscs:ignore requireDotNotation
  8811. response = conv( response );
  8812. } else {
  8813. try {
  8814. response = conv( response );
  8815. } catch ( e ) {
  8816. return {
  8817. state: "parsererror",
  8818. error: conv ? e : "No conversion from " + prev + " to " + current
  8819. };
  8820. }
  8821. }
  8822. }
  8823. }
  8824. }
  8825. }
  8826. return { state: "success", data: response };
  8827. }
  8828. jQuery.extend( {
  8829. // Counter for holding the number of active queries
  8830. active: 0,
  8831. // Last-Modified header cache for next request
  8832. lastModified: {},
  8833. etag: {},
  8834. ajaxSettings: {
  8835. url: ajaxLocation,
  8836. type: "GET",
  8837. isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
  8838. global: true,
  8839. processData: true,
  8840. async: true,
  8841. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  8842. /*
  8843. timeout: 0,
  8844. data: null,
  8845. dataType: null,
  8846. username: null,
  8847. password: null,
  8848. cache: null,
  8849. throws: false,
  8850. traditional: false,
  8851. headers: {},
  8852. */
  8853. accepts: {
  8854. "*": allTypes,
  8855. text: "text/plain",
  8856. html: "text/html",
  8857. xml: "application/xml, text/xml",
  8858. json: "application/json, text/javascript"
  8859. },
  8860. contents: {
  8861. xml: /\bxml\b/,
  8862. html: /\bhtml/,
  8863. json: /\bjson\b/
  8864. },
  8865. responseFields: {
  8866. xml: "responseXML",
  8867. text: "responseText",
  8868. json: "responseJSON"
  8869. },
  8870. // Data converters
  8871. // Keys separate source (or catchall "*") and destination types with a single space
  8872. converters: {
  8873. // Convert anything to text
  8874. "* text": String,
  8875. // Text to html (true = no transformation)
  8876. "text html": true,
  8877. // Evaluate text as a json expression
  8878. "text json": jQuery.parseJSON,
  8879. // Parse text as xml
  8880. "text xml": jQuery.parseXML
  8881. },
  8882. // For options that shouldn't be deep extended:
  8883. // you can add your own custom options here if
  8884. // and when you create one that shouldn't be
  8885. // deep extended (see ajaxExtend)
  8886. flatOptions: {
  8887. url: true,
  8888. context: true
  8889. }
  8890. },
  8891. // Creates a full fledged settings object into target
  8892. // with both ajaxSettings and settings fields.
  8893. // If target is omitted, writes into ajaxSettings.
  8894. ajaxSetup: function( target, settings ) {
  8895. return settings ?
  8896. // Building a settings object
  8897. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  8898. // Extending ajaxSettings
  8899. ajaxExtend( jQuery.ajaxSettings, target );
  8900. },
  8901. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  8902. ajaxTransport: addToPrefiltersOrTransports( transports ),
  8903. // Main method
  8904. ajax: function( url, options ) {
  8905. // If url is an object, simulate pre-1.5 signature
  8906. if ( typeof url === "object" ) {
  8907. options = url;
  8908. url = undefined;
  8909. }
  8910. // Force options to be an object
  8911. options = options || {};
  8912. var
  8913. // Cross-domain detection vars
  8914. parts,
  8915. // Loop variable
  8916. i,
  8917. // URL without anti-cache param
  8918. cacheURL,
  8919. // Response headers as string
  8920. responseHeadersString,
  8921. // timeout handle
  8922. timeoutTimer,
  8923. // To know if global events are to be dispatched
  8924. fireGlobals,
  8925. transport,
  8926. // Response headers
  8927. responseHeaders,
  8928. // Create the final options object
  8929. s = jQuery.ajaxSetup( {}, options ),
  8930. // Callbacks context
  8931. callbackContext = s.context || s,
  8932. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  8933. globalEventContext = s.context &&
  8934. ( callbackContext.nodeType || callbackContext.jquery ) ?
  8935. jQuery( callbackContext ) :
  8936. jQuery.event,
  8937. // Deferreds
  8938. deferred = jQuery.Deferred(),
  8939. completeDeferred = jQuery.Callbacks( "once memory" ),
  8940. // Status-dependent callbacks
  8941. statusCode = s.statusCode || {},
  8942. // Headers (they are sent all at once)
  8943. requestHeaders = {},
  8944. requestHeadersNames = {},
  8945. // The jqXHR state
  8946. state = 0,
  8947. // Default abort message
  8948. strAbort = "canceled",
  8949. // Fake xhr
  8950. jqXHR = {
  8951. readyState: 0,
  8952. // Builds headers hashtable if needed
  8953. getResponseHeader: function( key ) {
  8954. var match;
  8955. if ( state === 2 ) {
  8956. if ( !responseHeaders ) {
  8957. responseHeaders = {};
  8958. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  8959. responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
  8960. }
  8961. }
  8962. match = responseHeaders[ key.toLowerCase() ];
  8963. }
  8964. return match == null ? null : match;
  8965. },
  8966. // Raw string
  8967. getAllResponseHeaders: function() {
  8968. return state === 2 ? responseHeadersString : null;
  8969. },
  8970. // Caches the header
  8971. setRequestHeader: function( name, value ) {
  8972. var lname = name.toLowerCase();
  8973. if ( !state ) {
  8974. name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
  8975. requestHeaders[ name ] = value;
  8976. }
  8977. return this;
  8978. },
  8979. // Overrides response content-type header
  8980. overrideMimeType: function( type ) {
  8981. if ( !state ) {
  8982. s.mimeType = type;
  8983. }
  8984. return this;
  8985. },
  8986. // Status-dependent callbacks
  8987. statusCode: function( map ) {
  8988. var code;
  8989. if ( map ) {
  8990. if ( state < 2 ) {
  8991. for ( code in map ) {
  8992. // Lazy-add the new callback in a way that preserves old ones
  8993. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  8994. }
  8995. } else {
  8996. // Execute the appropriate callbacks
  8997. jqXHR.always( map[ jqXHR.status ] );
  8998. }
  8999. }
  9000. return this;
  9001. },
  9002. // Cancel the request
  9003. abort: function( statusText ) {
  9004. var finalText = statusText || strAbort;
  9005. if ( transport ) {
  9006. transport.abort( finalText );
  9007. }
  9008. done( 0, finalText );
  9009. return this;
  9010. }
  9011. };
  9012. // Attach deferreds
  9013. deferred.promise( jqXHR ).complete = completeDeferred.add;
  9014. jqXHR.success = jqXHR.done;
  9015. jqXHR.error = jqXHR.fail;
  9016. // Remove hash character (#7531: and string promotion)
  9017. // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
  9018. // Handle falsy url in the settings object (#10093: consistency with old signature)
  9019. // We also use the url parameter if available
  9020. s.url = ( ( url || s.url || ajaxLocation ) + "" )
  9021. .replace( rhash, "" )
  9022. .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
  9023. // Alias method option to type as per ticket #12004
  9024. s.type = options.method || options.type || s.method || s.type;
  9025. // Extract dataTypes list
  9026. s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
  9027. // A cross-domain request is in order when we have a protocol:host:port mismatch
  9028. if ( s.crossDomain == null ) {
  9029. parts = rurl.exec( s.url.toLowerCase() );
  9030. s.crossDomain = !!( parts &&
  9031. ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
  9032. ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
  9033. ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
  9034. );
  9035. }
  9036. // Convert data if not already a string
  9037. if ( s.data && s.processData && typeof s.data !== "string" ) {
  9038. s.data = jQuery.param( s.data, s.traditional );
  9039. }
  9040. // Apply prefilters
  9041. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  9042. // If request was aborted inside a prefilter, stop there
  9043. if ( state === 2 ) {
  9044. return jqXHR;
  9045. }
  9046. // We can fire global events as of now if asked to
  9047. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  9048. fireGlobals = jQuery.event && s.global;
  9049. // Watch for a new set of requests
  9050. if ( fireGlobals && jQuery.active++ === 0 ) {
  9051. jQuery.event.trigger( "ajaxStart" );
  9052. }
  9053. // Uppercase the type
  9054. s.type = s.type.toUpperCase();
  9055. // Determine if request has content
  9056. s.hasContent = !rnoContent.test( s.type );
  9057. // Save the URL in case we're toying with the If-Modified-Since
  9058. // and/or If-None-Match header later on
  9059. cacheURL = s.url;
  9060. // More options handling for requests with no content
  9061. if ( !s.hasContent ) {
  9062. // If data is available, append data to url
  9063. if ( s.data ) {
  9064. cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
  9065. // #9682: remove data so that it's not used in an eventual retry
  9066. delete s.data;
  9067. }
  9068. // Add anti-cache in url if needed
  9069. if ( s.cache === false ) {
  9070. s.url = rts.test( cacheURL ) ?
  9071. // If there is already a '_' parameter, set its value
  9072. cacheURL.replace( rts, "$1_=" + nonce++ ) :
  9073. // Otherwise add one to the end
  9074. cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
  9075. }
  9076. }
  9077. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  9078. if ( s.ifModified ) {
  9079. if ( jQuery.lastModified[ cacheURL ] ) {
  9080. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  9081. }
  9082. if ( jQuery.etag[ cacheURL ] ) {
  9083. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  9084. }
  9085. }
  9086. // Set the correct header, if data is being sent
  9087. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  9088. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  9089. }
  9090. // Set the Accepts header for the server, depending on the dataType
  9091. jqXHR.setRequestHeader(
  9092. "Accept",
  9093. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  9094. s.accepts[ s.dataTypes[ 0 ] ] +
  9095. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  9096. s.accepts[ "*" ]
  9097. );
  9098. // Check for headers option
  9099. for ( i in s.headers ) {
  9100. jqXHR.setRequestHeader( i, s.headers[ i ] );
  9101. }
  9102. // Allow custom headers/mimetypes and early abort
  9103. if ( s.beforeSend &&
  9104. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
  9105. // Abort if not done already and return
  9106. return jqXHR.abort();
  9107. }
  9108. // aborting is no longer a cancellation
  9109. strAbort = "abort";
  9110. // Install callbacks on deferreds
  9111. for ( i in { success: 1, error: 1, complete: 1 } ) {
  9112. jqXHR[ i ]( s[ i ] );
  9113. }
  9114. // Get transport
  9115. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  9116. // If no transport, we auto-abort
  9117. if ( !transport ) {
  9118. done( -1, "No Transport" );
  9119. } else {
  9120. jqXHR.readyState = 1;
  9121. // Send global event
  9122. if ( fireGlobals ) {
  9123. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  9124. }
  9125. // If request was aborted inside ajaxSend, stop there
  9126. if ( state === 2 ) {
  9127. return jqXHR;
  9128. }
  9129. // Timeout
  9130. if ( s.async && s.timeout > 0 ) {
  9131. timeoutTimer = window.setTimeout( function() {
  9132. jqXHR.abort( "timeout" );
  9133. }, s.timeout );
  9134. }
  9135. try {
  9136. state = 1;
  9137. transport.send( requestHeaders, done );
  9138. } catch ( e ) {
  9139. // Propagate exception as error if not done
  9140. if ( state < 2 ) {
  9141. done( -1, e );
  9142. // Simply rethrow otherwise
  9143. } else {
  9144. throw e;
  9145. }
  9146. }
  9147. }
  9148. // Callback for when everything is done
  9149. function done( status, nativeStatusText, responses, headers ) {
  9150. var isSuccess, success, error, response, modified,
  9151. statusText = nativeStatusText;
  9152. // Called once
  9153. if ( state === 2 ) {
  9154. return;
  9155. }
  9156. // State is "done" now
  9157. state = 2;
  9158. // Clear timeout if it exists
  9159. if ( timeoutTimer ) {
  9160. window.clearTimeout( timeoutTimer );
  9161. }
  9162. // Dereference transport for early garbage collection
  9163. // (no matter how long the jqXHR object will be used)
  9164. transport = undefined;
  9165. // Cache response headers
  9166. responseHeadersString = headers || "";
  9167. // Set readyState
  9168. jqXHR.readyState = status > 0 ? 4 : 0;
  9169. // Determine if successful
  9170. isSuccess = status >= 200 && status < 300 || status === 304;
  9171. // Get response data
  9172. if ( responses ) {
  9173. response = ajaxHandleResponses( s, jqXHR, responses );
  9174. }
  9175. // Convert no matter what (that way responseXXX fields are always set)
  9176. response = ajaxConvert( s, response, jqXHR, isSuccess );
  9177. // If successful, handle type chaining
  9178. if ( isSuccess ) {
  9179. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  9180. if ( s.ifModified ) {
  9181. modified = jqXHR.getResponseHeader( "Last-Modified" );
  9182. if ( modified ) {
  9183. jQuery.lastModified[ cacheURL ] = modified;
  9184. }
  9185. modified = jqXHR.getResponseHeader( "etag" );
  9186. if ( modified ) {
  9187. jQuery.etag[ cacheURL ] = modified;
  9188. }
  9189. }
  9190. // if no content
  9191. if ( status === 204 || s.type === "HEAD" ) {
  9192. statusText = "nocontent";
  9193. // if not modified
  9194. } else if ( status === 304 ) {
  9195. statusText = "notmodified";
  9196. // If we have data, let's convert it
  9197. } else {
  9198. statusText = response.state;
  9199. success = response.data;
  9200. error = response.error;
  9201. isSuccess = !error;
  9202. }
  9203. } else {
  9204. // We extract error from statusText
  9205. // then normalize statusText and status for non-aborts
  9206. error = statusText;
  9207. if ( status || !statusText ) {
  9208. statusText = "error";
  9209. if ( status < 0 ) {
  9210. status = 0;
  9211. }
  9212. }
  9213. }
  9214. // Set data for the fake xhr object
  9215. jqXHR.status = status;
  9216. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  9217. // Success/Error
  9218. if ( isSuccess ) {
  9219. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  9220. } else {
  9221. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  9222. }
  9223. // Status-dependent callbacks
  9224. jqXHR.statusCode( statusCode );
  9225. statusCode = undefined;
  9226. if ( fireGlobals ) {
  9227. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  9228. [ jqXHR, s, isSuccess ? success : error ] );
  9229. }
  9230. // Complete
  9231. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  9232. if ( fireGlobals ) {
  9233. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  9234. // Handle the global AJAX counter
  9235. if ( !( --jQuery.active ) ) {
  9236. jQuery.event.trigger( "ajaxStop" );
  9237. }
  9238. }
  9239. }
  9240. return jqXHR;
  9241. },
  9242. getJSON: function( url, data, callback ) {
  9243. return jQuery.get( url, data, callback, "json" );
  9244. },
  9245. getScript: function( url, callback ) {
  9246. return jQuery.get( url, undefined, callback, "script" );
  9247. }
  9248. } );
  9249. jQuery.each( [ "get", "post" ], function( i, method ) {
  9250. jQuery[ method ] = function( url, data, callback, type ) {
  9251. // shift arguments if data argument was omitted
  9252. if ( jQuery.isFunction( data ) ) {
  9253. type = type || callback;
  9254. callback = data;
  9255. data = undefined;
  9256. }
  9257. // The url can be an options object (which then must have .url)
  9258. return jQuery.ajax( jQuery.extend( {
  9259. url: url,
  9260. type: method,
  9261. dataType: type,
  9262. data: data,
  9263. success: callback
  9264. }, jQuery.isPlainObject( url ) && url ) );
  9265. };
  9266. } );
  9267. jQuery._evalUrl = function( url ) {
  9268. return jQuery.ajax( {
  9269. url: url,
  9270. // Make this explicit, since user can override this through ajaxSetup (#11264)
  9271. type: "GET",
  9272. dataType: "script",
  9273. cache: true,
  9274. async: false,
  9275. global: false,
  9276. "throws": true
  9277. } );
  9278. };
  9279. jQuery.fn.extend( {
  9280. wrapAll: function( html ) {
  9281. if ( jQuery.isFunction( html ) ) {
  9282. return this.each( function( i ) {
  9283. jQuery( this ).wrapAll( html.call( this, i ) );
  9284. } );
  9285. }
  9286. if ( this[ 0 ] ) {
  9287. // The elements to wrap the target around
  9288. var wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  9289. if ( this[ 0 ].parentNode ) {
  9290. wrap.insertBefore( this[ 0 ] );
  9291. }
  9292. wrap.map( function() {
  9293. var elem = this;
  9294. while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
  9295. elem = elem.firstChild;
  9296. }
  9297. return elem;
  9298. } ).append( this );
  9299. }
  9300. return this;
  9301. },
  9302. wrapInner: function( html ) {
  9303. if ( jQuery.isFunction( html ) ) {
  9304. return this.each( function( i ) {
  9305. jQuery( this ).wrapInner( html.call( this, i ) );
  9306. } );
  9307. }
  9308. return this.each( function() {
  9309. var self = jQuery( this ),
  9310. contents = self.contents();
  9311. if ( contents.length ) {
  9312. contents.wrapAll( html );
  9313. } else {
  9314. self.append( html );
  9315. }
  9316. } );
  9317. },
  9318. wrap: function( html ) {
  9319. var isFunction = jQuery.isFunction( html );
  9320. return this.each( function( i ) {
  9321. jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
  9322. } );
  9323. },
  9324. unwrap: function() {
  9325. return this.parent().each( function() {
  9326. if ( !jQuery.nodeName( this, "body" ) ) {
  9327. jQuery( this ).replaceWith( this.childNodes );
  9328. }
  9329. } ).end();
  9330. }
  9331. } );
  9332. function getDisplay( elem ) {
  9333. return elem.style && elem.style.display || jQuery.css( elem, "display" );
  9334. }
  9335. function filterHidden( elem ) {
  9336. // Disconnected elements are considered hidden
  9337. if ( !jQuery.contains( elem.ownerDocument || document, elem ) ) {
  9338. return true;
  9339. }
  9340. while ( elem && elem.nodeType === 1 ) {
  9341. if ( getDisplay( elem ) === "none" || elem.type === "hidden" ) {
  9342. return true;
  9343. }
  9344. elem = elem.parentNode;
  9345. }
  9346. return false;
  9347. }
  9348. jQuery.expr.filters.hidden = function( elem ) {
  9349. // Support: Opera <= 12.12
  9350. // Opera reports offsetWidths and offsetHeights less than zero on some elements
  9351. return support.reliableHiddenOffsets() ?
  9352. ( elem.offsetWidth <= 0 && elem.offsetHeight <= 0 &&
  9353. !elem.getClientRects().length ) :
  9354. filterHidden( elem );
  9355. };
  9356. jQuery.expr.filters.visible = function( elem ) {
  9357. return !jQuery.expr.filters.hidden( elem );
  9358. };
  9359. var r20 = /%20/g,
  9360. rbracket = /\[\]$/,
  9361. rCRLF = /\r?\n/g,
  9362. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  9363. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  9364. function buildParams( prefix, obj, traditional, add ) {
  9365. var name;
  9366. if ( jQuery.isArray( obj ) ) {
  9367. // Serialize array item.
  9368. jQuery.each( obj, function( i, v ) {
  9369. if ( traditional || rbracket.test( prefix ) ) {
  9370. // Treat each array item as a scalar.
  9371. add( prefix, v );
  9372. } else {
  9373. // Item is non-scalar (array or object), encode its numeric index.
  9374. buildParams(
  9375. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  9376. v,
  9377. traditional,
  9378. add
  9379. );
  9380. }
  9381. } );
  9382. } else if ( !traditional && jQuery.type( obj ) === "object" ) {
  9383. // Serialize object item.
  9384. for ( name in obj ) {
  9385. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  9386. }
  9387. } else {
  9388. // Serialize scalar item.
  9389. add( prefix, obj );
  9390. }
  9391. }
  9392. // Serialize an array of form elements or a set of
  9393. // key/values into a query string
  9394. jQuery.param = function( a, traditional ) {
  9395. var prefix,
  9396. s = [],
  9397. add = function( key, value ) {
  9398. // If value is a function, invoke it and return its value
  9399. value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
  9400. s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
  9401. };
  9402. // Set traditional to true for jQuery <= 1.3.2 behavior.
  9403. if ( traditional === undefined ) {
  9404. traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
  9405. }
  9406. // If an array was passed in, assume that it is an array of form elements.
  9407. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  9408. // Serialize the form elements
  9409. jQuery.each( a, function() {
  9410. add( this.name, this.value );
  9411. } );
  9412. } else {
  9413. // If traditional, encode the "old" way (the way 1.3.2 or older
  9414. // did it), otherwise encode params recursively.
  9415. for ( prefix in a ) {
  9416. buildParams( prefix, a[ prefix ], traditional, add );
  9417. }
  9418. }
  9419. // Return the resulting serialization
  9420. return s.join( "&" ).replace( r20, "+" );
  9421. };
  9422. jQuery.fn.extend( {
  9423. serialize: function() {
  9424. return jQuery.param( this.serializeArray() );
  9425. },
  9426. serializeArray: function() {
  9427. return this.map( function() {
  9428. // Can add propHook for "elements" to filter or add form elements
  9429. var elements = jQuery.prop( this, "elements" );
  9430. return elements ? jQuery.makeArray( elements ) : this;
  9431. } )
  9432. .filter( function() {
  9433. var type = this.type;
  9434. // Use .is(":disabled") so that fieldset[disabled] works
  9435. return this.name && !jQuery( this ).is( ":disabled" ) &&
  9436. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  9437. ( this.checked || !rcheckableType.test( type ) );
  9438. } )
  9439. .map( function( i, elem ) {
  9440. var val = jQuery( this ).val();
  9441. return val == null ?
  9442. null :
  9443. jQuery.isArray( val ) ?
  9444. jQuery.map( val, function( val ) {
  9445. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  9446. } ) :
  9447. { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  9448. } ).get();
  9449. }
  9450. } );
  9451. // Create the request object
  9452. // (This is still attached to ajaxSettings for backward compatibility)
  9453. jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
  9454. // Support: IE6-IE8
  9455. function() {
  9456. // XHR cannot access local files, always use ActiveX for that case
  9457. if ( this.isLocal ) {
  9458. return createActiveXHR();
  9459. }
  9460. // Support: IE 9-11
  9461. // IE seems to error on cross-domain PATCH requests when ActiveX XHR
  9462. // is used. In IE 9+ always use the native XHR.
  9463. // Note: this condition won't catch Edge as it doesn't define
  9464. // document.documentMode but it also doesn't support ActiveX so it won't
  9465. // reach this code.
  9466. if ( document.documentMode > 8 ) {
  9467. return createStandardXHR();
  9468. }
  9469. // Support: IE<9
  9470. // oldIE XHR does not support non-RFC2616 methods (#13240)
  9471. // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
  9472. // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
  9473. // Although this check for six methods instead of eight
  9474. // since IE also does not support "trace" and "connect"
  9475. return /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
  9476. createStandardXHR() || createActiveXHR();
  9477. } :
  9478. // For all other browsers, use the standard XMLHttpRequest object
  9479. createStandardXHR;
  9480. var xhrId = 0,
  9481. xhrCallbacks = {},
  9482. xhrSupported = jQuery.ajaxSettings.xhr();
  9483. // Support: IE<10
  9484. // Open requests must be manually aborted on unload (#5280)
  9485. // See https://support.microsoft.com/kb/2856746 for more info
  9486. if ( window.attachEvent ) {
  9487. window.attachEvent( "onunload", function() {
  9488. for ( var key in xhrCallbacks ) {
  9489. xhrCallbacks[ key ]( undefined, true );
  9490. }
  9491. } );
  9492. }
  9493. // Determine support properties
  9494. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  9495. xhrSupported = support.ajax = !!xhrSupported;
  9496. // Create transport if the browser can provide an xhr
  9497. if ( xhrSupported ) {
  9498. jQuery.ajaxTransport( function( options ) {
  9499. // Cross domain only allowed if supported through XMLHttpRequest
  9500. if ( !options.crossDomain || support.cors ) {
  9501. var callback;
  9502. return {
  9503. send: function( headers, complete ) {
  9504. var i,
  9505. xhr = options.xhr(),
  9506. id = ++xhrId;
  9507. // Open the socket
  9508. xhr.open(
  9509. options.type,
  9510. options.url,
  9511. options.async,
  9512. options.username,
  9513. options.password
  9514. );
  9515. // Apply custom fields if provided
  9516. if ( options.xhrFields ) {
  9517. for ( i in options.xhrFields ) {
  9518. xhr[ i ] = options.xhrFields[ i ];
  9519. }
  9520. }
  9521. // Override mime type if needed
  9522. if ( options.mimeType && xhr.overrideMimeType ) {
  9523. xhr.overrideMimeType( options.mimeType );
  9524. }
  9525. // X-Requested-With header
  9526. // For cross-domain requests, seeing as conditions for a preflight are
  9527. // akin to a jigsaw puzzle, we simply never set it to be sure.
  9528. // (it can always be set on a per-request basis or even using ajaxSetup)
  9529. // For same-domain requests, won't change header if already provided.
  9530. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  9531. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  9532. }
  9533. // Set headers
  9534. for ( i in headers ) {
  9535. // Support: IE<9
  9536. // IE's ActiveXObject throws a 'Type Mismatch' exception when setting
  9537. // request header to a null-value.
  9538. //
  9539. // To keep consistent with other XHR implementations, cast the value
  9540. // to string and ignore `undefined`.
  9541. if ( headers[ i ] !== undefined ) {
  9542. xhr.setRequestHeader( i, headers[ i ] + "" );
  9543. }
  9544. }
  9545. // Do send the request
  9546. // This may raise an exception which is actually
  9547. // handled in jQuery.ajax (so no try/catch here)
  9548. xhr.send( ( options.hasContent && options.data ) || null );
  9549. // Listener
  9550. callback = function( _, isAbort ) {
  9551. var status, statusText, responses;
  9552. // Was never called and is aborted or complete
  9553. if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
  9554. // Clean up
  9555. delete xhrCallbacks[ id ];
  9556. callback = undefined;
  9557. xhr.onreadystatechange = jQuery.noop;
  9558. // Abort manually if needed
  9559. if ( isAbort ) {
  9560. if ( xhr.readyState !== 4 ) {
  9561. xhr.abort();
  9562. }
  9563. } else {
  9564. responses = {};
  9565. status = xhr.status;
  9566. // Support: IE<10
  9567. // Accessing binary-data responseText throws an exception
  9568. // (#11426)
  9569. if ( typeof xhr.responseText === "string" ) {
  9570. responses.text = xhr.responseText;
  9571. }
  9572. // Firefox throws an exception when accessing
  9573. // statusText for faulty cross-domain requests
  9574. try {
  9575. statusText = xhr.statusText;
  9576. } catch ( e ) {
  9577. // We normalize with Webkit giving an empty statusText
  9578. statusText = "";
  9579. }
  9580. // Filter status for non standard behaviors
  9581. // If the request is local and we have data: assume a success
  9582. // (success with no data won't get notified, that's the best we
  9583. // can do given current implementations)
  9584. if ( !status && options.isLocal && !options.crossDomain ) {
  9585. status = responses.text ? 200 : 404;
  9586. // IE - #1450: sometimes returns 1223 when it should be 204
  9587. } else if ( status === 1223 ) {
  9588. status = 204;
  9589. }
  9590. }
  9591. }
  9592. // Call complete if needed
  9593. if ( responses ) {
  9594. complete( status, statusText, responses, xhr.getAllResponseHeaders() );
  9595. }
  9596. };
  9597. // Do send the request
  9598. // `xhr.send` may raise an exception, but it will be
  9599. // handled in jQuery.ajax (so no try/catch here)
  9600. if ( !options.async ) {
  9601. // If we're in sync mode we fire the callback
  9602. callback();
  9603. } else if ( xhr.readyState === 4 ) {
  9604. // (IE6 & IE7) if it's in cache and has been
  9605. // retrieved directly we need to fire the callback
  9606. window.setTimeout( callback );
  9607. } else {
  9608. // Register the callback, but delay it in case `xhr.send` throws
  9609. // Add to the list of active xhr callbacks
  9610. xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
  9611. }
  9612. },
  9613. abort: function() {
  9614. if ( callback ) {
  9615. callback( undefined, true );
  9616. }
  9617. }
  9618. };
  9619. }
  9620. } );
  9621. }
  9622. // Functions to create xhrs
  9623. function createStandardXHR() {
  9624. try {
  9625. return new window.XMLHttpRequest();
  9626. } catch ( e ) {}
  9627. }
  9628. function createActiveXHR() {
  9629. try {
  9630. return new window.ActiveXObject( "Microsoft.XMLHTTP" );
  9631. } catch ( e ) {}
  9632. }
  9633. // Install script dataType
  9634. jQuery.ajaxSetup( {
  9635. accepts: {
  9636. script: "text/javascript, application/javascript, " +
  9637. "application/ecmascript, application/x-ecmascript"
  9638. },
  9639. contents: {
  9640. script: /\b(?:java|ecma)script\b/
  9641. },
  9642. converters: {
  9643. "text script": function( text ) {
  9644. jQuery.globalEval( text );
  9645. return text;
  9646. }
  9647. }
  9648. } );
  9649. // Handle cache's special case and global
  9650. jQuery.ajaxPrefilter( "script", function( s ) {
  9651. if ( s.cache === undefined ) {
  9652. s.cache = false;
  9653. }
  9654. if ( s.crossDomain ) {
  9655. s.type = "GET";
  9656. s.global = false;
  9657. }
  9658. } );
  9659. // Bind script tag hack transport
  9660. jQuery.ajaxTransport( "script", function( s ) {
  9661. // This transport only deals with cross domain requests
  9662. if ( s.crossDomain ) {
  9663. var script,
  9664. head = document.head || jQuery( "head" )[ 0 ] || document.documentElement;
  9665. return {
  9666. send: function( _, callback ) {
  9667. script = document.createElement( "script" );
  9668. script.async = true;
  9669. if ( s.scriptCharset ) {
  9670. script.charset = s.scriptCharset;
  9671. }
  9672. script.src = s.url;
  9673. // Attach handlers for all browsers
  9674. script.onload = script.onreadystatechange = function( _, isAbort ) {
  9675. if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
  9676. // Handle memory leak in IE
  9677. script.onload = script.onreadystatechange = null;
  9678. // Remove the script
  9679. if ( script.parentNode ) {
  9680. script.parentNode.removeChild( script );
  9681. }
  9682. // Dereference the script
  9683. script = null;
  9684. // Callback if not abort
  9685. if ( !isAbort ) {
  9686. callback( 200, "success" );
  9687. }
  9688. }
  9689. };
  9690. // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
  9691. // Use native DOM manipulation to avoid our domManip AJAX trickery
  9692. head.insertBefore( script, head.firstChild );
  9693. },
  9694. abort: function() {
  9695. if ( script ) {
  9696. script.onload( undefined, true );
  9697. }
  9698. }
  9699. };
  9700. }
  9701. } );
  9702. var oldCallbacks = [],
  9703. rjsonp = /(=)\?(?=&|$)|\?\?/;
  9704. // Default jsonp settings
  9705. jQuery.ajaxSetup( {
  9706. jsonp: "callback",
  9707. jsonpCallback: function() {
  9708. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
  9709. this[ callback ] = true;
  9710. return callback;
  9711. }
  9712. } );
  9713. // Detect, normalize options and install callbacks for jsonp requests
  9714. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  9715. var callbackName, overwritten, responseContainer,
  9716. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  9717. "url" :
  9718. typeof s.data === "string" &&
  9719. ( s.contentType || "" )
  9720. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  9721. rjsonp.test( s.data ) && "data"
  9722. );
  9723. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  9724. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  9725. // Get callback name, remembering preexisting value associated with it
  9726. callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
  9727. s.jsonpCallback() :
  9728. s.jsonpCallback;
  9729. // Insert callback into url or form data
  9730. if ( jsonProp ) {
  9731. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  9732. } else if ( s.jsonp !== false ) {
  9733. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  9734. }
  9735. // Use data converter to retrieve json after script execution
  9736. s.converters[ "script json" ] = function() {
  9737. if ( !responseContainer ) {
  9738. jQuery.error( callbackName + " was not called" );
  9739. }
  9740. return responseContainer[ 0 ];
  9741. };
  9742. // force json dataType
  9743. s.dataTypes[ 0 ] = "json";
  9744. // Install callback
  9745. overwritten = window[ callbackName ];
  9746. window[ callbackName ] = function() {
  9747. responseContainer = arguments;
  9748. };
  9749. // Clean-up function (fires after converters)
  9750. jqXHR.always( function() {
  9751. // If previous value didn't exist - remove it
  9752. if ( overwritten === undefined ) {
  9753. jQuery( window ).removeProp( callbackName );
  9754. // Otherwise restore preexisting value
  9755. } else {
  9756. window[ callbackName ] = overwritten;
  9757. }
  9758. // Save back as free
  9759. if ( s[ callbackName ] ) {
  9760. // make sure that re-using the options doesn't screw things around
  9761. s.jsonpCallback = originalSettings.jsonpCallback;
  9762. // save the callback name for future use
  9763. oldCallbacks.push( callbackName );
  9764. }
  9765. // Call if it was a function and we have a response
  9766. if ( responseContainer && jQuery.isFunction( overwritten ) ) {
  9767. overwritten( responseContainer[ 0 ] );
  9768. }
  9769. responseContainer = overwritten = undefined;
  9770. } );
  9771. // Delegate to script
  9772. return "script";
  9773. }
  9774. } );
  9775. // data: string of html
  9776. // context (optional): If specified, the fragment will be created in this context,
  9777. // defaults to document
  9778. // keepScripts (optional): If true, will include scripts passed in the html string
  9779. jQuery.parseHTML = function( data, context, keepScripts ) {
  9780. if ( !data || typeof data !== "string" ) {
  9781. return null;
  9782. }
  9783. if ( typeof context === "boolean" ) {
  9784. keepScripts = context;
  9785. context = false;
  9786. }
  9787. context = context || document;
  9788. var parsed = rsingleTag.exec( data ),
  9789. scripts = !keepScripts && [];
  9790. // Single tag
  9791. if ( parsed ) {
  9792. return [ context.createElement( parsed[ 1 ] ) ];
  9793. }
  9794. parsed = buildFragment( [ data ], context, scripts );
  9795. if ( scripts && scripts.length ) {
  9796. jQuery( scripts ).remove();
  9797. }
  9798. return jQuery.merge( [], parsed.childNodes );
  9799. };
  9800. // Keep a copy of the old load method
  9801. var _load = jQuery.fn.load;
  9802. /**
  9803. * Load a url into a page
  9804. */
  9805. jQuery.fn.load = function( url, params, callback ) {
  9806. if ( typeof url !== "string" && _load ) {
  9807. return _load.apply( this, arguments );
  9808. }
  9809. var selector, type, response,
  9810. self = this,
  9811. off = url.indexOf( " " );
  9812. if ( off > -1 ) {
  9813. selector = jQuery.trim( url.slice( off, url.length ) );
  9814. url = url.slice( 0, off );
  9815. }
  9816. // If it's a function
  9817. if ( jQuery.isFunction( params ) ) {
  9818. // We assume that it's the callback
  9819. callback = params;
  9820. params = undefined;
  9821. // Otherwise, build a param string
  9822. } else if ( params && typeof params === "object" ) {
  9823. type = "POST";
  9824. }
  9825. // If we have elements to modify, make the request
  9826. if ( self.length > 0 ) {
  9827. jQuery.ajax( {
  9828. url: url,
  9829. // If "type" variable is undefined, then "GET" method will be used.
  9830. // Make value of this field explicit since
  9831. // user can override it through ajaxSetup method
  9832. type: type || "GET",
  9833. dataType: "html",
  9834. data: params
  9835. } ).done( function( responseText ) {
  9836. // Save response for use in complete callback
  9837. response = arguments;
  9838. self.html( selector ?
  9839. // If a selector was specified, locate the right elements in a dummy div
  9840. // Exclude scripts to avoid IE 'Permission Denied' errors
  9841. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  9842. // Otherwise use the full result
  9843. responseText );
  9844. // If the request succeeds, this function gets "data", "status", "jqXHR"
  9845. // but they are ignored because response was set above.
  9846. // If it fails, this function gets "jqXHR", "status", "error"
  9847. } ).always( callback && function( jqXHR, status ) {
  9848. self.each( function() {
  9849. callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
  9850. } );
  9851. } );
  9852. }
  9853. return this;
  9854. };
  9855. // Attach a bunch of functions for handling common AJAX events
  9856. jQuery.each( [
  9857. "ajaxStart",
  9858. "ajaxStop",
  9859. "ajaxComplete",
  9860. "ajaxError",
  9861. "ajaxSuccess",
  9862. "ajaxSend"
  9863. ], function( i, type ) {
  9864. jQuery.fn[ type ] = function( fn ) {
  9865. return this.on( type, fn );
  9866. };
  9867. } );
  9868. jQuery.expr.filters.animated = function( elem ) {
  9869. return jQuery.grep( jQuery.timers, function( fn ) {
  9870. return elem === fn.elem;
  9871. } ).length;
  9872. };
  9873. /**
  9874. * Gets a window from an element
  9875. */
  9876. function getWindow( elem ) {
  9877. return jQuery.isWindow( elem ) ?
  9878. elem :
  9879. elem.nodeType === 9 ?
  9880. elem.defaultView || elem.parentWindow :
  9881. false;
  9882. }
  9883. jQuery.offset = {
  9884. setOffset: function( elem, options, i ) {
  9885. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  9886. position = jQuery.css( elem, "position" ),
  9887. curElem = jQuery( elem ),
  9888. props = {};
  9889. // set position first, in-case top/left are set even on static elem
  9890. if ( position === "static" ) {
  9891. elem.style.position = "relative";
  9892. }
  9893. curOffset = curElem.offset();
  9894. curCSSTop = jQuery.css( elem, "top" );
  9895. curCSSLeft = jQuery.css( elem, "left" );
  9896. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  9897. jQuery.inArray( "auto", [ curCSSTop, curCSSLeft ] ) > -1;
  9898. // need to be able to calculate position if either top or left
  9899. // is auto and position is either absolute or fixed
  9900. if ( calculatePosition ) {
  9901. curPosition = curElem.position();
  9902. curTop = curPosition.top;
  9903. curLeft = curPosition.left;
  9904. } else {
  9905. curTop = parseFloat( curCSSTop ) || 0;
  9906. curLeft = parseFloat( curCSSLeft ) || 0;
  9907. }
  9908. if ( jQuery.isFunction( options ) ) {
  9909. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  9910. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  9911. }
  9912. if ( options.top != null ) {
  9913. props.top = ( options.top - curOffset.top ) + curTop;
  9914. }
  9915. if ( options.left != null ) {
  9916. props.left = ( options.left - curOffset.left ) + curLeft;
  9917. }
  9918. if ( "using" in options ) {
  9919. options.using.call( elem, props );
  9920. } else {
  9921. curElem.css( props );
  9922. }
  9923. }
  9924. };
  9925. jQuery.fn.extend( {
  9926. offset: function( options ) {
  9927. if ( arguments.length ) {
  9928. return options === undefined ?
  9929. this :
  9930. this.each( function( i ) {
  9931. jQuery.offset.setOffset( this, options, i );
  9932. } );
  9933. }
  9934. var docElem, win,
  9935. box = { top: 0, left: 0 },
  9936. elem = this[ 0 ],
  9937. doc = elem && elem.ownerDocument;
  9938. if ( !doc ) {
  9939. return;
  9940. }
  9941. docElem = doc.documentElement;
  9942. // Make sure it's not a disconnected DOM node
  9943. if ( !jQuery.contains( docElem, elem ) ) {
  9944. return box;
  9945. }
  9946. // If we don't have gBCR, just use 0,0 rather than error
  9947. // BlackBerry 5, iOS 3 (original iPhone)
  9948. if ( typeof elem.getBoundingClientRect !== "undefined" ) {
  9949. box = elem.getBoundingClientRect();
  9950. }
  9951. win = getWindow( doc );
  9952. return {
  9953. top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
  9954. left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
  9955. };
  9956. },
  9957. position: function() {
  9958. if ( !this[ 0 ] ) {
  9959. return;
  9960. }
  9961. var offsetParent, offset,
  9962. parentOffset = { top: 0, left: 0 },
  9963. elem = this[ 0 ];
  9964. // Fixed elements are offset from window (parentOffset = {top:0, left: 0},
  9965. // because it is its only offset parent
  9966. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  9967. // we assume that getBoundingClientRect is available when computed position is fixed
  9968. offset = elem.getBoundingClientRect();
  9969. } else {
  9970. // Get *real* offsetParent
  9971. offsetParent = this.offsetParent();
  9972. // Get correct offsets
  9973. offset = this.offset();
  9974. if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
  9975. parentOffset = offsetParent.offset();
  9976. }
  9977. // Add offsetParent borders
  9978. parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
  9979. parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
  9980. }
  9981. // Subtract parent offsets and element margins
  9982. // note: when an element has margin: auto the offsetLeft and marginLeft
  9983. // are the same in Safari causing offset.left to incorrectly be 0
  9984. return {
  9985. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  9986. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  9987. };
  9988. },
  9989. offsetParent: function() {
  9990. return this.map( function() {
  9991. var offsetParent = this.offsetParent;
  9992. while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) &&
  9993. jQuery.css( offsetParent, "position" ) === "static" ) ) {
  9994. offsetParent = offsetParent.offsetParent;
  9995. }
  9996. return offsetParent || documentElement;
  9997. } );
  9998. }
  9999. } );
  10000. // Create scrollLeft and scrollTop methods
  10001. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  10002. var top = /Y/.test( prop );
  10003. jQuery.fn[ method ] = function( val ) {
  10004. return access( this, function( elem, method, val ) {
  10005. var win = getWindow( elem );
  10006. if ( val === undefined ) {
  10007. return win ? ( prop in win ) ? win[ prop ] :
  10008. win.document.documentElement[ method ] :
  10009. elem[ method ];
  10010. }
  10011. if ( win ) {
  10012. win.scrollTo(
  10013. !top ? val : jQuery( win ).scrollLeft(),
  10014. top ? val : jQuery( win ).scrollTop()
  10015. );
  10016. } else {
  10017. elem[ method ] = val;
  10018. }
  10019. }, method, val, arguments.length, null );
  10020. };
  10021. } );
  10022. // Support: Safari<7-8+, Chrome<37-44+
  10023. // Add the top/left cssHooks using jQuery.fn.position
  10024. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  10025. // getComputedStyle returns percent when specified for top/left/bottom/right
  10026. // rather than make the css module depend on the offset module, we just check for it here
  10027. jQuery.each( [ "top", "left" ], function( i, prop ) {
  10028. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  10029. function( elem, computed ) {
  10030. if ( computed ) {
  10031. computed = curCSS( elem, prop );
  10032. // if curCSS returns percentage, fallback to offset
  10033. return rnumnonpx.test( computed ) ?
  10034. jQuery( elem ).position()[ prop ] + "px" :
  10035. computed;
  10036. }
  10037. }
  10038. );
  10039. } );
  10040. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  10041. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  10042. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
  10043. function( defaultExtra, funcName ) {
  10044. // margin is only for outerHeight, outerWidth
  10045. jQuery.fn[ funcName ] = function( margin, value ) {
  10046. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  10047. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  10048. return access( this, function( elem, type, value ) {
  10049. var doc;
  10050. if ( jQuery.isWindow( elem ) ) {
  10051. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  10052. // isn't a whole lot we can do. See pull request at this URL for discussion:
  10053. // https://github.com/jquery/jquery/pull/764
  10054. return elem.document.documentElement[ "client" + name ];
  10055. }
  10056. // Get document width or height
  10057. if ( elem.nodeType === 9 ) {
  10058. doc = elem.documentElement;
  10059. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  10060. // whichever is greatest
  10061. // unfortunately, this causes bug #3838 in IE6/8 only,
  10062. // but there is currently no good, small way to fix it.
  10063. return Math.max(
  10064. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  10065. elem.body[ "offset" + name ], doc[ "offset" + name ],
  10066. doc[ "client" + name ]
  10067. );
  10068. }
  10069. return value === undefined ?
  10070. // Get width or height on the element, requesting but not forcing parseFloat
  10071. jQuery.css( elem, type, extra ) :
  10072. // Set width or height on the element
  10073. jQuery.style( elem, type, value, extra );
  10074. }, type, chainable ? margin : undefined, chainable, null );
  10075. };
  10076. } );
  10077. } );
  10078. jQuery.fn.extend( {
  10079. bind: function( types, data, fn ) {
  10080. return this.on( types, null, data, fn );
  10081. },
  10082. unbind: function( types, fn ) {
  10083. return this.off( types, null, fn );
  10084. },
  10085. delegate: function( selector, types, data, fn ) {
  10086. return this.on( types, selector, data, fn );
  10087. },
  10088. undelegate: function( selector, types, fn ) {
  10089. // ( namespace ) or ( selector, types [, fn] )
  10090. return arguments.length === 1 ?
  10091. this.off( selector, "**" ) :
  10092. this.off( types, selector || "**", fn );
  10093. }
  10094. } );
  10095. // The number of elements contained in the matched element set
  10096. jQuery.fn.size = function() {
  10097. return this.length;
  10098. };
  10099. jQuery.fn.andSelf = jQuery.fn.addBack;
  10100. // Register as a named AMD module, since jQuery can be concatenated with other
  10101. // files that may use define, but not via a proper concatenation script that
  10102. // understands anonymous AMD modules. A named AMD is safest and most robust
  10103. // way to register. Lowercase jquery is used because AMD module names are
  10104. // derived from file names, and jQuery is normally delivered in a lowercase
  10105. // file name. Do this after creating the global so that if an AMD module wants
  10106. // to call noConflict to hide this version of jQuery, it will work.
  10107. // Note that for maximum portability, libraries that are not jQuery should
  10108. // declare themselves as anonymous modules, and avoid setting a global if an
  10109. // AMD loader is present. jQuery is a special case. For more information, see
  10110. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  10111. if ( typeof define === "function" && define.amd ) {
  10112. define( "jquery", [], function() {
  10113. return jQuery;
  10114. } );
  10115. }
  10116. var
  10117. // Map over jQuery in case of overwrite
  10118. _jQuery = window.jQuery,
  10119. // Map over the $ in case of overwrite
  10120. _$ = window.$;
  10121. jQuery.noConflict = function( deep ) {
  10122. if ( window.$ === jQuery ) {
  10123. window.$ = _$;
  10124. }
  10125. if ( deep && window.jQuery === jQuery ) {
  10126. window.jQuery = _jQuery;
  10127. }
  10128. return jQuery;
  10129. };
  10130. // Expose jQuery and $ identifiers, even in
  10131. // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  10132. // and CommonJS for browser emulators (#13566)
  10133. if ( !noGlobal ) {
  10134. window.jQuery = window.$ = jQuery;
  10135. }
  10136. return jQuery;
  10137. }));
  10138. (function($, undefined) {
  10139. /**
  10140. * Unobtrusive scripting adapter for jQuery
  10141. * https://github.com/rails/jquery-ujs
  10142. *
  10143. * Requires jQuery 1.8.0 or later.
  10144. *
  10145. * Released under the MIT license
  10146. *
  10147. */
  10148. // Cut down on the number of issues from people inadvertently including jquery_ujs twice
  10149. // by detecting and raising an error when it happens.
  10150. 'use strict';
  10151. if ( $.rails !== undefined ) {
  10152. $.error('jquery-ujs has already been loaded!');
  10153. }
  10154. // Shorthand to make it a little easier to call public rails functions from within rails.js
  10155. var rails;
  10156. var $document = $(document);
  10157. $.rails = rails = {
  10158. // Link elements bound by jquery-ujs
  10159. linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]',
  10160. // Button elements bound by jquery-ujs
  10161. buttonClickSelector: 'button[data-remote]:not([form]):not(form button), button[data-confirm]:not([form]):not(form button)',
  10162. // Select elements bound by jquery-ujs
  10163. inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',
  10164. // Form elements bound by jquery-ujs
  10165. formSubmitSelector: 'form',
  10166. // Form input elements bound by jquery-ujs
  10167. formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])',
  10168. // Form input elements disabled during form submission
  10169. disableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled',
  10170. // Form input elements re-enabled after form submission
  10171. enableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled',
  10172. // Form required input elements
  10173. requiredInputSelector: 'input[name][required]:not([disabled]), textarea[name][required]:not([disabled])',
  10174. // Form file input elements
  10175. fileInputSelector: 'input[name][type=file]:not([disabled])',
  10176. // Link onClick disable selector with possible reenable after remote submission
  10177. linkDisableSelector: 'a[data-disable-with], a[data-disable]',
  10178. // Button onClick disable selector with possible reenable after remote submission
  10179. buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]',
  10180. // Up-to-date Cross-Site Request Forgery token
  10181. csrfToken: function() {
  10182. return $('meta[name=csrf-token]').attr('content');
  10183. },
  10184. // URL param that must contain the CSRF token
  10185. csrfParam: function() {
  10186. return $('meta[name=csrf-param]').attr('content');
  10187. },
  10188. // Make sure that every Ajax request sends the CSRF token
  10189. CSRFProtection: function(xhr) {
  10190. var token = rails.csrfToken();
  10191. if (token) xhr.setRequestHeader('X-CSRF-Token', token);
  10192. },
  10193. // Make sure that all forms have actual up-to-date tokens (cached forms contain old ones)
  10194. refreshCSRFTokens: function(){
  10195. $('form input[name="' + rails.csrfParam() + '"]').val(rails.csrfToken());
  10196. },
  10197. // Triggers an event on an element and returns false if the event result is false
  10198. fire: function(obj, name, data) {
  10199. var event = $.Event(name);
  10200. obj.trigger(event, data);
  10201. return event.result !== false;
  10202. },
  10203. // Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm
  10204. confirm: function(message) {
  10205. return confirm(message);
  10206. },
  10207. // Default ajax function, may be overridden with custom function in $.rails.ajax
  10208. ajax: function(options) {
  10209. return $.ajax(options);
  10210. },
  10211. // Default way to get an element's href. May be overridden at $.rails.href.
  10212. href: function(element) {
  10213. return element[0].href;
  10214. },
  10215. // Checks "data-remote" if true to handle the request through a XHR request.
  10216. isRemote: function(element) {
  10217. return element.data('remote') !== undefined && element.data('remote') !== false;
  10218. },
  10219. // Submits "remote" forms and links with ajax
  10220. handleRemote: function(element) {
  10221. var method, url, data, withCredentials, dataType, options;
  10222. if (rails.fire(element, 'ajax:before')) {
  10223. withCredentials = element.data('with-credentials') || null;
  10224. dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType);
  10225. if (element.is('form')) {
  10226. method = element.data('ujs:submit-button-formmethod') || element.attr('method');
  10227. url = element.data('ujs:submit-button-formaction') || element.attr('action');
  10228. data = $(element[0]).serializeArray();
  10229. // memoized value from clicked submit button
  10230. var button = element.data('ujs:submit-button');
  10231. if (button) {
  10232. data.push(button);
  10233. element.data('ujs:submit-button', null);
  10234. }
  10235. element.data('ujs:submit-button-formmethod', null);
  10236. element.data('ujs:submit-button-formaction', null);
  10237. } else if (element.is(rails.inputChangeSelector)) {
  10238. method = element.data('method');
  10239. url = element.data('url');
  10240. data = element.serialize();
  10241. if (element.data('params')) data = data + '&' + element.data('params');
  10242. } else if (element.is(rails.buttonClickSelector)) {
  10243. method = element.data('method') || 'get';
  10244. url = element.data('url');
  10245. data = element.serialize();
  10246. if (element.data('params')) data = data + '&' + element.data('params');
  10247. } else {
  10248. method = element.data('method');
  10249. url = rails.href(element);
  10250. data = element.data('params') || null;
  10251. }
  10252. options = {
  10253. type: method || 'GET', data: data, dataType: dataType,
  10254. // stopping the "ajax:beforeSend" event will cancel the ajax request
  10255. beforeSend: function(xhr, settings) {
  10256. if (settings.dataType === undefined) {
  10257. xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
  10258. }
  10259. if (rails.fire(element, 'ajax:beforeSend', [xhr, settings])) {
  10260. element.trigger('ajax:send', xhr);
  10261. } else {
  10262. return false;
  10263. }
  10264. },
  10265. success: function(data, status, xhr) {
  10266. element.trigger('ajax:success', [data, status, xhr]);
  10267. },
  10268. complete: function(xhr, status) {
  10269. element.trigger('ajax:complete', [xhr, status]);
  10270. },
  10271. error: function(xhr, status, error) {
  10272. element.trigger('ajax:error', [xhr, status, error]);
  10273. },
  10274. crossDomain: rails.isCrossDomain(url)
  10275. };
  10276. // There is no withCredentials for IE6-8 when
  10277. // "Enable native XMLHTTP support" is disabled
  10278. if (withCredentials) {
  10279. options.xhrFields = {
  10280. withCredentials: withCredentials
  10281. };
  10282. }
  10283. // Only pass url to `ajax` options if not blank
  10284. if (url) { options.url = url; }
  10285. return rails.ajax(options);
  10286. } else {
  10287. return false;
  10288. }
  10289. },
  10290. // Determines if the request is a cross domain request.
  10291. isCrossDomain: function(url) {
  10292. var originAnchor = document.createElement('a');
  10293. originAnchor.href = location.href;
  10294. var urlAnchor = document.createElement('a');
  10295. try {
  10296. urlAnchor.href = url;
  10297. // This is a workaround to a IE bug.
  10298. urlAnchor.href = urlAnchor.href;
  10299. // If URL protocol is false or is a string containing a single colon
  10300. // *and* host are false, assume it is not a cross-domain request
  10301. // (should only be the case for IE7 and IE compatibility mode).
  10302. // Otherwise, evaluate protocol and host of the URL against the origin
  10303. // protocol and host.
  10304. return !(((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host) ||
  10305. (originAnchor.protocol + '//' + originAnchor.host ===
  10306. urlAnchor.protocol + '//' + urlAnchor.host));
  10307. } catch (e) {
  10308. // If there is an error parsing the URL, assume it is crossDomain.
  10309. return true;
  10310. }
  10311. },
  10312. // Handles "data-method" on links such as:
  10313. // <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
  10314. handleMethod: function(link) {
  10315. var href = rails.href(link),
  10316. method = link.data('method'),
  10317. target = link.attr('target'),
  10318. csrfToken = rails.csrfToken(),
  10319. csrfParam = rails.csrfParam(),
  10320. form = $('<form method="post" action="' + href + '"></form>'),
  10321. metadataInput = '<input name="_method" value="' + method + '" type="hidden" />';
  10322. if (csrfParam !== undefined && csrfToken !== undefined && !rails.isCrossDomain(href)) {
  10323. metadataInput += '<input name="' + csrfParam + '" value="' + csrfToken + '" type="hidden" />';
  10324. }
  10325. if (target) { form.attr('target', target); }
  10326. form.hide().append(metadataInput).appendTo('body');
  10327. form.submit();
  10328. },
  10329. // Helper function that returns form elements that match the specified CSS selector
  10330. // If form is actually a "form" element this will return associated elements outside the from that have
  10331. // the html form attribute set
  10332. formElements: function(form, selector) {
  10333. return form.is('form') ? $(form[0].elements).filter(selector) : form.find(selector);
  10334. },
  10335. /* Disables form elements:
  10336. - Caches element value in 'ujs:enable-with' data store
  10337. - Replaces element text with value of 'data-disable-with' attribute
  10338. - Sets disabled property to true
  10339. */
  10340. disableFormElements: function(form) {
  10341. rails.formElements(form, rails.disableSelector).each(function() {
  10342. rails.disableFormElement($(this));
  10343. });
  10344. },
  10345. disableFormElement: function(element) {
  10346. var method, replacement;
  10347. method = element.is('button') ? 'html' : 'val';
  10348. replacement = element.data('disable-with');
  10349. if (replacement !== undefined) {
  10350. element.data('ujs:enable-with', element[method]());
  10351. element[method](replacement);
  10352. }
  10353. element.prop('disabled', true);
  10354. element.data('ujs:disabled', true);
  10355. },
  10356. /* Re-enables disabled form elements:
  10357. - Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`)
  10358. - Sets disabled property to false
  10359. */
  10360. enableFormElements: function(form) {
  10361. rails.formElements(form, rails.enableSelector).each(function() {
  10362. rails.enableFormElement($(this));
  10363. });
  10364. },
  10365. enableFormElement: function(element) {
  10366. var method = element.is('button') ? 'html' : 'val';
  10367. if (element.data('ujs:enable-with') !== undefined) {
  10368. element[method](element.data('ujs:enable-with'));
  10369. element.removeData('ujs:enable-with'); // clean up cache
  10370. }
  10371. element.prop('disabled', false);
  10372. element.removeData('ujs:disabled');
  10373. },
  10374. /* For 'data-confirm' attribute:
  10375. - Fires `confirm` event
  10376. - Shows the confirmation dialog
  10377. - Fires the `confirm:complete` event
  10378. Returns `true` if no function stops the chain and user chose yes; `false` otherwise.
  10379. Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog.
  10380. Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function
  10381. return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog.
  10382. */
  10383. allowAction: function(element) {
  10384. var message = element.data('confirm'),
  10385. answer = false, callback;
  10386. if (!message) { return true; }
  10387. if (rails.fire(element, 'confirm')) {
  10388. try {
  10389. answer = rails.confirm(message);
  10390. } catch (e) {
  10391. (console.error || console.log).call(console, e.stack || e);
  10392. }
  10393. callback = rails.fire(element, 'confirm:complete', [answer]);
  10394. }
  10395. return answer && callback;
  10396. },
  10397. // Helper function which checks for blank inputs in a form that match the specified CSS selector
  10398. blankInputs: function(form, specifiedSelector, nonBlank) {
  10399. var foundInputs = $(),
  10400. input,
  10401. valueToCheck,
  10402. radiosForNameWithNoneSelected,
  10403. radioName,
  10404. selector = specifiedSelector || 'input,textarea',
  10405. requiredInputs = form.find(selector),
  10406. checkedRadioButtonNames = {};
  10407. requiredInputs.each(function() {
  10408. input = $(this);
  10409. if (input.is('input[type=radio]')) {
  10410. // Don't count unchecked required radio as blank if other radio with same name is checked,
  10411. // regardless of whether same-name radio input has required attribute or not. The spec
  10412. // states https://www.w3.org/TR/html5/forms.html#the-required-attribute
  10413. radioName = input.attr('name');
  10414. // Skip if we've already seen the radio with this name.
  10415. if (!checkedRadioButtonNames[radioName]) {
  10416. // If none checked
  10417. if (form.find('input[type=radio]:checked[name="' + radioName + '"]').length === 0) {
  10418. radiosForNameWithNoneSelected = form.find(
  10419. 'input[type=radio][name="' + radioName + '"]');
  10420. foundInputs = foundInputs.add(radiosForNameWithNoneSelected);
  10421. }
  10422. // We only need to check each name once.
  10423. checkedRadioButtonNames[radioName] = radioName;
  10424. }
  10425. } else {
  10426. valueToCheck = input.is('input[type=checkbox],input[type=radio]') ? input.is(':checked') : !!input.val();
  10427. if (valueToCheck === nonBlank) {
  10428. foundInputs = foundInputs.add(input);
  10429. }
  10430. }
  10431. });
  10432. return foundInputs.length ? foundInputs : false;
  10433. },
  10434. // Helper function which checks for non-blank inputs in a form that match the specified CSS selector
  10435. nonBlankInputs: function(form, specifiedSelector) {
  10436. return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank
  10437. },
  10438. // Helper function, needed to provide consistent behavior in IE
  10439. stopEverything: function(e) {
  10440. $(e.target).trigger('ujs:everythingStopped');
  10441. e.stopImmediatePropagation();
  10442. return false;
  10443. },
  10444. // Replace element's html with the 'data-disable-with' after storing original html
  10445. // and prevent clicking on it
  10446. disableElement: function(element) {
  10447. var replacement = element.data('disable-with');
  10448. if (replacement !== undefined) {
  10449. element.data('ujs:enable-with', element.html()); // store enabled state
  10450. element.html(replacement);
  10451. }
  10452. element.bind('click.railsDisable', function(e) { // prevent further clicking
  10453. return rails.stopEverything(e);
  10454. });
  10455. element.data('ujs:disabled', true);
  10456. },
  10457. // Restore element to its original state which was disabled by 'disableElement' above
  10458. enableElement: function(element) {
  10459. if (element.data('ujs:enable-with') !== undefined) {
  10460. element.html(element.data('ujs:enable-with')); // set to old enabled state
  10461. element.removeData('ujs:enable-with'); // clean up cache
  10462. }
  10463. element.unbind('click.railsDisable'); // enable element
  10464. element.removeData('ujs:disabled');
  10465. }
  10466. };
  10467. if (rails.fire($document, 'rails:attachBindings')) {
  10468. $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
  10469. // This event works the same as the load event, except that it fires every
  10470. // time the page is loaded.
  10471. //
  10472. // See https://github.com/rails/jquery-ujs/issues/357
  10473. // See https://developer.mozilla.org/en-US/docs/Using_Firefox_1.5_caching
  10474. $(window).on('pageshow.rails', function () {
  10475. $($.rails.enableSelector).each(function () {
  10476. var element = $(this);
  10477. if (element.data('ujs:disabled')) {
  10478. $.rails.enableFormElement(element);
  10479. }
  10480. });
  10481. $($.rails.linkDisableSelector).each(function () {
  10482. var element = $(this);
  10483. if (element.data('ujs:disabled')) {
  10484. $.rails.enableElement(element);
  10485. }
  10486. });
  10487. });
  10488. $document.on('ajax:complete', rails.linkDisableSelector, function() {
  10489. rails.enableElement($(this));
  10490. });
  10491. $document.on('ajax:complete', rails.buttonDisableSelector, function() {
  10492. rails.enableFormElement($(this));
  10493. });
  10494. $document.on('click.rails', rails.linkClickSelector, function(e) {
  10495. var link = $(this), method = link.data('method'), data = link.data('params'), metaClick = e.metaKey || e.ctrlKey;
  10496. if (!rails.allowAction(link)) return rails.stopEverything(e);
  10497. if (!metaClick && link.is(rails.linkDisableSelector)) rails.disableElement(link);
  10498. if (rails.isRemote(link)) {
  10499. if (metaClick && (!method || method === 'GET') && !data) { return true; }
  10500. var handleRemote = rails.handleRemote(link);
  10501. // Response from rails.handleRemote() will either be false or a deferred object promise.
  10502. if (handleRemote === false) {
  10503. rails.enableElement(link);
  10504. } else {
  10505. handleRemote.fail( function() { rails.enableElement(link); } );
  10506. }
  10507. return false;
  10508. } else if (method) {
  10509. rails.handleMethod(link);
  10510. return false;
  10511. }
  10512. });
  10513. $document.on('click.rails', rails.buttonClickSelector, function(e) {
  10514. var button = $(this);
  10515. if (!rails.allowAction(button) || !rails.isRemote(button)) return rails.stopEverything(e);
  10516. if (button.is(rails.buttonDisableSelector)) rails.disableFormElement(button);
  10517. var handleRemote = rails.handleRemote(button);
  10518. // Response from rails.handleRemote() will either be false or a deferred object promise.
  10519. if (handleRemote === false) {
  10520. rails.enableFormElement(button);
  10521. } else {
  10522. handleRemote.fail( function() { rails.enableFormElement(button); } );
  10523. }
  10524. return false;
  10525. });
  10526. $document.on('change.rails', rails.inputChangeSelector, function(e) {
  10527. var link = $(this);
  10528. if (!rails.allowAction(link) || !rails.isRemote(link)) return rails.stopEverything(e);
  10529. rails.handleRemote(link);
  10530. return false;
  10531. });
  10532. $document.on('submit.rails', rails.formSubmitSelector, function(e) {
  10533. var form = $(this),
  10534. remote = rails.isRemote(form),
  10535. blankRequiredInputs,
  10536. nonBlankFileInputs;
  10537. if (!rails.allowAction(form)) return rails.stopEverything(e);
  10538. // Skip other logic when required values are missing or file upload is present
  10539. if (form.attr('novalidate') === undefined) {
  10540. if (form.data('ujs:formnovalidate-button') === undefined) {
  10541. blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector, false);
  10542. if (blankRequiredInputs && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) {
  10543. return rails.stopEverything(e);
  10544. }
  10545. } else {
  10546. // Clear the formnovalidate in case the next button click is not on a formnovalidate button
  10547. // Not strictly necessary to do here, since it is also reset on each button click, but just to be certain
  10548. form.data('ujs:formnovalidate-button', undefined);
  10549. }
  10550. }
  10551. if (remote) {
  10552. nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector);
  10553. if (nonBlankFileInputs) {
  10554. // Slight timeout so that the submit button gets properly serialized
  10555. // (make it easy for event handler to serialize form without disabled values)
  10556. setTimeout(function(){ rails.disableFormElements(form); }, 13);
  10557. var aborted = rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]);
  10558. // Re-enable form elements if event bindings return false (canceling normal form submission)
  10559. if (!aborted) { setTimeout(function(){ rails.enableFormElements(form); }, 13); }
  10560. return aborted;
  10561. }
  10562. rails.handleRemote(form);
  10563. return false;
  10564. } else {
  10565. // Slight timeout so that the submit button gets properly serialized
  10566. setTimeout(function(){ rails.disableFormElements(form); }, 13);
  10567. }
  10568. });
  10569. $document.on('click.rails', rails.formInputClickSelector, function(event) {
  10570. var button = $(this);
  10571. if (!rails.allowAction(button)) return rails.stopEverything(event);
  10572. // Register the pressed submit button
  10573. var name = button.attr('name'),
  10574. data = name ? {name:name, value:button.val()} : null;
  10575. var form = button.closest('form');
  10576. if (form.length === 0) {
  10577. form = $('#' + button.attr('form'));
  10578. }
  10579. form.data('ujs:submit-button', data);
  10580. // Save attributes from button
  10581. form.data('ujs:formnovalidate-button', button.attr('formnovalidate'));
  10582. form.data('ujs:submit-button-formaction', button.attr('formaction'));
  10583. form.data('ujs:submit-button-formmethod', button.attr('formmethod'));
  10584. });
  10585. $document.on('ajax:send.rails', rails.formSubmitSelector, function(event) {
  10586. if (this === event.target) rails.disableFormElements($(this));
  10587. });
  10588. $document.on('ajax:complete.rails', rails.formSubmitSelector, function(event) {
  10589. if (this === event.target) rails.enableFormElements($(this));
  10590. });
  10591. $(function(){
  10592. rails.refreshCSRFTokens();
  10593. });
  10594. }
  10595. })( jQuery );
  10596. // This is a manifest file that'll be compiled into application.js, which will include all the files
  10597. // listed below.
  10598. //
  10599. // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
  10600. // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
  10601. //
  10602. // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
  10603. // the compiled file.
  10604. //
  10605. // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
  10606. // GO AFTER THE REQUIRES BELOW.
  10607. //
  10608. ;